@champpaba/claude-agent-kit 1.1.0 → 1.4.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 (95) hide show
  1. package/.claude/CHANGELOG-v1.1.1.md +259 -0
  2. package/.claude/CLAUDE.md +163 -0
  3. package/.claude/agents/01-integration.md +651 -0
  4. package/.claude/agents/02-uxui-frontend.md +809 -0
  5. package/.claude/agents/03-test-debug.md +616 -0
  6. package/.claude/agents/04-frontend.md +671 -0
  7. package/.claude/agents/05-backend.md +767 -0
  8. package/.claude/agents/06-database.md +817 -0
  9. package/.claude/commands/agentsetup.md +1464 -0
  10. package/.claude/commands/cdev.md +412 -0
  11. package/.claude/commands/csetup.md +760 -0
  12. package/.claude/commands/cstatus.md +60 -0
  13. package/.claude/commands/cview.md +364 -0
  14. package/.claude/commands/designsetup.md +1169 -0
  15. package/.claude/commands/extract.md +1005 -0
  16. package/.claude/commands/pageplan.md +357 -0
  17. package/.claude/commands/psetup.md +101 -0
  18. package/.claude/contexts/design/accessibility.md +611 -0
  19. package/.claude/contexts/design/box-thinking.md +566 -0
  20. package/.claude/contexts/design/color-theory.md +519 -0
  21. package/.claude/contexts/design/index.md +290 -0
  22. package/.claude/contexts/design/layout.md +400 -0
  23. package/.claude/contexts/design/responsive.md +551 -0
  24. package/.claude/contexts/design/shadows.md +522 -0
  25. package/.claude/contexts/design/spacing.md +445 -0
  26. package/.claude/contexts/design/typography.md +465 -0
  27. package/.claude/contexts/domain/README.md +164 -0
  28. package/.claude/contexts/patterns/agent-coordination.md +388 -0
  29. package/.claude/contexts/patterns/agent-discovery.md +182 -0
  30. package/.claude/contexts/patterns/change-workflow.md +538 -0
  31. package/.claude/contexts/patterns/code-standards.md +515 -0
  32. package/.claude/contexts/patterns/development-principles.md +513 -0
  33. package/.claude/contexts/patterns/error-handling.md +478 -0
  34. package/.claude/contexts/patterns/error-recovery.md +365 -0
  35. package/.claude/contexts/patterns/frontend-component-strategy.md +365 -0
  36. package/.claude/contexts/patterns/git-workflow.md +207 -0
  37. package/.claude/contexts/patterns/logging.md +424 -0
  38. package/.claude/contexts/patterns/task-breakdown.md +452 -0
  39. package/.claude/contexts/patterns/task-classification.md +523 -0
  40. package/.claude/contexts/patterns/tdd-classification.md +516 -0
  41. package/.claude/contexts/patterns/testing.md +413 -0
  42. package/.claude/contexts/patterns/ui-component-consistency.md +304 -0
  43. package/.claude/contexts/patterns/validation-framework.md +776 -0
  44. package/.claude/lib/README.md +81 -0
  45. package/.claude/lib/agent-executor.md +258 -0
  46. package/.claude/lib/agent-router.md +572 -0
  47. package/.claude/lib/context-loading-protocol.md +462 -0
  48. package/.claude/lib/detailed-guides/agent-system.md +237 -0
  49. package/.claude/lib/detailed-guides/best-practices-system.md +150 -0
  50. package/.claude/lib/detailed-guides/context-optimization.md +118 -0
  51. package/.claude/lib/detailed-guides/design-system.md +98 -0
  52. package/.claude/lib/detailed-guides/page-planning.md +147 -0
  53. package/.claude/lib/detailed-guides/taskmaster-analysis.md +263 -0
  54. package/.claude/lib/document-loader.md +353 -0
  55. package/.claude/lib/flags-updater.md +469 -0
  56. package/.claude/lib/handoff-protocol.md +665 -0
  57. package/.claude/lib/task-analyzer.md +694 -0
  58. package/.claude/lib/tdd-classifier.md +345 -0
  59. package/.claude/lib/tdd-workflow.md +891 -0
  60. package/.claude/lib/validation-gates.md +484 -0
  61. package/.claude/settings.local.json +42 -0
  62. package/.claude/templates/STYLE_GUIDE.template.md +879 -0
  63. package/.claude/templates/context-template.md +45 -0
  64. package/.claude/templates/design-context-template.md +220 -0
  65. package/.claude/templates/flags-template.json +42 -0
  66. package/.claude/templates/page-plan-example.md +562 -0
  67. package/.claude/templates/phase-templates.json +124 -0
  68. package/.claude/templates/phases-sections/accessibility-test.md +17 -0
  69. package/.claude/templates/phases-sections/api-design.md +37 -0
  70. package/.claude/templates/phases-sections/backend-tests.md +16 -0
  71. package/.claude/templates/phases-sections/backend.md +37 -0
  72. package/.claude/templates/phases-sections/business-logic-validation.md +16 -0
  73. package/.claude/templates/phases-sections/component-tests.md +17 -0
  74. package/.claude/templates/phases-sections/contract-backend.md +16 -0
  75. package/.claude/templates/phases-sections/contract-frontend.md +16 -0
  76. package/.claude/templates/phases-sections/database.md +35 -0
  77. package/.claude/templates/phases-sections/documentation.md +17 -0
  78. package/.claude/templates/phases-sections/e2e-tests.md +16 -0
  79. package/.claude/templates/phases-sections/fix-implementation.md +17 -0
  80. package/.claude/templates/phases-sections/frontend-integration.md +18 -0
  81. package/.claude/templates/phases-sections/frontend-mockup.md +123 -0
  82. package/.claude/templates/phases-sections/manual-flow-test.md +15 -0
  83. package/.claude/templates/phases-sections/manual-ux-test.md +16 -0
  84. package/.claude/templates/phases-sections/refactor-implementation.md +17 -0
  85. package/.claude/templates/phases-sections/refactor.md +16 -0
  86. package/.claude/templates/phases-sections/regression-tests.md +15 -0
  87. package/.claude/templates/phases-sections/report.md +16 -0
  88. package/.claude/templates/phases-sections/responsive-test.md +16 -0
  89. package/.claude/templates/phases-sections/script-implementation.md +43 -0
  90. package/.claude/templates/phases-sections/test-coverage.md +16 -0
  91. package/.claude/templates/phases-sections/user-approval.md +14 -0
  92. package/README.md +191 -0
  93. package/lib/init.js +1 -1
  94. package/lib/update.js +1 -1
  95. package/package.json +2 -2
