@champpaba/claude-agent-kit 2.0.0 → 2.1.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 (87) hide show
  1. package/.claude/CLAUDE.md +253 -31
  2. package/.claude/agents/01-integration.md +106 -552
  3. package/.claude/agents/02-uxui-frontend.md +188 -850
  4. package/.claude/agents/03-test-debug.md +152 -521
  5. package/.claude/agents/04-frontend.md +169 -549
  6. package/.claude/agents/05-backend.md +132 -661
  7. package/.claude/agents/06-database.md +149 -698
  8. package/.claude/agents/_shared/README.md +57 -0
  9. package/.claude/agents/_shared/agent-boundaries.md +64 -0
  10. package/.claude/agents/_shared/documentation-policy.md +47 -0
  11. package/.claude/agents/_shared/package-manager.md +59 -0
  12. package/.claude/agents/_shared/pre-work-checklist.md +57 -0
  13. package/.claude/commands/cdev.md +36 -61
  14. package/.claude/commands/csetup.md +90 -14
  15. package/.claude/commands/cstatus.md +153 -60
  16. package/.claude/commands/cview.md +364 -364
  17. package/.claude/commands/designsetup.md +1 -1
  18. package/.claude/commands/pageplan.md +53 -177
  19. package/.claude/commands/pstatus.md +431 -0
  20. package/.claude/contexts/design/accessibility.md +611 -611
  21. package/.claude/contexts/design/box-thinking.md +1 -1
  22. package/.claude/contexts/design/index.md +1 -1
  23. package/.claude/contexts/design/layout.md +400 -400
  24. package/.claude/contexts/design/responsive.md +551 -551
  25. package/.claude/contexts/design/shadows.md +522 -522
  26. package/.claude/contexts/design/typography.md +465 -465
  27. package/.claude/contexts/domain/README.md +164 -164
  28. package/.claude/contexts/patterns/agent-coordination.md +388 -388
  29. package/.claude/contexts/patterns/agent-discovery.md +2 -2
  30. package/.claude/contexts/patterns/animation-patterns.md +1 -1
  31. package/.claude/contexts/patterns/change-workflow.md +541 -538
  32. package/.claude/contexts/patterns/code-standards.md +10 -8
  33. package/.claude/contexts/patterns/development-principles.md +513 -513
  34. package/.claude/contexts/patterns/error-handling.md +478 -478
  35. package/.claude/contexts/patterns/error-recovery.md +365 -365
  36. package/.claude/contexts/patterns/frontend-component-strategy.md +1 -1
  37. package/.claude/contexts/patterns/logging.md +424 -424
  38. package/.claude/contexts/patterns/performance-optimization.md +1 -1
  39. package/.claude/contexts/patterns/task-breakdown.md +452 -452
  40. package/.claude/contexts/patterns/task-classification.md +523 -523
  41. package/.claude/contexts/patterns/tdd-classification.md +516 -516
  42. package/.claude/contexts/patterns/testing.md +413 -413
  43. package/.claude/contexts/patterns/ui-component-consistency.md +3 -3
  44. package/.claude/contexts/patterns/validation-framework.md +779 -776
  45. package/.claude/lib/README.md +4 -4
  46. package/.claude/lib/agent-executor.md +31 -40
  47. package/.claude/lib/agent-router.md +450 -572
  48. package/.claude/lib/context-loading-protocol.md +19 -36
  49. package/.claude/lib/detailed-guides/agent-system.md +43 -121
  50. package/.claude/lib/detailed-guides/taskmaster-analysis.md +1 -1
  51. package/.claude/lib/document-loader.md +22 -25
  52. package/.claude/lib/flags-updater.md +461 -469
  53. package/.claude/lib/tdd-classifier.md +345 -345
  54. package/.claude/lib/validation-gates.md +484 -484
  55. package/.claude/settings.local.json +42 -42
  56. package/.claude/templates/STYLE_GUIDE.template.md +1 -1
  57. package/.claude/templates/context-template.md +45 -45
  58. package/.claude/templates/design-context-template.md +1 -1
  59. package/.claude/templates/flags-template.json +42 -42
  60. package/.claude/templates/phases-sections/accessibility-test.md +17 -17
  61. package/.claude/templates/phases-sections/api-design.md +37 -37
  62. package/.claude/templates/phases-sections/backend-tests.md +16 -16
  63. package/.claude/templates/phases-sections/backend.md +37 -37
  64. package/.claude/templates/phases-sections/business-logic-validation.md +16 -16
  65. package/.claude/templates/phases-sections/component-tests.md +17 -17
  66. package/.claude/templates/phases-sections/contract-backend.md +16 -16
  67. package/.claude/templates/phases-sections/contract-frontend.md +16 -16
  68. package/.claude/templates/phases-sections/database.md +35 -35
  69. package/.claude/templates/phases-sections/e2e-tests.md +16 -16
  70. package/.claude/templates/phases-sections/fix-implementation.md +17 -17
  71. package/.claude/templates/phases-sections/frontend-integration.md +18 -18
  72. package/.claude/templates/phases-sections/frontend-mockup.md +126 -123
  73. package/.claude/templates/phases-sections/manual-flow-test.md +15 -15
  74. package/.claude/templates/phases-sections/manual-ux-test.md +16 -16
  75. package/.claude/templates/phases-sections/refactor-implementation.md +17 -17
  76. package/.claude/templates/phases-sections/refactor.md +16 -16
  77. package/.claude/templates/phases-sections/regression-tests.md +15 -15
  78. package/.claude/templates/phases-sections/responsive-test.md +16 -16
  79. package/.claude/templates/phases-sections/script-implementation.md +43 -43
  80. package/.claude/templates/phases-sections/test-coverage.md +16 -16
  81. package/.claude/templates/phases-sections/user-approval.md +14 -14
  82. package/LICENSE +21 -21
  83. package/PROJECT_STATUS.template.yml +105 -0
  84. package/README.md +103 -1115
  85. package/lib/init.js +30 -2
  86. package/package.json +3 -2
  87. package/.claude/CHANGELOG-v1.1.1.md +0 -259
