@champpaba/claude-agent-kit 1.8.0 → 2.0.1

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 (43) hide show
  1. package/.claude/CLAUDE.md +189 -39
  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 +101 -39
  15. package/.claude/commands/designsetup.md +1402 -337
  16. package/.claude/commands/extract.md +520 -245
  17. package/.claude/commands/pageplan.md +6 -6
  18. package/.claude/contexts/design/box-thinking.md +1 -1
  19. package/.claude/contexts/design/index.md +1 -1
  20. package/.claude/contexts/patterns/agent-discovery.md +2 -2
  21. package/.claude/contexts/patterns/animation-patterns.md +1 -1
  22. package/.claude/contexts/patterns/change-workflow.md +8 -5
  23. package/.claude/contexts/patterns/code-standards.md +10 -8
  24. package/.claude/contexts/patterns/error-recovery.md +4 -4
  25. package/.claude/contexts/patterns/frontend-component-strategy.md +1 -1
  26. package/.claude/contexts/patterns/performance-optimization.md +1 -1
  27. package/.claude/contexts/patterns/task-breakdown.md +2 -2
  28. package/.claude/contexts/patterns/task-classification.md +2 -2
  29. package/.claude/contexts/patterns/ui-component-consistency.md +3 -3
  30. package/.claude/contexts/patterns/validation-framework.md +36 -33
  31. package/.claude/lib/README.md +4 -4
  32. package/.claude/lib/agent-executor.md +31 -40
  33. package/.claude/lib/agent-router.md +91 -213
  34. package/.claude/lib/context-loading-protocol.md +19 -36
  35. package/.claude/lib/detailed-guides/agent-system.md +43 -121
  36. package/.claude/lib/detailed-guides/taskmaster-analysis.md +1 -1
  37. package/.claude/lib/document-loader.md +22 -25
  38. package/.claude/lib/flags-updater.md +24 -32
  39. package/.claude/templates/STYLE_GUIDE.template.md +1 -1
  40. package/.claude/templates/design-context-template.md +1 -1
  41. package/.claude/templates/phases-sections/frontend-mockup.md +8 -5
  42. package/README.md +99 -40
  43. package/package.json +1 -1
package/.claude/CLAUDE.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # CLAUDE.md
2
2
 
3
3
  > **Navigation Hub for AI Agents**
4
- > **Template Version:** 1.8.0 - Universal Multi-Agent Template (Opus 4.5)
5
- > **Latest:** Token Optimization - Removed documentation/report phases, verbose terminal output instead
4
+ > **Template Version:** 2.0.0 - Claude 4.5 Optimized + Design System v2.0
5
+ > **Latest:** Full template refactored with Claude 4.5 best practices (agents ~65% smaller) + Interactive design setup with theme selection
6
6
 
7
7
  ---
8
8
 
@@ -24,7 +24,7 @@
24
24
  | File | Purpose | When to Read |
25
25
  |------|---------|--------------|
26
26
  | `STYLE_GUIDE.md` | **Visual design** (colors, typography, spacing) | UI/Frontend phases |
27
- | `STYLE_TOKENS.json` | Lightweight design tokens (~500 tokens) | Quick UI reference |
27
+ | `tokens.json` | Design tokens with style/theme/animations (~800 tokens) | Quick UI reference |
28
28
  | `page-plan.md` | UI component layout + content strategy | uxui-frontend agent |
29
29
  | `phases.md` | Execution plan with agent assignments | All phases |
30
30
  | `flags.json` | Progress tracking | All phases |
@@ -65,14 +65,15 @@ Universal, framework-agnostic template for AI-assisted development.
65
65
 
66
66
  ## 📖 Quick Navigation
67
67
 
68
- **Design/UI:**
69
- - `/designsetup` - Auto-generate style guide from reference/codebase/AI
70
- - `design-system/STYLE_TOKENS.json` - **NEW!** Lightweight design tokens (~500 tokens)
71
- - `design-system/STYLE_GUIDE.md` - Full style guide (17 sections, ~5000 tokens)
72
- - `@/.claude/lib/document-loader.md` - **NEW!** Token-efficient loading patterns
68
+ **Design/UI (v2.0.0):**
69
+ - `/extract https://site.com` - Extract design from reference sites (multi-URL, style detection)
70
+ - `/designsetup @prd.md` - Interactive design setup (3-round loop, theme selection)
71
+ - `design-system/tokens.json` - Design tokens with style/theme/animations (~800 tokens)
72
+ - `design-system/patterns/*.md` - Selective code patterns (buttons, cards, forms, animations, decorations)
73
+ - `design-system/STYLE_GUIDE.md` - Human-readable guide (no code, ~150 lines)
74
+ - `.claude/extractions/*.json` - Extracted site data
75
+ - `@/.claude/lib/document-loader.md` - Token-efficient loading patterns
73
76
  - `@/.claude/contexts/design/index.md` (General design principles - fallback)
