@champpaba/claude-agent-kit 1.8.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/.claude/CLAUDE.md +189 -39
  2. package/.claude/agents/01-integration.md +106 -552
  3. package/.claude/agents/02-uxui-frontend.md +188 -850
  4. package/.claude/agents/03-test-debug.md +152 -521
  5. package/.claude/agents/04-frontend.md +169 -549
  6. package/.claude/agents/05-backend.md +132 -661
  7. package/.claude/agents/06-database.md +149 -698
  8. package/.claude/agents/_shared/README.md +57 -0
  9. package/.claude/agents/_shared/agent-boundaries.md +64 -0
  10. package/.claude/agents/_shared/documentation-policy.md +47 -0
  11. package/.claude/agents/_shared/package-manager.md +59 -0
  12. package/.claude/agents/_shared/pre-work-checklist.md +57 -0
  13. package/.claude/commands/cdev.md +36 -61
  14. package/.claude/commands/csetup.md +101 -39
  15. package/.claude/commands/designsetup.md +1402 -337
  16. package/.claude/commands/extract.md +520 -245
  17. package/.claude/commands/pageplan.md +6 -6
  18. package/.claude/contexts/design/box-thinking.md +1 -1
  19. package/.claude/contexts/design/index.md +1 -1
  20. package/.claude/contexts/patterns/agent-discovery.md +2 -2
  21. package/.claude/contexts/patterns/animation-patterns.md +1 -1
  22. package/.claude/contexts/patterns/change-workflow.md +8 -5
  23. package/.claude/contexts/patterns/code-standards.md +10 -8
  24. package/.claude/contexts/patterns/error-recovery.md +4 -4
  25. package/.claude/contexts/patterns/frontend-component-strategy.md +1 -1
  26. package/.claude/contexts/patterns/performance-optimization.md +1 -1
  27. package/.claude/contexts/patterns/task-breakdown.md +2 -2
  28. package/.claude/contexts/patterns/task-classification.md +2 -2
  29. package/.claude/contexts/patterns/ui-component-consistency.md +3 -3
  30. package/.claude/contexts/patterns/validation-framework.md +36 -33
  31. package/.claude/lib/README.md +4 -4
  32. package/.claude/lib/agent-executor.md +31 -40
  33. package/.claude/lib/agent-router.md +91 -213
  34. package/.claude/lib/context-loading-protocol.md +19 -36
  35. package/.claude/lib/detailed-guides/agent-system.md +43 -121
  36. package/.claude/lib/detailed-guides/taskmaster-analysis.md +1 -1
  37. package/.claude/lib/document-loader.md +22 -25
  38. package/.claude/lib/flags-updater.md +24 -32
  39. package/.claude/templates/STYLE_GUIDE.template.md +1 -1
  40. package/.claude/templates/design-context-template.md +1 -1
  41. package/.claude/templates/phases-sections/frontend-mockup.md +8 -5
  42. package/README.md +99 -40
  43. package/package.json +1 -1
@@ -1,14 +1,16 @@
1
- # Mandatory Agent Routing Protocol
1
+ # Agent Routing Protocol
2
2
 
3
- > **CRITICAL:** Main Claude CANNOT do implementation work directly
4
- > **PURPOSE:** Enforce strict agent boundaries and specialization
5
- > **APPLIES TO:** ALL tasks received from users
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 is an orchestrator, NOT an implementer**
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
- Write React/Vue components
23
- Create API endpoints
24
- Design database schemas
25
- Write tests
26
- Make API integrations
27
- Implement features directly
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
- ## 🚨 Routing Rules (MUST FOLLOW)
34
+ ## 📋 Routing Rules
33
35
 
34
- ### Rule 1: Detect Work Type FIRST
36
+ ### Rule 1: Detect Work Type First
35
37
 
36
- **Before doing ANY work, Main Claude MUST:**
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
- throw new Error('Main Claude cannot do implementation work!')
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 Validation Gate
228
+ ## 🚦 Pre-Work Checklist
227
229
 
228
- **Main Claude MUST check this gate BEFORE doing ANY work:**
230
+ **Before starting work, complete this quick check:**
229
231
 