@@ -903,7 +903,7 @@ Project Context:
903
903
 
904
904
  Task: Generate complete STYLE_GUIDE.md (1500-2000 lines) with ALL 17 sections.
905
905
 
906
- CRITICAL: Follow the EXACT format of existing STYLE_GUIDE.md:
906
+ Follow this format for STYLE_GUIDE.md:
907
907
 
908
908
  # [Project Name] Design System - Style Guide (${selectedOption.name})
909
909
 
@@ -1,13 +1,7 @@
1
- # /pageplan - Page Structure & Content Planning (v2.0.0)
1
+ # /pageplan - Page Structure & Content Planning
2
2
 
3
3
  **Purpose:** Generate a detailed page plan for UI implementation, including component reuse strategy, content draft, and asset checklist.
4
4
 
5
- **NEW in v2.0.0:**
6
- - 🎯 Auto-detects page type (landing/dashboard/auth) from proposal.md/tasks.md
7
- - 🎨 Reads `design-system/tokens.json` (style, theme, animations, decorations)
8
- - 📦 Loads `design-system/patterns/*.md` selectively based on page type
9
- - 🎬 Applies animations/decorations for marketing pages, minimal for dashboards
10
-
11
5
  **Usage:**
12
6
  ```bash
13
7
  # With context files
@@ -27,36 +21,22 @@
27
21
  1. **Reads User-Specified Context:**
28
22
  - Only reads files that user mentions with `@` prefix
29
23
  - Always reads `openspec/changes/{change-id}/proposal.md` (if exists)
30
- - Always reads `openspec/changes/{change-id}/tasks.md` (for page type detection)
31
- - **Always reads `design-system/tokens.json`** (lightweight, ~800 tokens) ✅
24
+ - **Always reads `design-system/STYLE_TOKENS.json`** (lightweight, ~500 tokens)
32
25
  - Validates `design-system/STYLE_GUIDE.md` exists (doesn't load full content)
33
26
 
34
- 2. **Auto-Detects Page Type:**
35
- - **Landing/Marketing:** Full decorations, scroll animations, buyer avatar analysis
36
- - **Dashboard/Admin:** Minimal decorations, data-focused, no buyer avatar
37
- - **Auth (Login/Register):** Clean, form-focused, no decorations
38
-
39
- 3. **Loads Patterns Selectively:**
40
- - `patterns/buttons.md` - Always
41
- - `patterns/cards.md` - Always
42
- - `patterns/forms.md` - Auth pages, settings
43
- - `patterns/scroll-animations.md` - Landing pages only
44
- - `patterns/decorations.md` - Landing pages only
45
-
46
- 4. **Searches Existing Components:**
27
+ 2. **Searches Existing Components:**
47
28
  - Glob: `**/{Navbar,Footer,Sidebar,Header}*.{tsx,jsx,vue}`
48
29
  - Grep: Common UI patterns
49
30
  - Builds reuse vs new component list
50
31
 
51
- 5. **Generates page-plan.md:**
52
- - Page type + design approach
32
+ 3. **Generates page-plan.md:**
53
33
  - Component plan (reuse vs new)
54
34
  - Page structure (layout composition)
55
- - Content draft (AI-generated, conversion-optimized for marketing)
35
+ - Content draft (AI-generated from PRD)
56
36
  - Asset checklist (user must prepare)
57
- - Animation/decoration blueprint (from tokens.json)
37
+ - Rationale (why this structure)
58
38
 
59
- 6. **Outputs to:** `openspec/changes/{change-id}/page-plan.md`
39
+ 4. **Outputs to:** `openspec/changes/{change-id}/page-plan.md`
60
40
 
61
41
  ---
62
42
 
@@ -77,7 +57,7 @@ if (!changeId) {
77
57
  const outputPath = `openspec/changes/${changeId}/page-plan.md`
78
58
  ```