74
- - `@/.claude/contexts/design/box-thinking.md` (Layout analysis)
75
- - `@/.claude/contexts/patterns/ui-component-consistency.md` (Visual consistency)
76
77
 
77
78
  **Development:**
78
79
  - `@/.claude/contexts/patterns/task-classification.md` (Agent selection guide)
@@ -84,14 +85,17 @@ Universal, framework-agnostic template for AI-assisted development.
84
85
  - `@/.claude/contexts/patterns/frontend-component-strategy.md`
85
86
 
86
87
  **Project Setup:**
87
- - `/designsetup` - Auto-generate style guide (reference → codebase → AI)
88
- - `/csetup` - **v1.8.0:** Now auto-detects tech stack + generates best practices (replaces /psetup, /agentsetup)
88
+ - `/extract https://site.com` - Extract design from reference sites
89
+ - `/designsetup @prd.md` - Interactive design system setup
90
+ - `/csetup` - **v1.8.0+:** Now auto-detects tech stack + generates best practices (replaces /psetup, /agentsetup)
89
91
 
90
- **Page Planning (UI Tasks):**
91
- - `/pageplan @prd.md @brief.md` - **ENHANCED v1.4.0!** Generate page structure & conversion-optimized content
92
+ **Page Planning (UI Tasks) - v2.0.0:**
93
+ - `/pageplan @prd.md @brief.md` - Generate page structure with auto page type detection
92
94
  - Output: `openspec/changes/{id}/page-plan.md` (component reuse, buyer avatar, conversion copy, asset checklist)
