@champpaba/claude-agent-kit 1.8.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/CLAUDE.md +189 -39
- package/.claude/agents/01-integration.md +106 -552
- package/.claude/agents/02-uxui-frontend.md +188 -850
- package/.claude/agents/03-test-debug.md +152 -521
- package/.claude/agents/04-frontend.md +169 -549
- package/.claude/agents/05-backend.md +132 -661
- package/.claude/agents/06-database.md +149 -698
- package/.claude/agents/_shared/README.md +57 -0
- package/.claude/agents/_shared/agent-boundaries.md +64 -0
- package/.claude/agents/_shared/documentation-policy.md +47 -0
- package/.claude/agents/_shared/package-manager.md +59 -0
- package/.claude/agents/_shared/pre-work-checklist.md +57 -0
- package/.claude/commands/cdev.md +36 -61
- package/.claude/commands/csetup.md +101 -39
- package/.claude/commands/designsetup.md +1402 -337
- package/.claude/commands/extract.md +520 -245
- package/.claude/commands/pageplan.md +6 -6
- package/.claude/contexts/design/box-thinking.md +1 -1
- package/.claude/contexts/design/index.md +1 -1
- package/.claude/contexts/patterns/agent-discovery.md +2 -2
- package/.claude/contexts/patterns/animation-patterns.md +1 -1
- package/.claude/contexts/patterns/change-workflow.md +8 -5
- package/.claude/contexts/patterns/code-standards.md +10 -8
- package/.claude/contexts/patterns/error-recovery.md +4 -4
- package/.claude/contexts/patterns/frontend-component-strategy.md +1 -1
- package/.claude/contexts/patterns/performance-optimization.md +1 -1
- package/.claude/contexts/patterns/task-breakdown.md +2 -2
- package/.claude/contexts/patterns/task-classification.md +2 -2
- package/.claude/contexts/patterns/ui-component-consistency.md +3 -3
- package/.claude/contexts/patterns/validation-framework.md +36 -33
- package/.claude/lib/README.md +4 -4
- package/.claude/lib/agent-executor.md +31 -40
- package/.claude/lib/agent-router.md +91 -213
- package/.claude/lib/context-loading-protocol.md +19 -36
- package/.claude/lib/detailed-guides/agent-system.md +43 -121
- package/.claude/lib/detailed-guides/taskmaster-analysis.md +1 -1
- package/.claude/lib/document-loader.md +22 -25
- package/.claude/lib/flags-updater.md +24 -32
- package/.claude/templates/STYLE_GUIDE.template.md +1 -1
- package/.claude/templates/design-context-template.md +1 -1
- package/.claude/templates/phases-sections/frontend-mockup.md +8 -5
- package/README.md +99 -40
- package/package.json +1 -1
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Agent Routing Protocol
|
|
2
2
|
|
|
3
|
-
> **
|
|
4
|
-
> **
|
|
5
|
-
> **
|
|
3
|
+
> **Purpose:** Route tasks to specialized agents for best results
|
|
4
|
+
> **Scope:** All tasks received from users
|
|
5
|
+
> **Version:** 2.0.0 (Claude 4.5 Optimized)
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## 🎯 Core Principle
|
|
10
10
|
|
|
11
|
-
**Main Claude
|
|
11
|
+
**Main Claude orchestrates, specialist agents implement.**
|
|
12
|
+
|
|
13
|
+
WHY: Specialist agents have domain-specific validation (design tokens, TDD patterns, error handling) that ensures higher quality output than general implementation.
|
|
12
14
|
|
|
13
15
|
```
|
|
14
16
|
Main Claude's Role:
|
|
@@ -19,21 +21,21 @@ Main Claude's Role:
|
|
|
19
21
|
✅ Report progress
|
|
20
22
|
✅ Coordinate between agents
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
Delegate to specialists:
|
|
25
|
+
→ UI work → uxui-frontend agent
|
|
26
|
+
→ API endpoints → backend agent
|
|
27
|
+
→ Database schemas → database agent
|
|
28
|
+
→ Tests/bugs → test-debug agent
|
|
29
|
+
→ API integration → frontend agent
|
|
28
30
|
```
|
|
29
31
|
|
|
30
32
|
---
|
|
31
33
|
|
|
32
|
-
##
|
|
34
|
+
## 📋 Routing Rules
|
|
33
35
|
|
|
34
|
-
### Rule 1: Detect Work Type
|
|
36
|
+
### Rule 1: Detect Work Type First
|
|
35
37
|
|
|
36
|
-
**Before
|
|
38
|
+
**Before starting work, determine the task type:**
|
|
37
39
|
|
|
38
40
|
```typescript
|
|
39
41
|
function routeTask(userRequest: string): AgentPlan {
|
|
@@ -48,7 +50,7 @@ function routeTask(userRequest: string): AgentPlan {
|
|
|
48
50
|
|
|
49
51
|
// 4. Validate match
|
|
50
52
|
if (agent === 'main-claude' && isImplementationWork(workType)) {
|
|
51
|
-
|
|
53
|
+
return { mustDelegate: true, reason: 'Implementation work routes to specialist' }
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
return {
|
|
@@ -223,182 +225,86 @@ function matchAgent(workType: string): string {
|
|
|
223
225
|
|
|
224
226
|
---
|
|
225
227
|
|
|
226
|
-
## 🚦 Pre-Work
|
|
228
|
+
## 🚦 Pre-Work Checklist
|
|
227
229
|
|
|
228
|
-
**
|
|
230
|
+
**Before starting work, complete this quick check:**
|
|
229
231
|
|
|
230
232
|
```markdown
|
|
231
|
-
## ✅
|
|
232
|
-
|
|
233
|
-
Before proceeding, Main Claude must answer:
|
|
233
|
+
## ✅ Task Routing Checklist
|
|
234
234
|
|
|
235
235
|
### Q1: What is the user requesting?
|
|
236
|
-
- [ ]
|
|
237
|
-
- [ ]
|
|
236
|
+
- [ ] Read request carefully
|
|
237
|
+
- [ ] Identify the end goal
|
|
238
238
|
|
|
239
239
|
### Q2: Is this implementation work?
|
|
240
|
-
- [ ] YES →
|
|
240
|
+
- [ ] YES → Route to specialist (see Q3)
|
|
241
241
|
- [ ] NO → Can proceed directly (planning/reading)
|
|
242
242
|
|
|
243
|
-
### Q3: Which
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
-
|
|
256
|
-
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
- [ ] Include all necessary context
|
|
261
|
-
- [ ] Wait for agent response
|
|
262
|
-
- [ ] Update flags.json after completion
|
|
263
|
-
|
|
264
|
-
**If I skip Q2-Q5 for implementation work, I am violating system protocol.**
|
|
243
|
+
### Q3: Which specialist handles this?
|
|
244
|
+
| Task Type | Agent |
|
|
245
|
+
|-----------|-------|
|
|
246
|
+
| UI components, layouts, design | uxui-frontend |
|
|
247
|
+
| API endpoints, business logic | backend |
|
|
248
|
+
| Schema, migrations, queries | database |
|
|
249
|
+
| API integration, state management | frontend |
|
|
250
|
+
| Testing, bug fixes | test-debug |
|
|
251
|
+
| Contract validation | integration |
|
|
252
|
+
| Planning, reading, orchestration | main-claude |
|
|
253
|
+
|
|
254
|
+
### Q4: Execute
|
|
255
|
+
- If specialist needed → Use Task tool with selected agent
|
|
256
|
+
- If main-claude work → Proceed directly
|
|
257
|
+
|
|
258
|
+
WHY this routing: Specialists have domain-specific validation
|
|
259
|
+
(design tokens, TDD patterns, error handling) that ensures quality.
|
|
265
260
|
```
|
|
266
261
|
|
|
267
262
|
---
|
|
268
263
|
|
|
269
|
-
##
|
|
264
|
+
## 📋 Task Routing Table
|
|
270
265
|
|
|
271
|
-
###
|
|
266
|
+
### Route to Specialists
|
|
272
267
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
-
|
|
280
|
-
|
|
281
|
-
❌ Backend Implementation:
|
|
282
|
-
- Create API routes/endpoints
|
|
283
|
-
- Write controller functions
|
|
284
|
-
- Add middleware
|
|
285
|
-
- Implement authentication logic
|
|
286
|
-
- Write business rules
|
|
287
|
-
|
|
288
|
-
❌ Database Implementation:
|
|
289
|
-
- Design database schemas
|
|
290
|
-
- Write Prisma/SQL migrations
|
|
291
|
-
- Create model definitions
|
|
292
|
-
- Write complex queries
|
|
293
|
-
- Add indexes or constraints
|
|
294
|
-
|
|
295
|
-
❌ Integration Implementation:
|
|
296
|
-
- Write fetch/axios calls
|
|
297
|
-
- Create state management stores
|
|
298
|
-
- Add loading/error states
|
|
299
|
-
- Connect UI to APIs
|
|
300
|
-
- Write data transformation logic
|
|
301
|
-
|
|
302
|
-
❌ Testing Implementation:
|
|
303
|
-
- Write test files
|
|
304
|
-
- Add test cases
|
|
305
|
-
- Debug failing tests
|
|
306
|
-
- Fix bugs in code
|
|
307
|
-
- Generate test coverage
|
|
308
|
-
|
|
309
|
-
**Penalty for violation:** System integrity compromised, user loses specialized agent benefits
|
|
310
|
-
```
|
|
268
|
+
| Task Type | Route To | WHY |
|
|
269
|
+
|-----------|----------|-----|
|
|
270
|
+
| UI/Frontend | uxui-frontend | Design system validation, component reuse checks |
|
|
271
|
+
| API endpoints | backend | TDD patterns, error handling, validation |
|
|
272
|
+
| Database | database | Schema validation, migration safety |
|
|
273
|
+
| API integration | frontend | State management patterns |
|
|
274
|
+
| Testing | test-debug | Iterative debugging, coverage |
|
|
311
275
|
|
|
312
|
-
|
|
276
|
+
### Main Claude Handles Directly
|
|
313
277
|
|
|
314
|
-
|
|
278
|
+
| Task Type | Examples |
|
|
279
|
+
|-----------|----------|
|
|
280
|
+
| Analysis | Read files, explain code, analyze structure |
|
|
281
|
+
| Planning | Break down tasks, create workflows |
|
|
282
|
+
| Orchestration | /cdev, /csetup, coordinate agents |
|
|
283
|
+
| Progress | Update flags.json, report status |
|
|
284
|
+
| User interaction | Ask questions, provide options |
|
|
315
285
|
|
|
316
|
-
|
|
317
|
-
✅ Analysis & Planning:
|
|
318
|
-
- Read files to understand codebase
|
|
319
|
-
- Analyze code structure
|
|
320
|
-
- Break down complex tasks
|
|
321
|
-
- Create workflow plans
|
|
322
|
-
- Explain how things work
|
|
323
|
-
|
|
324
|
-
✅ Orchestration:
|
|
325
|
-
- Execute /cdev, /csetup, /cview commands
|
|
326
|
-
- Invoke specialized agents via Task tool
|
|
327
|
-
- Update flags.json after agents complete
|
|
328
|
-
- Coordinate between multiple agents
|
|
329
|
-
- Handle agent retry and escalation
|
|
330
|
-
|
|
331
|
-
✅ Progress Tracking:
|
|
332
|
-
- Report progress to user
|
|
333
|
-
- Show files created/modified
|
|
334
|
-
- Display time tracking
|
|
335
|
-
- Show test results
|
|
336
|
-
- Summarize agent outputs
|
|
337
|
-
|
|
338
|
-
✅ User Interaction:
|
|
339
|
-
- Ask clarifying questions
|
|
340
|
-
- Provide options
|
|
341
|
-
- Wait for user input
|
|
342
|
-
- Explain system behavior
|
|
343
|
-
- Guide user through workflows
|
|
344
|
-
```
|
|
286
|
+
---
|
|
345
287
|
|
|
346
288
|
---
|
|
347
289
|
|
|
348
|
-
##
|
|
290
|
+
## 🔄 Quick Routing Flow
|
|
349
291
|
|
|
350
|
-
|
|
292
|
+
```
|
|
293
|
+
1. Parse → What is the user asking?
|
|
294
|
+
2. Classify → Is this implementation work?
|
|
295
|
+
3. Route → Which specialist handles this?
|
|
296
|
+
4. Execute → Task tool or proceed directly
|
|
297
|
+
5. Report → Show decision to user
|
|
298
|
+
```
|
|
351
299
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
### Step 2: Classify Work Type
|
|
362
|
-
- Run: detectWorkType(request)
|
|
363
|
-
- Result: [work-type]
|
|
364
|
-
|
|
365
|
-
### Step 3: Check if Implementation
|
|
366
|
-
- Is this implementation work? [YES/NO]
|
|
367
|
-
- If YES → MUST delegate
|
|
368
|
-
|
|
369
|
-
### Step 4: Select Agent
|
|
370
|
-
- Run: matchAgent(workType)
|
|
371
|
-
- Result: [agent-name]
|
|
372
|
-
- Reason: [why-this-agent]
|
|
373
|
-
|
|
374
|
-
### Step 5: Validate Can-Do
|
|
375
|
-
- Can Main Claude do this? [YES/NO]
|
|
376
|
-
- Check: WORK_PATTERNS[workType].canMainDo
|
|
377
|
-
- If NO → MUST delegate
|
|
378
|
-
|
|
379
|
-
### Step 6: Execute or Delegate
|
|
380
|
-
- If canMainDo === true:
|
|
381
|
-
→ Proceed directly
|
|
382
|
-
→ Example: Read files, explain code, plan workflow
|
|
383
|
-
|
|
384
|
-
- If canMainDo === false:
|
|
385
|
-
→ MUST invoke agent
|
|
386
|
-
→ Use Task tool
|
|
387
|
-
→ Wait for response
|
|
388
|
-
→ Update flags.json
|
|
389
|
-
|
|
390
|
-
### Step 7: Report Decision
|
|
391
|
-
- Output to user:
|
|
392
|
-
```
|
|
393
|
-
🔍 Task Analysis:
|
|
394
|
-
- Work type: [type]
|
|
395
|
-
- Requires: [agent] agent
|
|
396
|
-
- Reason: [explanation]
|
|
397
|
-
|
|
398
|
-
🚀 Invoking [agent] agent...
|
|
399
|
-
```
|
|
400
|
-
|
|
401
|
-
**If I skip this self-check for implementation work, I am NOT following protocol.**
|
|
300
|
+
**Output format:**
|
|
301
|
+
```
|
|
302
|
+
🔍 Task Analysis:
|
|
303
|
+
- Work type: [type]
|
|
304
|
+
- Routing to: [agent] agent
|
|
305
|
+
- Reason: [explanation]
|
|
306
|
+
|
|
307
|
+
🚀 Invoking [agent] agent...
|
|
402
308
|
```
|
|
403
309
|
|
|
404
310
|
---
|
|
@@ -510,63 +416,35 @@ Task(
|
|
|
510
416
|
|
|
511
417
|
---
|
|
512
418
|
|
|
513
|
-
##
|
|
419
|
+
## 💡 When User Asks to Skip Routing
|
|
514
420
|
|
|
515
|
-
|
|
421
|
+
If user requests direct implementation:
|
|
516
422
|
|
|
517
423
|
```markdown
|
|
518
|
-
User: "Just create the button
|
|
519
|
-
|
|
520
|
-
Main Claude Response:
|
|
521
|
-
"I understand you'd like me to create the button component directly, but I must delegate this to the uxui-frontend agent for the following reasons:
|
|
522
|
-
|
|
523
|
-
1. **Design Consistency:** The uxui-frontend agent enforces design system patterns (spacing, colors, shadows) that ensure visual consistency.
|
|
424
|
+
User: "Just create the button yourself, skip the agent"
|
|
524
425
|
|
|
525
|
-
|
|
426
|
+
Response:
|
|
427
|
+
"I'll route this to the uxui-frontend agent. Here's why this produces better results:
|
|
526
428
|
|
|
527
|
-
|
|
429
|
+
1. **Design Consistency** - Agent validates against design tokens
|
|
430
|
+
2. **Component Reuse** - Agent searches for existing components first
|
|
431
|
+
3. **Quality Checks** - Agent follows Box Thinking, spacing rules
|
|
528
432
|
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
[Proceeds to invoke uxui-frontend agent]
|
|
433
|
+
Invoking uxui-frontend agent now..."
|
|
532
434
|
```
|
|
533
435
|
|
|
534
|
-
**Exception:**
|
|
535
|
-
|
|
536
|
-
---
|
|
537
|
-
|
|
538
|
-
## 🔧 Integration with Other Systems
|
|
539
|
-
|
|
540
|
-
**This protocol is enforced by:**
|
|
541
|
-
- CLAUDE.md (top-level instructions)
|
|
542
|
-
- /cdev command (when executing phases)
|
|
543
|
-
- validation-gates.md (pre-work checks)
|
|
544
|
-
|
|
545
|
-
**This protocol depends on:**
|
|
546
|
-
- task-classification.md (agent selection guide)
|
|
547
|
-
- agent-executor.md (retry and validation)
|
|
548
|
-
- flags-updater.md (progress tracking)
|
|
436
|
+
**Exception:** User explicitly confirms "this is a test/demo" → proceed with note
|
|
549
437
|
|
|
550
438
|
---
|
|
551
439
|
|
|
552
|
-
##
|
|
553
|
-
|
|
554
|
-
After implementing this protocol, you should see:
|
|
555
|
-
|
|
556
|
-
1. **95%+ Delegation Rate**
|
|
557
|
-
- Implementation work always delegated
|
|
558
|
-
- Only planning/reading done by Main Claude
|
|
559
|
-
|
|
560
|
-
2. **Zero Boundary Violations**
|
|
561
|
-
- Main Claude never writes components
|
|
562
|
-
- Main Claude never creates endpoints
|
|
563
|
-
- Main Claude never designs schemas
|
|
440
|
+
## 🔗 Related Files
|
|
564
441
|
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
442
|
+
| File | Purpose |
|
|
443
|
+
|------|---------|
|
|
444
|
+
| `task-classification.md` | Agent selection guide |
|
|
445
|
+
| `agent-executor.md` | Retry and validation |
|
|
446
|
+
| `flags-updater.md` | Progress tracking |
|
|
569
447
|
|
|
570
448
|
---
|
|
571
449
|
|
|
572
|
-
**💡
|
|
450
|
+
**💡 Summary:** Main Claude orchestrates, specialists implement. This routing ensures quality through domain-specific validation.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Context Loading Protocol
|
|
2
2
|
|
|
3
3
|
> **Unified context loading strategy for all agents**
|
|
4
|
-
> **Version:**
|
|
5
|
-
> **Purpose:**
|
|
4
|
+
> **Version:** 2.0.0 (Claude 4.5 Optimized)
|
|
5
|
+
> **Purpose:** Consistent context loading across 6 agents (DRY principle)
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -22,17 +22,17 @@ This protocol defines how agents discover and load context before starting work.
|
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## 📦 Level 0: Package Manager Discovery
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
**Before running install/run commands, detect the package manager.**
|
|
28
28
|
|
|
29
29
|
### Why This Matters:
|
|
30
30
|
|
|
31
|
-
Using the
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
31
|
+
Using the correct package manager:
|
|
32
|
+
- ✅ Prevents duplicate lock files (package-lock.json + pnpm-lock.yaml conflicts)
|
|
33
|
+
- ✅ Installs to correct location (node_modules vs .venv)
|
|
34
|
+
- ✅ Maintains CI/CD compatibility
|
|
35
|
+
- ✅ Avoids version conflicts
|
|
36
36
|
|
|
37
37
|
### Protocol:
|
|
38
38
|
|
|
@@ -78,7 +78,7 @@ From tech-stack.md, extract:
|
|
|
78
78
|
|
|
79
79
|
2. **Package Manager** (pnpm, npm, bun, uv, poetry, pip)
|
|
80
80
|
- Use for: ALL install/run commands
|
|
81
|
-
-
|
|
81
|
+
- Always use detected PM to prevent lock file conflicts
|
|
82
82
|
|
|
83
83
|
3. **ORM/Database Tool** (Prisma, SQLAlchemy, TypeORM, Drizzle)
|
|
84
84
|
- Use for: Database agents
|
|
@@ -350,35 +350,18 @@ Each agent loads additional contexts based on their role.
|
|
|
350
350
|
|
|
351
351
|
---
|
|
352
352
|
|
|
353
|
-
##
|
|
353
|
+
## 📋 Package Manager Guidelines
|
|
354
354
|
|
|
355
|
-
###
|
|
355
|
+
### Use Detected Package Manager
|
|
356
356
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
# ❌ Assuming package manager
|
|
365
|
-
npm run dev
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
### ✅ ALWAYS Do This:
|
|
357
|
+
| If Detected | Install Command | Run Command |
|
|
358
|
+
|-------------|-----------------|-------------|
|
|
359
|
+
| pnpm | `pnpm install lodash` | `pnpm run dev` |
|
|
360
|
+
| npm | `npm install lodash` | `npm run dev` |
|
|
361
|
+
| uv | `uv pip install requests` | `uv run app.py` |
|
|
362
|
+
| poetry | `poetry add requests` | `poetry run python app.py` |
|
|
369
363
|
|
|
370
|
-
|
|
371
|
-
# ✅ Read tech-stack.md first
|
|
372
|
-
# ✅ Use detected package manager
|
|
373
|
-
|
|
374
|
-
# If pnpm detected:
|
|
375
|
-
pnpm install lodash
|
|
376
|
-
pnpm run dev
|
|
377
|
-
|
|
378
|
-
# If uv detected:
|
|
379
|
-
uv pip install requests
|
|
380
|
-
uv run app.py
|
|
381
|
-
```
|
|
364
|
+
WHY: Using the detected PM prevents lock file conflicts and maintains CI/CD compatibility.
|
|
382
365
|
|
|
383
366
|
### Error Handling:
|
|
384
367
|
|