79
59
 
80
- ### STEP 2: Read Context Files & Detect Page Type
60
+ ### STEP 2: Read Context Files
81
61
 
82
62
  ```typescript
83
63
  // Only read files user specified with @
@@ -85,22 +65,29 @@ const userFiles = extractMentionedFiles(userMessage) // @prd.md, @brief.md
85
65
 
86
66
  // Always read (if exists)
87
67
  const proposalPath = `openspec/changes/${changeId}/proposal.md`
88
- const tasksPath = `openspec/changes/${changeId}/tasks.md`
89
- const tokensPath = `design-system/tokens.json` // 🆕 v2.0 tokens with style/theme/animations
68
+ const tokensPath = `design-system/STYLE_TOKENS.json` // 🆕 Lightweight tokens
90
69
  const styleGuidePath = `design-system/STYLE_GUIDE.md` // Validate only, don't load
91
70
 
71
+ const contextFiles = [
72
+ ...userFiles,
73
+ proposalPath
74
+ ].filter(fileExists)
75
+
92
76
  // Read all context
77
+ let context = contextFiles.map(readFile).join('\n\n---\n\n')
78
+
79
+ // 🆕 Extract individual content for buyer avatar analysis (STEP 3.5)
93
80
  let proposalContent = ''
94
- let tasksContent = ''
95
81
  let briefContent = ''
96
- let tokens = null
82
+ let tasksContent = ''
97
83
 
98
84
  // Read proposal separately if exists
99
85
  if (fileExists(proposalPath)) {
100
86
  proposalContent = Read(proposalPath)
101
87
  }
102
88
 
103
- // Read tasks.md if exists (for page type detection)
89
+ // Read tasks.md if exists (for marketing page detection)
90
+ const tasksPath = `openspec/changes/${changeId}/tasks.md`
104
91
  if (fileExists(tasksPath)) {
105
92
  tasksContent = Read(tasksPath)
106
93
  }
@@ -111,88 +98,14 @@ if (briefFile && fileExists(briefFile)) {
111
98
  briefContent = Read(briefFile)
112
99
  }
113
100
 
114
- // ========== PAGE TYPE DETECTION ==========
115
- output(`
116
- 🔍 Detecting page type from proposal.md/tasks.md...
117
- `)
118
-
119
- const combinedContext = `${proposalContent}\n${tasksContent}`.toLowerCase()
120
-
121
- let pageType = 'generic'
122
- let pageTypeConfig = {}
123
-
124
- if (combinedContext.match(/(landing|marketing|homepage|product.page|sales|conversion)/i)) {
125
- pageType = 'landing'
126
- pageTypeConfig = {
127
- name: 'Landing/Marketing Page',
128
- decorations: true,
129
- scrollAnimations: true,
130
- buyerAvatar: true,
131
- patterns: ['buttons.md', 'cards.md', 'scroll-animations.md', 'decorations.md']
132
- }
133
- } else if (combinedContext.match(/(dashboard|admin|analytics|reports|settings)/i)) {
134
- pageType = 'dashboard'
135
- pageTypeConfig = {
136
- name: 'Dashboard/Admin Page',
137
- decorations: false,
138
- scrollAnimations: false,
139
- buyerAvatar: false,
140
- patterns: ['buttons.md', 'cards.md', 'forms.md']
141
- }
142
- } else if (combinedContext.match(/(login|register|signup|sign.up|auth|forgot.password)/i)) {
143
- pageType = 'auth'
144
- pageTypeConfig = {
145
- name: 'Authentication Page',
146
- decorations: false,
147
- scrollAnimations: false,
148
- buyerAvatar: false,
149
- patterns: ['buttons.md', 'forms.md']
150
- }
151
- } else {
152
- pageType = 'generic'
153
- pageTypeConfig = {
154
- name: 'Generic Page',
155
- decorations: false,
156
- scrollAnimations: false,
157
- buyerAvatar: false,
158
- patterns: ['buttons.md', 'cards.md']
159
- }
160
- }
161
-
162
- output(`
163
- ✅ Page Type Detected: ${pageTypeConfig.name}
164
- - Decorations: ${pageTypeConfig.decorations ? '✅ Enabled' : '❌ Disabled'}
165
- - Scroll Animations: ${pageTypeConfig.scrollAnimations ? '✅ Enabled' : '❌ Disabled'}
166
- - Buyer Avatar Analysis: ${pageTypeConfig.buyerAvatar ? '✅ Enabled' : '❌ Skipped'}
167
- - Patterns to Load: ${pageTypeConfig.patterns.join(', ')}
168
- `)
169
-
170
- // ========== LOAD TOKENS.JSON (v2.0 structure) ==========
101
+ // 🆕 Load design tokens (lightweight)
171
102
  if (fileExists(tokensPath)) {
172
- tokens = JSON.parse(Read(tokensPath))
173
-
174
- output(`
175
- tokens.json Loaded:
176
- - Style: ${tokens.style.name} (${tokens.style.confidence}% confidence)
177
- - Theme: ${tokens.theme.name}
178
- - Decorations: ${tokens.theme.decorative_elements.use.slice(0, 3).join(', ')}
179
- - Animations: ${tokens.animations.enabled ? 'Enabled' : 'Disabled'}
180
- - Primary Color: ${tokens.colors.primary.DEFAULT}
181
- `)
182
- } else {
183
- warn(`⚠️ No tokens.json found - run /designsetup first`)
184
- }
185
-
186
- // ========== LOAD PATTERNS SELECTIVELY ==========
187
- const loadedPatterns = {}
188
- const patternsDir = 'design-system/patterns'
189
-
190
- for (const patternFile of pageTypeConfig.patterns) {
191
- const patternPath = `${patternsDir}/${patternFile}`
192
- if (fileExists(patternPath)) {
193
- loadedPatterns[patternFile] = Read(patternPath)
194
- output(` ✅ Loaded: ${patternFile}`)
195
- }
103
+ const tokens = JSON.parse(Read(tokensPath))
104
+ context += `\n\n---\n\n# Design Tokens (STYLE_TOKENS.json)\n\n`
105
+ context += `Primary Color: ${tokens.tokens.colors.primary.DEFAULT}\n`
106
+ context += `Spacing Scale: ${tokens.tokens.spacing.scale.join(', ')}px\n`
107
+ context += `Component Library: ${tokens.component_library.name}\n`
108
+ context += `Shadows: ${Object.keys(tokens.tokens.shadows).join(', ')}\n`
196
109
  }
