@champpaba/claude-agent-kit 3.6.0 → 3.6.2

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.
@@ -1,1405 +0,0 @@
1
- # /designsetup - Interactive Design System Setup
2
-
3
- You are a senior design systems architect with experience at FANG-level companies.
4
-
5
- Your task is to guide user through an **interactive design system setup** with verbose options, theme selection, and decorative direction.
6
-
7
- ---
8
-
9
- ## 📖 Usage
10
-
11
- ```bash
12
- /designsetup [@context-files...]
13
-
14
- Arguments:
15
- @context-files Optional. Context files (prd.md, project.md, brief.md, etc.)
16
-
17
- Examples:
18
- /designsetup @prd.md @project.md
19
- /designsetup @docs/brief.md @docs/requirements.md
20
- /designsetup # No context (interactive fallback)
21
- ```
22
-
23
- ---
24
-
25
- ## 🎯 Mission
26
-
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**
30
-
31
- **Process:**
32
- 1. Load all extracted data from `design-system/extracted/*/data.yaml`
33
- 2. Present verbose style options with Match scores
34
- 3. **Interactive Loop** (max 3 rounds): Present → Feedback → Adjust
35
- 4. Theme selection + Decorative direction recommendation
36
- 5. Merge psychology + tokens → Generate data.yaml + README.md
37
-
38
- **Key Principles:**
39
- 1. **Interactive Loop**: User must accept 100% before generating
40
- 2. **Verbose Options**: Show full details (characteristics, feel, examples)
41
- 3. **Theme + Decorations**: Agent recommends based on project context
42
- 4. **Psychology Preserved**: Emotions, target audience, why it works
43
-
44
- ---
45
-
46
- ## STEP 0: Discovery & Validation
47
-
48
- ### STEP 0.1: Find Extracted Site Data
49
-
50
- 1. Search for extracted site data:
51
- ```
52
- Glob: design-system/extracted/*/data.yaml
53
- ```
54
-
55
- **If no files found:**
56
- ```
57
- ❌ No extracted data found
58
-
59
- Please extract at least 1 site first:
60
- /extract https://motherduck.com
61
- /extract https://linear.app
62
-
63
- Then run: /designsetup @prd.md @project.md
64
- ```
65
- → STOP here, do not continue
66
-
67
- **If files found:**
68
- ```
69
- ✅ Found extracted sites: [list site names]
70
- ```
71
- → Continue to STEP 0.2
72
-
73
- ### STEP 0.2: Load Extracted Site Data
74
-
75
- For each extracted site found:
76
- 1. Extract the site name from the path (the folder name between `extracted/` and `/data.yaml`)
77
- 2. Read the data.yaml file
78
- 3. Parse the YAML content
79
- 4. Store in memory for later use (map site name to data)
80
-
81
- → Continue to STEP 0.3
82
-
83
- ### STEP 0.3: Load Context Files (Optional)
84
-
85
- 1. Check if user provided context files (arguments starting with `@`)
86
-
87
- **If no context files provided:**
88
- - Set contexts as empty
89
- - Will use interactive mode later
90
- → Continue to STEP 0.4
91
-
92
- **If context files provided:**
93
- For each context file argument:
94
- 1. Remove the `@` prefix to get the file path
95
- 2. Check if file exists:
96
- - **If not found:** Warn user and skip this file
97
- - **If found:** Read the file content and store with filename as key
98
-
99
- → Continue to STEP 0.4
100
-
101
- ### STEP 0.4: Report Discovery Results
102
-
103
- **Report:**
104
- ```
105
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
106
- 🎨 Design Setup Started
107
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
108
-
109
- 📊 Extracted Sites: ${Object.keys(extractedData).length}
110
- ${Object.entries(extractedData).map(([site, data]) =>
111
- ` - ${site}: ${data.style.detected} (${data.style.confidence}% confidence)`
112
- ).join('\n')}
113
-
114
- ${mergedInsights ? `📋 Merged Insights: Available (${mergedInsights.meta.sites_count} sites)` : ''}
115
-
116
- 📁 Context Files: ${Object.keys(contexts).length || 'None (will use interactive mode)'}
117
- ${Object.keys(contexts).length > 0 ? Object.keys(contexts).map(c => ` - ${c}`).join('\n') : ''}
118
-
119
- 🔄 Analyzing context...
120
- ```
121
-
122
- ---
123
-
124
- ## STEP 1: Context Analysis
125
-
126
- ### STEP 1.1: Check for Context Files
127
-
128
- **If context files were loaded in STEP 0.3:**
129
- → Continue to STEP 1.2 (AI Analysis)
130
-
131
- **If no context files:**
132
- → Skip to STEP 1.3 (Interactive Questions)
133
-
134
- ### STEP 1.2: AI Analysis of Context Files
135
-
136
- 1. Ask Claude to analyze the context files and identify project characteristics
137
-
138
- **Analysis Prompt:**
139
- ```
140
- You are analyzing project context to recommend design directions.
141
-
142
- Context Files:
143
- [Include each context file name and first 2000 characters of content]
144
-
145
- Task: Identify project characteristics and return JSON.
146
-
147
- Return JSON:
148
- {
149
- "has_context": true,
150
- "target_audience": {
151
- "age_range": "18-25" | "26-40" | "40+" | "mixed",
152
- "demographics": "string",
153
- "tech_savvy": "low" | "medium" | "high",
154
- "description": "string"
155
- },
156
- "brand_personality": ["bold" | "professional" | "playful" | "minimal" | "technical", ...],
157
- "product_type": "SaaS" | "E-commerce" | "Marketing" | "Internal Tool" | "Other",
158
- "market_position": "string (differentiation strategy)",
159
- "design_preferences": {
160
- "mentioned": boolean,
161
- "details": "string (if any design preferences mentioned)"
162
- },
163
- "business_goals": ["string", ...]
164
- }
165
-
166
- If context is insufficient or unclear, set "has_context": false.
167
- ```
168
-
169
- 2. Parse the JSON response from Claude
170
-
171
- **If has_context is true:**
172
- → Skip to STEP 1.4 (Report)
173
-
174
- **If has_context is false:**
175
- → Continue to STEP 1.3 (Interactive Questions)
176
-
177
- ### STEP 1.3: Interactive Questions (Fallback)
178
-
179
- Ask user to answer these questions:
180
-
181
- **Question 1: Product Type**
182
- - Header: "Product Type"
183
- - Single selection
184
- - Options:
185
- - "SaaS Dashboard" - Business software, data tools, analytics
186
- - "E-commerce" - Online store, marketplace, shopping
187
- - "Marketing Site" - Landing pages, content, blog
188
- - "Internal Tool" - Admin panels, workflows, dashboards
189
-
190
- **Question 2: Target Audience**
191
- - Header: "Audience"
192
- - Single selection
193
- - Options:
194
- - "Gen Z (18-25)" - Young, tech-savvy, bold preferences
195
- - "Millennials (26-40)" - Professional, value-driven, modern
196
- - "Enterprise (40+)" - Conservative, trust-focused, established
197
- - "Developers" - Technical, efficiency-focused, minimal
198
-
199
- **Question 3: Brand Personality**
200
- - Header: "Brand"
201
- - Multiple selection allowed
202
- - Options:
203
- - "Bold" - Stand out, memorable, confident, different
204
- - "Professional" - Trustworthy, credible, serious, polished
205
- - "Playful" - Fun, friendly, approachable, warm
206
- - "Minimal" - Clean, simple, understated, elegant
207
-
208
- Build context analysis from user answers:
209
- - product_type: from Question 1
210
- - target_audience.demographics: from Question 2
211
- - target_audience.tech_savvy: "high" if Gen Z or Developers selected, otherwise "medium"
212
- - brand_personality: list from Question 3 (converted to lowercase)
213
-
214
- → Continue to STEP 1.4
215
-
216
- ### STEP 1.4: Report Context Analysis
217
-
218
- **Report:**
219
- ```
220
- ✅ Context Analysis Complete!
221
-
222
- 🎯 Project Profile:
223
- - Product: ${contextAnalysis.product_type}
224
- - Audience: ${contextAnalysis.target_audience.demographics}
225
- - Brand: ${contextAnalysis.brand_personality.join(', ')}
226
- ${contextAnalysis.market_position ? `- Position: ${contextAnalysis.market_position}` : ''}
227
-
228
- 🔄 Generating style direction options...
229
- ```
230
-
231
- ---
232
-
233
- ## STEP 2: Interactive Style Selection (Verbose + Loop)
234
-
235
- > **Key Change:** Interactive loop until user accepts 100%
236
-
237
- **Loop Configuration:**
238
- - Maximum rounds: 3
239
- - Current round: starts at 1
240
- - User must accept to exit loop
241
-
242
- ### STEP 2.1: Start New Round
243
-
244
- Display round header:
245
- ```
246
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
247
- 📋 ROUND [current round]/3: Style Selection
248
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
249
- ```
250
-
251
- → Continue to STEP 2.2
252
-
253
- ### STEP 2.2: Build Style Options from Extracted Data
254
-
255
- For each extracted site:
256
- 1. Extract the following information from the site's data:
257
- - site: site name
258
- - style: data.style.detected
259
- - confidence: data.style.confidence
260
- - characteristics: data.style.characteristics
261
- - feel: data.style.feel
262
- - colors: data.colors.primary
263
- - animations: data.animation_libraries
264
- - scrollPatterns: data.scroll_animations.patterns
265
- - decorativeTypes: data.decorative_elements.types
266
- 2. Add to options list
267
-
268
- → Continue to STEP 2.3
269
-
270
- ### STEP 2.3: Calculate Match Scores
271
-
272
- For each style option:
273
- 1. Start with base score = confidence value
274
- 2. Apply brand personality bonuses:
275
- - **If brand includes "bold":**
276
- - Add +15 if style is "Neo-Brutalism" or "Playful/Creative"
277
- - **If brand includes "professional":**
278
- - Add +15 if style is "Minimalist" or "Modern SaaS"
279
- - **If brand includes "playful":**
280
- - Add +15 if style is "Playful/Creative"
281
- - **If brand includes "minimal":**
282
- - Add +15 if style is "Minimalist"
283
- 3. Cap final score at 100 (max)
284
- 4. Store as matchScore
285
-
286
- Sort all options by matchScore (highest first)
287
-
288
- → Continue to STEP 2.4
289
-
290
- ### STEP 2.4: Display Verbose Style Options
291
-
292
- For each scored option (in sorted order):
293
- 1. Assign a letter (A, B, C, etc.)
294
- 2. Mark the first option (highest score) as "RECOMMENDED"
295
- 3. Display in this format:
296
-
297
- ```
298
- ┌─────────────────────────────────────────────────────────────┐
299
- │ Option [Letter]: [Style Name] [⭐ RECOMMENDED if first]
300
- │ Source: [site name]
301
- │ Match Score: [score]%
302
- ├─────────────────────────────────────────────────────────────┤
303
-
304
- │ 📝 Characteristics:
305
- │ • [characteristic 1]
306
- │ • [characteristic 2]
307
- │ ...
308
-
309
- │ 🎭 Feel: [feel description]
310
-
311
- │ 🎨 Colors: [primary colors list]
312
-
313
- │ 🎬 Animations Available:
314
- │ • [animation 1]
315
- │ • [animation 2]
316
- │ (or "(none detected)")
317
-
318
- │ 📜 Scroll Patterns:
319
- │ • [pattern 1]
320
- │ • [pattern 2]
321
- │ (or "(none detected)")
322
-
323
- │ 🖼️ Decorative Elements:
324
- │ • [element 1]
325
- │ • [element 2]
326
- │ (or "(none detected)")
327
-
328
- └─────────────────────────────────────────────────────────────┘
329
- ```
330
-
331
- → Continue to STEP 2.5
332
-
333
- ### STEP 2.5: Ask User to Select Style
334
-
335
- Ask user to choose:
336
- - Header: "Style"
337
- - Single selection
338
- - Options:
339
- - For each scored option: "[Letter]: [Style Name]" - "[Score]% match - [Feel]"
340
- - Last option: "Mix/Custom" - "ผสมหลาย style หรือปรับแต่งเอง"
341
-
342
- **If user selects "Mix/Custom":**
343
- 1. Display prompt: "พิมพ์ความต้องการ (ตัวอย่าง: 'ชอบ border ของ A แต่อยากได้สี soft กว่านี้'):"
344
- 2. Get text input from user
345
- 3. Display: "🤖 กำลังปรับตาม feedback: '[input]'..."
346
- 4. Increment round counter
347
- 5. **If round <= 3:** → Go back to STEP 2.1 (new round with adjusted options)
348
- 6. **If round > 3:** → Continue to STEP 2.10 (max rounds reached)
349
-
350
- **If user selects a specific style (A, B, C, etc.):**
351
- 1. Extract the letter (A=0, B=1, C=2, etc.)
352
- 2. Get the corresponding option from scored list
353
- 3. Store as selectedStyle
354
- → Continue to STEP 2.6
355
-
356
- ### STEP 2.6: Animation Selection
357
-
358
- Display round header:
359
- ```
360
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
361
- 📋 ROUND [current round]/3: Animation Selection
362
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
363
- ```
364
-
365
- **Step 2.6.1: Collect All Available Animations**
366
-
367
- For each extracted site:
368
- 1. **From animation_libraries:**
369
- - For each library: Add entry with type="library", name=lib.name, source=siteName, description="[lib.name] library detected"
370
-
371
- 2. **From scroll_animations.patterns:**
372
- - For each pattern: Add entry with type="scroll", name=pattern, source=siteName, description="Scroll animation: [pattern]"
373
-
374
- 3. **From component_animations:**
375
- - **If button_hover is not "none":**
376
- - Add entry with type="component", name="Button: [button_hover]", source=siteName, description=button_hover value
377
- - **If card_hover is not "none":**
378
- - Add entry with type="component", name="Card: [card_hover]", source=siteName, description=card_hover value
379
-
380
- **Step 2.6.2: Display Available Animations**
381
-
382
- Display header: "🎬 Available Animations (จาก references ทั้งหมด):"
383
-
384
- For each animation (numbered 1, 2, 3, etc.):
385
- ```
386
- [number] [animation name]
387
- Type: [type]
388
- Source: [source site]
389
- Description: [description]
390
- ```
391
-
392
- **Step 2.6.3: Ask User to Select Animations**
393
-
394
- Ask user to choose:
395
- - Header: "Animations"
396
- - Multiple selection allowed
397
- - Question: "เลือก animations ที่ต้องการ (เลือกได้หลายอัน):"
398
- - Options:
399
- - For each animation: "[animation name]" - "From [source]: [description]"
400
-
401
- Parse user's selections and store as selectedAnimations list
402
-
403
- → Continue to STEP 2.7
404
-
405
- ### STEP 2.7: Theme & Decorative Direction
406
-
407
- Display round header:
408
- ```
409
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
410
- 📋 ROUND [current round]/3: Theme & Decorative Direction
411
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
412
- ```
413
-
414
- **Step 2.7.1: AI Theme Recommendations**
415
-
416
- Ask Claude to recommend 3-4 theme options based on project context.
417
-
418
- **Recommendation Prompt:**
419
- ```
420
- Based on project context, recommend 3-4 theme options.
421
-
422
- Project Context:
423
- - Product Type: [from context analysis]
424
- - Target Audience: [from context analysis]
425
- - Brand Personality: [from context analysis]
426
- [If context files exist: list context file names]
427
- [If context files exist: include first 500 chars of first file]
428
-
429
- Return JSON array:
430
- [
431
- {
432
- "name": "Theme Name",
433
- "description": "What this theme represents",
434
- "feeling": "How it makes users feel",
435
- "decorative_elements": ["element1", "element2", "element3"],
436
- "avoid_elements": ["avoid1", "avoid2"],
437
- "icons_suggestion": ["Lucide icon names"],
438
- "match_reason": "Why this theme fits the project"
439
- }
440
- ]
441
- ```
442
-
443
- Parse the JSON response to get theme options list.
444
-
445
- **Step 2.7.2: Display Theme Options**
446
-
447
- Display header: "🎨 Theme Recommendations (based on your project):"
448
-
449
- For each theme option:
450
- ```
451
- ┌─────────────────────────────────────────────────────────────┐
452
- │ Theme [Letter]: [theme name]
453
- ├─────────────────────────────────────────────────────────────┤
454
-
455
- │ 📝 Description: [description]
456
- │ 🎭 Feeling: [feeling]
457
-
458
- │ ✅ Decorative Elements (Use):
459
- │ • [element 1]
460
- │ • [element 2]
461
- │ ...
462
-
463
- │ ❌ Avoid:
464
- │ • [avoid 1]
465
- │ • [avoid 2]
466
- │ ...
467
-
468
- │ 🎯 Icons (Lucide): [icons list]
469
-
470
- │ 💡 Why: [match_reason]
471
-
472
- └─────────────────────────────────────────────────────────────┘
473
- ```
474
-
475
- **Step 2.7.3: Ask User to Select Theme**
476
-
477
- Ask user to choose:
478
- - Header: "Theme"
479
- - Single selection
480
- - Question: "เลือก theme หรือพิมพ์ custom:"
481
- - Options:
482
- - For each theme: "[Letter]: [name]" - "[feeling] - [first 3 decorative elements]"
483
- - "No Theme" - "ไม่ใช้ theme - geometric/abstract"
484
- - "Custom" - "กำหนด theme เอง"
485
-
486
- **If user selects "Custom":**
487
- 1. Display prompt: "พิมพ์ theme ที่ต้องการ (ตัวอย่าง: 'อวกาศ - จรวด, ดาวเทียม, ดาว'):"
488
- 2. Get text input from user
489
- 3. Build custom theme:
490
- - name: "Custom"
491
- - description: [user input]
492
- - decorative_elements: [split user input by comma and trim]
493
- - avoid_elements: []
494
- 4. Store as selectedTheme
495
-
496
- **If user selects "No Theme":**
497
- 1. Build abstract theme:
498
- - name: "Abstract"
499
- - description: "No specific theme - geometric and abstract decorations"
500
- - decorative_elements: ["geometric shapes", "gradients", "blobs"]
501
- - avoid_elements: []
502
- 2. Store as selectedTheme
503
-
504
- **If user selects a specific theme (A, B, C, etc.):**
505
- 1. Extract the letter (A=0, B=1, C=2, etc.)
506
- 2. Get the corresponding theme from options list
507
- 3. Store as selectedTheme
508
-
509
- → Continue to STEP 2.8
510
-
511
- ### STEP 2.8: Display Summary and Confirmation
512
-
513
- Display summary header:
514
- ```
515
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
516
- ✅ SUMMARY - Please Confirm
517
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
518
-
519
- 🎨 Style: [selectedStyle.style] (from [selectedStyle.site])
520
- Feel: [selectedStyle.feel]
521
-
522
- 🎬 Animations Enabled:
523
- ✅ [animation 1]
524
- ✅ [animation 2]
525
- (or "(none selected)" if empty)
526
-
527
- 🎭 Theme: [selectedTheme.name]
528
- Decorations: [decorative_elements list]
529
- Avoid: [avoid_elements list or "(none)"]
530
-
531
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
532
- ```
533
-
534
- **Step 2.8.1: Ask User to Confirm**
535
-
536
- Ask user to confirm:
537
- - Header: "Confirm"
538
- - Single selection
539
- - Question: "ยืนยันการตั้งค่านี้?"
540
- - Options:
541
- - "Yes, Generate" - "สร้าง design system ตามนี้"
542
- - "Adjust" - "ปรับแต่งอีกรอบ"
543
- - "Start Over" - "เริ่มใหม่ตั้งแต่ต้น"
544
-
545
- **If user selects "Yes, Generate":**
546
- - Mark as accepted
547
- → Exit loop, continue to STEP 3
548
-
549
- **If user selects "Start Over":**
550
- - Reset round counter to 1
551
- → Go back to STEP 2.1 (start fresh)
552
-
553
- **If user selects "Adjust":**
554
- - Increment round counter
555
- → Continue to STEP 2.9 (check round limit)
556
-
557
- ### STEP 2.9: Check Round Limit
558
-
559
- **If current round <= 3:**
560
- → Go back to STEP 2.1 (new adjustment round)
561
-
562
- **If current round > 3 (max rounds reached):**
563
- → Continue to STEP 2.10
564
-
565
- ### STEP 2.10: Max Rounds Reached - Force Decision
566
-
567
- Display warning:
568
- ```
569
- ⚠️ ครบ 3 รอบแล้ว
570
-
571
- แนะนำ:
572
- 1. รัน /extract กับ reference ใหม่
573
- 2. หรือ accept แล้วค่อย manual edit ไฟล์ที่สร้าง
574
- ```
575
-
576
- Ask user for final decision:
577
- - Header: "Force"
578
- - Single selection
579
- - Question: "ต้องการ generate ตาม settings ปัจจุบันไหม?"
580
- - Options:
581
- - "Yes" - "Generate ตาม settings ล่าสุด"
582
- - "Cancel" - "ยกเลิก"
583
-
584
- **If user selects "Yes":**
585
- - Mark as accepted
586
- → Continue to STEP 3
587
-
588
- **If user selects "Cancel":**
589
- - Display: "Design setup cancelled."
590
- → STOP (exit command)
591
-
592
- ---
593
-
594
- **Report:**
595
- ```
596
- ✅ User Selection Complete!
597
-
598
- 🎨 Style: ${selectedStyle.style}
599
- 🎬 Animations: ${selectedAnimations.length} selected
600
- 🎭 Theme: ${selectedTheme.name}
601
-
602
- 🔄 Generating design system files...
603
- ```
604
-
605
- ---
606
-
607
- ## STEP 3: Generate Preview YAMLs (Legacy - Optional)
608
-
609
- > **Note:** This step is optional and creates preview files for each option. In the new flow, we skip directly to generating the final files.
610
-
611
- **If you want to generate preview files:**
612
-
613
- For each style option that was presented to the user:
614
- 1. Assign a letter (A, B, C, etc.)
615
- 2. Ask Claude to generate an abbreviated YAML preview
616
-
617
- **Preview Generation Prompt:**
618
- ```
619
- You are generating a preview style guide in YAML format.
620
-
621
- Style Direction: [option.name]
622
- Fit Score: [option.fit_score]%
623
- Rationale: [option.rationale]
624
-
625
- Source Mapping:
626
- [JSON of option.sources]
627
-
628
- Customizations:
629
- [list of option.customizations]
630
-
631
- Extracted Data (for reference):
632
- [First 5000 chars of extractedData JSON]
633
-
634
- Task: Create abbreviated YAML preview with key values only.
635
-
636
- Format:
637
- ```yaml
638
- meta:
639
- style_name: "[option.name]"
640
- fit_score: [option.fit_score]
641
- sources: [list of source sites]
642
-
643
- colors:
644
- primary:
645
- hex: "#..." # From [option.sources.colors]
646
- rationale: "Why this color fits"
647
- secondary:
648
- hex: "#..."
649
- # ... 5-10 key colors
650
-
651
- typography:
652
- font_family: "..." # From [option.sources.typography]
653
- h1: { size: "...", weight: "..." }
654
- # ... key type styles
655
-
656
- shadows:
657
- brutal: "..." # From [option.sources.shadows]
658
- # ... 3-5 key shadows
659
-
660
- spacing:
661
- grid: "..." # From [option.sources.spacing]
662
-
663
- components:
664
- button:
665
- hover_animation: "..." # From [option.sources.button_hover]
666
- description: "..."
667
- card:
668
- hover_animation: "..." # From [option.sources.card_hover]
669
- # ... key components
670
-
671
- border_radius:
672
- values: [...] # From [option.sources.border_radius]
673
- ```
674
-
675
- Return only the YAML content.
676
- ```
677
-
678
- 3. Write the preview to file:
679
- - Path: `design-system/synthesis/options/option-[letter]-[name-kebab-case].yaml`
680
- - Content: YAML from Claude's response
681
-
682
- **Skip this step in most cases** - proceed directly to STEP 3.5
683
-
684
- ---
685
-
686
- ## STEP 3.5: Quick User Input (Legacy - v1.4.0)
687
-
688
- > **Note:** This step is from an older version and asks for preferences before presenting options. This is now integrated into STEP 2's interactive loop. Can be skipped.
689
-
690
- **If you want to collect user preferences upfront:**
691
-
692
- Display header:
693
- ```
694
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
695
- 📝 Quick Question
696
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
697
- ```
698
-
699
- Ask user about special preferences:
700
- - Header: "Preferences"
701
- - Single selection
702
- - Question: "มีอะไรอยากปรับหรือเน้นเป็นพิเศษไหม? (optional)"
703
- - Options:
704
- - "ไม่มี ใช้ AI แนะนำ" - "ให้ AI เลือกสิ่งที่เหมาะสมที่สุด"
705
- - "มีสี CI ของตัวเอง" - "ระบุสีแบรนด์"
706
- - "ชอบ component เฉพาะ" - "ชอบ button/card ของเว็บใดเป็นพิเศษ"
707
- - "ปรับอื่นๆ" - "Typography, shadows, หรืออื่นๆ"
708
-
709
- Initialize userPreferences with type: 'none'
710
-
711
- **If user selects "มีสี CI ของตัวเอง":**
712
- 1. Display prompt:
713
- ```
714
- กรุณาระบุสี (HEX format, คั่นด้วย comma):
715
- ตัวอย่าง: #0d7276, #f97316
716
-
717
- สีของคุณ:
718
- ```
719
- 2. Get text input from user
720
- 3. Parse colors: split by comma, trim, filter only valid HEX format (#RRGGBB)
721
- 4. **If valid colors found:**
722
- - Set userPreferences.type = 'custom_colors'
723
- - Set userPreferences.colors.primary = first color
724
- - Set userPreferences.colors.secondary = second color (or null)
725
- - Set userPreferences.colors.accent = third color (or null)
726
- - Display: "✅ รับสีแล้ว: [colors list]"
727
-
728
- **If user selects "ชอบ component เฉพาะ":**
729
- 1. Display prompt: "ระบุความชอบ (ตัวอย่าง: 'ชอบ button ของ motherduck, card ของ gitingest'):"
730
- 2. Get text input from user
731
- 3. Set userPreferences.type = 'component_preference'
732
- 4. Set userPreferences.text = user input
733
- 5. Display: "✅ บันทึกความชอบแล้ว"
734
-
735
- **If user selects "ปรับอื่นๆ":**
736
- 1. Display prompt: "ระบุสิ่งที่อยากปรับ (ตัวอย่าง: 'ใช้ font Inter, shadow แบบ soft'):"
737
- 2. Get text input from user
738
- 3. Set userPreferences.type = 'other_adjustment'
739
- 4. Set userPreferences.text = user input
740
- 5. Display: "✅ บันทึกการปรับแต่งแล้ว"
741
-
742
- Display final message:
743
- ```
744
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
745
- 🔄 กำลังสร้าง style options (พร้อม preferences ของคุณ)...
746
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
747
- ```
748
-
749
- **In most cases, skip this step** - preferences are handled in STEP 2's interactive loop
750
-
751
- ---
752
-
753
- ## STEP 4: Present Options to User (Legacy - Old Flow)
754
-
755
- > **Note:** This step is from the old flow (v1.x). In the new flow (v2.0+), user selection happens in STEP 2's interactive loop. This step is now DEPRECATED.
756
-
757
- **Old flow (for reference only):**
758
-
759
- Display analysis summary:
760
- ```
761
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
762
- 🎨 Design Direction Analysis Complete
763
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
764
-
765
- Based on:
766
- ✓ [number] extracted sites ([site names])
767
- ✓ Target: [target audience]
768
- ✓ Brand: [brand personality]
769
- ✓ Product: [product type]
770
- [If preferences: ✓ User preferences: [preferences]]
771
-
772
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
773
- ```
774
-
775
- For each style option:
776
- Display:
777
- ```
778
- Option [Letter]: [option.name] [⭐ (Recommended) if first]
779
- Fit Score: [option.fit_score]%
780
-
781
- Rationale:
782
- [option.rationale]
783
-
784
- Component Sources:
785
- - Colors: [option.sources.colors]
786
- - Shadows: [option.sources.shadows]
787
- - Typography: [option.sources.typography]
788
- - Button hover: [option.sources.button_hover]
789
- - Card hover: [option.sources.card_hover]
790
- - Input focus: [option.sources.input_focus]
791
- - Border radius: [option.sources.border_radius]
792
- - Overall vibe: [option.sources.overall_vibe]
793
-
794
- Customizations Applied:
795
- • [customization 1]
796
- • [customization 2]
797
- ...
798
-
799
- Advantages:
800
- ✅ [advantage 1]
801
- ✅ [advantage 2]
802
- ...
803
-
804
- Disadvantages:
805
- ⚠️ [disadvantage 1]
806
- ⚠️ [disadvantage 2]
807
- ...
808
-
809
- Preview: design-system/synthesis/options/option-[letter]-[name-kebab].yaml
810
-
811
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
812
- ```
813
-
814
- Ask user to select:
815
- - Header: "Style"
816
- - Single selection
817
- - Question: "Select design direction:"
818
- - Options:
819
- - For each option: "[Letter]: [name]" - "[score]% fit - [first 100 chars of rationale]..."
820
-
821
- Extract selected index and get corresponding option.
822
-
823
- **Report:**
824
- ```
825
- ✅ Style Selected: [selectedOption.name]
826
-
827
- 🔄 Generating comprehensive design system...
828
- ```
829
-
830
- **In current version (v2.0+), skip this step** - user selection is handled in STEP 2
831
-
832
- ---
833
-
834
- ## STEP 5: Generate Final Design System (Legacy - Deprecated in v2.0+)
835
-
836
- > **Note:** This step is from the old flow (v1.x). In the current flow (v2.0+), design system generation happens in STEP 5.5 (data.yaml), STEP 5.6 (patterns/*.md), and STEP 5.7 (README.md). This step is now DEPRECATED.
837
-
838
- **Old flow (for reference only):**
839
-
840
- This step would generate a comprehensive 1500-2000 line README.md by:
841
-
842
- 1. Preparing a prompt for Claude with:
843
- - Selected option details (name, fit score, rationale)
844
- - Source mapping (which site provided which design elements)
845
- - Customizations applied
846
- - Full extracted data from all sites
847
- - Preview YAML content
848
- - Project context (product type, audience, brand)
849
-
850
- 2. The prompt would request a complete design system markdown file with:
851
- - Header with metadata (source, date, style, tech stack, primary color)
852
- - Quick reference section (most-used patterns table, design tokens JSON)
853
- - Table of contents (all 17 sections)
854
- - Section 1: Overview (summary, characteristics, tech stack, goals)
855
- - Section 2: Design Philosophy (core principles, visual identity, differentiators, UX goals)
856
- - Section 3: Color Palette (primary/secondary colors with hex, usage, psychology, source, CSS variables, Tailwind classes)
857
- - Section 4: Typography (font family, weights, text styles for all headings with exact Tailwind classes and sources)
858
- - Section 5: Spacing System (grid base, scale array from source)
859
- - Section 6: Component Styles (buttons, cards, etc. with exact classes, animations, sources)
860
- - Section 7: Shadows & Elevation (levels and usage from source)
861
- - Sections 8-16: [Other design system sections]
862
- - Section 17: Additional Sections (implementation best practices, accessibility guidelines, critical DO/DON'T rules)
863
- - Footer with project name, date, sources
864
-
865
- 3. Ask Claude's LLM to generate the content (max 16000 tokens)
866
-
867
- 4. Write the generated content to `design-system/README.md`
868
-
869
- **In current version (v2.0+), skip this step** - generation is split into STEP 5.5, 5.6, and 5.7
870
-
871
- ---
872
-
873
- ## STEP 5.5: Generate tokens.json and data.yaml (Enhanced v2.0.0)
874
-
875
- > **Enhanced v2.0.0:** Now includes style, theme, animations, decorative_direction, and patterns_index
876
-
877
- Display progress:
878
- ```
879
- 🔄 Generating enhanced tokens.json...
880
- ```
881
-
882
- ### Build Tokens Data Structure
883
-
884
- Create a data structure with the following sections:
885
-
886
- **1. Schema & Meta:**
887
- - schema: "https://json-schema.org/draft-07/schema"
888
- - version: "2.0.0"
889
- - meta.generated_at: current timestamp (ISO format)
890
- - meta.generated_by: "/designsetup command v2.0.0"
891
- - meta.source_sites: list of extracted site names
892
- - meta.description: "Design tokens for agents (~800 tokens). Human-readable guide: README.md"
893
-
894
- **2. Style (from user selection in STEP 2):**
895
- - style.name: selectedStyle.style
896
- - style.confidence: selectedStyle.confidence
897
- - style.characteristics: selectedStyle.characteristics
898
- - style.feel: selectedStyle.feel
899
- - style.source_site: selectedStyle.site
900
-
901
- **3. Theme (from user selection in STEP 2.7):**
902
- - theme.name: selectedTheme.name
903
- - theme.description: selectedTheme.description
904
- - theme.feeling: selectedTheme.feeling (or description if feeling not set)
905
- - theme.decorative_elements.use: selectedTheme.decorative_elements
906
- - theme.decorative_elements.avoid: selectedTheme.avoid_elements
907
- - theme.icons_suggestion: selectedTheme.icons_suggestion (or ["Lucide icons"] as fallback)
908
-
909
- **4. Animations (from user selection in STEP 2.6):**
910
- - animations.enabled: true if selectedAnimations has items, false otherwise
911
- - animations.libraries: extractedData[selectedStyle.site].animation_libraries (or empty array)
912
- - animations.selected_patterns: selectedAnimations list
913
- - animations.scroll_animations.enabled: true if any selected animation includes 'scroll', 'parallax', 'fade', or 'stacking'
914
- - animations.scroll_animations.patterns: extractedData[selectedStyle.site].scroll_animations.patterns (or empty)
915
- - animations.component_animations.button_hover: from selected site's data (or "scale + shadow" as fallback)
916
- - animations.component_animations.card_hover: from selected site's data (or "translateY + shadow" as fallback)
917
- - animations.component_animations.input_focus: from selected site's data (or "ring" as fallback)
918
- - animations.duration.fast: "150ms"
919
- - animations.duration.normal: "200ms"
920
- - animations.duration.slow: "300ms"
921
- - animations.easing.default: "ease-in-out"
922
- - animations.easing.bounce: "cubic-bezier(0.68, -0.55, 0.265, 1.55)"
923
-
924
- **5. Colors (from selectedStyle):**
925
- - colors.primary.DEFAULT: selectedStyle.colors[0] (or "#0d7276" as fallback)
926
- - colors.primary.foreground: "#ffffff"
927
- - colors.primary.hover: darken primary color by 10%
928
- - colors.primary.tailwind: "bg-primary, text-primary, border-primary"
929
- - colors.secondary.DEFAULT: selectedStyle.colors[1] (or "#64748b" as fallback)
930
- - colors.secondary.foreground: "#ffffff"
931
- - colors.secondary.hover: darken secondary color by 10%
932
- - colors.accent.DEFAULT: selectedStyle.colors[2] (or primary color, or "#f97316")
933
- - colors.accent.foreground: "#ffffff"
934
- - colors.background: { DEFAULT: "#ffffff", muted: "#f1f5f9", subtle: "#f8fafc" }
935
- - colors.foreground: { DEFAULT: "#0a0a0a", muted: "#64748b", subtle: "#94a3b8" }
936
- - colors.border: { DEFAULT: "#e2e8f0", hover: "#cbd5e1", focus: primary color }
937
- - colors.semantic: { success: "#10b981", warning: "#f59e0b", error: "#ef4444", info: "#3b82f6" }
938
-
939
- **Color Darkening Logic:**
940
- To darken a hex color by a percentage:
941
- 1. Remove '#' prefix and convert to integer
942
- 2. Calculate amount: round(2.55 * percent)
943
- 3. Extract RGB: R = (num >> 16), G = (num >> 8 & 0xFF), B = (num & 0xFF)
944
- 4. Subtract amount from each: max(R - amount, 0), max(G - amount, 0), max(B - amount, 0)
945
- 5. Recombine and convert back to hex with '#' prefix
946
-
947
- **6. Typography (from selected site):**
948
- - typography.font_family.sans: extractedData[selectedStyle.site].typography.fonts[0] (or "'Inter', sans-serif")
949
- - typography.font_family.mono: "'Fira Code', monospace"
950
- - typography.font_size: { xs: "12px", sm: "14px", base: "16px", lg: "18px", xl: "20px", 2xl: "24px", 3xl: "30px", 4xl: "36px", 5xl: "48px" }
951
- - typography.font_weight: { normal: "400", medium: "500", semibold: "600", bold: "700" }
952
- - typography.headings: { h1: "text-5xl font-bold", h2: "text-4xl font-bold", h3: "text-3xl font-semibold", h4: "text-2xl font-semibold", h5: "text-xl font-medium", h6: "text-lg font-medium" }
953
-
954
- **7. Spacing (from selected site):**
955
- - spacing.scale: extractedData[selectedStyle.site].spacing.common (or [4, 8, 12, 16, 24, 32, 48, 64, 96])
956
- - spacing.grid_base: extractedData[selectedStyle.site].spacing.grid_base (or "8px")
957
- - spacing.common_patterns: { component_padding: "p-4 (16px) or p-6 (24px)", section_gap: "gap-8 (32px) or gap-12 (48px)", layout_margin: "mt-16 (64px) or mt-24 (96px)" }
958
-
959
- **8. Shadows (from selected site):**
960
- - shadows.values: extractedData[selectedStyle.site].shadows (or default array)
961
- - shadows.usage: { cards: "shadow-md", dropdowns: "shadow-lg", modals: "shadow-xl", buttons_hover: "shadow-sm" }
962
-
963
- **9. Borders (from selected site):**
964
- - borders.radius: extractedData[selectedStyle.site].border_radius (or ["4px", "8px", "12px", "9999px"])
965
- - borders.usage: { inputs: "rounded-md", buttons: "rounded-lg", cards: "rounded-xl", avatars: "rounded-full" }
966
-
967
- **10. Patterns Index:**
968
- - patterns_index.buttons: "design-system/patterns/buttons.md"
969
- - patterns_index.scroll_animations: "design-system/patterns/scroll-animations.md"
970
- - patterns_index.decorations: "design-system/patterns/decorations.md"
971
- - patterns_index.cards: "design-system/patterns/cards.md"
972
- - patterns_index.forms: "design-system/patterns/forms.md"
973
-
974
- **11. Component Library:**
975
- - component_library.name: "shadcn/ui"
976
- - component_library.install_command: "npx shadcn-ui@latest init"
977
- - component_library.common_components: ["button", "card", "input", "select", "dialog", "dropdown-menu", "badge", "avatar", "tooltip"]
978
-
979
- **12. Critical Rules:**
980
- - critical_rules.colors: ["❌ NO hardcoded hex values", "✅ USE theme tokens (bg-primary, text-foreground)"]
981
- - critical_rules.spacing: ["❌ NO arbitrary values (p-5, gap-7)", "✅ USE spacing scale (p-4, p-6, gap-8)"]
982
- - critical_rules.consistency: ["❌ NO mixing patterns", "✅ USE consistent patterns from tokens"]
983
-
984
- ### Generate data.yaml
985
-
986
- Call the helper function (see Helper section below) to generate YAML format with:
987
- - Tokens data from above
988
- - Psychology data from extractedData[selectedStyle.site]
989
- - All design tokens in YAML format
990
-
991
- Write to file: `design-system/data.yaml`
992
-
993
- Display confirmation:
994
- ```
995
- ✅ data.yaml generated (~300 lines)
996
- ```
997
-
998
- → Continue to STEP 5.6
999
-
1000
- ---
1001
-
1002
- ## STEP 5.6: Generate patterns/*.md Files
1003
-
1004
- > **Code patterns for agents** - Selective loading based on page type
1005
-
1006
- ### STEP 5.6.1: Display Progress Message
1007
-
1008
- Display progress message:
1009
- ```
1010
- 🔄 Generating pattern files...
1011
- ```
1012
-
1013
- ### STEP 5.6.2: Create Patterns Directory
1014
-
1015
- Create the patterns directory:
1016
- - Path: `design-system/patterns`
1017
-
1018
- ### STEP 5.6.3: Generate buttons.md
1019
-
1020
- Build the buttons pattern content with these sections:
1021
-
1022
- 1. **Header metadata:**
1023
- - Source: selectedStyle.site
1024
- - Style: selectedStyle.style
1025
- - Load when: "Any UI page"
1026
-
1027
- 2. **Button variants** (each with TSX code example):
1028
- - Primary Button (with conditional hover based on tokensData.animations.component_animations.button_hover)
1029
- - Secondary Button
1030
- - Ghost Button
1031
- - Outline Button
1032
- - Icon Button
1033
-
1034
- 3. **Button sizes:**
1035
- - Small: px-3 py-1.5 text-sm rounded-md
1036
- - Medium (default): px-4 py-2 text-base rounded-lg
1037
- - Large: px-6 py-3 text-lg rounded-lg
1038
-
1039
- ### STEP 5.6.4: Generate scroll-animations.md
1040
-
1041
- Build the scroll animations pattern content with these sections:
1042
-
1043
- 1. **Header metadata:**
1044
- - Source: selectedStyle.site
1045
- - Style: selectedStyle.style
1046
- - Load when: "Landing pages, marketing pages"
1047
- - Libraries: List from tokensData.animations.libraries or "CSS/Tailwind"
1048
-
1049
- 2. **Enabled Patterns list:** List from selectedAnimations or "No scroll animations selected"
1050
-
1051
- 3. **Code examples** (TSX):
1052
- - Fade In on Scroll (CSS with IntersectionObserver)
1053
- - Stacking Cards (GSAP ScrollTrigger)
1054
- - Parallax Section (CSS with scroll handler)
1055
- - Slide In from Side (Left and Right animations)
1056
-
1057
- Write the content to `design-system/patterns/scroll-animations.md`
1058
-
1059
- ### STEP 5.6.5: Generate decorations.md
1060
-
1061
- Build the decorations pattern content with these sections:
1062
-
1063
- 1. **Header metadata:**
1064
- - Theme: selectedTheme.name
1065
- - Load when: "Landing pages, marketing pages (NOT dashboards)"
1066
-
1067
- 2. **Theme Direction:**
1068
- - USE These Elements: List from selectedTheme.decorative_elements
1069
- - AVOID These Elements: List from selectedTheme.avoid_elements or "(none specified)"
1070
- - Suggested Icons (Lucide): List from selectedTheme.icons_suggestion or "Default Lucide icons"
1071
-
1072
- 3. **Code examples** (TSX):
1073
- - Gradient Background (subtle overlay and mesh gradient)
1074
- - Blob Shapes (animated blob with CSS keyframes)
1075
- - Grid Pattern (dot grid and line grid backgrounds)
1076
- - Floating Elements (floating icons with animation)
1077
- - Dividers & Separators (wave divider SVG and gradient line)
1078
-
1079
- Write the content to `design-system/patterns/decorations.md`
1080
-
1081
- ### STEP 5.6.6: Generate cards.md
1082
-
1083
- Build the cards pattern content with these sections:
1084
-
1085
- 1. **Header metadata:**
1086
- - Source: selectedStyle.site
1087
- - Style: selectedStyle.style
1088
- - Load when: "Any UI page"
1089
-
1090
- 2. **Card variants** (each with TSX code example):
1091
- - Default Card
1092
- - Interactive Card (with conditional hover based on tokensData.animations.component_animations.card_hover)
1093
- - Feature Card (with icon container)
1094
- - Pricing Card (with popular badge, price, features list, CTA button)
1095
- - Testimonial Card (with avatar, name, title, quote)
1096
-
1097
- Write the content to `design-system/patterns/cards.md`
1098
-
1099
- ### STEP 5.6.7: Generate forms.md
1100
-
1101
- Build the forms pattern content with these sections:
1102
-
1103
- 1. **Header metadata:**
1104
- - Source: selectedStyle.site
1105
- - Style: selectedStyle.style
1106
- - Load when: "Auth pages, settings, any form UI"
1107
-
1108
- 2. **Form elements** (each with TSX code example):
1109
- - Input Field (with label, input, helper text)
1110
- - Input with Error (error state styling and error message)
1111
- - Select Field (dropdown)
1112
- - Checkbox (with label)
1113
- - Form Layout (complete form with submit button)
1114
-
1115
- Write the content to `design-system/patterns/forms.md`
1116
-
1117
- ### STEP 5.6.8: Display Completion Message
1118
-
1119
- Display completion message:
1120
- ```
1121
- ✅ Pattern files generated:
1122
- - design-system/patterns/buttons.md
1123
- - design-system/patterns/scroll-animations.md
1124
- - design-system/patterns/decorations.md
1125
- - design-system/patterns/cards.md
1126
- - design-system/patterns/forms.md
1127
- ```
1128
-
1129
- → Continue to STEP 5.7
1130
-
1131
- ---
1132
-
1133
- ## STEP 5.7: Generate Lean README.md (Human-Readable)
1134
-
1135
- > **Human-readable guide** - No code, just descriptions and visuals
1136
-
1137
- ### STEP 5.7.1: Display Progress Message
1138
-
1139
- Display progress message:
1140
- ```
1141
- 🔄 Generating lean README.md (human-readable)...
1142
- ```
1143
-
1144
- ### STEP 5.7.2: Build README Content
1145
-
1146
- Build a markdown document with these 11 sections:
1147
-
1148
- **Header:**
1149
- - Title: "[selectedStyle.style] Design System"
1150
- - Metadata: Style, Theme, Generated date, Sources
1151
-
1152
- **Section 1: Overview**
1153
- - Description of design system (style + theme)
1154
- - Feel: selectedStyle.feel
1155
- - Characteristics: List from selectedStyle.characteristics
1156
-
1157
- **Section 2: Color Palette**
1158
- - Primary Color (value, usage, feel)
1159
- - Secondary Color (value, usage)
1160
- - Background Colors (DEFAULT, muted, subtle)
1161
- - Text Colors (DEFAULT, muted, subtle)
1162
- - Semantic Colors (success, warning, error, info)
1163
-
1164
- **Section 3: Typography**
1165
- - Font Family (sans, monospace)
1166
- - Heading Sizes (H1-H6 with px sizes and weights)
1167
- - Body Text (large, base, small, extra small)
1168
-
1169
- **Section 4: Spacing System**
1170
- - Base Unit: tokensData.spacing.grid_base
1171
- - Scale: List from tokensData.spacing.scale
1172
- - Common Patterns (component padding, section gap, layout margin)
1173
-
1174
- **Section 5: Shadows & Elevation**
1175
- - Elevation Levels (0-4)
1176
- - Usage guide for each level
1177
-
1178
- **Section 6: Border Radius**
1179
- - Values: List from tokensData.borders.radius
1180
- - Usage guide (inputs, buttons, cards, avatars)
1181
-
1182
- **Section 7: Theme**
1183
- - Theme name: selectedTheme.name
1184
- - Description and feeling
1185
- - Decorative Elements to USE (list)
1186
- - Elements to AVOID (list or "none specified")
1187
- - Suggested Icons
1188
-
1189
- **Section 8: Animations**
1190
- - Enabled status (Yes/No)
1191
- - Libraries list or "CSS/Tailwind only"
1192
- - Selected Patterns list or "No scroll animations"
1193
- - Component Animations (button hover, card hover, input focus)
1194
- - Timing (fast, normal, slow)
1195
-
1196
- **Section 9: Component Library**
1197
- - Recommended: tokensData.component_library.name
1198
- - Common Components list
1199
-
1200
- **Section 10: Code Patterns**
1201
- - Reference links to all 5 pattern files
1202
-
1203
- **Section 11: Critical Rules**
1204
- - Colors rules (NO hardcoded hex, USE tokens)
1205
- - Spacing rules (NO arbitrary values, USE scale)
1206
- - Consistency rules (NO mixing, USE consistent patterns)
1207
-
1208
- **Footer:**
1209
- - "Generated by /designsetup v2.0.0"
1210
- - "Sources: [list of extracted sites]"
1211
-
1212
- ### STEP 5.7.3: Write README File
1213
-
1214
- Write the markdown content to `design-system/README.md`
1215
-
1216
- ### STEP 5.7.4: Display Confirmation
1217
-
1218
- Display confirmation message:
1219
- ```
1220
- ✅ README.md generated (lean, human-readable, ~100 lines)
1221
- ```
1222
-
1223
- → Continue to STEP 6
1224
-
1225
- ---
1226
-
1227
- ## STEP 6: Final Report
1228
-
1229
- Display a comprehensive final report with these sections:
1230
-
1231
- **Header:**
1232
- ```
1233
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1234
- ✅ Design Setup Complete!
1235
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1236
- ```
1237
-
1238
- **Summary Section:**
1239
- - Style: [selectedStyle.style] (from [selectedStyle.site])
1240
- - Theme: [selectedTheme.name]
1241
- - Sources: [list of extracted sites]
1242
- - Animations: [count] patterns enabled
1243
-
1244
- **Style Characteristics:**
1245
- - List first 4 characteristics from selectedStyle.characteristics
1246
-
1247
- **Theme Direction:**
1248
- - USE: First 3 elements from selectedTheme.decorative_elements
1249
- - AVOID: First 2 elements from selectedTheme.avoid_elements or "(none)"
1250
-
1251
- **Files Created:**
1252
- - FOR AGENTS section:
1253
- - design-system/data.yaml (~300 lines)
1254
- - design-system/patterns/buttons.md
1255
- - design-system/patterns/cards.md
1256
- - design-system/patterns/forms.md
1257
- - design-system/patterns/scroll-animations.md
1258
- - design-system/patterns/decorations.md
1259
-
1260
- - FOR HUMANS section:
1261
- - design-system/README.md (~100 lines)
1262
-
1263
- **Next Steps:**
1264
- 1. Review generated files (commands provided)
1265
- 2. Plan your pages with /pageplan
1266
- 3. Setup & develop with /csetup and /cdev
1267
-
1268
- **How It Works:**
1269
- - Explain /pageplan reads data.yaml and auto-detects page type
1270
- - Explain uxui-frontend agent reads data.yaml and selective patterns
1271
- - Mention content includes Psychology, Target Audience, Why It Works
1272
-
1273
- **Footer:**
1274
- ```
1275
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1276
- ```
1277
-
1278
- ---
1279
-
1280
- ## Helper: Generate data.yaml
1281
-
1282
- This helper function generates the complete data.yaml file by merging psychology data from extracted sites with design tokens.
1283
-
1284
- **Inputs:**
1285
- - tokensData: Design tokens object built in STEP 5.5
1286
- - extractedData: All extracted site data
1287
- - selectedStyle: Selected style object from user choice
1288
-
1289
- **Process:**
1290
-
1291
- 1. Get psychology data from the selected site:
1292
- - selectedSiteData = extractedData[selectedStyle.site]
1293
- - psychology = selectedSiteData.psychology or empty object
1294
-
1295
- 2. Build YAML content with 5 major sections:
1296
-
1297
- **Section 1: Header Comments**
1298
- - Generated by: /designsetup
1299
- - Source: selectedStyle.site
1300
- - Style: selectedStyle.style
1301
-
1302
- **Section 2: Meta**
1303
- - generated_at: Current ISO timestamp
1304
- - source_site: selectedStyle.site
1305
- - style: selectedStyle.style
1306
- - theme: tokensData.theme.name or "default"
1307
-
1308
- **Section 3: Psychology & Analysis**
1309
- - style_classification: From psychology or selectedStyle.style
1310
- - emotions_evoked: List of {emotion, reason} or "# Not available"
1311
- - target_audience:
1312
- - primary: {description, age_range, tech_savvy}
1313
- - secondary: {description}
1314
- - visual_principles: List of {name, description} or "# Not available"
1315
- - why_it_works: List of strings or "# Not available"
1316
- - design_philosophy: {core_belief, key_principles list} or "Not specified"
1317
-
1318
- **Section 4: Design Tokens**
1319
- - style: {detected, characteristics list, feel}
1320
- - colors: {primary, secondary, background, foreground, muted, accent}
1321
- - typography: {font_family, heading_font, weights array, sizes object}
1322
- - spacing: {base, scale array}
1323
- - border_radius: {sm, md, lg, full}
1324
- - shadows: {sm, md, lg}
1325
-
1326
- **Section 5: Animations**
1327
- - durations: {fast, normal, slow}
1328
- - easing: {default, bounce}
1329
- - component_animations: {button_hover, card_hover}
1330
- - scroll_animations: {enabled boolean, patterns array}
1331
-
1332
- **Section 6: Theme Direction**
1333
- - theme: {name, decorative_elements list, avoid_elements list}
1334
-
1335
- **Output:** Returns the complete YAML content as a string
1336
-
1337
- ---
1338
-
1339
- ## Error Handling
1340
-
1341
- Handle these error scenarios throughout the workflow:
1342
-
1343
- ### Error 1: No Extracted Data (STEP 0.1)
1344
-
1345
- **When:** No design-system/extracted/*/data.yaml files found
1346
-
1347
- **Action:** Display error message and stop execution:
1348
- ```
1349
- ❌ No extracted data found
1350
-
1351
- Please extract at least 1 site:
1352
- /extract https://airbnb.com
1353
-
1354
- Then run: /designsetup @prd.md
1355
- ```
1356
-
1357
- ### Error 2: AI Analysis Fails (STEP 1.2, 2.3, etc.)
1358
-
1359
- **When:** LLM call fails during context analysis or style generation
1360
-
1361
- **Action:** Catch error and display message with debugging guidance:
1362
- ```
1363
- ❌ AI analysis failed: [error.message]
1364
-
1365
- This may be due to:
1366
- - Extracted data too large (try fewer sites)
1367
- - API rate limit (wait and retry)
1368
- - Invalid context files
1369
-
1370
- Retry or use --debug for details
1371
- ```
1372
-
1373
- ### Error 3: User Cancels (STEP 2.8)
1374
-
1375
- **When:** User selects "Cancel" option at max rounds or during confirmation
1376
-
1377
- **Action:** Display cancellation message and preserve data:
1378
- ```
1379
- ⚠️ Design setup cancelled
1380
-
1381
- Your data is preserved:
1382
- - Extracted: design-system/extracted/
1383
- - Options: design-system/synthesis/options/
1384
-
1385
- Run /designsetup again when ready.
1386
- ```
1387
-
1388
- ### Error 4: Write Fails (STEP 5.6, 5.7)
1389
-
1390
- **When:** Unable to write to design-system/ directory
1391
-
1392
- **Action:**
1393
- 1. Save backup to temporary location: /tmp/style-guide-backup.md
1394
- 2. Display error message with backup location:
1395
- ```
1396
- ❌ Failed to write README.md
1397
-
1398
- Check permissions: design-system/
1399
-
1400
- Backup saved: /tmp/style-guide-backup.md
1401
- ```
1402
-
1403
- ---
1404
-
1405
- **Now execute the synthesis.**