@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.
- package/LICENSE +21 -0
- package/README.md +561 -0
- package/bin/cli.js +61 -0
- package/lib/init.js +52 -0
- package/lib/update.js +73 -0
- package/package.json +47 -0
- package/template/.claude/CHANGELOG-v1.1.1.md +259 -0
- package/template/.claude/CLAUDE.md +329 -0
- package/template/.claude/agents/01-integration.md +797 -0
- package/template/.claude/agents/02-uxui-frontend.md +899 -0
- package/template/.claude/agents/03-test-debug.md +759 -0
- package/template/.claude/agents/04-frontend.md +1099 -0
- package/template/.claude/agents/05-backend.md +1217 -0
- package/template/.claude/agents/06-database.md +969 -0
- package/template/.claude/commands/agentsetup.md +1464 -0
- package/template/.claude/commands/cdev.md +327 -0
- package/template/.claude/commands/csetup.md +447 -0
- package/template/.claude/commands/cstatus.md +60 -0
- package/template/.claude/commands/cview.md +364 -0
- package/template/.claude/commands/psetup.md +101 -0
- package/template/.claude/contexts/design/accessibility.md +611 -0
- package/template/.claude/contexts/design/box-thinking.md +553 -0
- package/template/.claude/contexts/design/color-theory.md +498 -0
- package/template/.claude/contexts/design/index.md +247 -0
- package/template/.claude/contexts/design/layout.md +400 -0
- package/template/.claude/contexts/design/responsive.md +551 -0
- package/template/.claude/contexts/design/shadows.md +522 -0
- package/template/.claude/contexts/design/spacing.md +428 -0
- package/template/.claude/contexts/design/typography.md +465 -0
- package/template/.claude/contexts/domain/README.md +164 -0
- package/template/.claude/contexts/patterns/agent-coordination.md +388 -0
- package/template/.claude/contexts/patterns/agent-discovery.md +182 -0
- package/template/.claude/contexts/patterns/change-workflow.md +538 -0
- package/template/.claude/contexts/patterns/code-standards.md +515 -0
- package/template/.claude/contexts/patterns/development-principles.md +513 -0
- package/template/.claude/contexts/patterns/error-handling.md +478 -0
- package/template/.claude/contexts/patterns/error-recovery.md +365 -0
- package/template/.claude/contexts/patterns/frontend-component-strategy.md +365 -0
- package/template/.claude/contexts/patterns/git-workflow.md +207 -0
- package/template/.claude/contexts/patterns/logging.md +424 -0
- package/template/.claude/contexts/patterns/task-breakdown.md +452 -0
- package/template/.claude/contexts/patterns/task-classification.md +523 -0
- package/template/.claude/contexts/patterns/tdd-classification.md +516 -0
- package/template/.claude/contexts/patterns/testing.md +413 -0
- package/template/.claude/contexts/patterns/ui-component-consistency.md +304 -0
- package/template/.claude/contexts/patterns/validation-framework.md +776 -0
- package/template/.claude/lib/README.md +39 -0
- package/template/.claude/lib/agent-executor.md +258 -0
- package/template/.claude/lib/agent-router.md +572 -0
- package/template/.claude/lib/flags-updater.md +469 -0
- package/template/.claude/lib/tdd-classifier.md +345 -0
- package/template/.claude/lib/validation-gates.md +484 -0
- package/template/.claude/settings.local.json +42 -0
- package/template/.claude/templates/context-template.md +45 -0
- package/template/.claude/templates/flags-template.json +42 -0
- package/template/.claude/templates/phase-templates.json +124 -0
- package/template/.claude/templates/phases-sections/accessibility-test.md +17 -0
- package/template/.claude/templates/phases-sections/api-design.md +37 -0
- package/template/.claude/templates/phases-sections/backend-tests.md +16 -0
- package/template/.claude/templates/phases-sections/backend.md +37 -0
- package/template/.claude/templates/phases-sections/business-logic-validation.md +16 -0
- package/template/.claude/templates/phases-sections/component-tests.md +17 -0
- package/template/.claude/templates/phases-sections/contract-backend.md +16 -0
- package/template/.claude/templates/phases-sections/contract-frontend.md +16 -0
- package/template/.claude/templates/phases-sections/database.md +35 -0
- package/template/.claude/templates/phases-sections/documentation.md +17 -0
- package/template/.claude/templates/phases-sections/e2e-tests.md +16 -0
- package/template/.claude/templates/phases-sections/fix-implementation.md +17 -0
- package/template/.claude/templates/phases-sections/frontend-integration.md +18 -0
- package/template/.claude/templates/phases-sections/frontend-mockup.md +123 -0
- package/template/.claude/templates/phases-sections/manual-flow-test.md +15 -0
- package/template/.claude/templates/phases-sections/manual-ux-test.md +16 -0
- package/template/.claude/templates/phases-sections/refactor-implementation.md +17 -0
- package/template/.claude/templates/phases-sections/refactor.md +16 -0
- package/template/.claude/templates/phases-sections/regression-tests.md +15 -0
- package/template/.claude/templates/phases-sections/report.md +16 -0
- package/template/.claude/templates/phases-sections/responsive-test.md +16 -0
- package/template/.claude/templates/phases-sections/script-implementation.md +43 -0
- package/template/.claude/templates/phases-sections/test-coverage.md +16 -0
- 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
|
+
[](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
|
+
};
|