@champpaba/claude-agent-kit 2.6.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 (72) 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 +13 -13
  6. package/.claude/commands/cview.md +364 -364
  7. package/.claude/commands/designsetup.md +171 -48
  8. package/.claude/commands/extract.md +382 -668
  9. package/.claude/commands/pageplan.md +25 -27
  10. package/.claude/contexts/design/accessibility.md +611 -611
  11. package/.claude/contexts/design/box-thinking.md +4 -4
  12. package/.claude/contexts/design/color-theory.md +5 -5
  13. package/.claude/contexts/design/index.md +9 -9
  14. package/.claude/contexts/design/layout.md +400 -400
  15. package/.claude/contexts/design/responsive.md +551 -551
  16. package/.claude/contexts/design/shadows.md +522 -522
  17. package/.claude/contexts/design/spacing.md +4 -4
  18. package/.claude/contexts/design/typography.md +465 -465
  19. package/.claude/contexts/domain/README.md +164 -164
  20. package/.claude/contexts/patterns/agent-coordination.md +388 -388
  21. package/.claude/contexts/patterns/agent-discovery.md +1 -1
  22. package/.claude/contexts/patterns/animation-patterns.md +3 -3
  23. package/.claude/contexts/patterns/development-principles.md +513 -513
  24. package/.claude/contexts/patterns/error-handling.md +478 -478
  25. package/.claude/contexts/patterns/logging.md +424 -424
  26. package/.claude/contexts/patterns/tdd-classification.md +516 -516
  27. package/.claude/contexts/patterns/testing.md +413 -413
  28. package/.claude/contexts/patterns/ui-component-consistency.md +3 -3
  29. package/.claude/lib/README.md +1 -1
  30. package/.claude/lib/agent-executor.md +223 -0
  31. package/.claude/lib/context-loading-protocol.md +5 -6
  32. package/.claude/lib/detailed-guides/agent-system.md +4 -4
  33. package/.claude/lib/detailed-guides/best-practices-system.md +5 -4
  34. package/.claude/lib/detailed-guides/context-optimization.md +21 -22
  35. package/.claude/lib/detailed-guides/design-system.md +6 -5
  36. package/.claude/lib/detailed-guides/page-planning.md +6 -6
  37. package/.claude/lib/document-loader.md +32 -47
  38. package/.claude/lib/task-analyzer.md +194 -1
  39. package/.claude/lib/tdd-classifier.md +345 -345
  40. package/.claude/lib/validation-gates.md +484 -484
  41. package/.claude/settings.local.json +42 -42
  42. package/.claude/templates/PROJECT_STATUS.template.yml +1 -1
  43. package/.claude/templates/STYLE_GUIDE.template.md +7 -7
  44. package/.claude/templates/context-template.md +45 -45
  45. package/.claude/templates/design-context-template.md +22 -29
  46. package/.claude/templates/flags-template.json +42 -42
  47. package/.claude/templates/page-plan-example.md +9 -9
  48. package/.claude/templates/phases-sections/accessibility-test.md +17 -17
  49. package/.claude/templates/phases-sections/api-design.md +37 -37
  50. package/.claude/templates/phases-sections/backend-tests.md +16 -16
  51. package/.claude/templates/phases-sections/backend.md +37 -37
  52. package/.claude/templates/phases-sections/business-logic-validation.md +16 -16
  53. package/.claude/templates/phases-sections/component-tests.md +17 -17
  54. package/.claude/templates/phases-sections/contract-backend.md +16 -16
  55. package/.claude/templates/phases-sections/contract-frontend.md +16 -16
  56. package/.claude/templates/phases-sections/database.md +35 -35
  57. package/.claude/templates/phases-sections/e2e-tests.md +16 -16
  58. package/.claude/templates/phases-sections/fix-implementation.md +17 -17
  59. package/.claude/templates/phases-sections/frontend-integration.md +18 -18
  60. package/.claude/templates/phases-sections/manual-flow-test.md +15 -15
  61. package/.claude/templates/phases-sections/manual-ux-test.md +16 -16
  62. package/.claude/templates/phases-sections/refactor-implementation.md +17 -17
  63. package/.claude/templates/phases-sections/refactor.md +16 -16
  64. package/.claude/templates/phases-sections/regression-tests.md +15 -15
  65. package/.claude/templates/phases-sections/responsive-test.md +16 -16
  66. package/.claude/templates/phases-sections/script-implementation.md +43 -43
  67. package/.claude/templates/phases-sections/test-coverage.md +16 -16
  68. package/.claude/templates/phases-sections/user-approval.md +14 -14
  69. package/.claude/templates/phases-sections/ux-testing.md +164 -0
  70. package/LICENSE +21 -21
  71. package/README.md +3 -1
  72. package/package.json +1 -1
@@ -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