197
110
 
198
111
  // Validate STYLE_GUIDE.md exists (don't load!)
@@ -201,7 +114,7 @@ if (!hasStyleGuide) {
201
114
  warn(`⚠️ No STYLE_GUIDE.md found - run /designsetup first`)
202
115
  }
203
116
 
204
- // Total context: ~1.5K tokens (tokens.json + selective patterns)
117
+ // Total context: ~1.5K tokens (vs 5K+ if loading full STYLE_GUIDE.md)
205
118
  ```
206
119
 
207
120
  ### STEP 3: Search Existing Components
@@ -228,18 +141,19 @@ for (const pattern of searchPatterns) {
228
141
  }
229
142
  ```
230
143
 
231
- ### STEP 3.5: Buyer Avatar Analysis (Conditional - Marketing Pages Only)
144
+ ### STEP 3.5: Buyer Avatar Analysis (NEW - Conversion Optimization)
232
145
 
233
146
  > **Purpose:** Extract buyer psychology to generate conversion-optimized copy (inspired by Eugene Schwartz framework)
234
- > **Triggered by:** pageTypeConfig.buyerAvatar === true (landing pages only)
235
147
 
236
148
  ```typescript
149
+ // Only analyze if this is a marketing/landing page
150
+ const isMarketingPage = tasksContent.toLowerCase().match(/(landing|marketing|homepage|product page|sales)/i)
151
+
237
152
  let buyerAvatar = null
238
153
 
239
- // Only analyze if page type config enables buyer avatar
240
- if (pageTypeConfig.buyerAvatar && (proposalContent || briefContent)) {
154
+ if (isMarketingPage && (proposalContent || briefContent)) {
241
155
  output(`
