@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.
- package/.claude/CLAUDE.md +103 -58
- package/.claude/agents/02-uxui-frontend.md +5 -6
- package/.claude/agents/07-ux-tester.md +407 -0
- package/.claude/commands/cdev.md +113 -8
- package/.claude/commands/csetup.md +86 -28
- package/.claude/commands/designsetup.md +171 -48
- package/.claude/commands/extract.md +382 -668
- package/.claude/commands/pageplan.md +43 -27
- package/.claude/contexts/design/box-thinking.md +4 -4
- package/.claude/contexts/design/color-theory.md +5 -5
- package/.claude/contexts/design/index.md +9 -9
- package/.claude/contexts/design/spacing.md +4 -4
- package/.claude/contexts/patterns/agent-discovery.md +1 -1
- package/.claude/contexts/patterns/animation-patterns.md +3 -3
- package/.claude/contexts/patterns/ui-component-consistency.md +3 -3
- package/.claude/lib/README.md +1 -1
- package/.claude/lib/agent-executor.md +223 -0
- package/.claude/lib/context-loading-protocol.md +5 -6
- package/.claude/lib/detailed-guides/agent-system.md +4 -4
- package/.claude/lib/detailed-guides/best-practices-system.md +5 -4
- package/.claude/lib/detailed-guides/context-optimization.md +21 -22
- package/.claude/lib/detailed-guides/design-system.md +6 -5
- package/.claude/lib/detailed-guides/page-planning.md +6 -6
- package/.claude/lib/document-loader.md +32 -47
- package/.claude/lib/task-analyzer.md +194 -1
- package/.claude/templates/PROJECT_STATUS.template.yml +1 -1
- package/.claude/templates/STYLE_GUIDE.template.md +7 -7
- package/.claude/templates/design-context-template.md +22 -29
- package/.claude/templates/page-plan-example.md +9 -9
- package/.claude/templates/phases-sections/ux-testing.md +164 -0
- package/README.md +3 -1
- 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/
|
|
183
|
-
const
|
|
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
|
|
187
|
+
const hasReadme = fileExists(readmePath)
|
|
188
188
|
const hasPagePlan = fileExists(pagePlanPath)
|
|
189
189
|
|
|
190
|
-
// ========== LOAD
|
|
190
|
+
// ========== LOAD data.yaml (v2.0 structure) ==========
|
|
191
191
|
if (hasTokens) {
|
|
192
192
|
tokens = JSON.parse(Read(tokensPath))
|
|
193
|
-
output(`ā
|
|
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
|
-
${
|
|
221
|
-
${hasTokens ? 'ā
' : 'ā'}
|
|
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(` -
|
|
244
|
-
output(` -
|
|
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/
|
|
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
|
-
-
|
|
2539
|
+
- data.yaml: \`design-system/data.yaml\` (~800 tokens)
|
|
2540
2540
|
- patterns/: \`design-system/patterns/*.md\` (selective loading)
|
|
2541
|
-
-
|
|
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:
|
|
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: {
|
|
2618
|
-
š Template: {
|
|
2619
|
-
š ļø Detected: {
|
|
2626
|
+
š¦ Change: ${changeId}
|
|
2627
|
+
š Template: ${templateName} (${totalPhases} phases)
|
|
2628
|
+
š ļø Detected: ${detectedCategories.join(', ')}
|
|
2620
2629
|
|
|
2621
2630
|
š Files created:
|
|
2622
|
-
ā openspec/changes
|
|
2623
|
-
ā openspec/changes
|
|
2624
|
-
ā openspec/changes
|
|
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: {
|
|
2636
|
+
Phase 1: ${firstPhaseName} (${firstPhaseAgent} agent, ${firstPhaseMin} min)
|
|
2628
2637
|
...
|
|
2629
|
-
Phase {
|
|
2638
|
+
Phase ${totalPhases}: ${lastPhaseName}
|
|
2630
2639
|
|
|
2631
|
-
ā±ļø Total estimated time:
|
|
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
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
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
|
|
28
|
-
- `design-system/
|
|
29
|
-
- `design-system/
|
|
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
|
|
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.
|
|
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. **
|
|
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 .
|
|
51
|
-
const
|
|
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 (
|
|
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
|
|
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
|
|
69
|
-
const siteName = path.basename(file
|
|
70
|
-
extractedData[siteName] =
|
|
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
|
|
864
|
+
š Generating comprehensive design system...
|
|
873
865
|
```
|
|
874
866
|
|
|
875
867
|
---
|
|
876
868
|
|
|
877
|
-
## STEP 5: Generate Final
|
|
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
|
|
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
|
|
896
|
+
Task: Generate complete design system (1500-2000 lines) with ALL 17 sections.
|
|
905
897
|
|
|
906
|
-
Follow this format
|
|
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/
|
|
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:
|
|
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
|
|
1329
|
-
|
|
1330
|
-
|
|
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
|
|
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
|
|
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/
|
|
2089
|
-
output(`ā
|
|
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 (
|
|
2120
|
-
ā design-system/
|
|
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 (
|
|
2128
|
-
ā design-system/
|
|
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/
|
|
2136
|
-
cat design-system/
|
|
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
|
-
ā
|
|
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
|
-
ā
|
|
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
|
-
|
|
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 (
|
|
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/
|
|
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
|
|
2346
|
+
ā Failed to write README.md
|
|
2224
2347
|
|
|
2225
2348
|
Check permissions: design-system/
|
|
2226
2349
|
|