@champpaba/claude-agent-kit 2.5.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/.claude/CLAUDE.md +103 -58
  2. package/.claude/agents/02-uxui-frontend.md +5 -6
  3. package/.claude/agents/07-ux-tester.md +407 -0
  4. package/.claude/commands/cdev.md +113 -8
  5. package/.claude/commands/csetup.md +86 -28
  6. package/.claude/commands/designsetup.md +171 -48
  7. package/.claude/commands/extract.md +382 -668
  8. package/.claude/commands/pageplan.md +43 -27
  9. package/.claude/contexts/design/box-thinking.md +4 -4
  10. package/.claude/contexts/design/color-theory.md +5 -5
  11. package/.claude/contexts/design/index.md +9 -9
  12. package/.claude/contexts/design/spacing.md +4 -4
  13. package/.claude/contexts/patterns/agent-discovery.md +1 -1
  14. package/.claude/contexts/patterns/animation-patterns.md +3 -3
  15. package/.claude/contexts/patterns/ui-component-consistency.md +3 -3
  16. package/.claude/lib/README.md +1 -1
  17. package/.claude/lib/agent-executor.md +223 -0
  18. package/.claude/lib/context-loading-protocol.md +5 -6
  19. package/.claude/lib/detailed-guides/agent-system.md +4 -4
  20. package/.claude/lib/detailed-guides/best-practices-system.md +5 -4
  21. package/.claude/lib/detailed-guides/context-optimization.md +21 -22
  22. package/.claude/lib/detailed-guides/design-system.md +6 -5
  23. package/.claude/lib/detailed-guides/page-planning.md +6 -6
  24. package/.claude/lib/document-loader.md +32 -47
  25. package/.claude/lib/task-analyzer.md +194 -1
  26. package/.claude/templates/PROJECT_STATUS.template.yml +1 -1
  27. package/.claude/templates/STYLE_GUIDE.template.md +7 -7
  28. package/.claude/templates/design-context-template.md +22 -29
  29. package/.claude/templates/page-plan-example.md +9 -9
  30. package/.claude/templates/phases-sections/ux-testing.md +164 -0
  31. package/README.md +3 -1
  32. package/package.json +1 -1
@@ -179,18 +179,18 @@ let pageType = 'generic'
179
179
  if (hasFrontend) {
180
180
  output(`\nšŸŽØ UI work detected - validating design system...`)
181
181
 
182
- const tokensPath = 'design-system/tokens.json' // v2.0 tokens
183
- const styleGuidePath = 'design-system/STYLE_GUIDE.md'
182
+ const tokensPath = 'design-system/data.yaml' // v2.0 tokens
183
+ const readmePath = 'design-system/README.md'
184
184
  const pagePlanPath = `openspec/changes/${changeId}/page-plan.md`
185
185
 
186
186
  const hasTokens = fileExists(tokensPath)
187
- const hasStyleGuide = fileExists(styleGuidePath)
187
+ const hasReadme = fileExists(readmePath)
188
188
  const hasPagePlan = fileExists(pagePlanPath)
189
189
 
190
- // ========== LOAD tokens.json (v2.0 structure) ==========
190
+ // ========== LOAD data.yaml (v2.0 structure) ==========
191
191
  if (hasTokens) {
192
192
  tokens = JSON.parse(Read(tokensPath))
193
- output(`āœ… tokens.json Loaded:`)
193
+ output(`āœ… data.yaml Loaded:`)
194
194
  output(` - Style: ${tokens.style.name}`)
195
195
  output(` - Theme: ${tokens.theme.name}`)
196
196
  output(` - Animations: ${tokens.animations.enabled ? 'Enabled' : 'Disabled'}`)
@@ -217,8 +217,8 @@ if (hasFrontend) {
217
217
  āš ļø WARNING: UI work detected but design system incomplete!
218
218
 
219
219
  Found:
220
- ${hasStyleGuide ? 'āœ…' : 'āŒ'} STYLE_GUIDE.md
221
- ${hasTokens ? 'āœ…' : 'āŒ'} tokens.json
220
+ ${hasReadme ? 'āœ…' : 'āŒ'} README.md (human-readable)
221
+ ${hasTokens ? 'āœ…' : 'āŒ'} data.yaml
222
222
  ${hasPagePlan ? 'āœ…' : 'āŒ'} page-plan.md
223
223
 
224
224
  This may result in:
@@ -240,8 +240,8 @@ Continue anyway? (yes/no)
240
240
  }
241
241
  } else {
242
242
  output(`āœ… Design System Ready`)
243
- output(` - STYLE_GUIDE.md āœ“`)
244
- output(` - tokens.json āœ“`)
243
+ output(` - README.md āœ“ (human-readable)`)
244
+ output(` - data.yaml āœ“`)
245
245
  if (hasPagePlan) output(` - page-plan.md āœ“`)
246
246
  }
247
247
  }