242
- 🎯 Marketing page detected - analyzing buyer psychology...
156
+ 🎯 Detecting marketing page - analyzing buyer psychology...
243
157
  `)
244
158
 
245
159
  const avatarPrompt = `
@@ -295,8 +209,7 @@ If insufficient context, return { "has_context": false }
295
209
  }
296
210
  } else {
297
211
  output(`
298
- ℹ️ Page type: ${pageTypeConfig.name} - skipping buyer avatar analysis
299
- (Buyer avatar only for landing/marketing pages)
212
+ ℹ️ Non-marketing page detected - skipping buyer avatar analysis
300
213
  `)
301
214
  }
302
215
  ```
@@ -622,14 +535,14 @@ Based on context + found components + buyer avatar (if available), generate:
622
535
 
623
536
  ---
624
537
 
625
- ### Performance Rules (CRITICAL!)
538
+ ### Performance Guidelines
626
539
 
627
- **✅ DO USE (GPU-accelerated):**
540
+ **GPU-accelerated (preferred):**
628
541
  - `transform` (translate, scale, rotate)
629
542
  - `opacity`
630
543
  - `filter` (blur, brightness)
631
544
 
632
- **❌ DON'T USE (CPU-intensive, causes reflow):**
545
+ **Avoid for animations (CPU-intensive):**
633
546
  - `width`, `height` (causes layout recalculation)
634
547
  - `top`, `left`, `margin` (use `transform` instead)
635
548
  - `font-size` (causes text reflow)
@@ -854,60 +767,23 @@ _([length] chars - based on [source])_
854
767
 
855
768
  ---
856
769
 
857
- ## 6. Design System (from tokens.json)
858
-
859
- > **Page Type:** ${pageTypeConfig.name}
860
- > **Decorations:** ${pageTypeConfig.decorations ? 'Enabled' : 'Disabled'}
861
- > **Scroll Animations:** ${pageTypeConfig.scrollAnimations ? 'Enabled' : 'Disabled'}
862
-
863
- ### Style Direction
864
- - **Style:** ${tokens?.style?.name || '[Run /designsetup]'}
865
- - **Feel:** ${tokens?.style?.feel || '[Run /designsetup]'}
866
- - **Source:** ${tokens?.style?.source_site || '[Run /designsetup]'}
867
-
868
- ### Theme & Decorations
869
- ${pageTypeConfig.decorations && tokens ? `
870
- - **Theme:** ${tokens.theme.name}
871
- - **Feeling:** ${tokens.theme.feeling}
872
- - **USE These Elements:**
873
- ${tokens.theme.decorative_elements.use.map(e => `- ✅ ${e}`).join('\n ')}
874
- - **AVOID These Elements:**
875
- ${tokens.theme.decorative_elements.avoid.map(e => `- ❌ ${e}`).join('\n ') || ' (none)'}
876
- - **Suggested Icons:** ${tokens.theme.icons_suggestion?.join(', ') || 'Lucide icons'}
877
- ` : `
878
- ℹ️ Decorations disabled for ${pageTypeConfig.name}
879
- `}
770
+ ## 6. Design Notes
880
771
 
881
- ### Animations
882
- ${pageTypeConfig.scrollAnimations && tokens?.animations?.enabled ? `
883
- - **Scroll Animations:** Enabled
884
- - **Patterns:** ${tokens.animations.scroll_animations.patterns.join(', ') || 'None specified'}
885
- - **Libraries:** ${tokens.animations.libraries.map(l => l.name).join(', ') || 'CSS/Tailwind'}
886
- ` : `
887
- ℹ️ Scroll animations disabled for ${pageTypeConfig.name}
888
- `}
772
+ **Design System Files:**
773
+ - Tokens (lightweight): \`design-system/STYLE_TOKENS.json\`
774
+ - Full guide (reference): \`design-system/STYLE_GUIDE.md\`
775
+
776
+ **Key Design Tokens:**
777
+ - Primary color: [from STYLE_TOKENS.json]
778
+ - Font family: [from STYLE_TOKENS.json]
779
+ - Spacing scale: [from STYLE_TOKENS.json]
780
+ - Component library: [from STYLE_TOKENS.json]
781
+ - Shadows: [from STYLE_TOKENS.json]
889
782
 
890
- ### Component Animations (Always Apply)
891
- - **Button Hover:** ${tokens?.animations?.component_animations?.button_hover || 'scale + shadow'}
892
- - **Card Hover:** ${tokens?.animations?.component_animations?.card_hover || 'translateY + shadow'}
893
- - **Input Focus:** ${tokens?.animations?.component_animations?.input_focus || 'ring'}
894
-
895
- ### Design Tokens
896
- - **Primary Color:** ${tokens?.colors?.primary?.DEFAULT || '#0d7276'}
897
- - **Font Family:** ${tokens?.typography?.font_family?.sans || 'Inter'}
898
- - **Spacing Scale:** ${tokens?.spacing?.scale?.join(', ') || '4, 8, 16, 24, 32, 48'}px
899
- - **Component Library:** ${tokens?.component_library?.name || 'shadcn/ui'}
900
-
901
- ### Pattern Files Loaded
902
- ${pageTypeConfig.patterns.map(p => `- ✅ design-system/patterns/${p}`).join('\n')}
903
-
904
- ### Agent Instructions
905
- - uxui-frontend MUST read \`design-system/tokens.json\` in STEP 0.5
906
- - Load patterns from \`design-system/patterns/\` selectively (see above)
907
- - Use theme tokens (text-foreground/70), NOT hardcoded colors
908
- - Use spacing scale (p-4, p-6), NOT arbitrary values (p-5)
909
- - ${pageTypeConfig.decorations ? '✅ Apply decorations from theme' : '❌ Skip decorations for this page type'}
910
- - ${pageTypeConfig.scrollAnimations ? '✅ Apply scroll animations' : '❌ Skip scroll animations for this page type'}
783
+ **Agent Instructions:**
784
+ - uxui-frontend reads STYLE_TOKENS.json in STEP 0.5
785
+ - Use theme tokens (text-foreground/70) for theme-awareness
786
+ - Use spacing scale (p-4, p-6) for consistency
911
787
 
912
788
  ## 7. Implementation Notes
913
789