Support PRODUCT.md + DESIGN.md as canonical context files

Pioneers a two-file convention for project context:
- PRODUCT.md (strategic): users, brand, principles — answers who/what/why
- DESIGN.md (visual): follows Google's Stitch DESIGN.md spec — answers how-it-looks

Both files live at the repo root. Filename matching is case-insensitive.
DESIGN.md wins on visual conflicts, PRODUCT.md wins on strategic/voice.

Legacy .impeccable.md is auto-migrated to PRODUCT.md on first read by the
new shared loader. This is silent and one-shot — the rename is permanent.

What changed:
- New scripts/load-context.mjs: shared context loader used by every command
  that needs project context. Reads both files, handles legacy migration.
- New reference/document.md: /impeccable document command that generates
  DESIGN.md by auto-extracting tokens (colors, typography, spacing, radii,
  shadows, components) from CSS/Tailwind/theme files, then asking the user
  to confirm descriptive language for atmosphere and color character.
  Follows Google's Stitch DESIGN.md format for tool compatibility.
- SKILL.md Context Gathering Protocol updated to load both files and
  nudge the user to run /impeccable document when DESIGN.md is missing.
- reference/teach.md rewritten to split discovery cleanly: strategic
  questions go to PRODUCT.md, visual/design-system work is delegated to
  /impeccable document (skipped on empty projects).
- reference/live.md consumes {product, design, productPath, designPath,
  migrated} from the loader instead of a single context blob.
- scripts/live.mjs uses the shared loader instead of inline file reading.
- Command count updated 22 → 23 (new: document). Metadata, router table,
  command menu, periodic table viz, and homepage data all updated.
- .gitignore adds PRODUCT.md + DESIGN.md (repo-local, not shared).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Paul Bakaus
2026-04-13 18:14:13 -07:00
co-authored by Claude Opus 4.6
parent f339796b2b
commit af2d6e1194
129 changed files with 3937 additions and 544 deletions
+4 -2
View File
@@ -71,6 +71,7 @@ export const SKILL_CATEGORIES = {
onboard: 'harden',
// SYSTEM - setup and tooling
teach: 'system',
document: 'system',
extract: 'system',
live: 'system',
};
@@ -129,8 +130,9 @@ export const COMMAND_RELATIONSHIPS = {
harden: { combinesWith: ['optimize'] },
onboard: { combinesWith: ['clarify', 'delight'] },
// System
teach: {},
extract: {},
teach: { combinesWith: ['document'] },
document: { combinesWith: ['teach', 'extract'] },
extract: { combinesWith: ['document'] },
live: {},
};
+2 -2
View File
@@ -394,8 +394,8 @@ const EXCLUDED_FROM_SUGGESTIONS = new Set([
// These are the commands that audit/critique/etc. reference when suggesting next steps.
const IMPECCABLE_SUB_COMMANDS = [
'adapt', 'animate', 'audit', 'bolder', 'clarify', 'colorize',
'critique', 'delight', 'distill', 'harden', 'layout', 'onboard',
'optimize', 'overdrive', 'polish', 'quieter', 'shape', 'typeset',
'critique', 'delight', 'distill', 'document', 'harden', 'layout',
'onboard', 'optimize', 'overdrive', 'polish', 'quieter', 'shape', 'typeset',
];
export function replacePlaceholders(content, provider, commandNames = [], allSkillNames = []) {