@champpaba/claude-agent-kit 1.0.0 → 1.1.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 (84) hide show
  1. package/{template/.claude → .claude}/CHANGELOG-v1.1.1.md +259 -259
  2. package/{template/.claude → .claude}/CLAUDE.md +555 -329
  3. package/{template/.claude → .claude}/agents/01-integration.md +797 -797
  4. package/{template/.claude → .claude}/agents/02-uxui-frontend.md +955 -899
  5. package/{template/.claude → .claude}/agents/03-test-debug.md +759 -759
  6. package/{template/.claude → .claude}/agents/04-frontend.md +1099 -1099
  7. package/{template/.claude → .claude}/agents/05-backend.md +1217 -1217
  8. package/{template/.claude → .claude}/agents/06-database.md +969 -969
  9. package/{template/.claude → .claude}/commands/agentsetup.md +1464 -1464
  10. package/{template/.claude → .claude}/commands/cdev.md +327 -327
  11. package/{template/.claude → .claude}/commands/csetup.md +447 -447
  12. package/{template/.claude → .claude}/commands/cstatus.md +60 -60
  13. package/{template/.claude → .claude}/commands/cview.md +364 -364
  14. package/.claude/commands/designsetup.md +838 -0
  15. package/.claude/commands/extract.md +1005 -0
  16. package/.claude/commands/pageplan.md +327 -0
  17. package/{template/.claude → .claude}/commands/psetup.md +101 -101
  18. package/{template/.claude → .claude}/contexts/design/accessibility.md +611 -611
  19. package/{template/.claude → .claude}/contexts/design/box-thinking.md +566 -553
  20. package/{template/.claude → .claude}/contexts/design/color-theory.md +519 -498
  21. package/{template/.claude → .claude}/contexts/design/index.md +290 -247
  22. package/{template/.claude → .claude}/contexts/design/layout.md +400 -400
  23. package/{template/.claude → .claude}/contexts/design/responsive.md +551 -551
  24. package/{template/.claude → .claude}/contexts/design/shadows.md +522 -522
  25. package/{template/.claude → .claude}/contexts/design/spacing.md +445 -428
  26. package/{template/.claude → .claude}/contexts/design/typography.md +465 -465
  27. package/{template/.claude → .claude}/contexts/domain/README.md +164 -164
  28. package/{template/.claude → .claude}/contexts/patterns/agent-coordination.md +388 -388
  29. package/{template/.claude → .claude}/contexts/patterns/agent-discovery.md +182 -182
  30. package/{template/.claude → .claude}/contexts/patterns/change-workflow.md +538 -538
  31. package/{template/.claude → .claude}/contexts/patterns/code-standards.md +515 -515
  32. package/{template/.claude → .claude}/contexts/patterns/development-principles.md +513 -513
  33. package/{template/.claude → .claude}/contexts/patterns/error-handling.md +478 -478
  34. package/{template/.claude → .claude}/contexts/patterns/error-recovery.md +365 -365
  35. package/{template/.claude → .claude}/contexts/patterns/logging.md +424 -424
  36. package/{template/.claude → .claude}/contexts/patterns/task-breakdown.md +452 -452
  37. package/{template/.claude → .claude}/contexts/patterns/task-classification.md +523 -523
  38. package/{template/.claude → .claude}/contexts/patterns/tdd-classification.md +516 -516
  39. package/{template/.claude → .claude}/contexts/patterns/testing.md +413 -413
  40. package/{template/.claude → .claude}/contexts/patterns/validation-framework.md +776 -776
  41. package/{template/.claude → .claude}/lib/README.md +39 -39
  42. package/{template/.claude → .claude}/lib/agent-executor.md +258 -258
  43. package/{template/.claude → .claude}/lib/agent-router.md +572 -572
  44. package/{template/.claude → .claude}/lib/flags-updater.md +469 -469
  45. package/{template/.claude → .claude}/lib/tdd-classifier.md +345 -345
  46. package/{template/.claude → .claude}/lib/validation-gates.md +484 -484
  47. package/{template/.claude → .claude}/settings.local.json +42 -42
  48. package/.claude/templates/STYLE_GUIDE.template.md +879 -0
  49. package/{template/.claude → .claude}/templates/context-template.md +45 -45
  50. package/{template/.claude → .claude}/templates/flags-template.json +42 -42
  51. package/.claude/templates/page-plan-example.md +562 -0
  52. package/{template/.claude → .claude}/templates/phase-templates.json +124 -124
  53. package/{template/.claude → .claude}/templates/phases-sections/accessibility-test.md +17 -17
  54. package/{template/.claude → .claude}/templates/phases-sections/api-design.md +37 -37
  55. package/{template/.claude → .claude}/templates/phases-sections/backend-tests.md +16 -16
  56. package/{template/.claude → .claude}/templates/phases-sections/backend.md +37 -37
  57. package/{template/.claude → .claude}/templates/phases-sections/business-logic-validation.md +16 -16
  58. package/{template/.claude → .claude}/templates/phases-sections/component-tests.md +17 -17
  59. package/{template/.claude → .claude}/templates/phases-sections/contract-backend.md +16 -16
  60. package/{template/.claude → .claude}/templates/phases-sections/contract-frontend.md +16 -16
  61. package/{template/.claude → .claude}/templates/phases-sections/database.md +35 -35
  62. package/{template/.claude → .claude}/templates/phases-sections/documentation.md +17 -17
  63. package/{template/.claude → .claude}/templates/phases-sections/e2e-tests.md +16 -16
  64. package/{template/.claude → .claude}/templates/phases-sections/fix-implementation.md +17 -17
  65. package/{template/.claude → .claude}/templates/phases-sections/frontend-integration.md +18 -18
  66. package/{template/.claude → .claude}/templates/phases-sections/frontend-mockup.md +123 -123
  67. package/{template/.claude → .claude}/templates/phases-sections/manual-flow-test.md +15 -15
  68. package/{template/.claude → .claude}/templates/phases-sections/manual-ux-test.md +16 -16
  69. package/{template/.claude → .claude}/templates/phases-sections/refactor-implementation.md +17 -17
  70. package/{template/.claude → .claude}/templates/phases-sections/refactor.md +16 -16
  71. package/{template/.claude → .claude}/templates/phases-sections/regression-tests.md +15 -15
  72. package/{template/.claude → .claude}/templates/phases-sections/report.md +16 -16
  73. package/{template/.claude → .claude}/templates/phases-sections/responsive-test.md +16 -16
  74. package/{template/.claude → .claude}/templates/phases-sections/script-implementation.md +43 -43
  75. package/{template/.claude → .claude}/templates/phases-sections/test-coverage.md +16 -16
  76. package/{template/.claude → .claude}/templates/phases-sections/user-approval.md +14 -14
  77. package/LICENSE +21 -21
  78. package/README.md +758 -331
  79. package/lib/init.js +1 -1
  80. package/lib/update.js +1 -1
  81. package/package.json +2 -2
  82. /package/{template/.claude → .claude}/contexts/patterns/frontend-component-strategy.md +0 -0
  83. /package/{template/.claude → .claude}/contexts/patterns/git-workflow.md +0 -0
  84. /package/{template/.claude → .claude}/contexts/patterns/ui-component-consistency.md +0 -0
package/README.md CHANGED
@@ -1,468 +1,756 @@
1
- # Claude Multi-Agent Template
1
+ # Claude Agent Kit
2
2
 