@@ -0,0 +1,357 @@
1
+ # /pageplan - Page Structure & Content Planning
2
+
3
+ **Purpose:** Generate a detailed page plan for UI implementation, including component reuse strategy, content draft, and asset checklist.
4
+
5
+ **Usage:**
6
+ ```bash
7
+ # With context files
8
+ /pageplan @proposal.md @prd.md @project_brief.md
9
+
10
+ # Current change only (uses proposal.md in .changes/)
11
+ /pageplan
12
+
13
+ # Specify change ID
14
+ /pageplan landing-page
15
+ ```
16
+
17
+ ---
18
+
19
+ ## What This Command Does
20
+
21
+ 1. **Reads User-Specified Context:**
22
+ - Only reads files that user mentions with `@` prefix
23
+ - Always reads `.changes/{change-id}/proposal.md` (if exists)
24
+ - **Always reads `design-system/STYLE_TOKENS.json`** (lightweight, ~500 tokens) ✅
25
+ - Validates `design-system/STYLE_GUIDE.md` exists (doesn't load full content)
26
+
27
+ 2. **Searches Existing Components:**
28
+ - Glob: `**/{Navbar,Footer,Sidebar,Header}*.{tsx,jsx,vue}`
29
+ - Grep: Common UI patterns
30
+ - Builds reuse vs new component list
31
+
32
+ 3. **Generates page-plan.md:**
33
+ - Component plan (reuse vs new)
34
+ - Page structure (layout composition)
35
+ - Content draft (AI-generated from PRD)
36
+ - Asset checklist (user must prepare)
37
+ - Rationale (why this structure)
38
+
39
+ 4. **Outputs to:** `.changes/{change-id}/page-plan.md`
40
+
41
+ ---
42
+
43
+ ## Implementation Instructions
44
+
45
+ ### STEP 1: Detect Change Context
46
+
47
+ ```typescript
48
+ // Detect current change ID
49
+ const changesDir = '.changes/'
50
+ const changeId = detectCurrentChange() // or from command arg
51
+
52
+ if (!changeId) {
53
+ error("No active change found. Run after OpenSpec generates proposal.md")
54
+ return
55
+ }
56
+
57
+ const outputPath = `.changes/${changeId}/page-plan.md`
58
+ ```
59
+
60
+ ### STEP 2: Read Context Files
61
+
62
+ ```typescript
63
+ // Only read files user specified with @
64
+ const userFiles = extractMentionedFiles(userMessage) // @prd.md, @brief.md
65
+
66
+ // Always read (if exists)
67
+ const proposalPath = `.changes/${changeId}/proposal.md`
68
+ const tokensPath = `design-system/STYLE_TOKENS.json` // 🆕 Lightweight tokens
69
+ const styleGuidePath = `design-system/STYLE_GUIDE.md` // Validate only, don't load
70
+
71
+ const contextFiles = [
72
+ ...userFiles,
73
+ proposalPath
74
+ ].filter(fileExists)
75
+
76
+ // Read all context
77
+ let context = contextFiles.map(readFile).join('\n\n---\n\n')
78
+
79
+ // 🆕 Load design tokens (lightweight)
80
+ if (fileExists(tokensPath)) {
81
+ const tokens = JSON.parse(Read(tokensPath))
82
+ context += `\n\n---\n\n# Design Tokens (STYLE_TOKENS.json)\n\n`
83
+ context += `Primary Color: ${tokens.tokens.colors.primary.DEFAULT}\n`
84
+ context += `Spacing Scale: ${tokens.tokens.spacing.scale.join(', ')}px\n`
85
+ context += `Component Library: ${tokens.component_library.name}\n`
86
+ context += `Shadows: ${Object.keys(tokens.tokens.shadows).join(', ')}\n`
87
+ }
88
+
89
+ // Validate STYLE_GUIDE.md exists (don't load!)
90
+ const hasStyleGuide = fileExists(styleGuidePath)
91
+ if (!hasStyleGuide) {
92
+ warn(`⚠️ No STYLE_GUIDE.md found - run /designsetup first`)
93
+ }
94
+
95
+ // Total context: ~1.5K tokens (vs 5K+ if loading full STYLE_GUIDE.md)
96
+ ```
97
+
98
+ ### STEP 3: Search Existing Components
99
+
100
+ ```typescript
101
+ // Search for common shared components
102
+ const searchPatterns = [
103
+ '**/{Navbar,Navigation}*.{tsx,jsx,vue}',
104
+ '**/{Footer}*.{tsx,jsx,vue}',
105
+ '**/{Sidebar,Drawer}*.{tsx,jsx,vue}',
106
+ '**/{Header}*.{tsx,jsx,vue}',
107
+ ]
108
+
109
+ const foundComponents = []
110
+ for (const pattern of searchPatterns) {
111
+ const matches = glob(pattern)
112
+ if (matches.length > 0) {
113
+ foundComponents.push({
114
+ name: extractComponentName(matches[0]),
115
+ path: matches[0],
116
+ exports: grepExports(matches[0])
117
+ })
118
+ }
119
+ }
120
+ ```
121
+
122
+ ### STEP 4: Analyze & Generate Plan
123
+
124
+ Based on context + found components, generate:
125
+
126
+ ```markdown
127
+ # Page Plan: [Page Name]
128
+ > Generated from: [list of context files]
129
+ > Change ID: ${changeId}
130
+
131
+ ## 1. Component Plan
132
+
133
+ ### 🔄 Reuse Components (Found in codebase)
134
+ [For each found component]
135
+ - **[ComponentName]**
136
+ - Path: \`[path]\`
137
+ - Usage: \`<ComponentName prop="value" />\`
138
+ - Notes: [Any notes about usage]
139
+
140
+ ### ✅ Create New Components
141
+
142
+ #### Shared Components (reusable across pages)
143
+ [Components that will be used in multiple pages]
144
+ - **[ComponentName]**
145
+ - Purpose: [description]
146
+ - Will be used in: [list pages]
147
+ - Store at: \`/components/[category]/[ComponentName].tsx\`
148
+
149
+ #### Page-Specific Components (used only here)
150
+ [Components for this page only]
151
+ - **[ComponentName]**
152
+ - Purpose: [description]
153
+ - Compose with: [other components]
154
+ - Store at: \`/app/[page]/[ComponentName].tsx\`
155
+
156
+ ## 2. Page Structure
157
+
158
+ \`\`\`tsx
159
+ <Layout>
160
+ <ComponentA /> {/* Reuse */}
161
+ <ComponentB /> {/* New shared */}
162
+ <ComponentC /> {/* New specific */}
163
+ </Layout>
164
+ \`\`\`
165
+
166
+ ## 3. 📦 Assets to Prepare (คุณต้องเตรียม)
167
+
168
+ ### Images
169
+ - [ ] \`filename.jpg\` (widthxheight, format)
170
+ → Place at: \`/public/images/filename.jpg\`
171
+ → Purpose: [description]
172
+
173
+ ### Icons
174
+ - [ ] [description] (size, format)
175
+ → Place at: \`/public/icons/\`
176
+ → Style: [match STYLE_GUIDE]
177
+
178
+ ### Other Assets
179
+ [Fonts, videos, etc.]
180
+
181
+ ---
182
+
183
+ ## 4. 📝 Content Draft (AI-Generated - กรุณา Review & Edit)
184
+
185
+ ### [Section Name]
186
+
187
+ **[Element Type]:** "[Content]"
188
+ _([length] chars - based on [source])_
189
+
190
+ [Repeat for all content elements]
191
+
192
+ ---
193
+
194
+ **Instructions for User:**
195
+ 1. Review content above
196
+ 2. Edit tone, length, messaging as needed
197
+ 3. Prepare assets per checklist
198
+ 4. When ready, run: \`/csetup ${changeId}\`
199
+
200
+ ---
201
+
202
+ ## 5. Design Notes
203
+
204
+ **Design System Files:**
205
+ - Tokens (lightweight): \`design-system/STYLE_TOKENS.json\`
206
+ - Full guide (reference): \`design-system/STYLE_GUIDE.md\`
207
+
208
+ **Key Design Tokens:**
209
+ - Primary color: [from STYLE_TOKENS.json]
210
+ - Font family: [from STYLE_TOKENS.json]
211
+ - Spacing scale: [from STYLE_TOKENS.json]
212
+ - Component library: [from STYLE_TOKENS.json]
213
+ - Shadows: [from STYLE_TOKENS.json]
214
+
215
+ **Agent Instructions:**
216
+ - uxui-frontend MUST read STYLE_TOKENS.json in STEP 0.5
217
+ - Use theme tokens (text-foreground/70), NOT hardcoded colors
218
+ - Use spacing scale (p-4, p-6), NOT arbitrary values (p-5)
219
+
220
+ ## 6. Implementation Notes
221
+
222
+ ### Component Imports (Reference)
223
+ \`\`\`tsx
224
+ // Reuse
225
+ [import statements for reused components]
226
+
227
+ // shadcn/ui or component library
228
+ [import statements]
229
+
230
+ // New (to be created)
231
+ [import statements with comments]
232
+ \`\`\`
233
+
234
+ ---
235
+
236
+ ## Next Steps
237
+ 1. ✅ Review & edit content draft
238
+ 2. ✅ Prepare assets (images, icons)
239
+ 3. ✅ Run \`/csetup ${changeId}\` when ready
240
+ 4. ✅ Run \`/cdev ${changeId}\` to implement
241
+ ```
242
+
243
+ ### STEP 5: Write Output & Report
244
+
245
+ ```typescript
246
+ // Write page-plan.md
247
+ writeFile(outputPath, pagePlanContent)
248
+
249
+ // Report to user
250
+ console.log(`
251
+ ✅ Page plan generated!
252
+
253
+ 📄 Output: ${outputPath}
254
+
255
+ 📊 Summary:
256
+ - Found components: ${foundComponents.length} (reuse)
257
+ - New shared: ${newSharedComponents.length}
258
+ - New specific: ${newSpecificComponents.length}
259
+ - Assets needed: ${assetsCount}
260
+ - Content sections: ${contentSections.length}
261
+
262
+ 📝 Next Steps:
263
+ 1. Review content in ${outputPath}
264
+ 2. Edit as needed (tone, messaging)
265
+ 3. Prepare assets per checklist
266
+ 4. Run: /csetup ${changeId}
267
+ `)
268
+ ```
269
+
270
+ ---
271
+
272
+ ## Example Scenarios
273
+
274
+ ### Scenario 1: Landing Page (First page)
275
+ ```bash
276
+ User: /pageplan @prd.md @project_brief.md
277
+
278
+ Result:
279
+ - Found components: 0 (empty project)
280
+ - New shared: Navbar, Footer (will reuse later)
281
+ - New specific: HeroSection, FeatureGrid
282
+ - Content: Headlines, descriptions from PRD
283
+ ```
284
+
285
+ ### Scenario 2: Dashboard (Has existing components)
286
+ ```bash
287
+ User: /pageplan @prd.md
288
+
289
+ Result:
290
+ - Found components: Navbar ✅, Footer ✅
291
+ - New shared: Sidebar (for dashboard/profile/admin)
292
+ - New specific: DashboardStats, ActivityTimeline
293
+ - Content: Dashboard-specific text
294
+ ```
295
+
296
+ ### Scenario 3: Backend API (No UI)
297
+ ```bash
298
+ User: /pageplan
299
+
300
+ Result:
301
+ - Error: "This change doesn't involve UI work. Skip /pageplan."
302
+ - OR: Detect from proposal.md and auto-skip
303
+ ```
304
+
305
+ ---
306
+
307
+ ## Error Handling
308
+
309
+ 1. **No change ID found:**
310
+ - Error: "No active change. Run after OpenSpec generates proposal."
311
+
312
+ 2. **No @mentions and no proposal.md:**
313
+ - Error: "No context files provided. Use: /pageplan @prd.md"
314
+
315
+ 3. **No UI work detected:**
316
+ - Warning: "This change appears to be backend/API work. /pageplan is for UI tasks."
317
+ - Ask: "Continue anyway? (Y/N)"
318
+
319
+ 4. **STYLE_GUIDE.md missing:**
320
+ - Warning: "No STYLE_GUIDE.md found. Run /designsetup first for best results."
321
+ - Continue: Use general design principles as fallback
322
+
323
+ ---
324
+
325
+ ## Implementation Priority
326
+
327
+ **Critical:**
328
+ - ✅ Read user-specified files only
329
+ - ✅ Search existing components
330
+ - ✅ Generate component reuse plan
331
+ - ✅ Generate content draft from PRD
332
+
333
+ **Nice to have:**
334
+ - Asset checklist detail level
335
+ - Auto-detect UI vs backend tasks
336
+ - Suggest component classification
337
+
338
+ ---
339
+
340
+ ## Integration with Multi-Agent Flow
341
+
342
+ ```
343
+ tasks.md → /pageplan → page-plan.md → /csetup → /cdev
344
+ ↓ ↓ ↓ ↓
345
+ Search User review Phases uxui-frontend
346
+ components & edit reads plan
347
+ skips search
348
+ ```
349
+
350
+ **Agent behavior:**
351
+ - `uxui-frontend`: Reads page-plan.md in STEP 0, skips component search (STEP 3)
352
+ - `frontend`: May read page-plan.md for component locations
353
+ - Other agents: Ignore page-plan.md (not relevant)
354
+
355
+ ---
356
+
357
+ **END OF COMMAND SPECIFICATION**
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: Project Setup
3
+ description: Setup project-level contexts (one-time)
4
+ category: Multi-Agent
5
+ tags: [setup, project, context7]
6
+ ---
7
+
8
+ ## Usage
9
+
10
+ ```bash
11
+ /psetup
12
+ ```
13
+
14
+ ## What It Does
15
+
16
+ One-time project setup:
17
+ 1. Detect tech stack from package files
18
+ 2. Query Context7 for best practices
19
+ 3. Create domain/ structure (3-level indexing)
20
+ 4. Generate best practices files
21
+
22
+ ## Steps
23
+
24
+ ### 1. Check if Already Setup
25
+
26
+ ```bash
27
+ ls .claude/contexts/domain/project/
28
+ ```
29
+
30
+ If exists:
31
+ ```
32
+ ⚠️ Project already set up
33
+ Re-run will overwrite existing files
34
+ Continue? (yes/no)
35
+ ```
36
+
37
+ ### 2. Detect Package Manager
38
+
39
+ Check for lock files:
40
+ - `pnpm-lock.yaml` → pnpm
41
+ - `package-lock.json` → npm
42
+ - `yarn.lock` → yarn
43
+ - `uv.lock` → uv
44
+ - `poetry.lock` → poetry
45
+ - etc.
46
+
47
+ ### 3. Detect Tech Stack
48
+
49
+ Parse `package.json` / `requirements.txt`:
50
+ - Extract framework names and versions
51
+ - Detect: Next.js, React, Prisma, FastAPI, etc.
52
+
53
+ ### 4. Query Context7
54
+
55
+ For each framework:
56
+ ```
57
+ mcp__context7__resolve-library-id({framework})
58
+ mcp__context7__get-library-docs({id}, {topic}, {tokens: 8000})
59
+ ```
60
+
61
+ ### 5. Generate Files
62
+
63
+ Create:
64
+ - `.claude/contexts/domain/index.md`
65
+ - `.claude/contexts/domain/project/README.md`
66
+ - `.claude/contexts/domain/project/tech-stack.md`
67
+ - `.claude/contexts/domain/project/best-practices/index.md`
68
+ - `.claude/contexts/domain/project/best-practices/{framework}.md` (each)
69
+
70
+ ### 6. Output Summary
71
+
72
+ ```
73
+ ✅ Project setup complete!
74
+
75
+ 📦 Package Manager: pnpm 9.x
76
+ 🛠️ Tech Stack Detected:
77
+ - Frontend: Next.js 14.2.0
78
+ - Frontend: React 18.3.0
79
+ - Database: Prisma 6.5.0
80
+ - Testing: Vitest 2.0.0
81
+
82
+ 📚 Best Practices Generated (from Context7):
83
+ ✓ nextjs-14.md (8000 tokens)
84
+ ✓ react-18.md (8000 tokens)
85
+ ✓ prisma-6.md (8000 tokens)
86
+ ✓ vitest-2.md (8000 tokens)
87
+
88
+ 📁 Files Created:
89
+ ✓ domain/index.md
90
+ ✓ domain/project/README.md
91
+ ✓ domain/project/tech-stack.md
92
+ ✓ domain/project/best-practices/index.md
93
+ ✓ domain/project/best-practices/ (4 files)
94
+
95
+ 🚀 Ready for development!
96
+
97
+ Next steps:
98
+ 1. Create change with OpenSpec
99
+ 2. Setup change: /csetup {change-id}
100
+ 3. Start development: /cdev {change-id}
101
+ ```