@@ -316,7 +316,7 @@ for (const layer of requiredLayers) {
316
316
  }
317
317
 
318
318
  // 5. Check for conflicts with design system (if exists)
319
- const tokensPath = 'design-system/tokens.json'
319
+ const tokensPath = 'design-system/data.yaml'
320
320
  if (fileExists(tokensPath) && researchResults.length > 0) {
321
321
  const tokens = JSON.parse(Read(tokensPath))
322
322
  const conflicts = checkDesignConflicts(tokens, researchResults, changeAnalysis)
@@ -2536,9 +2536,9 @@ if (hasFrontend && tokens) {
2536
2536
  ## šŸŽØ Design System (v2.0.0)
2537
2537
 
2538
2538
  **Design Files:**
2539
- - tokens.json: \`design-system/tokens.json\` (~800 tokens)
2539
+ - data.yaml: \`design-system/data.yaml\` (~800 tokens)
2540
2540
  - patterns/: \`design-system/patterns/*.md\` (selective loading)
2541
- - STYLE_GUIDE.md: \`design-system/STYLE_GUIDE.md\` (human-readable, ~150 lines)
2541
+ - README.md: \`design-system/README.md\` (human-readable, ~100 lines)
2542
2542
  ${pagePlan ? `- page-plan.md: \`openspec/changes/${changeId}/page-plan.md\` āœ…` : ''}
2543
2543
 
2544
2544
  **Style Direction:**
@@ -2577,7 +2577,7 @@ pageType.includes('auth') ?
2577
2577
  - patterns/forms.md āœ…`}
2578
2578
 
2579
2579
  **Agent Loading (STEP 0.5 for uxui-frontend):**
2580
- 1. Read: tokens.json (~800 tokens)
2580
+ 1. Read: data.yaml (~800 tokens)
2581
2581
  2. Read: page-plan.md (if exists)
2582
2582
  3. Load patterns selectively based on page type
2583
2583
  4. Report: Design tokens + page type extracted
@@ -2609,33 +2609,91 @@ contextTemplate = contextTemplate
2609
2609
 
2610
2610
  Write to: `openspec/changes/{change-id}/.claude/context.md`
2611
2611
 
2612
- ### Step 8: Output Summary
2612
+ ### Step 8: Output Summary (ENHANCED v2.6.0)
2613
2613
 
2614
- ```
2614
+ ```typescript
2615
+ // Check if UI work was detected (from Step 2.5/Step 3)
2616
+ const hasUIWork = hasFrontend || (hasDatabase && lower.includes('ui'))
2617
+
2618
+ // Check for existing page-plan.md
2619
+ const pagePlanPath = `openspec/changes/${changeId}/page-plan.md`
2620
+ const hasPagePlan = fileExists(pagePlanPath)
2621
+
2622
+ // Build output
2623
+ let output = `
2615
2624
  āœ… Change setup complete!
2616
2625
 
2617
- šŸ“¦ Change: {change-id}
2618
- šŸ“‹ Template: {template-name} ({total-phases} phases)
2619
- šŸ› ļø Detected: {detected-categories}
2626
+ šŸ“¦ Change: ${changeId}
2627
+ šŸ“‹ Template: ${templateName} (${totalPhases} phases)
2628
+ šŸ› ļø Detected: ${detectedCategories.join(', ')}
2620
2629
 
2621
2630
  šŸ“ Files created:
2622
- āœ“ openspec/changes/{change-id}/.claude/phases.md
2623
- āœ“ openspec/changes/{change-id}/.claude/flags.json
2624
- āœ“ openspec/changes/{change-id}/.claude/context.md
2631
+ āœ“ openspec/changes/${changeId}/.claude/phases.md
2632
+ āœ“ openspec/changes/${changeId}/.claude/flags.json
2633
+ āœ“ openspec/changes/${changeId}/.claude/context.md
2625
2634
 
2626
2635
  šŸ“Š Workflow:
2627
- Phase 1: {first-phase-name} ({agent} agent, {estimated} min)
2636
+ Phase 1: ${firstPhaseName} (${firstPhaseAgent} agent, ${firstPhaseMin} min)
2628
2637
  ...
2629
- Phase {n}: {last-phase-name}
2638
+ Phase ${totalPhases}: ${lastPhaseName}
2630
2639
 
2631
- ā±ļø Total estimated time: ~{hours}h {minutes}m
2640
+ ā±ļø Total estimated time: ~${hours}h ${minutes}m
2641
+ `
2632
2642
 
2643
+ // šŸ†• v2.6.0: Recommend /pageplan if UI work detected
2644
+ if (hasUIWork) {
2645
+ if (hasPagePlan) {
2646
+ output += `
2647
+ āœ… page-plan.md found: ${pagePlanPath}
2648
+ → uxui-frontend will use this for component planning
2649
+ `
2650
+ } else {
2651
+ output += `
2652
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2653
+ šŸŽØ UI Work Detected!
2654
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2655
+
2656
+ Phases with UI work:
2657
+ ${uiPhases.map(p => \` • Phase \${p.number}: \${p.name} (\${p.agent})\`).join('\\n')}
2658
+
2659
+ šŸ’” RECOMMENDED: Run /pageplan before /cdev
2660
+
2661
+ Why?
2662
+ ā”œā”€ā”€ Content variants (3 options per element - user picks A/B/C)
2663
+ ā”œā”€ā”€ Component index (auto-generated, prevents duplicates)
2664
+ ā”œā”€ā”€ Asset checklist (images, icons with specs)
2665
+ └── Approval process (user reviews before implementation)
2666
+
2667
+ šŸ“ Recommended Steps:
2668
+ 1. /pageplan @prd.md ← Generate page plan
2669
+ 2. Edit page-plan.md ← Pick A/B/C content, prepare assets
2670
+ 3. Mark APPROVED in Section 6 ← Sign-off before implementation
2671
+ 4. /cdev ${changeId} ← Implement with real content
2672
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2673
+ `
2674
+ }
2675
+ }
2676
+
2677
+ output += `
2633
2678
  šŸš€ Ready to start development!
2634
2679
 
2635
- Next steps:
2636
- 1. Review generated workflow: openspec/changes/{change-id}/.claude/phases.md
2637
- 2. Start development: /cdev {change-id}
2638
- 3. View progress: /cview {change-id}
2680
+ Next steps:`
2681
+
2682
+ if (hasUIWork && !hasPagePlan) {
2683
+ output += `
2684
+ 1. (Recommended) Run: /pageplan @prd.md
2685
+ 2. Edit page-plan.md (content, assets, approval)
2686
+ 3. Review workflow: openspec/changes/${changeId}/.claude/phases.md
2687
+ 4. Start development: /cdev ${changeId}
2688
+ 5. View progress: /cview ${changeId}`
2689
+ } else {
2690
+ output += `
2691
+ 1. Review workflow: openspec/changes/${changeId}/.claude/phases.md
2692
+ 2. Start development: /cdev ${changeId}
2693
+ 3. View progress: /cview ${changeId}`
2694
+ }
2695
+
2696
+ console.log(output)
2639
2697
  ```
2640
2698
 
2641
2699
  ---
@@ -24,56 +24,48 @@ Examples:
24
24
 
25
25
  ## šŸŽÆ Mission
26
26
 
27
- Generate lean design system files:
28
- - `design-system/tokens.json` (~800 tokens) - **PRIMARY: Agent reads this**
29
- - `design-system/patterns/*.md` - Code patterns (selective loading)
30
- - `design-system/STYLE_GUIDE.md` (~2000 tokens) - **Human-readable (no code)**
27
+ Generate design system files:
28
+ - `design-system/data.yaml` (~300 lines) - **PRIMARY: Agent reads this** (merged tokens + psychology)
29
+ - `design-system/README.md` (~100 lines) - **Human-readable summary**
31
30
 
32
31
  **Process:**
33
- 1. Load all extracted data from `.claude/extractions/*.json`
32
+ 1. Load all extracted data from `design-system/extracted/*/data.yaml`
34
33
  2. Present verbose style options with Match scores
35
34
  3. **Interactive Loop** (max 3 rounds): Present → Feedback → Adjust
36
35
  4. Theme selection + Decorative direction recommendation
37
- 5. Generate tokens.json + patterns/*.md + STYLE_GUIDE.md
36
+ 5. Merge psychology + tokens → Generate data.yaml + README.md
38
37
 
39
38
  **Key Principles:**
40
39
  1. **Interactive Loop**: User must accept 100% before generating
41
40
  2. **Verbose Options**: Show full details (characteristics, feel, examples)
42
41
  3. **Theme + Decorations**: Agent recommends based on project context
43
- 4. **Lean Output**: tokens.json for agents, STYLE_GUIDE.md for humans
42
+ 4. **Psychology Preserved**: Emotions, target audience, why it works
44
43
 
45
44
  ---
46
45
 
47
46
  ## STEP 0: Discovery & Validation
48
47
 
49
48
  ```javascript
50
- // 1. Find extracted sites from .claude/extractions/
51
- const extractedFiles = glob('.claude/extractions/*.json').filter(f => !f.includes('merged-insights'));
52
- const mergedInsightsPath = '.claude/extractions/merged-insights.json';
49
+ // 1. Find extracted sites from design-system/extracted/*/data.yaml
50
+ const extractedDirs = glob('design-system/extracted/*/data.yaml');
53
51
 
54
- if (extractedFiles.length === 0) {
52
+ if (extractedDirs.length === 0) {
55
53
  return error(`
56
54
  āŒ No extracted data found
57
55
 
58
56
  Please extract at least 1 site first:
59
57
  /extract https://motherduck.com
60
- /extract https://linear.app https://stripe.com
58
+ /extract https://linear.app
61
59
 
62
60
  Then run: /designsetup @prd.md @project.md
63
61
  `);
64
62
  }
65
63
 
66
- // 2. Load all extracted site data
64
+ // 2. Load all extracted site data (YAML format with psychology)
67
65
  const extractedData = {};
68
- for (const file of extractedFiles) {
69
- const siteName = path.basename(file, '.json');
70
- extractedData[siteName] = JSON.parse(Read(file));
71
- }
72
-
73
- // 3. Load merged insights if exists (for multi-site)
74
- let mergedInsights = null;
75
- if (exists(mergedInsightsPath)) {
76
- mergedInsights = JSON.parse(Read(mergedInsightsPath));
66
+ for (const file of extractedDirs) {
67
+ const siteName = path.basename(path.dirname(file)); // Get folder name
68
+ extractedData[siteName] = YAML.parse(Read(file));
77
69
  }
78
70
 
79
71
  // 4. Load context files
@@ -869,16 +861,16 @@ const selectedOption = styleOptions.options[selectedIndex];
869
861
  ```
870
862
  āœ… Style Selected: ${selectedOption.name}
871
863
 
872
- šŸ”„ Generating comprehensive STYLE_GUIDE.md...
864
+ šŸ”„ Generating comprehensive design system...
873
865
  ```
874
866
 
875
867
  ---
876
868
 
877
- ## STEP 5: Generate Final STYLE_GUIDE.md
869
+ ## STEP 5: Generate Final Design System (Legacy - See STEP 5.7)
878
870
 
879
871
  ```javascript
880
872
  const styleGuidePrompt = `
881
- You are generating the final, comprehensive STYLE_GUIDE.md file.
873
+ You are generating the final, comprehensive design system file.
882
874
 
883
875
  Selected Style: ${selectedOption.name}
884
876
  Fit Score: ${selectedOption.fit_score}%
@@ -901,9 +893,9 @@ Project Context:
901
893
  - Audience: ${contextAnalysis.target_audience.demographics}
902
894
  - Brand: ${contextAnalysis.brand_personality.join(', ')}
903
895
 
904
- Task: Generate complete STYLE_GUIDE.md (1500-2000 lines) with ALL 17 sections.
896
+ Task: Generate complete design system (1500-2000 lines) with ALL 17 sections.
905
897
 
906
- Follow this format for STYLE_GUIDE.md:
898
+ Follow this format:
907
899
 
908
900
  # [Project Name] Design System - Style Guide (${selectedOption.name})
909
901
 
@@ -1110,7 +1102,7 @@ const styleGuideMD = await LLM({
1110
1102
  max_tokens: 16000
1111
1103
  });
1112
1104
 
1113
- Write('design-system/STYLE_GUIDE.md', styleGuideMD);
1105
+ Write('design-system/README.md', styleGuideMD);
1114
1106
  ```
1115
1107
 
1116
1108
  ---
@@ -1132,7 +1124,7 @@ const tokensData = {
1132
1124
  "generated_at": new Date().toISOString(),
1133
1125
  "generated_by": "/designsetup command v2.0.0",
1134
1126
  "source_sites": Object.keys(extractedData),
1135
- "description": "Design tokens for agents (~800 tokens). Human-readable guide: STYLE_GUIDE.md"
1127
+ "description": "Design tokens for agents (~800 tokens). Human-readable guide: README.md"
1136
1128
  },
1137
1129
 
1138
1130
  // ========== NEW: Style & Theme (from user selection) ==========
@@ -1325,9 +1317,10 @@ function darkenColor(hex, percent) {
1325
1317
  return '#' + (0x1000000 + R * 0x10000 + G * 0x100 + B).toString(16).slice(1);
1326
1318
  }
1327
1319
 
1328
- // Write tokens.json
1329
- Write('design-system/tokens.json', JSON.stringify(tokensData, null, 2));
1330
- output(`āœ… tokens.json generated (~800 tokens)`);
1320
+ // Write data.yaml (includes psychology from extracted sites)
1321
+ const dataYaml = generateDataYaml(tokensData, extractedData, selectedStyle);
1322
+ Write('design-system/data.yaml', dataYaml);
1323
+ output(`āœ… data.yaml generated (~300 lines)`);
1331
1324
  ```
1332
1325
 
1333
1326
  ---
@@ -1876,13 +1869,13 @@ output(`
1876
1869
 
1877
1870
  ---
1878
1871
 
1879
- ## STEP 5.7: Generate Lean STYLE_GUIDE.md (Human-Readable)
1872
+ ## STEP 5.7: Generate Lean README.md (Human-Readable)
1880
1873
 
1881
1874
  > **Human-readable guide** - No code, just descriptions and visuals
1882
1875
 
1883
1876
  ```javascript
1884
1877
  output(`
1885
- šŸ”„ Generating lean STYLE_GUIDE.md (human-readable)...
1878
+ šŸ”„ Generating lean README.md (human-readable)...
1886
1879
  `);
1887
1880
 
1888
1881
  const styleGuideMD = `# ${selectedStyle.style} Design System
@@ -2085,8 +2078,8 @@ ${tokensData.component_library.common_components.map(c => `- ${c}`).join('\n')}
2085
2078
  *Sources: ${Object.keys(extractedData).join(', ')}*
2086
2079
  `;
2087
2080
 
2088
- Write('design-system/STYLE_GUIDE.md', styleGuideMD);
2089
- output(`āœ… STYLE_GUIDE.md generated (lean, human-readable, ~150 lines)`);
2081
+ Write('design-system/README.md', styleGuideMD);
2082
+ output(`āœ… README.md generated (lean, human-readable, ~100 lines)`);
2090
2083
  ```
2091
2084
 
2092
2085
  ---
@@ -2116,24 +2109,24 @@ ${selectedStyle.characteristics.slice(0, 4).map(c => ` • ${c}`).join('\n')}
2116
2109
 
2117
2110
  šŸ“¦ Files Created:
2118
2111
 
2119
- šŸ¤– FOR AGENTS (code patterns):
2120
- āœ“ design-system/tokens.json (~800 tokens)
2112
+ šŸ¤– FOR AGENTS (merged data + psychology):
2113
+ āœ“ design-system/data.yaml (~300 lines)
2121
2114
  āœ“ design-system/patterns/buttons.md
2122
2115
  āœ“ design-system/patterns/cards.md
2123
2116
  āœ“ design-system/patterns/forms.md
2124
2117
  āœ“ design-system/patterns/scroll-animations.md
2125
2118
  āœ“ design-system/patterns/decorations.md
2126
2119
 
2127
- šŸ‘¤ FOR HUMANS (no code):
2128
- āœ“ design-system/STYLE_GUIDE.md (~150 lines)
2120
+ šŸ‘¤ FOR HUMANS (summary):
2121
+ āœ“ design-system/README.md (~100 lines)
2129
2122
 
2130
2123
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2131
2124
 
2132
2125
  šŸš€ Next Steps:
2133
2126
 
2134
2127
  1. Review generated files:
2135
- cat design-system/tokens.json | head -50
2136
- cat design-system/STYLE_GUIDE.md
2128
+ cat design-system/data.yaml | head -50
2129
+ cat design-system/README.md
2137
2130
 
2138
2131
  2. Plan your pages:
2139
2132
  /pageplan @prd.md @project.md
@@ -2147,19 +2140,19 @@ ${selectedStyle.characteristics.slice(0, 4).map(c => ` • ${c}`).join('\n')}
2147
2140
  šŸ“– How It Works:
2148
2141
 
2149
2142
  /pageplan reads:
2150
- → tokens.json (style, theme, colors, animations)
2143
+ → data.yaml (style, theme, colors, animations, psychology)
2151
2144
  → Auto-detects page type (landing/dashboard/auth)
2152
2145
  → Loads patterns/*.md selectively
2153
2146
 
2154
2147
  uxui-frontend agent reads:
2155
- → tokens.json (all tokens)
2148
+ → data.yaml (tokens + psychology)
2156
2149
  → patterns/buttons.md (always)
2157
2150
  → patterns/cards.md (always)
2158
2151
  → patterns/scroll-animations.md (landing pages only)
2159
2152
  → patterns/decorations.md (landing pages only)
2160
2153
  → patterns/forms.md (forms only)
2161
2154
 
2162
- Token Savings: ~800 vs ~5000 (84% reduction) ✨
2155
+ Content includes: Psychology, Target Audience, Why It Works ✨
2163
2156
 
2164
2157
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2165
2158
  `);
@@ -2167,11 +2160,141 @@ ${selectedStyle.characteristics.slice(0, 4).map(c => ` • ${c}`).join('\n')}
2167
2160
 
2168
2161
  ---
2169
2162
 
2163
+ ## Helper: Generate data.yaml
2164
+
2165
+ ```javascript
2166
+ function generateDataYaml(tokensData, extractedData, selectedStyle) {
2167
+ // Get psychology from the selected extracted site
2168
+ const selectedSiteData = extractedData[selectedStyle.site];
2169
+ const psychology = selectedSiteData?.psychology || {};
2170
+
2171
+ return `# Design System Data
2172
+ # Generated by: /designsetup
2173
+ # Source: ${selectedStyle.site}
2174
+ # Style: ${selectedStyle.style}
2175
+
2176
+ meta:
2177
+ generated_at: ${new Date().toISOString()}
2178
+ source_site: ${selectedStyle.site}
2179
+ style: ${selectedStyle.style}
2180
+ theme: ${tokensData.theme?.name || 'default'}
2181
+
2182
+ # ============================================
2183
+ # PSYCHOLOGY & ANALYSIS
2184
+ # ============================================
2185
+
2186
+ psychology:
2187
+ style_classification: ${psychology.style_classification || selectedStyle.style}
2188
+
2189
+ emotions_evoked:
2190
+ ${(psychology.emotions_evoked || []).map(e => ` - emotion: "${e.emotion}"
2191
+ reason: "${e.reason}"`).join('\n') || ' # Not available'}
2192
+
2193
+ target_audience:
2194
+ primary:
2195
+ description: "${psychology.target_audience?.primary?.description || 'Not specified'}"
2196
+ age_range: "${psychology.target_audience?.primary?.age_range || 'mixed'}"
2197
+ tech_savvy: ${psychology.target_audience?.primary?.tech_savvy || 'medium'}
2198
+ secondary:
2199
+ description: "${psychology.target_audience?.secondary?.description || 'Not specified'}"
2200
+
2201
+ visual_principles:
2202
+ ${(psychology.visual_principles || []).map(v => ` - name: "${v.name}"
2203
+ description: "${v.description}"`).join('\n') || ' # Not available'}
2204
+
2205
+ why_it_works:
2206
+ ${(psychology.why_it_works || []).map(w => ` - "${w}"`).join('\n') || ' # Not available'}
2207
+
2208
+ design_philosophy:
2209
+ core_belief: "${psychology.design_philosophy?.core_belief || 'Not specified'}"
2210
+ key_principles:
2211
+ ${(psychology.design_philosophy?.key_principles || []).map(p => ` - "${p}"`).join('\n') || ' # Not available'}
2212
+
2213
+ # ============================================
2214
+ # DESIGN TOKENS
2215
+ # ============================================
2216
+
2217
+ style:
2218
+ detected: ${tokensData.style.detected}
2219
+ characteristics:
2220
+ ${tokensData.style.characteristics.map(c => ` - "${c}"`).join('\n')}
2221
+ feel: "${tokensData.style.feel}"
2222
+
2223
+ colors:
2224
+ primary: "${tokensData.colors.primary}"
2225
+ secondary: "${tokensData.colors.secondary}"
2226
+ background: "${tokensData.colors.background}"
2227
+ foreground: "${tokensData.colors.foreground}"
2228
+ muted: "${tokensData.colors.muted}"
2229
+ accent: "${tokensData.colors.accent}"
2230
+
2231
+ typography:
2232
+ font_family: "${tokensData.typography.font_family}"
2233
+ heading_font: "${tokensData.typography.heading_font}"
2234
+ weights: [${tokensData.typography.weights.join(', ')}]
2235
+ sizes:
2236
+ h1: "${tokensData.typography.sizes.h1}"
2237
+ h2: "${tokensData.typography.sizes.h2}"
2238
+ h3: "${tokensData.typography.sizes.h3}"
2239
+ body: "${tokensData.typography.sizes.body}"
2240
+ small: "${tokensData.typography.sizes.small}"
2241
+
2242
+ spacing:
2243
+ base: ${tokensData.spacing.base}
2244
+ scale: [${tokensData.spacing.scale.join(', ')}]
2245
+
2246
+ border_radius:
2247
+ sm: "${tokensData.border_radius.sm}"
2248
+ md: "${tokensData.border_radius.md}"
2249
+ lg: "${tokensData.border_radius.lg}"
2250
+ full: "${tokensData.border_radius.full}"
2251
+
2252
+ shadows:
2253
+ sm: "${tokensData.shadows.sm}"
2254
+ md: "${tokensData.shadows.md}"
2255
+ lg: "${tokensData.shadows.lg}"
2256
+
2257
+ # ============================================
2258
+ # ANIMATIONS
2259
+ # ============================================
2260
+
2261
+ animations:
2262
+ durations:
2263
+ fast: "${tokensData.animations.durations.fast}"
2264
+ normal: "${tokensData.animations.durations.normal}"
2265
+ slow: "${tokensData.animations.durations.slow}"
2266
+ easing:
2267
+ default: "${tokensData.animations.easing.default}"
2268
+ bounce: "${tokensData.animations.easing.bounce}"
2269
+ component_animations:
2270
+ button_hover: "${tokensData.animations.component_animations.button_hover}"
2271
+ card_hover: "${tokensData.animations.component_animations.card_hover}"
2272
+ scroll_animations:
2273
+ enabled: ${tokensData.animations.scroll_animations.enabled}
2274
+ patterns:
2275
+ ${(tokensData.animations.scroll_animations.patterns || []).map(p => ` - "${p}"`).join('\n')}
2276
+
2277
+ # ============================================
2278
+ # THEME DIRECTION
2279
+ # ============================================
2280
+
2281
+ theme:
2282
+ name: "${tokensData.theme?.name || 'default'}"
2283
+ decorative_elements:
2284
+ ${(tokensData.theme?.decorative_elements || []).map(d => ` - "${d}"`).join('\n')}
2285
+ avoid_elements:
2286
+ ${(tokensData.theme?.avoid_elements || []).map(a => ` - "${a}"`).join('\n')}
2287
+ `;
2288
+ }
2289
+ ```
2290
+
2291
+ ---
2292
+
2170
2293
  ## Error Handling
2171
2294
 
2172
2295
  ```javascript
2173
2296
  // No extracted data
2174
- if (extractedFiles.length === 0) {
2297
+ if (extractedDirs.length === 0) {
2175
2298
  return error(`
2176
2299
  āŒ No extracted data found
2177
2300
 
@@ -2214,13 +2337,13 @@ if (!userChoice) {
2214
2337
 
2215
2338
  // Write fails
2216
2339
  try {
2217
- Write('design-system/STYLE_GUIDE.md', styleGuideMD);
2340
+ Write('design-system/README.md', styleGuideMD);
2218
2341
  } catch (error) {
2219
2342
  // Save backup
2220
2343
  Write('/tmp/style-guide-backup.md', styleGuideMD);
2221
2344
 
2222
2345
  return error(`
2223
- āŒ Failed to write STYLE_GUIDE.md
2346
+ āŒ Failed to write README.md
2224
2347
 
2225
2348
  Check permissions: design-system/
2226
2349