93
- - **NEW:** Buyer avatar analysis (Eugene Schwartz framework) for marketing pages
94
- - **NEW:** Conversion-optimized content (pain → promise → CTA)
95
+ - Auto-detects page type (landing/dashboard/auth) from proposal.md/tasks.md
96
+ - Reads tokens.json for style/theme/animations
97
+ - Loads patterns/*.md selectively based on page type
98
+ - Buyer avatar analysis (Eugene Schwartz framework) for marketing pages only
95
99
  - Used by: uxui-frontend agent (auto-reads in STEP 0.5)
96
100
 
97
101
  **OpenSpec Multi-Agent Workflow:**
@@ -111,9 +115,9 @@ Universal, framework-agnostic template for AI-assisted development.
111
115
 
112
116
  **Implementation Logic:**
113
117
  - `@/.claude/lib/README.md` - Implementation logic overview
114
- - `@/.claude/lib/agent-executor.md` - Agent retry & escalation logic (used by /cdev) + 🆕 Incremental testing execution (v1.6.0)
118
+ - `@/.claude/lib/agent-executor.md` - Agent retry & escalation logic (used by /cdev) + Incremental testing execution
115
119
  - `@/.claude/lib/tdd-classifier.md` - TDD classification logic (used by /csetup)
116
- - `@/.claude/lib/task-analyzer.md` - 🆕 Task analysis with milestone generation (v1.6.0)
120
+ - `@/.claude/lib/task-analyzer.md` - Task analysis with milestone generation
117
121
  - `@/.claude/lib/flags-updater.md` - Progress tracking protocol (Main Claude updates flags.json)
118
122
  - `@/.claude/lib/agent-router.md` - Mandatory agent routing rules (enforce delegation)
119
123
  - `@/.claude/contexts/patterns/agent-discovery.md` - Shared agent discovery flow
@@ -126,7 +130,7 @@ Universal, framework-agnostic template for AI-assisted development.
126
130
  - `/csetup` **auto-detects tech stack** from: package.json → design.md → proposal/tasks (3 sources)
127
131
  - **Auto-generates best practices** from Context7 MCP (React, Next.js, Prisma, etc.)
128
132
  - Files created in `.claude/contexts/domain/project/best-practices/`
129
- - **Agents MUST read** best practices before coding (validated by agent-executor)
133
+ - **Agents read** best practices before coding (validated by agent-executor)
130
134
  - `/cdev` **injects** relevant best-practices paths into agent prompts
131
135
 
132
136
  **Flow:**
@@ -137,47 +141,85 @@ Universal, framework-agnostic template for AI-assisted development.
137
141
 
138
142
  ---
139
143
 
140
- ## 🎨 Design System / Style Guide Generation
144
+ ## 🎨 Design System v2.0.0 (Interactive Setup)
141
145
 
142
146
  **→ See:** `@/.claude/lib/detailed-guides/design-system.md` for complete guide
143
147
 
144
148
  **Quick Summary:**
145
- - `/designsetup` auto-detects project context with **3 smart paths**: Reference design → Brownfield (reverse engineering) → Greenfield (AI-generated)
146
- - Generates comprehensive `design-system/STYLE_GUIDE.md` (17 sections: colors, typography, spacing, components, etc.)
147
- - **uxui-frontend agent** auto-reads style guide (Priority #1) or falls back to general design principles
148
- - Ensures visual consistency, prevents duplicates, enforces accessibility
149
+ - `/extract https://site.com` Extracts design from reference sites (multi-URL, style detection)
150
+ - `/designsetup @prd.md` Interactive 3-round loop with theme selection
151
+ - Generates:
152
+ - `tokens.json` - Design tokens with style/theme/animations (~800 tokens) **FOR AGENTS**
153
+ - `patterns/*.md` - Code patterns (buttons, cards, forms, animations, decorations) **SELECTIVE LOADING**
154
+ - `STYLE_GUIDE.md` - Human-readable guide (no code, ~150 lines) **FOR HUMANS**
155
+
156
+ **New Features in v2.0.0:**
157
+ - 🎯 **Style Detection:** Neo-Brutalism, Minimalist, Glassmorphism, Modern SaaS, etc.
158
+ - 🎭 **Theme Selection:** AI recommends themes based on project context
159
+ - 🎬 **Animation Support:** GSAP, ScrollTrigger, Framer Motion detection
160
+ - 📜 **Scroll Patterns:** stacking-cards, parallax, fade-in, slide-in
161
+ - 🖼️ **Decorative Direction:** USE/AVOID elements for theme consistency
162
+
163
+ **Flow:**
164
+ ```
165
+ /extract → .claude/extractions/*.json
166
+
167
+ /designsetup → tokens.json + patterns/*.md + STYLE_GUIDE.md
168
+
169
+ /pageplan → page-plan.md (reads tokens.json, auto-detects page type)
170
+
171
+ /csetup → phases.md (reads page-plan.md)
172
+
173
+ /cdev → uxui-frontend (reads tokens.json + patterns/*.md selectively)
174
+ ```
149
175
 
150
176
  ---
151
177
 
152
- ## ⚡ Context Optimization (v1.2.0)
178
+ ## ⚡ Context Optimization (v2.0.0)
153
179
 
154
180
  **→ See:** `@/.claude/lib/detailed-guides/context-optimization.md` for complete guide
155
181
 
156
182
  **Quick Summary:**
157
183
  - **Problem:** 20K tokens wasted (STYLE_GUIDE.md read 4x by different commands/agents)
158
- - **Solution:** 3-tier loading → STYLE_TOKENS.json (500 tokens) → design-context.md (1K) → STYLE_GUIDE.md (5K, selective)
159
- - **Result:** 70% token reduction (~4.7K total), 3-4x faster, maintained quality
184
+ - **Solution (v2.0.0):**
185
+ - `tokens.json` (~800 tokens) - **PRIMARY: All agents read this**
186
+ - `patterns/*.md` - **SELECTIVE: Load based on page type**
187
+ - `STYLE_GUIDE.md` (~150 lines) - **HUMAN-READABLE: No code**
188
+ - **Page Type Detection:**
189
+ - Landing/Marketing → Full patterns (buttons, cards, scroll-animations, decorations)
190
+ - Dashboard/Admin → Minimal patterns (buttons, cards, forms)
191
+ - Auth → Clean patterns (buttons, forms)
192
+ - **Result:** 84% token reduction (~800 tokens vs ~5000), 4x faster, theme consistency
160
193
 
161
194
  ---
162
195
 
163
- ## 📋 Page Planning System (v1.4.0 - Conversion-Optimized)
196
+ ## 📋 Page Planning System (v2.0.0 - Auto Page Type Detection)
164
197
 
165
198
  **→ See:** `@/.claude/lib/detailed-guides/page-planning.md` for complete guide
166
199
 
167
200
  **Quick Summary:**
168
- - **Problem:** Agents duplicate components (Navbar 3x), use random colors, lorem ipsum content, **generic copy that doesn't convert**
201
+ - **Problem:** Agents duplicate components (Navbar 3x), use random colors, lorem ipsum content, wrong decorations for page type
169
202
  - **Solution:** `/pageplan @prd.md @brief.md` → Generates `openspec/changes/{id}/page-plan.md` with:
203
+ - **Auto page type detection** (landing/dashboard/auth from proposal.md/tasks.md)
204
+ - **tokens.json integration** (style, theme, animations, decorative direction)
205
+ - **Selective pattern loading** (only load patterns relevant to page type)
170
206
  - Component reuse plan ✅ (prevent duplicates)
171
- - **Buyer avatar analysis** 🆕 (Eugene Schwartz framework)
172
- - **Conversion-optimized content** 🆕 (pain → promise → CTA)
207
+ - Buyer avatar analysis (Eugene Schwartz framework) **for marketing pages only**
208
+ - Conversion-optimized content (pain → promise → CTA) **for marketing pages only**
173
209
  - Asset checklist ✅ (performance-optimized)
174
- - **Benefits:**
175
- - Prevents duplicates, ensures design consistency
176
- - **Real content from PRD with conversion psychology** 🆕
177
- - **2-5x better conversion rates** (pain-based headlines vs generic)
178
- - 25% faster (search + copy strategy done once upfront)
179
- - **Use for:** Landing pages, marketing sites, product pages (auto-detects marketing vs dashboard)
180
- - **Skips for:** Dashboards, admin panels, backend/database work (no buyer avatar needed)
210
+
211
+ **Page Type Handling:**
212
+ | Page Type | Decorations | Scroll Anims | Buyer Avatar | Patterns Loaded |
213
+ |-----------|-------------|--------------|--------------|-----------------|
214
+ | Landing/Marketing | Full | Enabled | ✅ Enabled | buttons, cards, scroll-anims, decorations |
215
+ | Dashboard/Admin | Minimal | Disabled | Skipped | buttons, cards, forms |
216
+ | Auth (Login/Register) | None | Disabled | Skipped | buttons, forms |
217
+
218
+ **Benefits:**
219
+ - Auto-detects page type from context (no manual config)
220
+ - Theme + decorations from tokens.json applied consistently
221
+ - 84% token reduction (selective pattern loading)
222
+ - Conversion-optimized only where needed (marketing pages)
181
223
 
182
224
  ---
183
225
 
@@ -214,7 +256,7 @@ Universal, framework-agnostic template for AI-assisted development.
214
256
  **Quick Summary:**
215
257
  - **6 specialist agents**: integration (validate contracts), uxui-frontend (UI with mock data), test-debug (tests/bugs), frontend (connect UI to API), backend (API endpoints), database (schemas/migrations)
216
258
  - **Main Claude's role**: Orchestrator (plan, coordinate, report), NOT implementer (no writing code directly)
217
- - **Self-check protocol**: MANDATORY checklist before ANY work (detect work type → select agent → delegate)
259
+ - **Self-check protocol**: Checklist before ANY work (detect work type → select agent → delegate)
218
260
  - **Agent pre-work**: STEP 0 (project discovery for ALL) + STEP 1-5 (design fundamentals for uxui-frontend only)
219
261
 
220
262
  **Example workflow:**
@@ -225,6 +267,114 @@ User: "Build login system"
225
267
  → Phase 2.5: integration (validate contracts)
226
268
  → Phase 3: frontend (connect UI to API)
227
269
  → Phase 4: test-debug (tests)
270
+ ```
271
+
272
+ ---
273
+
274
+ ## 🆕 v2.0.0: Claude 4.5 Optimization + Design System v2.0
275
+
276
+ **Based on:** [Claude 4 Best Practices](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-4-best-practices)
277
+
278
+ ### Claude 4.5 Changes Applied
279
+
280
+ | Before | After | WHY |
281
+ |--------|-------|-----|
282
+ | "MUST", "WILL BE REJECTED" | Professional tone | Claude 4.5 works better with respectful instructions |
283
+ | "Don't do X", "Never Y" | "Use X instead" | Positive instructions are clearer |
284
+ | Rules without context | Rules with WHY | Claude applies rules more intelligently |
285
+ | Duplicated content (6x) | Shared `_shared/` folder | 83% token reduction |
286
+ | ~1000 lines per agent | ~250-350 lines | 65% smaller |
287
+
288
+ ### New Shared Components
289
+
290
+ ```
291
+ .claude/agents/_shared/
292
+ ├── pre-work-checklist.md # Common validation steps
293
+ ├── package-manager.md # Package manager protocol
294
+ ├── documentation-policy.md # What files to create
295
+ ├── agent-boundaries.md # When to use which agent
296
+ └── README.md # Overview
297
+ ```
298
+
299
+ ### Token Savings
300
+
301
+ | Agent | Before | After | Reduction |
302
+ |-------|--------|-------|-----------|
303
+ | uxui-frontend | ~1037 | ~375 | 64% |
304
+ | integration | ~600 | ~210 | 65% |
305
+ | backend | ~700 | ~244 | 65% |
306
+ | database | ~680 | ~273 | 60% |
307
+ | frontend | ~650 | ~296 | 54% |
308
+ | test-debug | ~580 | ~252 | 57% |
309
+ | **Total** | **~4247** | **~1650** | **61%** |
310
+
311
+ Plus ~500 tokens in shared files = **~2150 total** (was ~4247)
312
+
313
+ ### Best Practices Applied
314
+
315
+ 1. **Tone Calibration** - Professional, direct (not aggressive)
316
+ 2. **Action Orientation** - Explicit "Write code" vs "Consider"
317
+ 3. **Prevent Overengineering** - Clear boundaries
318
+ 4. **Encourage Exploration** - Read before implementing
319
+ 5. **Rich Output When Needed** - Specify requirements
320
+ 6. **Context for Rules** - Explain WHY
321
+ 7. **Positive Instructions** - "Use X" not "Don't Y"
322
+
323
+ ### Additional Files Refactored
324
+
325
+ Beyond the 6 agent files, these supporting files were also updated:
326
+
327
+ **Implementation Logic (lib/):**
328
+ | File | Changes |
329
+ |------|---------|
330
+ | `agent-router.md` | Routing table format, removed "CANNOT/forbidden" language |
331
+ | `agent-executor.md` | Professional rejection messages, table format |
332
+ | `context-loading-protocol.md` | WHY explanations, removed "CRITICAL" warnings |
333
+ | `flags-updater.md` | Best practices table, removed "Step 3 CANNOT be skipped" |
334
+ | `document-loader.md` | Table format for DO/DON'T sections |
335
+ | `detailed-guides/agent-system.md` | Compact table format, shared file references |
336
+
337
+ **Commands:**
338
+ | File | Changes |
339
+ |------|---------|
340
+ | `cdev.md` | WHY context for best practices, softer tone |
341
+ | `csetup.md` | Best Practices / Anti-Patterns format |
342
+ | `pageplan.md` | "Guidelines" instead of "CRITICAL Rules" |
343
+ | `designsetup.md` | "Follow this format" instead of "EXACT format" |
344
+
345
+ **Patterns (contexts/patterns/):**
346
+ | File | Changes |
347
+ |------|---------|
348
+ | `validation-framework.md` | WHY explanations, removed "🚨" symbols |
349
+ | `error-recovery.md` | "⚠️" instead of "🚨", professional escalation format |
350
+ | `ui-component-consistency.md` | "Common Issues" instead of "Red Flags" |
351
+ | `task-breakdown.md` | Positive framing for incremental approach |
352
+ | `agent-discovery.md` | Softer language, "⚠️ Fallback" instead of "🚨" |
353
+ | `code-standards.md` | "File Creation Policy" with WHY table |
354
+ | `animation-patterns.md` | "⚠️ Common Mistakes" instead of "🚨" |
355
+ | `frontend-component-strategy.md` | "⚠️ Anti-Patterns" instead of "🚨" |
356
+ | `performance-optimization.md` | "⚠️ Common Mistakes" instead of "🚨" |
357
+ | `change-workflow.md` | Table format for read-only files |
358
+ | `task-classification.md` | "Agent Capabilities Reference" section title |
359
+
360
+ **Design (contexts/design/):**
361
+ | File | Changes |
362
+ |------|---------|
363
+ | `index.md` | "should check" instead of "MUST check" |
364
+ | `box-thinking.md` | "⚠️ Common Mistakes" instead of "🚨" |
365
+
366
+ **Templates:**
367
+ | File | Changes |
368
+ |------|---------|
369
+ | `phases-sections/frontend-mockup.md` | Table with WHY for design rules |
370
+ | `design-context-template.md` | "⚠️ Design Rules" instead of "🚨 Critical" |
371
+ | `STYLE_GUIDE.template.md` | "🔧 Troubleshooting" instead of "🚨" |
372
+
373
+ **Other lib files:**
374
+ | File | Changes |
375
+ |------|---------|
376
+ | `lib/README.md` | Softer descriptions, "📌 Important" |
377
+ | `detailed-guides/taskmaster-analysis.md` | "🔴 HIGH" instead of "🚨 HIGH" |
228
378
 
229
379
  ---
230
380