@champpaba/claude-agent-kit 1.0.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 (80) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +561 -0
  3. package/bin/cli.js +61 -0
  4. package/lib/init.js +52 -0
  5. package/lib/update.js +73 -0
  6. package/package.json +47 -0
  7. package/template/.claude/CHANGELOG-v1.1.1.md +259 -0
  8. package/template/.claude/CLAUDE.md +329 -0
  9. package/template/.claude/agents/01-integration.md +797 -0
  10. package/template/.claude/agents/02-uxui-frontend.md +899 -0
  11. package/template/.claude/agents/03-test-debug.md +759 -0
  12. package/template/.claude/agents/04-frontend.md +1099 -0
  13. package/template/.claude/agents/05-backend.md +1217 -0
  14. package/template/.claude/agents/06-database.md +969 -0
  15. package/template/.claude/commands/agentsetup.md +1464 -0
  16. package/template/.claude/commands/cdev.md +327 -0
  17. package/template/.claude/commands/csetup.md +447 -0
  18. package/template/.claude/commands/cstatus.md +60 -0
  19. package/template/.claude/commands/cview.md +364 -0
  20. package/template/.claude/commands/psetup.md +101 -0
  21. package/template/.claude/contexts/design/accessibility.md +611 -0
  22. package/template/.claude/contexts/design/box-thinking.md +553 -0
  23. package/template/.claude/contexts/design/color-theory.md +498 -0
  24. package/template/.claude/contexts/design/index.md +247 -0
  25. package/template/.claude/contexts/design/layout.md +400 -0
  26. package/template/.claude/contexts/design/responsive.md +551 -0
  27. package/template/.claude/contexts/design/shadows.md +522 -0
  28. package/template/.claude/contexts/design/spacing.md +428 -0
  29. package/template/.claude/contexts/design/typography.md +465 -0
  30. package/template/.claude/contexts/domain/README.md +164 -0
  31. package/template/.claude/contexts/patterns/agent-coordination.md +388 -0
  32. package/template/.claude/contexts/patterns/agent-discovery.md +182 -0
  33. package/template/.claude/contexts/patterns/change-workflow.md +538 -0
  34. package/template/.claude/contexts/patterns/code-standards.md +515 -0
  35. package/template/.claude/contexts/patterns/development-principles.md +513 -0
  36. package/template/.claude/contexts/patterns/error-handling.md +478 -0
  37. package/template/.claude/contexts/patterns/error-recovery.md +365 -0
  38. package/template/.claude/contexts/patterns/frontend-component-strategy.md +365 -0
  39. package/template/.claude/contexts/patterns/git-workflow.md +207 -0
  40. package/template/.claude/contexts/patterns/logging.md +424 -0
  41. package/template/.claude/contexts/patterns/task-breakdown.md +452 -0
  42. package/template/.claude/contexts/patterns/task-classification.md +523 -0
  43. package/template/.claude/contexts/patterns/tdd-classification.md +516 -0
  44. package/template/.claude/contexts/patterns/testing.md +413 -0
  45. package/template/.claude/contexts/patterns/ui-component-consistency.md +304 -0
  46. package/template/.claude/contexts/patterns/validation-framework.md +776 -0
  47. package/template/.claude/lib/README.md +39 -0
  48. package/template/.claude/lib/agent-executor.md +258 -0
  49. package/template/.claude/lib/agent-router.md +572 -0
  50. package/template/.claude/lib/flags-updater.md +469 -0
  51. package/template/.claude/lib/tdd-classifier.md +345 -0
  52. package/template/.claude/lib/validation-gates.md +484 -0
  53. package/template/.claude/settings.local.json +42 -0
  54. package/template/.claude/templates/context-template.md +45 -0
  55. package/template/.claude/templates/flags-template.json +42 -0
  56. package/template/.claude/templates/phase-templates.json +124 -0
  57. package/template/.claude/templates/phases-sections/accessibility-test.md +17 -0
  58. package/template/.claude/templates/phases-sections/api-design.md +37 -0
  59. package/template/.claude/templates/phases-sections/backend-tests.md +16 -0
  60. package/template/.claude/templates/phases-sections/backend.md +37 -0
  61. package/template/.claude/templates/phases-sections/business-logic-validation.md +16 -0
  62. package/template/.claude/templates/phases-sections/component-tests.md +17 -0
  63. package/template/.claude/templates/phases-sections/contract-backend.md +16 -0
  64. package/template/.claude/templates/phases-sections/contract-frontend.md +16 -0
  65. package/template/.claude/templates/phases-sections/database.md +35 -0
  66. package/template/.claude/templates/phases-sections/documentation.md +17 -0
  67. package/template/.claude/templates/phases-sections/e2e-tests.md +16 -0
  68. package/template/.claude/templates/phases-sections/fix-implementation.md +17 -0
  69. package/template/.claude/templates/phases-sections/frontend-integration.md +18 -0
  70. package/template/.claude/templates/phases-sections/frontend-mockup.md +123 -0
  71. package/template/.claude/templates/phases-sections/manual-flow-test.md +15 -0
  72. package/template/.claude/templates/phases-sections/manual-ux-test.md +16 -0
  73. package/template/.claude/templates/phases-sections/refactor-implementation.md +17 -0
  74. package/template/.claude/templates/phases-sections/refactor.md +16 -0
  75. package/template/.claude/templates/phases-sections/regression-tests.md +15 -0
  76. package/template/.claude/templates/phases-sections/report.md +16 -0
  77. package/template/.claude/templates/phases-sections/responsive-test.md +16 -0
  78. package/template/.claude/templates/phases-sections/script-implementation.md +43 -0
  79. package/template/.claude/templates/phases-sections/test-coverage.md +16 -0
  80. package/template/.claude/templates/phases-sections/user-approval.md +14 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 ChampPABA
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,561 @@
1
+ # Claude Multi-Agent Template
2
+
3
+ > Reusable multi-agent system for spec-driven development with automatic Context7 integration.
4
+
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+
7
+ ---
8
+
9
+ ## šŸŽÆ What is this?
10
+
11
+ A **production-ready template** for building software with AI agents that:
12
+
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)
18
+
19
+ ---
20
+
21
+ ## šŸš€ Quick Start
22
+
23
+ ### ąø”ąø²ąø–ąø¶ąø‡ąø›ąøøą¹Šąøš ต้องทำอะไร? (Step-by-Step)
24
+
25
+ #### šŸ“„ Step 1: Clone Template (1 นาที)
26
+
27
+ ```bash
28
+ # Clone template ดา
29
+ git clone https://github.com/anongecko/claude-multi-agent-template.git my-project
30
+ cd my-project
31
+
32
+ # คบ .git เดณด ą¹ąø„ą¹‰ąø§ąøŖąø£ą¹‰ąø²ąø‡ą¹ƒąø«ąø”ą¹ˆ
33
+ rm -rf .git
34
+ git init
35
+ git add .
36
+ git commit -m "Initial commit from template"
37
+ ```
38
+
39
+ ---
40
+
41
+ #### šŸ”Œ Step 2: Setup Context7 MCP (2 นาที)
42
+
43
+ **ทำไดต้องดี?** ą¹ƒąø«ą¹‰ AI ąø«ąø² docs ąø„ą¹ˆąø²ąøŖąøøąø”ąø‚ąø­ąø‡ framework ą¹ƒąø«ą¹‰ą¹€ąø­ąø‡ (Next.js, FastAPI, Vue, etc.)
44
+
45
+ **ąø§ąø“ąø˜ąøµąø•ąø“ąø”ąø•ąø±ą¹‰ąø‡:**
46
+
47
+ 1. เปณด Claude Code Settings → MCP Servers
48
+ 2. ą¹€ąøžąø“ą¹ˆąø” config นี้:
49
+
50
+ ```json
51
+ {
52
+ "mcpServers": {
53
+ "context7": {
54
+ "command": "npx",
55
+ "args": ["-y", "@context7/mcp"]
56
+ }
57
+ }
58
+ }
59
+ ```
60
+
61
+ 3. Restart Claude Code
62
+ 4. ą¹€ąøŠą¹‡ąø„ąø§ą¹ˆąø²ą¹ƒąøŠą¹‰ąø‡ąø²ąø™ą¹„ąø”ą¹‰: ąøžąø“ąø”ąøžą¹Œ `/mcp` ดู list → ต้องดี `context7`
63
+
64
+ ---
65
+
66
+ #### ⚔ Step 3: Auto-Setup Tech Stack (30 วณนาที)
67
+
68
+ **ą¹ƒąøŠą¹‰ `/agentsetup` command:**
69
+
70
+ ```bash
71
+ /agentsetup
72
+ ```
73
+
74
+ **Command ąøˆąø°ąø—ąø³ąø­ąø°ą¹„ąø£?**
75
+
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
81
+
82
+ - **Greenfield** (ą¹€ąø£ąø“ą¹ˆąø”ą¹ƒąø«ąø”ą¹ˆ):
83
+ - ąø–ąø²ąø”ąø§ą¹ˆąø²ąøˆąø°ą¹ƒąøŠą¹‰ stack อะไร (Next.js? FastAPI? Django?)
84
+ - ąø–ąø²ąø”ąø•ą¹ˆąø­: Database ORM? Testing framework?
85
+ - ดึง docs จาก Context7
86
+
87
+ **2. ąøŖąø£ą¹‰ąø²ąø‡ą¹„ąøŸąø„ą¹Œ Domain Context:**
88
+ ```
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 ดี)
94
+ ```
95
+
96
+ **ąø•ąø±ąø§ąø­ąø¢ą¹ˆąø²ąø‡ Output:**
97
+ ```
98
+ āœ… Agent Setup Complete!
99
+
100
+ šŸ“¦ Project Type: Brownfield
101
+
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
107
+
108
+ šŸ“ Domain Context Created:
109
+ - .claude/contexts/domain/myproject/tech-stack.md
110
+
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)
115
+
116
+ šŸš€ Ready to start!
117
+ ```
118
+
119
+ **หดายเหตุ:** ąø–ą¹‰ąø²ą¹„ąø”ą¹ˆąø£ąø¹ą¹‰ąøˆąø°ą¹ƒąøŠą¹‰ stack อะไร ą¹ƒąø«ą¹‰ąø‚ą¹‰ąø²ąø” step ąø™ąøµą¹‰ą¹„ąø›ąøą¹ˆąø­ąø™ ą¹ąø„ą¹‰ąø§ąø„ą¹ˆąø­ąø¢ąøąø„ąø±ąøšąø”ąø²ąø£ąø±ąø™ `/agentsetup` ทีหคัง
120
+
121
+ ---
122
+
123
+ #### šŸŽØ Step 4: (Optional) กำหนดสี Design Tokens (5 นาที)
124
+
125
+ ąø–ą¹‰ąø²ą¹‚ąø›ąø£ą¹€ąøˆąø„ąø”ąøµąøŖąøµą¹€ąø‰ąøžąø²ąø° ą¹€ąøŠą¹ˆąø™ brand colors:
126
+
127
+ ```bash
128
+ mkdir -p .claude/contexts/domain/myproject
129
+ ```
130
+
131
+ ąøŖąø£ą¹‰ąø²ąø‡ą¹„ąøŸąø„ą¹Œ `.claude/contexts/domain/myproject/design-tokens.md`:
132
+
133
+ ```markdown
134
+ # MyProject Design Tokens
135
+
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)
140
+
141
+ ## Usage
142
+ - Primary: CTA buttons, links, brand elements
143
+ - Secondary: Headers, navigation
144
+ - Accent: Success messages, completed states
145
+ ```
146
+
147
+ **หดายเหตุ:** ąø–ą¹‰ąø²ą¹„ąø”ą¹ˆąøąø³ąø«ąø™ąø”ą¹€ąø­ąø‡ AI ąøˆąø°ą¹ƒąøŠą¹‰ design foundation จาก `.claude/contexts/design/` (ąøŖąøµąø—ąø±ą¹ˆąø§ą¹„ąø›)
148
+
149
+ ---
150
+
151
+ #### šŸ—ļø Step 5: ą¹€ąø£ąø“ą¹ˆąø”ąø—ąø³ąø‡ąø²ąø™ - เคือก 1 ą¹ƒąø™ 2 วณธี
152
+
153
+ ### **ąø§ąø“ąø˜ąøµąø—ąøµą¹ˆ 1: ąøŖąø±ą¹ˆąø‡ąø•ąø£ąø‡ą¹† (Simple, Ad-hoc)**
154
+
155
+ ```bash
156
+ # เปณด Orchestrator
157
+ /agents orchestrator
158
+
159
+ # ąøŖąø±ą¹ˆąø‡ąø‡ąø²ąø™
160
+ "สร้าง login form ą¹ƒąøŠą¹‰ Next.js + Prisma"
161
+ ```
162
+
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
172
+
173
+ ---
174
+
175
+ ### **ąø§ąø“ąø˜ąøµąø—ąøµą¹ˆ 2: ą¹ƒąøŠą¹‰ tasks.md (Structured, Complex Projects)**
176
+
177
+ ąøŖąø£ą¹‰ąø²ąø‡ą¹„ąøŸąø„ą¹Œ `tasks.md`:
178
+
179
+ ```markdown
180
+ # Feature: User Authentication
181
+
182
+ ## Tech Stack
183
+ - Frontend: Next.js 15 App Router
184
+ - Backend: Next.js API Routes
185
+ - Database: Prisma + PostgreSQL
186
+ - Testing: Vitest
187
+
188
+ ---
189
+
190
+ ## Phase 1: MVT (Minimum Viable Test)
191
+ **Goal:** 1 user สาดารถ login ได้
192
+
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' }`
198
+
199
+ ### Task 1.2: Write Unit Tests (Test-Debug Agent)
200
+ - Test form validation (empty fields, invalid email)
201
+ - Test mock login flow
202
+
203
+ ### Task 1.3: Human Approval āœ‹
204
+ **STOP** - User tests manually, approves before Phase 2
205
+
206
+ ---
207
+
208
+ ## Phase 2: Complexity (Add Real API)
209
+ **Goal:** Connect form to real backend
210
+
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
215
+
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
220
+
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
225
+
226
+ ---
227
+
228
+ ## Phase 3: Scale (Full Auth Flow)
229
+
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
+ ```
240
+
241
+ ### Task 3.2: Password Hashing (Backend Agent)
242
+ - Install bcrypt
243
+ - Hash password before saving
244
+ - Compare hash during login
245
+
246
+ ### Task 3.3: JWT Generation (Backend Agent)
247
+ - Install jsonwebtoken
248
+ - Generate token with user.id payload
249
+ - Set expiry (7 days)
250
+
251
+ ### Task 3.4: Protected Routes (Frontend Agent)
252
+ - Create middleware to check JWT
253
+ - Redirect to /login if not authenticated
254
+
255
+ ---
256
+
257
+ ## Phase 4: Deploy (Production Ready)
258
+
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()
263
+
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)
267
+
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
272
+
273
+ ### Task 4.4: Documentation (Orchestrator)
274
+ - API documentation (endpoints, request/response)
275
+ - Setup instructions (environment variables)
276
+ ```
277
+
278
+ **ąø§ąø“ąø˜ąøµą¹ƒąøŠą¹‰:**
279
+
280
+ ```bash
281
+ /agents orchestrator
282
+ "Execute tasks.md"
283
+ ```
284
+
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.)
291
+
292
+ ---
293
+
294
+ #### šŸ”„ Step 6: ą¹ƒąøŠą¹‰ąø‡ąø²ąø™ąø•ą¹ˆąø­ą¹€ąø™ąø·ą¹ˆąø­ąø‡
295
+
296
+ **ą¹€ąøžąø“ą¹ˆąø” Feature ใหด่:**
297
+ ```bash
298
+ /agents orchestrator
299
+ "สร้าง user profile page - ą¹ƒąø«ą¹‰ą¹ąøą¹‰ą¹„ąø‚ąøŠąø·ą¹ˆąø­/อีเดคได้"
300
+ ```
301
+
302
+ **แก้ Bug:**
303
+ ```bash
304
+ /agents test-debug
305
+ "Login form ą¹„ąø”ą¹ˆą¹ąøŖąø”ąø‡ error message ą¹€ąø”ąø·ą¹ˆąø­ password ąøœąø“ąø”"
306
+ ```
307
+
308
+ **Refactor Code:**
309
+ ```bash
310
+ /agents backend
311
+ "Refactor /api/auth/login - แยก validation logic ออกดา"
312
+ ```
313
+
314
+ ---
315
+
316
+ #### šŸ“š Step 7: ą¹€ąø£ąøµąø¢ąø™ąø£ąø¹ą¹‰ą¹€ąøžąø“ą¹ˆąø”ą¹€ąø•ąø“ąø”
317
+
318
+ **ąø­ą¹ˆąø²ąø™ navigation guide:**
319
+ ```bash
320
+ cat .claude/CLAUDE.md
321
+ ```
322
+
323
+ **ดู agent ทั้งหดด:**
324
+ ```bash
325
+ ls .claude/agents/
326
+ ```
327
+
328
+ **ดู universal patterns:**
329
+ ```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)
335
+ ```
336
+
337
+ **ดู design foundation:**
338
+ ```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.
343
+ ```
344
+
345
+ ---
346
+
347
+ ## šŸ¤– Agents
348
+
349
+ ### **Orchestrator** (Sonnet 4.5)
350
+ Coordinates multi-step tasks, detects tech stack, delegates to specialists.
351
+
352
+ ### **UX-UI Frontend** (Haiku 4.5)
353
+ Creates components with mock data, follows design foundation.
354
+
355
+ ### **Test-Debug** (Haiku 4.5)
356
+ Runs tests, fixes bugs automatically (max 3-4 iterations, then escalates).
357
+
358
+ ### **Frontend** (Haiku 4.5)
359
+ Connects components to real APIs, implements state management.
360
+
361
+ ### **Backend** (Haiku 4.5)
362
+ Builds API endpoints with validation (FastAPI, Express, Next.js API Routes).
363
+
364
+ ### **Database** (Haiku 4.5)
365
+ Designs schemas, writes migrations (Prisma, SQLAlchemy, TypeORM).
366
+
367
+ ---
368
+
369
+ ## šŸ“ Structure
370
+
371
+ ```
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
+ ```
408
+
409
+ ---
410
+
411
+ ## šŸŽØ Design System
412
+
413
+ Template includes **universal design foundation**:
414
+
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
421
+
422
+ **Project-specific colors:** Define in `.claude/contexts/domain/{project}/design-tokens.md`
423
+
424
+ ---
425
+
426
+ ## 🧪 Testing Philosophy
427
+
428
+ ### TDD for Critical Paths (Required)
429
+ - Business logic (calculations, transformations)
430
+ - API endpoints (validation, error handling)
431
+ - External service integrations
432
+ - Data transformations
433
+
434
+ ### Test-Alongside for Simple Code
435
+ - CRUD operations
436
+ - UI components (presentational)
437
+ - Configuration files
438
+
439
+ **Test-Debug agent** runs tests automatically, fixes bugs (max 3-4 iterations).
440
+
441
+ ---
442
+
443
+ ## šŸ“Š Logging & Observability
444
+
445
+ **Every significant action must be logged** (structured JSON):
446
+
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
+ ```
452
+
453
+ See: `.claude/contexts/patterns/logging.md`
454
+
455
+ ---
456
+
457
+ ## šŸ”§ Tech Stack Support
458
+
459
+ ### Automatically Detected via Context7
460
+
461
+ **Frontend:**
462
+ - Next.js, React, Vue, Svelte, Angular
463
+
464
+ **Backend:**
465
+ - FastAPI, Express, NestJS, Django, Flask
466
+
467
+ **Database:**
468
+ - Prisma, SQLAlchemy, TypeORM, Drizzle
469
+
470
+ **Testing:**
471
+ - Vitest, Jest, Pytest, Playwright
472
+
473
+ Agents search Context7 MCP for latest docs automatically.
474
+
475
+ ---
476
+
477
+ ## šŸ“– Examples
478
+
479
+ ### Example 1: Next.js + Prisma
480
+
481
+ ```bash
482
+ # Your project
483
+ package.json: { "dependencies": { "next": "15.5.0", "@prisma/client": "6.5.0" } }
484
+
485
+ # Orchestrator detects:
486
+ Frontend = Next.js 15
487
+ Database = Prisma
488
+ → Agents use Context7: Next.js App Router docs + Prisma docs
489
+ ```
490
+
491
+ ### Example 2: FastAPI + SQLAlchemy
492
+
493
+ ```bash
494
+ # Your project
495
+ requirements.txt: fastapi, sqlalchemy
496
+
497
+ # Orchestrator detects:
498
+ Backend = FastAPI
499
+ Database = SQLAlchemy
500
+ → Agents use Context7: FastAPI docs + SQLAlchemy docs
501
+ ```
502
+
503
+ ---
504
+
505
+ ## šŸŽÆ Customization
506
+
507
+ ### Add Domain-Specific Context
508
+
509
+ ```bash
510
+ mkdir -p .claude/contexts/domain/myproject
511
+ ```
512
+
513
+ Example (E-commerce):
514
+ ```markdown
515
+ <!-- .claude/contexts/domain/ecommerce/checkout-flow.md -->
516
+ # Checkout Flow
517
+
518
+ ## Steps
519
+ 1. Cart review
520
+ 2. Shipping address
521
+ 3. Payment method
522
+ 4. Order confirmation
523
+
524
+ ## Business Rules
525
+ - Free shipping > $50
526
+ - Tax calculation by state
527
+ - Inventory check before payment
528
+ ```
529
+
530
+ Agents will load these patterns automatically.
531
+
532
+ ---
533
+
534
+ ## šŸ¤ Contributing
535
+
536
+ This is a template repo. Fork and customize for your needs!
537
+
538
+ **Improvements welcome:**
539
+ - Additional patterns (caching, rate limiting, etc.)
540
+ - More design foundation content
541
+ - Example projects
542
+ - Documentation improvements
543
+
544
+ ---
545
+
546
+ ## šŸ“„ License
547
+
548
+ MIT License - see [LICENSE](LICENSE)
549
+
550
+ ---
551
+
552
+ ## šŸ™ Credits
553
+
554
+ 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)
558
+
559
+ ---
560
+
561
+ **Ready to build?** Clone this template and start creating! šŸš€
package/bin/cli.js ADDED
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Claude Agent Kit - CLI Entry Point
5
+ *
6
+ * This is the main CLI file that handles all commands:
7
+ * - cak init → Initialize template in current project
8
+ * - cak update → Update template to latest version
9
+ * - cak --version → Show version
10
+ * - cak --help → Show help
11
+ */
12
+
13
+ const { program } = require('commander');
14
+ const chalk = require('chalk');
15
+ const pkg = require('../package.json');
16
+
17
+ // Import command handlers
18
+ const initCommand = require('../lib/init');
19
+ const updateCommand = require('../lib/update');
20
+
21
+ // Configure CLI
22
+ program
23
+ .name('cak')
24
+ .description(chalk.cyan('šŸ¤– Claude Agent Kit - Universal Multi-Agent Template'))
25
+ .version(pkg.version, '-v, --version', 'Show version number');
26
+
27
+ // Command: cak init
28
+ program
29
+ .command('init')
30
+ .description('Initialize Claude Agent Kit template in current project')
31
+ .option('-f, --force', 'Force initialization even if .claude/ exists')
32
+ .action(async (options) => {
33
+ try {
34
+ await initCommand(options);
35
+ } catch (error) {
36
+ console.error(chalk.red('āŒ Error:'), error.message);
37
+ process.exit(1);
38
+ }
39
+ });
40
+
41
+ // Command: cak update
42
+ program
43
+ .command('update')
44
+ .description('Update template files to latest version')
45
+ .option('-b, --backup', 'Create backup before updating')
46
+ .action(async (options) => {
47
+ try {
48
+ await updateCommand(options);
49
+ } catch (error) {
50
+ console.error(chalk.red('āŒ Error:'), error.message);
51
+ process.exit(1);
52
+ }
53
+ });
54
+
55
+ // Show help if no command provided
56
+ if (!process.argv.slice(2).length) {
57
+ program.outputHelp();
58
+ }
59
+
60
+ // Parse command line arguments
61
+ program.parse(process.argv);
package/lib/init.js ADDED
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Init Command - Initialize Claude Agent Kit template
3
+ *
4
+ * This function copies the .claude/ template folder to the current project.
5
+ */
6
+
7
+ const fs = require('fs-extra');
8
+ const path = require('path');
9
+ const chalk = require('chalk');
10
+
11
+ module.exports = async function init(options = {}) {
12
+ const { force } = options;
13
+
14
+ // Paths
15
+ const templatePath = path.join(__dirname, '../template/.claude');
16
+ const targetPath = path.join(process.cwd(), '.claude');
17
+
18
+ console.log(chalk.cyan('\nšŸ¤– Claude Agent Kit - Initializing...\n'));
19
+
20
+ // Check if template exists
21
+ if (!fs.existsSync(templatePath)) {
22
+ throw new Error('Template folder not found. Please reinstall the package.');
23
+ }
24
+
25
+ // Check if .claude/ already exists
26
+ if (fs.existsSync(targetPath)) {
27
+ if (!force) {
28
+ console.log(chalk.yellow('āš ļø .claude/ already exists in this project.'));
29
+ console.log(chalk.gray(' Use --force to overwrite:\n'));
30
+ console.log(chalk.cyan(' cak init --force\n'));
31
+ return;
32
+ }
33
+
34
+ console.log(chalk.yellow('āš ļø Overwriting existing .claude/ folder...\n'));
35
+ await fs.remove(targetPath);
36
+ }
37
+
38
+ // Copy template
39
+ try {
40
+ await fs.copy(templatePath, targetPath);
41
+
42
+ console.log(chalk.green('āœ… Successfully initialized Claude Agent Kit!\n'));
43
+ console.log(chalk.white('šŸ“ Files copied to: ') + chalk.cyan(targetPath));
44
+ console.log(chalk.white('\nšŸ“š Next steps:\n'));
45
+ console.log(chalk.gray(' 1. Review the .claude/ folder'));
46
+ console.log(chalk.gray(' 2. Run: ') + chalk.cyan('/psetup') + chalk.gray(' (one-time project setup)'));
47
+ console.log(chalk.gray(' 3. Start using agents with Claude Code\n'));
48
+
49
+ } catch (error) {
50
+ throw new Error(`Failed to copy template: ${error.message}`);
51
+ }
52
+ };