230
232
  ```markdown
231
- ## ✅ Pre-Work Gate Checklist
232
-
233
- Before proceeding, Main Claude must answer:
233
+ ## ✅ Task Routing Checklist
234
234
 
235
235
  ### Q1: What is the user requesting?
236
- - [ ] I have read the user request carefully
237
- - [ ] I understand what they want
236
+ - [ ] Read request carefully
237
+ - [ ] Identify the end goal
238
238
 
239
239
  ### Q2: Is this implementation work?
240
- - [ ] YES → Go to Q3 (MUST delegate)
240
+ - [ ] YES → Route to specialist (see Q3)
241
241
  - [ ] NO → Can proceed directly (planning/reading)
242
242
 
243
- ### Q3: Which agent should handle this? (Read task-classification.md)
244
- - [ ] uxui-frontend: UI components, layouts, design
245
- - [ ] backend: API endpoints, business logic
246
- - [ ] database: Schema, migrations, complex queries
247
- - [ ] frontend: API integration, state management
248
- - [ ] test-debug: Testing, bug fixes
249
- - [ ] integration: Contract validation, API design
250
- - [ ] main-claude: Planning, reading, orchestration
251
-
252
- ### Q4: Can I do this myself?
253
- - [ ] Check: workType in WORK_PATTERNS
254
- - [ ] Check: canMainDo === true?
255
- - [ ] If NO MUST delegate (go to Q5)
256
- - [ ] If YES Can proceed directly
257
-
258
- ### Q5: Invoke specialized agent
259
- - [ ] Use Task tool with selected agent
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 neededUse Task tool with selected agent
256
+ - If main-claude workProceed 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
- ## 🚫 Forbidden Actions for Main Claude
264
+ ## 📋 Task Routing Table
270
265
 
271
- ### Main Claude CANNOT Do:
266
+ ### Route to Specialists
272
267
 
273
- ```markdown
274
- ❌ UI/Frontend Implementation:
275
- - Write React/Vue/Svelte components
276
- - Create JSX/TSX files
277
- - Write Tailwind/CSS styles
278
- - Design layouts or forms
279
- - Add responsive breakpoints
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
- ### Main Claude CAN Do:
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
- ```markdown
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
- ## 🔒 Self-Check Mechanism
290
+ ## 🔄 Quick Routing Flow
349
291
 
350
- **Main Claude must run this self-check for EVERY user request:**
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
- ```markdown
353
- ## 🔍 Self-Check Protocol
354
-
355
- Run this BEFORE doing ANY work:
356
-
357
- ### Step 1: Parse Request
358
- - What is the user asking for?
359
- - Extract: action, target, context
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
- ## ⚠️ Override Protection
419
+ ## 💡 When User Asks to Skip Routing
514
420
 
515
- **Even if user explicitly requests Main Claude to "do it yourself":**
421
+ If user requests direct implementation:
516
422
 
517
423
  ```markdown
518
- User: "Just create the button component yourself, don't use agents"
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
- 2. **Component Reuse:** The agent checks for existing components first to avoid duplicates.
426
+ Response:
427
+ "I'll route this to the uxui-frontend agent. Here's why this produces better results:
526
428
 
527
- 3. **Quality Assurance:** The agent follows mandatory pre-work checklists (Box Thinking, Design Tokens) that I cannot replicate.
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
- This ensures your codebase maintains high quality standards. I'll invoke the agent now."
530
-
531
- [Proceeds to invoke uxui-frontend agent]
433
+ Invoking uxui-frontend agent now..."
532
434
  ```
533
435
 
534
- **Exception:** Only if user says "I know you should delegate, but this is a special test/demo case" → Can proceed with warning
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
- ## 🎯 Success Metrics
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
- 3. **Clear Task Classification**
566
- - Every task analyzed before execution
567
- - Decision reasoning visible to user
568
- - No ambiguity in routing
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
- **💡 Remember:** Main Claude orchestrates, agents implement. No exceptions.
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:** 1.4.0
5
- > **Purpose:** Eliminate duplication across 6 agents, enforce consistency
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
- ## 🚨 Level 0: Package Manager Discovery (CRITICAL!)
25
+ ## 📦 Level 0: Package Manager Discovery
26
26
 
27
- **⚠️ STOP! Read this BEFORE running ANY install/run command**
27
+ **Before running install/run commands, detect the package manager.**
28
28
 
29
29
  ### Why This Matters:
30
30
 
31
- Using the wrong package manager can:
32
- - Create duplicate lock files (package-lock.json + pnpm-lock.yaml)
33
- - Install to wrong location (node_modules vs .venv)
34
- - Break CI/CD pipelines
35
- - Cause version conflicts
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
- - **CRITICAL:** NEVER hardcode npm/pip
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
- ## 🚨 Package Manager Safety Rules
353
+ ## 📋 Package Manager Guidelines
354
354
 
355
- ### NEVER Do This:
355
+ ### Use Detected Package Manager
356
356
 
357
- ```bash
358
- # ❌ Hardcoded npm (wrong if project uses pnpm)
359
- npm install lodash
360
-
361
- # Hardcoded pip (wrong if project uses uv)
362
- pip install requests
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
- ```bash
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