3
- > Reusable multi-agent system for spec-driven development with automatic Context7 integration.
3
+ > 🤖 **Multi-Agent Implementation Engine** - The perfect companion for [OpenSpec](https://github.com/Fission-AI/OpenSpec) spec-driven development
4
4
 
5
+ [![npm version](https://badge.fury.io/js/@champpaba%2Fclaude-agent-kit.svg)](https://www.npmjs.com/package/@champpaba/claude-agent-kit)
5
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+ [![Node.js Version](https://img.shields.io/node/v/@champpaba/claude-agent-kit)](https://nodejs.org)
6
8
 
7
9
  ---
8
10
 
9
11
  ## 🎯 What is this?
10
12
 
11
- A **production-ready template** for building software with AI agents that:
13
+ **Claude Agent Kit picks up where OpenSpec planning ends.**
12
14
 
13
- - **Coordinate complex tasks** - Orchestrator delegates to specialists
14
- - ✅ **Always up-to-date** - Uses Context7 MCP for latest framework docs
15
- - **Zero maintenance** - No tech stack docs to update (Context7 handles it)
16
- - ✅ **Reusable** - Works for Next.js, FastAPI, Vue, Django, or any stack
17
- - ✅ **Incremental** - 4-phase methodology (MVT → Complexity → Scale → Deploy)
15
+ While OpenSpec handles **alignment** (Draft Proposal → Review & Align), Claude Agent Kit handles **implementation** (Implement Tasks Archive & Update) with specialized AI agents.
16
+
17
+ ### The Complete Workflow
18
+
19
+ ```
20
+ ┌─────────────────────────────────────────────────────────────┐
21
+ │ OpenSpec Planning │
22
+ │ (Spec-Driven Development for AI Coding Assistants) │
23
+ └─────────────────────────────────────────────────────────────┘
24
+
25
+ Generates: proposal.md + tasks.md
26
+
27
+ ┌─────────────────────────────────────────────────────────────┐
28
+ │ Claude Agent Kit Implementation │
29
+ │ (Multi-Agent Execution with 6 Specialists) │
30
+ └─────────────────────────────────────────────────────────────┘
31
+
32
+ Completes: All tasks with quality gates
33
+ ```
18
34
 
19
35
  ---
20
36
 
21
- ## 🚀 Quick Start
37
+ ## 🔄 How They Work Together
22
38
 
23
- ### มาถึงปุ๊บ ต้องทำอะไร? (Step-by-Step)
39
+ | Stage | Tool | What Happens | Output |
40
+ |-------|------|--------------|--------|
41
+ | **1. Draft Proposal** | OpenSpec | Human requests change, AI scaffolds structure | `proposal.md` + `tasks.md` |
42
+ | **2. Review & Align** | OpenSpec | Team iterates until consensus | Approved specs |
43
+ | **2.5. Page Planning** | **Claude Agent Kit** | *(UI tasks only)* Generate content & component plan | `page-plan.md` |
44
+ | **3. Setup Context** | **Claude Agent Kit** | Classify tasks, generate workflow | `workflow.md` |
45
+ | **4. Implement Tasks** | **Claude Agent Kit** | 6 specialized agents execute work | Working code + tests |
46
+ | **5. Archive & Update** | OpenSpec | Merge changes back to specs | Updated `specs/` |
24
47
 
25
- #### 📥 Step 1: Clone Template (1 นาที)
48
+ ### What OpenSpec Generates
26
49
 
27
- ```bash
28
- # Clone template มา
29
- git clone https://github.com/anongecko/claude-multi-agent-template.git my-project
30
- cd my-project
50
+ **proposal.md** - Business case and scope
51
+ ```markdown
52
+ # Change Proposal: User Authentication System
31
53
 
32
- # ลบ .git เดิม แล้วสร้างใหม่
33
- rm -rf .git
34
- git init
35
- git add .
36
- git commit -m "Initial commit from template"
54
+ ## Motivation
55
+ Users need secure login functionality...
56
+
57
+ ## Scope
58
+ - Email/password authentication
59
+ - JWT token generation
60
+ - Protected routes middleware
37
61
  ```
38
62
 
63
+ **tasks.md** - Implementation checklist
64
+ ```markdown
65
+ ## Database Setup
66
+ - [ ] Create User model with email, password fields
67
+ - [ ] Add unique constraint on email
68
+
69
+ ## Backend Implementation
70
+ - [ ] POST /api/auth/login endpoint
71
+ - [ ] Password hashing with bcrypt
72
+ - [ ] JWT token generation
73
+
74
+ ## Frontend Implementation
75
+ - [ ] Login form component
76
+ - [ ] Form validation
77
+ - [ ] Token storage
78
+ ```
79
+
80
+ ### What Claude Agent Kit Does
81
+
82
+ **Input:** Reads `proposal.md` + `tasks.md` from OpenSpec
83
+
84
+ **Process:**
85
+ 1. `/pageplan` *(UI tasks only)* - Generate content & component reuse plan
86
+ 2. `/csetup {change-id}` - Analyze tasks, classify by agent, generate workflow
87
+ 3. `/cdev {change-id}` - Execute with 6 specialized agents in phases:
88
+ - **Phase 1:** UI with mock data (uxui-frontend)
89
+ - **Phase 2:** Real API + database (backend + database, parallel)
90
+ - **Phase 2.5:** Validate contracts (integration)
91
+ - **Phase 3:** Connect UI to API (frontend)
92
+ - **Phase 4:** Tests + bug fixes (test-debug)
93
+
94
+ **Output:** Working implementation ready for review
95
+
39
96
  ---
40
97
 
41
- #### 🔌 Step 2: Setup Context7 MCP (2 นาที)
98
+ ## 🎨 NEW: Page Planning for UI Tasks
42
99
 
43
- **ทำไมต้องมี?** ให้ AI หา docs ล่าสุดของ framework ให้เอง (Next.js, FastAPI, Vue, etc.)
100
+ **Problem:** Before `/pageplan`, agents would:
101
+ - ❌ Create duplicate components (3 different Navbar components!)
102
+ - ❌ Use inconsistent colors (`#0d7276` on landing, `#4f46e5` on dashboard)
103
+ - ❌ Generate lorem ipsum instead of real content
104
+ - ❌ Waste time searching for components during implementation
44
105
 
45
- **วิธีติดตั้ง:**
106
+ **Solution:** `/pageplan` command analyzes BEFORE implementing
46
107
 
47
- 1. เปิด Claude Code Settings → MCP Servers
48
- 2. เพิ่ม config นี้:
108
+ ### How It Works
49
109
 
50
- ```json
51
- {
52
- "mcpServers": {
53
- "context7": {
54
- "command": "npx",
55
- "args": ["-y", "@context7/mcp"]
56
- }
57
- }
58
- }
110
+ ```bash
111
+ # Step 1: OpenSpec generates tasks
112
+ User: "Build landing page for TOEIC app"
113
+ → Creates: .changes/landing-page/proposal.md + tasks.md
114
+
115
+ # Step 2: Generate page plan (NEW!)
116
+ User: /pageplan @prd.md @project_brief.md
117
+
118
+ # What it does:
119
+ # 1. Reads user-specified files (PRD, brief)
120
+ # 2. Reads proposal.md (technical architecture)
121
+ # 3. Reads STYLE_GUIDE.md (visual design)
122
+ # 4. Searches existing components (Navbar, Footer, etc.)
123
+ # 5. AI drafts real content from PRD
124
+ # 6. Generates: .changes/landing-page/page-plan.md
59
125
  ```
60
126
 
61
- 3. Restart Claude Code
62
- 4. เช็คว่าใช้งานได้: พิมพ์ `/mcp` ดู list → ต้องมี `context7`
127
+ ### page-plan.md Output
63
128
 
64
- ---
129
+ ```markdown
130
+ # Page Plan: Landing Page
131
+
132
+ ## 1. Component Plan
133
+ 🔄 Reuse: Navbar, Footer (found in codebase)
134
+ ✅ New Shared: (none)
135
+ ✅ New Specific: HeroSection, FeatureGrid, TestimonialCarousel
136
+
137
+ ## 2. Page Structure
138
+ <Layout>
139
+ <Navbar /> {/* Reuse */}
140
+ <HeroSection /> {/* New - see content below */}
141
+ <FeatureGrid />
142
+ <TestimonialCarousel />
143
+ <Footer /> {/* Reuse */}
144
+ </Layout>
145
+
146
+ ## 3. Assets to Prepare
147
+ - [ ] hero-image.jpg (1920x1080)
148
+ - [ ] logo.svg (200x60)
149
+ - [ ] feature-icons (3x 24x24 SVG)
150
+
151
+ ## 4. Content Draft (AI-Generated - Please Review & Edit)
152
+ **Headline:** "Master TOEIC with AI-Powered Tests"
153
+ **Subheadline:** "Experience exam-quality questions with instant AI scoring"
154
+ **CTA:** "Start Free Test"
155
+
156
+ **Features:**
157
+ - Real TOEIC-style questions
158
+ - Instant AI scoring
159
+ - Progress tracking dashboard
160
+ ```
161
+
162
+ ### Step 3: User Prepares
65
163
 
66
- #### Step 3: Auto-Setup Tech Stack (30 วินาที)
164
+ - Review content draft (edit as needed)
165
+ - ✅ Prepare assets (images, icons)
166
+ - ✅ Approve `page-plan.md`
67
167
 
68
- **ใช้ `/agentsetup` command:**
168
+ ### Step 4: Implementation
69
169
 
70
170
  ```bash
71
- /agentsetup
171
+ /csetup landing-page
172
+ /cdev landing-page
173
+
174
+ # uxui-frontend agent automatically:
175
+ # - STEP 0.5: Reads page-plan.md ✅
176
+ # - STEP 3: SKIP component search (already done!) ⚡ 25% faster
177
+ # - Uses: Real content from page-plan
178
+ # - Reuses: Navbar, Footer (no duplicates)
179
+ # - Creates: HeroSection, FeatureGrid, TestimonialCarousel
180
+ # - Applies: Colors/spacing from STYLE_GUIDE.md
72
181
  ```
73
182
 
74
- **Command จะทำอะไร?**
183
+ ### Benefits
75
184
 
76
- **1. ตรวจสอบ Greenfield vs Brownfield:**
77
- - **Brownfield** (มีโปรเจคอยู่แล้ว):
78
- - อ่าน `package.json` / `requirements.txt` / `composer.json`
79
- - ตรวจจับ stack อัตโนมัติ (Next.js 15, Prisma 6, etc.)
80
- - ดึง docs จาก Context7
185
+ | Before (No page-plan) | After (With page-plan) |
186
+ |----------------------|------------------------|
187
+ | Agent searches during implementation | ✅ Search done once upfront (25% faster) |
188
+ | Duplicate components created | Clear reuse plan |
189
+ | Lorem ipsum content | ✅ Real content from PRD |
190
+ | ❌ Missing assets mid-work | ✅ Asset checklist prepared |
191
+ | ❌ Inconsistent design | ✅ Synced with STYLE_GUIDE |
192
+ | ❌ Agent guesses structure | ✅ Clear component hierarchy |
81
193
 
82
- - **Greenfield** (เริ่มใหม่):
83
- - ถามว่าจะใช้ stack อะไร (Next.js? FastAPI? Django?)
84
- - ถามต่อ: Database ORM? Testing framework?
85
- - ดึง docs จาก Context7
194
+ ### When to Use /pageplan
86
195
 
87
- **2. สร้างไฟล์ Domain Context:**
88
196
  ```
89
- .claude/contexts/domain/{project}/
90
- ├─ tech-stack.md ← Stack + versions + Context7 IDs
91
- ├─ architecture.md ← (ถ้า spec มี)
92
- ├─ business-rules.md ← (ถ้า spec มี)
93
- └─ design-tokens.md ← (ถ้า spec มี)
197
+ ✅ Use for:
198
+ - Landing pages
199
+ - Dashboards
200
+ - Multi-section UI pages
201
+ - Any task with multiple components
202
+
203
+ ❌ Skip for:
204
+ - Backend API endpoints
205
+ - Database schemas
206
+ - Single-component tasks
207
+ - Non-UI work
94
208
  ```
95
209
 
96
- **ตัวอย่าง Output:**
97
- ```
98
- ✅ Agent Setup Complete!
210
+ ---
99
211
 
100
- 📦 Project Type: Brownfield
212
+ ## 🤖 The 6 Specialized Agents
101
213
 
102
- 🛠️ Tech Stack Detected:
103
- - Frontend: Next.js 15.5.0
104
- - Database: Prisma 6.5.0
105
- - State: Zustand 5.0.0
106
- - Testing: Vitest 2.0.0
214
+ | Agent | Color | Responsibility | Phase |
215
+ |-------|-------|---------------|-------|
216
+ | **uxui-frontend** | 🔵 Blue | Design UI components with mock data | 1 |
217
+ | **backend** | 🟣 Purple | Create API endpoints with validation | 2 |
218
+ | **database** | 🩷 Pink | Design schemas, migrations, queries | 2 |
219
+ | **integration** | 🟠 Orange | Validate API contracts before connecting | 2.5 |
220
+ | **frontend** | 🟢 Green | Connect UI to backend APIs | 3 |
221
+ | **test-debug** | 🔴 Red | Run tests and fix bugs (max 3-4 iterations) | 1,3,4 |
107
222
 
108
- 📁 Domain Context Created:
109
- - .claude/contexts/domain/myproject/tech-stack.md
223
+ Each agent:
224
+ - ✅ Auto-discovers your project context (tech stack, best practices)
225
+ - ✅ Follows framework-specific patterns from Context7 MCP
226
+ - ✅ Maintains design consistency across the codebase
227
+ - ✅ Reports progress with detailed logging
110
228
 
111
- 📚 Context7 Docs Retrieved:
112
- - Next.js 15 App Router (5000 tokens)
113
- - Prisma 6 Best Practices (5000 tokens)
114
- - Zustand 5 TypeScript (3000 tokens)
229
+ ---
115
230
 
116
- 🚀 Ready to start!
231
+ ## 📦 Installation
232
+
233
+ ```bash
234
+ npm install -g @champpaba/claude-agent-kit
117
235
  ```
118
236
 
119
- **หมายเหตุ:** ถ้าไม่รู้จะใช้ stack อะไร ให้ข้าม step นี้ไปก่อน แล้วค่อยกลับมารัน `/agentsetup` ทีหลัง
237
+ ### Alternative Package Managers
238
+
239
+ ```bash
240
+ # Using pnpm
241
+ pnpm add -g @champpaba/claude-agent-kit
242
+
243
+ # Using yarn
244
+ yarn global add @champpaba/claude-agent-kit
245
+ ```
120
246
 
121
247
  ---
122
248
 
123
- #### 🎨 Step 4: (Optional) กำหนดสี Design Tokens (5 นาที)
249
+ ## 🚀 Quick Start (with OpenSpec)
124
250
 
125
- ถ้าโปรเจคมีสีเฉพาะ เช่น brand colors:
251
+ ### Step 1: OpenSpec Planning
126
252
 
127
253
  ```bash
128
- mkdir -p .claude/contexts/domain/myproject
129
- ```
254
+ # In your OpenSpec-enabled project
255
+ cd my-app
130
256
 
131
- สร้างไฟล์ `.claude/contexts/domain/myproject/design-tokens.md`:
257
+ # Draft a change proposal (OpenSpec handles this)
258
+ "I want to build a landing page for my TOEIC app"
259
+ # → Generates: .changes/landing-page/proposal.md + tasks.md
260
+ ```
132
261
 
133
- ```markdown
134
- # MyProject Design Tokens
262
+ ### Step 2: Initialize Claude Agent Kit
135
263
 
136
- ## Brand Colors
137
- - Primary: `rgb(255, 87, 34)` (Orange - Energy, Innovation)
138
- - Secondary: `rgb(33, 150, 243)` (Blue - Trust, Stability)
139
- - Accent: `rgb(76, 175, 80)` (Green - Success)
264
+ ```bash
265
+ # Initialize the agent system
266
+ cak init
140
267
 
141
- ## Usage
142
- - Primary: CTA buttons, links, brand elements
143
- - Secondary: Headers, navigation
144
- - Accent: Success messages, completed states
268
+ # Setup project context (detects tech stack)
269
+ # In Claude Code:
270
+ /psetup
145
271
  ```
146
272
 
147
- **หมายเหตุ:** ถ้าไม่กำหนดเอง AI จะใช้ design foundation จาก `.claude/contexts/design/` (สีทั่วไป)
273
+ ### Step 3: Generate Page Plan (UI tasks only)
148
274
 
149
- ---
275
+ ```bash
276
+ # In Claude Code:
277
+ /pageplan @prd.md @project_brief.md
150
278
 
151
- #### 🏗️ Step 5: เริ่มทำงาน - เลือก 1 ใน 2 วิธี
279
+ # Generates: .changes/landing-page/page-plan.md
280
+ # → Review content, prepare assets
281
+ ```
152
282
 
153
- ### **วิธีที่ 1: สั่งตรงๆ (Simple, Ad-hoc)**
283
+ ### Step 4: Setup Change Context
154
284
 
155
285
  ```bash
156
- # เปิด Orchestrator
157
- /agents orchestrator
158
-
159
- # สั่งงาน
160
- "สร้าง login form ใช้ Next.js + Prisma"
286
+ /csetup landing-page
161
287
  ```
162
288
 
163
- **Orchestrator จะ:**
164
- 1. ตรวจสอบ tech stack ในโปรเจค (อ่าน `package.json` หรือ `requirements.txt`)
165
- 2. ค้น Context7 หา docs (Next.js 15, Prisma 6)
166
- 3. มอบหมายงานให้ agents:
167
- - **UX-UI Frontend**: สร้าง form + mock data
168
- - **Test-Debug**: เขียน tests
169
- - **Frontend**: ต่อ API
170
- - **Backend**: สร้าง POST /api/auth/login
171
- - **Database**: สร้าง User model
289
+ **What happens:**
290
+ - Reads `.changes/landing-page/proposal.md` (business context)
291
+ - Reads `.changes/landing-page/tasks.md` (implementation checklist)
292
+ - Reads `.changes/landing-page/page-plan.md` (if exists - content plan)
293
+ - Classifies tasks by agent (database, backend, frontend, etc.)
294
+ - Generates `workflow.md` (execution plan)
172
295
 
173
- ---
296
+ ### Step 5: Execute Implementation
297
+
298
+ ```bash
299
+ /cdev landing-page
300
+ ```
174
301
 
175
- ### **วิธีที่ 2: ใช้ tasks.md (Structured, Complex Projects)**
302
+ **What happens:**
303
+ 1. **Phase 1:** uxui-frontend reads `page-plan.md` → creates UI with real content
304
+ 2. **Phase 2:** backend + database create APIs + models (parallel, if needed)
305
+ 3. **Phase 2.5:** integration validates API contracts
306
+ 4. **Phase 3:** frontend connects UI to APIs (if needed)
307
+ 5. **Phase 4:** test-debug runs tests, fixes bugs
176
308
 
177
- สร้างไฟล์ `tasks.md`:
309
+ ### Step 6: Monitor Progress
178
310
 
179
- ```markdown
180
- # Feature: User Authentication
311
+ ```bash
312
+ # View detailed progress
313
+ /cview landing-page
181
314
 
182
- ## Tech Stack
183
- - Frontend: Next.js 15 App Router
184
- - Backend: Next.js API Routes
185
- - Database: Prisma + PostgreSQL
186
- - Testing: Vitest
315
+ # Quick status check
316
+ /cstatus landing-page
317
+ # → Phase 1/4 - UI Implementation (100%)
318
+ ```
187
319
 
188
320
  ---
189
321
 
190
- ## Phase 1: MVT (Minimum Viable Test)
191
- **Goal:** 1 user สามารถ login ได้
322
+ ## 🎯 Complete Workflow Examples
192
323
 
193
- ### Task 1.1: Create Login Form (UX-UI Frontend Agent)
194
- - Email input (required, type=email)
195
- - Password input (required, minLength=8)
196
- - Submit button
197
- - Mock data: `{ email: 'test@example.com', password: 'password123' }`
324
+ ### Workflow A: UI Feature (with /pageplan)
198
325
 
199
- ### Task 1.2: Write Unit Tests (Test-Debug Agent)
200
- - Test form validation (empty fields, invalid email)
201
- - Test mock login flow
326
+ ```bash
327
+ # 1. OpenSpec Planning
328
+ User: "Build landing page for TOEIC app"
329
+ → Creates: proposal.md + tasks.md
330
+
331
+ # 2. Page Planning (NEW!)
332
+ /pageplan @prd.md @project_brief.md
333
+ → Creates: page-plan.md
334
+ → User reviews content & prepares assets
335
+
336
+ # 3. Setup Context
337
+ /csetup landing-page
338
+ → Reads: proposal.md, tasks.md, page-plan.md
339
+ → Generates: workflow.md
340
+
341
+ # 4. Implementation
342
+ /cdev landing-page
343
+ → uxui-frontend reads page-plan.md (STEP 0.5)
344
+ → Skips redundant component search
345
+ → Uses real content + reuse plan
346
+ → 25% faster implementation
347
+
348
+ # 5. Monitor
349
+ /cview landing-page
350
+ ```
202
351
 
203
- ### Task 1.3: Human Approval
204
- **STOP** - User tests manually, approves before Phase 2
352
+ ### Workflow B: Backend Feature (skip /pageplan)
205
353
 
206
- ---
354
+ ```bash
355
+ # 1. OpenSpec Planning
356
+ User: "Add payment processing API"
357
+ → Creates: proposal.md + tasks.md
358
+
359
+ # 2. Setup Context (skip /pageplan - not UI work)
360
+ /csetup payment-api
361
+
362
+ # 3. Implementation
363
+ /cdev payment-api
364
+ → Phase 2: backend + database agents (parallel)
365
+ → Phase 2.5: integration validates contracts
366
+ → Phase 3: frontend connects (if UI exists)
367
+ → Phase 4: test-debug validates
368
+
369
+ # 4. Monitor
370
+ /cview payment-api
371
+ ```
207
372
 
208
- ## Phase 2: Complexity (Add Real API)
209
- **Goal:** Connect form to real backend
373
+ ### Workflow C: Full-Stack Feature (with /pageplan)
210
374
 
211
- ### Task 2.1: Create Login API (Backend Agent)
212
- - POST /api/auth/login
213
- - Validate email + password with Zod
214
- - Return 200 + JWT token OR 401 error
375
+ ```bash
376
+ # 1. OpenSpec Planning
377
+ User: "Build user authentication system"
378
+ Creates: proposal.md + tasks.md
379
+
380
+ # 2. Page Planning (for login UI only)
381
+ /pageplan @prd.md
382
+ → Creates: page-plan.md (login form content + components)
383
+
384
+ # 3. Setup Context
385
+ /csetup auth-system
386
+
387
+ # 4. Implementation
388
+ /cdev auth-system
389
+ → Phase 1: uxui-frontend (login form, reads page-plan.md)
390
+ → Phase 2: backend (POST /api/auth/login) + database (User model)
391
+ → Phase 2.5: integration (validate contract)
392
+ → Phase 3: frontend (connect form to API)
393
+ → Phase 4: test-debug (E2E tests)
394
+
395
+ # 5. Monitor
396
+ /cview auth-system
397
+ ```
398
+
399
+ ---
215
400
 
216
- ### Task 2.2: Connect Form to API (Frontend Agent)
217
- - Replace mock data with fetch('/api/auth/login')
218
- - Handle loading state
219
- - Handle error messages
401
+ ## 📁 Project Structure After Init
220
402
 
221
- ### Task 2.3: Add State Management (Frontend Agent)
222
- - Zustand store for auth state
223
- - Store JWT token in localStorage
224
- - Add logout action
403
+ ```
404
+ your-project/
405
+ ├── openspec/
406
+ │ ├── specs/ # Source of truth (OpenSpec)
407
+ │ └── changes/
408
+ │ └── landing-page/
409
+ │ ├── proposal.md ← OpenSpec generates
410
+ │ ├── tasks.md ← OpenSpec generates
411
+ │ ├── page-plan.md ← /pageplan generates (UI tasks)
412
+ │ ├── workflow.md ← /csetup generates
413
+ │ └── flags.json ← /cdev tracks progress
414
+
415
+ ├── design-system/
416
+ │ └── STYLE_GUIDE.md ← /designsetup generates
417
+
418
+ └── .claude/
419
+ ├── CLAUDE.md # Navigation guide
420
+
421
+ ├── agents/ # 6 specialized agents
422
+ │ ├── 01-integration.md
423
+ │ ├── 02-uxui-frontend.md
424
+ │ ├── 03-test-debug.md
425
+ │ ├── 04-frontend.md
426
+ │ ├── 05-backend.md
427
+ │ └── 06-database.md
428
+
429
+ ├── commands/ # Slash commands
430
+ │ ├── designsetup.md # Generate style guide
431
+ │ ├── pageplan.md # Generate page plan (NEW!)
432
+ │ ├── psetup.md # Project setup
433
+ │ ├── csetup.md # Change setup
434
+ │ ├── cdev.md # Change development
435
+ │ ├── cview.md # View progress
436
+ │ └── cstatus.md # Quick status
437
+
438
+ ├── contexts/
439
+ │ ├── design/ # Design foundation
440
+ │ ├── patterns/ # Universal patterns
441
+ │ └── domain/ # Project context
442
+
443
+ └── lib/ # Implementation logic
444
+ ├── agent-executor.md
445
+ ├── tdd-classifier.md
446
+ ├── flags-updater.md
447
+ └── agent-router.md
448
+ ```
225
449
 
226
450
  ---
227
451
 
228
- ## Phase 3: Scale (Full Auth Flow)
452
+ ## 🎯 Why Use Claude Agent Kit?
229
453
 
230
- ### Task 3.1: Database Schema (Database Agent)
231
- ```prisma
232
- model User {
233
- id String @id @default(uuid())
234
- email String @unique
235
- password String // bcrypt hash
236
- name String?
237
- createdAt DateTime @default(now())
238
- }
239
- ```
454
+ ### Without Claude Agent Kit (Manual Implementation)
240
455
 
241
- ### Task 3.2: Password Hashing (Backend Agent)
242
- - Install bcrypt
243
- - Hash password before saving
244
- - Compare hash during login
456
+ ```
457
+ You manually interpret tasks.md
458
+ You context-switch between frontend/backend/database
459
+ You might forget edge cases or tests
460
+ ❌ Inconsistent code patterns across features
461
+ ❌ No systematic error handling
462
+ ❌ Duplicate components everywhere
463
+ ❌ Lorem ipsum content in UI
464
+ ```
245
465
 
246
- ### Task 3.3: JWT Generation (Backend Agent)
247
- - Install jsonwebtoken
248
- - Generate token with user.id payload
249
- - Set expiry (7 days)
466
+ ### With Claude Agent Kit
250
467
 
251
- ### Task 3.4: Protected Routes (Frontend Agent)
252
- - Create middleware to check JWT
253
- - Redirect to /login if not authenticated
468
+ ```
469
+ Agents auto-classify and execute tasks
470
+ Each agent focuses on its specialty
471
+ ✅ Built-in validation gates (integration agent)
472
+ ✅ Consistent patterns via auto-discovery
473
+ ✅ Automatic retry with escalation
474
+ ✅ Component reuse plan (/pageplan)
475
+ ✅ Real content from PRD
476
+ ✅ 25% faster UI implementation
477
+ ```
254
478
 
255
479
  ---
256
480
 
257
- ## Phase 4: Deploy (Production Ready)
481
+ ## 📚 Key Features
258
482
 
259
- ### Task 4.1: Error Handling (Backend Agent)
260
- - Add try-catch to all API routes
261
- - Return proper HTTP status codes
262
- - Log all errors with logger.error()
483
+ ### Seamless OpenSpec Integration
263
484
 
264
- ### Task 4.2: Integration Tests (Test-Debug Agent)
265
- - Test complete login flow (form → API → database)
266
- - Test error cases (wrong password, user not found)
485
+ - Reads `proposal.md` for business context
486
+ - Parses `tasks.md` for implementation checklist
487
+ - Generates `page-plan.md` for UI tasks (NEW!)
488
+ - Tracks progress in `flags.json`
489
+ - Updates completion status back to OpenSpec
267
490
 
268
- ### Task 4.3: Security Review (Backend Agent)
269
- - Add rate limiting (max 5 login attempts/minute)
270
- - Add CORS configuration
271
- - Add input sanitization
491
+ ### Auto-Generated Best Practices
272
492
 
273
- ### Task 4.4: Documentation (Orchestrator)
274
- - API documentation (endpoints, request/response)
275
- - Setup instructions (environment variables)
493
+ Uses Context7 MCP to fetch latest framework docs:
494
+
495
+ ```bash
496
+ /psetup
497
+ # → Detects: Next.js 15, React 18, Prisma 6
498
+ # → Generates: .claude/contexts/domain/{project}/best-practices/
499
+ # - nextjs-15.md
500
+ # - react-18.md
501
+ # - prisma-6.md
276
502
  ```
277
503
 
278
- **วิธีใช้:**
504
+ ### ✅ 3-Level Project Indexing
279
505
 
280
- ```bash
281
- /agents orchestrator
282
- "Execute tasks.md"
506
+ Agents auto-discover context:
507
+
508
+ ```
509
+ 1. Read: domain/index.md → Get current project
510
+ 2. Read: domain/{project}/README.md → Get tech stack
511
+ 3. Read: domain/{project}/best-practices/index.md → Load patterns
283
512
  ```
284
513
 
285
- **Orchestrator จะ:**
286
- 1. อ่าน tasks.md ทั้งหมด
287
- 2. ตรวจสอบ tech stack (Next.js 15, Prisma)
288
- 3. ดึง docs จาก Context7
289
- 4. ทำงาน Phase 1 → รอ approval → Phase 2 → Phase 3 → Phase 4
290
- 5. หยุดรอที่ "Human Approval ✋" (Task 1.3, 2.3, etc.)
514
+ ### ✅ Design Foundation
515
+
516
+ Universal design principles:
517
+ - Color theory (WCAG AAA contrast)
518
+ - Typography scales
519
+ - 8px spacing grid (8, 16, 24, 32, 40, 48px)
520
+ - 4-level shadow system
521
+ - Box thinking framework
522
+ - Accessibility (WCAG 2.1 AA)
523
+
524
+ ### ✅ Quality Gates
525
+
526
+ - **TDD for critical paths** (auth, payments, data transforms)
527
+ - **Test-alongside for simple code** (CRUD, UI components)
528
+ - **Max 3-4 retry iterations** before escalation
529
+ - **Integration validation** before connecting UI to API
291
530
 
292
531
  ---
293
532
 
294
- #### 🔄 Step 6: ใช้งานต่อเนื่อง
533
+ ## 🔧 CLI Commands
295
534
 
296
- **เพิ่ม Feature ใหม่:**
297
- ```bash
298
- /agents orchestrator
299
- "สร้าง user profile page - ให้แก้ไขชื่อ/อีเมลได้"
300
- ```
535
+ ### `cak init`
536
+ Initialize agent system in current project
301
537
 
302
- **แก้ Bug:**
303
538
  ```bash
304
- /agents test-debug
305
- "Login form ไม่แสดง error message เมื่อ password ผิด"
539
+ cak init
540
+ cak init --force # Overwrite existing .claude/
306
541
  ```
307
542
 
308
- **Refactor Code:**
543
+ **Creates:**
544
+ - `.claude/` folder with 6 agents
545
+ - Slash commands (`/psetup`, `/csetup`, `/cdev`, etc.)
546
+ - Universal patterns & design foundation
547
+
548
+ ---
549
+
550
+ ### `cak update`
551
+ Update to latest agent templates
552
+
309
553
  ```bash
310
- /agents backend
311
- "Refactor /api/auth/login - แยก validation logic ออกมา"
554
+ cak update
555
+ cak update --backup # Create .claude.backup/ first
312
556
  ```
313
557
 
558
+ **What it does:**
559
+ - Updates all template files to latest version
560
+ - Preserves your customizations in `domain/`
561
+ - Creates backup before updating (with `--backup` flag)
562
+
314
563
  ---
315
564
 
316
- #### 📚 Step 7: เรียนรู้เพิ่มเติม
565
+ ### `cak --version`
566
+ Show version number
317
567
 
318
- **อ่าน navigation guide:**
319
568
  ```bash
320
- cat .claude/CLAUDE.md
569
+ cak --version
570
+ # → 1.0.0
321
571
  ```
322
572
 
323
- **ดู agent ทั้งหมด:**
573
+ ---
574
+
575
+ ### `cak --help`
576
+ Display help information
577
+
324
578
  ```bash
325
- ls .claude/agents/
579
+ cak --help
326
580
  ```
327
581
 
328
- **ดู universal patterns:**
582
+ ---
583
+
584
+ ## 🔄 Workflow Commands (in Claude Code)
585
+
586
+ ### `/designsetup` - Generate style guide (one-time)
587
+
329
588
  ```bash
330
- ls .claude/contexts/patterns/
331
- # - logging.md (structured JSON logging)
332
- # - testing.md (TDD, Red-Green-Refactor)
333
- # - error-handling.md (try-catch, retry, circuit breaker)
334
- # - task-breakdown.md (4-phase methodology)
589
+ /designsetup
335
590
  ```
336
591
 
337
- **ดู design foundation:**
592
+ **Auto-detects from:**
593
+ 1. `reference/` folder → Extract design from HTML/screenshots
594
+ 2. Existing codebase → Reverse engineer patterns
595
+ 3. AI generation → Modern best practices
596
+
597
+ **Creates:** `design-system/STYLE_GUIDE.md`
598
+
599
+ ---
600
+
601
+ ### `/pageplan` - Generate page plan (UI tasks only) 🆕
602
+
338
603
  ```bash
339
- ls .claude/contexts/design/
340
- # - box-thinking.md (layout analysis framework)
341
- # - accessibility.md (WCAG 2.1 AA compliance)
342
- # - color-theory.md, typography.md, spacing.md, etc.
604
+ /pageplan @prd.md @project_brief.md
343
605
  ```
344
606
 
607
+ **What it does:**
608
+ - Reads user-specified files (PRD, brief)
609
+ - Reads `proposal.md` + `STYLE_GUIDE.md`
610
+ - Searches existing components
611
+ - AI drafts real content from PRD
612
+ - Generates asset checklist
613
+
614
+ **Creates:** `page-plan.md`
615
+ - Component reuse plan (🔄 Reuse vs ✅ New)
616
+ - Page structure (component hierarchy)
617
+ - Assets to prepare (images, icons)
618
+ - Content draft (headlines, descriptions)
619
+
345
620
  ---
346
621
 
347
- ## 🤖 Agents
622
+ ### `/psetup` - Setup project (one-time)
348
623
 
349
- ### **Orchestrator** (Sonnet 4.5)
350
- Coordinates multi-step tasks, detects tech stack, delegates to specialists.
624
+ ```bash
625
+ /psetup
626
+ ```
351
627
 
352
- ### **UX-UI Frontend** (Haiku 4.5)
353
- Creates components with mock data, follows design foundation.
628
+ **What it does:**
629
+ - Detects tech stack (Next.js, React, Prisma, etc.)
630
+ - Creates `domain/{project}/README.md`
631
+ - Generates best practices via Context7 MCP
354
632
 
355
- ### **Test-Debug** (Haiku 4.5)
356
- Runs tests, fixes bugs automatically (max 3-4 iterations, then escalates).
633
+ ---
357
634
 
358
- ### **Frontend** (Haiku 4.5)
359
- Connects components to real APIs, implements state management.
635
+ ### `/csetup {change-id}` - Setup change context
360
636
 
361
- ### **Backend** (Haiku 4.5)
362
- Builds API endpoints with validation (FastAPI, Express, Next.js API Routes).
637
+ ```bash
638
+ /csetup landing-page
639
+ ```
363
640
 
364
- ### **Database** (Haiku 4.5)
365
- Designs schemas, writes migrations (Prisma, SQLAlchemy, TypeORM).
641
+ **What it does:**
642
+ - Reads `proposal.md` (business context)
643
+ - Reads `tasks.md` (implementation checklist)
644
+ - Reads `page-plan.md` (if exists - UI content plan)
645
+ - Classifies tasks by agent
646
+ - Generates `workflow.md` (execution plan)
366
647
 
367
648
  ---
368
649
 
369
- ## 📁 Structure
650
+ ### `/cdev {change-id}` - Execute implementation
370
651
 
652
+ ```bash
653
+ /cdev landing-page
371
654
  ```
372
- .claude/
373
- ├── CLAUDE.md # Navigation guide
374
- ├── agents/ # 6 agents (Orchestrator + 5 specialists)
375
- │ ├── 01-orchestrator.md
376
- │ ├── 02-uxui-frontend.md
377
- │ ├── 03-test-debug.md
378
- │ ├── 04-frontend.md
379
- │ ├── 05-backend.md
380
- │ └── 06-database.md
381
-
382
- └── contexts/
383
- ├── patterns/ # Universal patterns (static)
384
- │ ├── logging.md
385
- │ ├── testing.md
386
- │ ├── error-handling.md
387
- │ ├── task-breakdown.md
388
- │ ├── development-principles.md
389
- │ ├── code-standards.md
390
- │ # REMOVED - Use Context7 MCP instead
391
- │ # REMOVED - Use Context7 MCP instead
392
- │ # REMOVED - Optional (OpenSpec, BMAD, SpecKit)
393
-
394
- ├── design/ # Design foundation (static)
395
- │ ├── index.md
396
- │ ├── color-theory.md
397
- │ ├── typography.md
398
- │ ├── spacing.md
399
- │ ├── shadows.md
400
- │ ├── layout.md
401
- │ ├── responsive.md
402
- │ ├── box-thinking.md
403
- │ └── accessibility.md
404
-
405
- └── domain/ # Project-specific (you create)
406
- └── README.md
407
- ```
655
+
656
+ **What it does:**
657
+ - Runs agents in phases (1 2 → 2.5 → 3 → 4)
658
+ - uxui-frontend auto-reads `page-plan.md` (STEP 0.5)
659
+ - Updates `flags.json` (progress tracking)
660
+ - Reports completion status
408
661
 
409
662
  ---
410
663
 
411
- ## 🎨 Design System
664
+ ### `/cview {change-id}` - View detailed progress
412
665
 
413
- Template includes **universal design foundation**:
666
+ ```bash
667
+ /cview landing-page
668
+ ```
414
669
 
415
- - **Color Theory** - Harmony, WCAG AAA contrast, shade generation
416
- - **Typography** - Font scales, hierarchy, readability
417
- - **Spacing** - 8px grid system
418
- - **Shadows** - 4-level elevation system
419
- - **Layout** - Grid, flexbox, responsive patterns
420
- - **Accessibility** - ARIA, keyboard nav, screen readers
670
+ **Shows:**
671
+ - Completed/pending tasks
672
+ - Agent activity log
673
+ - Current phase
674
+ - Error messages (if any)
421
675
 
422
- **Project-specific colors:** Define in `.claude/contexts/domain/{project}/design-tokens.md`
676
+ ---
677
+
678
+ ### `/cstatus {change-id}` - Quick status
679
+
680
+ ```bash
681
+ /cstatus landing-page
682
+ # → Phase 2/4 - Backend Implementation (75%)
683
+ ```
423
684
 
424
685
  ---
425
686
 
426
- ## 🧪 Testing Philosophy
687
+ ## 🎨 Design System Integration
427
688
 
428
- ### TDD for Critical Paths (Required)
429
- - Business logic (calculations, transformations)
430
- - API endpoints (validation, error handling)
431
- - External service integrations
432
- - Data transformations
689
+ ### Auto-Generate Style Guide
433
690
 
434
- ### Test-Alongside for Simple Code
435
- - CRUD operations
436
- - UI components (presentational)
437
- - Configuration files
691
+ ```bash
692
+ /designsetup
693
+ ```
438
694
 
439
- **Test-Debug agent** runs tests automatically, fixes bugs (max 3-4 iterations).
695
+ **Detection priority:**
696
+ 1. **reference/ folder** (HTML/screenshots) → Extract design style
697
+ 2. **Existing codebase** (>10 components) → Reverse engineer patterns
698
+ 3. **AI generation** → Modern best practices
699
+
700
+ **Output:** `design-system/STYLE_GUIDE.md`
701
+
702
+ **17 Comprehensive Sections:**
703
+ 1. Overview
704
+ 2. Design Philosophy
705
+ 3. Color Palette (HEX codes, usage, Tailwind classes)
706
+ 4. Typography (headings, body, weights)
707
+ 5. Spacing System (4px/8px grid)
708
+ 6. Component Styles (Button, Card, Input, Badge, etc.)
709
+ 7. Shadows & Elevation
710
+ 8. Animations & Transitions
711
+ 9. Border Styles
712
+ 10. Border Radius
713
+ 11. Opacity & Transparency
714
+ 12. Z-Index Layers
715
+ 13. Responsive Breakpoints
716
+ 14. CSS Variables / Tailwind Theme (Design Tokens)
717
+ 15. Layout Patterns
718
+ 16. Example Component Reference (React + Tailwind code)
719
+ 17. Additional Sections (Best Practices, Accessibility, Icon System)
720
+
721
+ **Agents automatically use `STYLE_GUIDE.md` for:**
722
+ - Color palette (no hardcoded colors)
723
+ - Spacing scale (consistent gaps/padding)
724
+ - Typography (font hierarchy)
725
+ - Component patterns (reuse before create)
440
726
 
441
727
  ---
442
728
 
443
- ## 📊 Logging & Observability
729
+ ## 🧪 Testing Philosophy
444
730
 
445
- **Every significant action must be logged** (structured JSON):
731
+ **Agents follow TDD classification:**
446
732
 
447
- ```typescript
448
- logger.info('api_route_entry', { route, method, requestId })
449
- logger.info('db_operation_success', { operation, table, duration })
450
- logger.error('api_route_error', { route, error, stack, requestId })
451
- ```
733
+ | Code Type | Approach | Example |
734
+ |-----------|----------|---------|
735
+ | **Critical paths** | TDD (Red-Green-Refactor) | Auth logic, payments, calculations |
736
+ | **Simple code** | Test-alongside | CRUD, UI components, config |
452
737
 
453
- See: `.claude/contexts/patterns/logging.md`
738
+ **Test-debug agent:**
739
+ - Runs tests automatically after implementation
740
+ - Fixes bugs (max 3-4 iterations)
741
+ - Escalates if stuck (reports to user)
454
742
 
455
743
  ---
456
744
 
457
- ## 🔧 Tech Stack Support
745
+ ## 🔧 Supported Tech Stacks
458
746
 
459
- ### Automatically Detected via Context7
747
+ Agents auto-detect your stack via Context7 MCP:
460
748
 
461
749
  **Frontend:**
462
750
  - Next.js, React, Vue, Svelte, Angular
463
751
 
464
752
  **Backend:**
465
- - FastAPI, Express, NestJS, Django, Flask
753
+ - FastAPI, Express, NestJS, Django, Flask, Next.js API Routes
466
754
 
467
755
  **Database:**
468
756
  - Prisma, SQLAlchemy, TypeORM, Drizzle
@@ -470,49 +758,99 @@ See: `.claude/contexts/patterns/logging.md`
470
758
  **Testing:**
471
759
  - Vitest, Jest, Pytest, Playwright
472
760
 
473
- Agents search Context7 MCP for latest docs automatically.
761
+ ---
762
+
763
+ ## 📖 Usage Examples
764
+
765
+ ### Example 1: Simple UI Task (with /pageplan)
766
+
767
+ ```bash
768
+ # In Claude Code
769
+ "Build a user profile page with edit functionality"
770
+
771
+ # If it's a UI task, optionally run:
772
+ /pageplan @prd.md
773
+
774
+ # Then execute:
775
+ /csetup profile-page
776
+ /cdev profile-page
777
+ ```
778
+
779
+ Claude will:
780
+ 1. Read `task-classification.md`
781
+ 2. Select agents: `uxui-frontend` → `backend` → `frontend` → `test-debug`
782
+ 3. uxui-frontend reads `page-plan.md` (if exists)
783
+ 4. Execute in sequence
784
+ 5. Report completion
474
785
 
475
786
  ---
476
787
 
477
- ## 📖 Examples
788
+ ### Example 2: Complex Multi-Agent Workflow (OpenSpec)
478
789
 
479
- ### Example 1: Next.js + Prisma
790
+ Using OpenSpec workflow:
480
791
 
481
792
  ```bash
482
- # Your project
483
- package.json: { "dependencies": { "next": "15.5.0", "@prisma/client": "6.5.0" } }
793
+ # 1. OpenSpec generates proposal + tasks
794
+ "I want to add a dashboard with analytics"
795
+ # → proposal.md + tasks.md created
796
+
797
+ # 2. Generate page plan
798
+ /pageplan @prd.md @analytics_spec.md
799
+
800
+ # 3. Setup change context
801
+ /csetup analytics-dashboard
802
+
803
+ # 4. Start development
804
+ /cdev analytics-dashboard
484
805
 
485
- # Orchestrator detects:
486
- Frontend = Next.js 15
487
- Database = Prisma
488
- → Agents use Context7: Next.js App Router docs + Prisma docs
806
+ # 5. View progress
807
+ /cview analytics-dashboard
489
808
  ```
490
809
 
491
- ### Example 2: FastAPI + SQLAlchemy
810
+ This follows a structured 4-phase approach:
811
+ 1. **Phase 1:** UI with mock data (uxui-frontend reads page-plan.md)
812
+ 2. **Phase 2:** Real API + database (backend + database)
813
+ 3. **Phase 2.5:** Validate contracts (integration)
814
+ 4. **Phase 3:** Connect UI to API (frontend)
815
+ 5. **Phase 4:** Tests + bug fixes (test-debug)
816
+
817
+ ---
818
+
819
+ ## 🔄 Updating to Latest Version
820
+
821
+ ### Method 1: Update the npm package
492
822
 
493
823
  ```bash
494
- # Your project
495
- requirements.txt: fastapi, sqlalchemy
824
+ npm update -g @champpaba/claude-agent-kit
825
+ ```
826
+
827
+ ### Method 2: Update template in project
496
828
 
497
- # Orchestrator detects:
498
- Backend = FastAPI
499
- Database = SQLAlchemy
500
- → Agents use Context7: FastAPI docs + SQLAlchemy docs
829
+ ```bash
830
+ cd your-project
831
+ cak update --backup
501
832
  ```
502
833
 
834
+ This will:
835
+ - Create backup at `.claude.backup/`
836
+ - Update all template files
837
+ - Preserve your customizations in `domain/`
838
+
503
839
  ---
504
840
 
505
841
  ## 🎯 Customization
506
842
 
507
- ### Add Domain-Specific Context
843
+ ### Add Project-Specific Context
844
+
845
+ After running `cak init`, add your own context files:
508
846
 
509
847
  ```bash
510
- mkdir -p .claude/contexts/domain/myproject
848
+ mkdir -p .claude/contexts/domain/my-project
511
849
  ```
512
850
 
513
- Example (E-commerce):
851
+ **Example:** E-commerce checkout flow
514
852
  ```markdown
515
- <!-- .claude/contexts/domain/ecommerce/checkout-flow.md -->
853
+ <!-- .claude/contexts/domain/my-project/checkout-flow.md -->
516
854
  # Checkout Flow
517
855
 
518
856
  ## Steps
@@ -522,24 +860,34 @@ Example (E-commerce):
522
860
  4. Order confirmation
523
861
 
524
862
  ## Business Rules
525
- - Free shipping > $50
863
+ - Free shipping over $50
526
864
  - Tax calculation by state
527
865
  - Inventory check before payment
528
866
  ```
529
867
 
530
- Agents will load these patterns automatically.
868
+ Agents will auto-discover and use these patterns.
869
+
870
+ ---
871
+
872
+ ## 🔗 Ecosystem
873
+
874
+ **Claude Agent Kit works with:**
875
+
876
+ | Tool | Purpose | Integration |
877
+ |------|---------|-------------|
878
+ | **OpenSpec** | Spec-driven planning | Reads `proposal.md` + `tasks.md` |
879
+ | **Context7 MCP** | Always-updated docs | Auto-generates best practices |
880
+ | **Claude Code** | AI coding assistant | Execution environment |
531
881
 
532
882
  ---
533
883
 
534
884
  ## 🤝 Contributing
535
885
 
536
- This is a template repo. Fork and customize for your needs!
886
+ We welcome contributions!
537
887
 
538
- **Improvements welcome:**
539
- - Additional patterns (caching, rate limiting, etc.)
540
- - More design foundation content
541
- - Example projects
542
- - Documentation improvements
888
+ - Report bugs: [GitHub Issues](https://github.com/ChampPABA/claude-multi-agent-template/issues)
889
+ - Feature requests: [Discussions](https://github.com/ChampPABA/claude-multi-agent-template/discussions)
890
+ - Pull requests: Follow [CONTRIBUTING.md](CONTRIBUTING.md)
543
891
 
544
892
  ---
545
893
 
@@ -552,10 +900,89 @@ MIT License - see [LICENSE](LICENSE)
552
900
  ## 🙏 Credits
553
901
 
554
902
  Built with:
555
- - [Claude Code](https://claude.com/claude-code) - AI-powered coding assistant
556
- - [Context7 MCP](https://context7.com) - Always up-to-date library documentation
557
- - [OpenSpec](https://openspec.dev) - Spec-driven development framework (optional)
903
+ - [OpenSpec](https://github.com/Fission-AI/OpenSpec) - Spec-driven development framework
904
+ - [Claude Code](https://claude.com/claude-code) - AI coding assistant
905
+ - [Context7 MCP](https://context7.com) - Always up-to-date library docs
906
+
907
+ ---
908
+
909
+ ## 🔗 Links
910
+
911
+ - **npm Package:** https://www.npmjs.com/package/@champpaba/claude-agent-kit
912
+ - **GitHub:** https://github.com/ChampPABA/claude-multi-agent-template
913
+ - **OpenSpec:** https://github.com/Fission-AI/OpenSpec
914
+ - **Issues:** https://github.com/ChampPABA/claude-multi-agent-template/issues
915
+
916
+ ---
917
+
918
+ ## 💡 Quick Tips
919
+
920
+ 1. **Run `/designsetup` FIRST** - Ensures visual consistency from day 1
921
+ 2. **Use `/pageplan` for UI tasks** - 25% faster implementation, better content
922
+ 3. **Review `page-plan.md` before `/cdev`** - Edit content, prepare assets
923
+ 4. **Setup Context7 MCP** - Agents get latest framework docs automatically
924
+ 5. **Use OpenSpec for complex features** - Better alignment before implementation
925
+ 6. **Monitor with `/cview`** - See exactly what agents are doing
926
+ 7. **Always use `--backup` when updating** - Protects your customizations
558
927
 
559
928
  ---
560
929
 
561
- **Ready to build?** Clone this template and start creating! 🚀
930
+ ## 📋 Complete Flow Summary
931
+
932
+ ```
933
+ 1️⃣ OpenSpec Planning
934
+ → proposal.md + tasks.md
935
+
936
+ 2️⃣ Generate Style Guide (one-time)
937
+ /designsetup
938
+ → STYLE_GUIDE.md
939
+
940
+ 3️⃣ Setup Project (one-time)
941
+ /psetup
942
+ → domain/{project}/best-practices/
943
+
944
+ 4️⃣ Generate Page Plan (UI tasks only)
945
+ /pageplan @prd.md
946
+ → page-plan.md (content + component plan)
947
+
948
+ 5️⃣ Setup Change Context
949
+ /csetup {change-id}
950
+ → workflow.md
951
+
952
+ 6️⃣ Execute Implementation
953
+ /cdev {change-id}
954
+ → Working code + tests
955
+
956
+ 7️⃣ Monitor Progress
957
+ /cview {change-id}
958
+ → Detailed progress report
959
+
960
+ 8️⃣ OpenSpec Archive & Update
961
+ → Merge to specs/
962
+ ```
963
+
964
+ ---
965
+
966
+ **Ready to implement with confidence?** 🚀
967
+
968
+ ```bash
969
+ # Install globally
970
+ npm install -g @champpaba/claude-agent-kit
971
+
972
+ # Initialize in your project
973
+ cd your-project
974
+ cak init
975
+
976
+ # Setup project context
977
+ /psetup
978
+
979
+ # Generate style guide (optional but recommended)
980
+ /designsetup
981
+
982
+ # Start building (after OpenSpec planning)
983
+ /pageplan @prd.md # UI tasks only
984
+ /csetup your-feature
985
+ /cdev your-feature
986
+ ```
987
+
988
+ Let specialized agents handle implementation while you focus on specs and architecture!