@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
@@ -0,0 +1,523 @@
1
+ # Task Classification for Agent Selection
2
+
3
+ > **Purpose:** Help Main Claude select the right specialist agent for any given task.
4
+ >
5
+ > **How to use:** Read **Part 1 (Quick Reference)** first. If uncertain, consult **Part 2 (Detailed Scenarios)**.
6
+
7
+ ---
8
+
9
+ ## Part 1: Quick Reference (Read This First!)
10
+
11
+ ### 🎯 Agent Selection Matrix
12
+
13
+ | Task Type | Keywords to Look For | Agent | Phase | Example |
14
+ |-----------|---------------------|-------|-------|---------|
15
+ | **UI Design** | component, layout, form, page, design, mock, prototype | **uxui-frontend** | 1 | "Create login form" |
16
+ | **API Integration** | connect, fetch, integrate, replace mock, state management | **frontend** | 3 | "Connect form to backend" |
17
+ | **API Endpoint** | POST, GET, PUT, DELETE, endpoint, route, validation | **backend** | 2 | "Create /api/login" |
18
+ | **Database** | schema, model, migration, table, query, relationship | **database** | 2 | "Add User table" |
19
+ | **Testing/Bugs** | test, fix, debug, error, failing | **test-debug** | 1,3,4 | "Fix test errors" |
20
+ | **Contract Check** | validate contracts, verify API, integration report | **integration** | 2.5 | "Check API contracts" |
21
+
22
+ ---
23
+
24
+ ### 🔄 Common Workflows
25
+
26
+ #### **Full-Stack Feature (Login System)**
27
+ ```
28
+ Phase 1: uxui-frontend → Create login form UI (mock data)
29
+ Phase 2a: backend → Create POST /api/login endpoint
30
+ Phase 2b: database → Create User model + migration
31
+ (2a and 2b run in parallel)
32
+ Phase 2.5: integration → Verify frontend expects what backend returns
33
+ Phase 3: frontend → Connect form to real API (replace mock)
34
+ Phase 4: test-debug → Run integration tests, fix bugs
35
+ ```
36
+
37
+ #### **UI-Only Feature (Landing Page)**
38
+ ```
39
+ Phase 1: uxui-frontend → Create all sections (hero, features, etc.)
40
+ Phase 2: test-debug → Test responsive design, accessibility
41
+ ```
42
+
43
+ #### **API-Only Feature (Analytics Endpoint)**
44
+ ```
45
+ Phase 1: backend → Create GET /api/analytics endpoint
46
+ Phase 2: database → Create complex query (if needed)
47
+ Phase 3: test-debug → Test endpoint with various inputs
48
+ ```
49
+
50
+ ---
51
+
52
+ ### 🚦 Decision Tree (Ultra-Strict Boundaries)
53
+
54
+ **Ask yourself:**
55
+
56
+ 1. **"Is this ONLY about UI/UX appearance?"**
57
+ - ✅ YES → **uxui-frontend** agent
58
+ - ❌ NO → Go to Q2
59
+
60
+ 2. **"Does this involve connecting UI to a backend?"**
61
+ - ✅ YES → **frontend** agent
62
+ - ❌ NO → Go to Q3
63
+
64
+ 3. **"Does this involve creating API endpoints or business logic?"**
65
+ - ✅ YES → **backend** agent
66
+ - ❌ NO → Go to Q4
67
+
68
+ 4. **"Does this involve database schema or complex queries?"**
69
+ - ✅ YES → **database** agent
70
+ - ❌ NO → Go to Q5
71
+
72
+ 5. **"Is this about testing or fixing bugs?"**
73
+ - ✅ YES → **test-debug** agent
74
+ - ❌ NO → Go to Q6
75
+
76
+ 6. **"Is this about validating API contracts?"**
77
+ - ✅ YES → **integration** agent
78
+ - ❌ NO → Ask user to clarify the task
79
+
80
+ ---
81
+
82
+ ## Part 2: Detailed Scenarios (Consult When Uncertain)
83
+
84
+ ### Scenario 1: "Build a login page"
85
+
86
+ **Analysis:**
87
+ - Keywords: "login **page**" (UI focus)
88
+ - No mention of backend/API
89
+
90
+ **Agent:** uxui-frontend
91
+
92
+ **Reasoning:**
93
+ - User wants the UI/UX only
94
+ - Should use mock data for now
95
+ - Don't connect to real API yet
96
+
97
+ **Output:**
98
+ - Login form component
99
+ - Mock credentials for testing
100
+ - TODO comment: "Connect to /api/login (backend agent)"
101
+
102
+ ---
103
+
104
+ ### Scenario 2: "Implement authentication"
105
+
106
+ **Analysis:**
107
+ - Keywords: "implement" (full feature)
108
+ - "authentication" (backend + frontend + database)
109
+
110
+ **Ambiguous!** → Ask user to clarify:
111
+
112
+ **Ask user:**
113
+ > "Do you want:
114
+ >
115
+ > A) Just the login UI with mock data? → uxui-frontend
116
+ >
117
+ > B) The backend API endpoint? → backend + database
118
+ >
119
+ > C) Full authentication (all phases)? → uxui → backend → database → frontend → test"
120
+
121
+ **If user says "full authentication":**
122
+ ```
123
+ Phase 1: uxui-frontend → Login form UI (mock)
124
+ Phase 2: backend → POST /api/login endpoint
125
+ Phase 2: database → User model + sessions table (parallel)
126
+ Phase 2.5: integration → Verify contracts
127
+ Phase 3: frontend → Connect UI to API
128
+ Phase 4: test-debug → Integration tests
129
+ ```
130
+
131
+ ---
132
+
133
+ ### Scenario 3: "Connect the login form to the backend"
134
+
135
+ **Analysis:**
136
+ - Keywords: "**connect**" (integration)
137
+ - Implies UI already exists
138
+ - Implies backend already exists
139
+
140
+ **Agent:** frontend
141
+
142
+ **Prerequisites check:**
143
+ 1. ✅ UI exists? (from uxui-frontend)
144
+ 2. ✅ Backend exists? (from backend)
145
+ 3. ❌ If either missing → create them first
146
+
147
+ **Output:**
148
+ - Remove mock data from UI
149
+ - Add real API calls (fetch/axios)
150
+ - Add error handling
151
+ - Add loading states
152
+
153
+ ---
154
+
155
+ ### Scenario 4: "Create POST /api/users endpoint"
156
+
157
+ **Analysis:**
158
+ - Keywords: "POST" + "/api/" (backend)
159
+ - "endpoint" (backend)
160
+
161
+ **Agent:** backend
162
+
163
+ **Reasoning:**
164
+ - Pure API work
165
+ - No UI involved
166
+ - No complex database queries (simple CRUD)
167
+
168
+ **Output:**
169
+ - API route handler
170
+ - Request validation (Pydantic/Zod)
171
+ - Response format
172
+ - Basic database query (e.g., `db.create(User)`)
173
+
174
+ ---
175
+
176
+ ### Scenario 5: "Add User and Post models with relationship"
177
+
178
+ **Analysis:**
179
+ - Keywords: "models" + "relationship" (database)
180
+
181
+ **Agent:** database
182
+
183
+ **Reasoning:**
184
+ - Schema design
185
+ - Relationships (1:N, M:N)
186
+ - Migrations
187
+
188
+ **Output:**
189
+ - User model (schema)
190
+ - Post model (schema)
191
+ - Relationship (User → Posts 1:N)
192
+ - Migration file
193
+
194
+ ---
195
+
196
+ ### Scenario 6: "Fix the failing login test"
197
+
198
+ **Analysis:**
199
+ - Keywords: "**fix**" + "**failing**" + "**test**"
200
+
201
+ **Agent:** test-debug
202
+
203
+ **Reasoning:**
204
+ - Bug fixing
205
+ - Test-related
206
+
207
+ **Workflow:**
208
+ 1. Run test
209
+ 2. Analyze error
210
+ 3. Fix code (max 3-4 iterations)
211
+ 4. If still failing → escalate to Main Claude
212
+
213
+ ---
214
+
215
+ ### Scenario 7: "Optimize the user query performance"
216
+
217
+ **Analysis:**
218
+ - Keywords: "**optimize**" + "**query**" (database)
219
+ - No UI/API changes
220
+
221
+ **Agent:** database
222
+
223
+ **Reasoning:**
224
+ - Query optimization
225
+ - Indexes, eager loading
226
+ - Database-layer work
227
+
228
+ **Output:**
229
+ - Add indexes
230
+ - Refactor query (prevent N+1)
231
+ - Benchmark results
232
+
233
+ ---
234
+
235
+ ### Scenario 8: "Add loading spinner to button"
236
+
237
+ **Analysis:**
238
+ - Keywords: "loading spinner" (UI)
239
+ - "button" (component)
240
+
241
+ **Agent:** uxui-frontend
242
+
243
+ **Reasoning:**
244
+ - Visual/UX change only
245
+ - No API logic change
246
+
247
+ **Output:**
248
+ - Update button component
249
+ - Add spinner animation
250
+ - Add `isLoading` prop
251
+
252
+ ---
253
+
254
+ ### Scenario 9: "Validate email format on the server"
255
+
256
+ **Analysis:**
257
+ - Keywords: "**validate**" + "**server**" (backend)
258
+
259
+ **Agent:** backend
260
+
261
+ **Reasoning:**
262
+ - Server-side validation
263
+ - Business logic
264
+ - Not UI validation (client-side)
265
+
266
+ **Output:**
267
+ - Add Pydantic/Zod email validation
268
+ - Return 422 if invalid
269
+ - Error message
270
+
271
+ ---
272
+
273
+ ### Scenario 10: "Make the dashboard responsive on mobile"
274
+
275
+ **Analysis:**
276
+ - Keywords: "**responsive**" + "**mobile**" (UI)
277
+ - No API/backend changes
278
+
279
+ **Agent:** uxui-frontend
280
+
281
+ **Reasoning:**
282
+ - Layout/styling work
283
+ - CSS/responsive design
284
+
285
+ **Output:**
286
+ - Update component styles
287
+ - Add mobile breakpoints
288
+ - Test on 320px, 768px, 1024px
289
+
290
+ ---
291
+
292
+ ## Part 3: Edge Cases (Consult for Tricky Scenarios)
293
+
294
+ ### Edge Case 1: "Add caching to API responses"
295
+
296
+ **Question:** frontend or backend?
297
+
298
+ **Answer:** **backend** agent
299
+
300
+ **Reasoning:**
301
+ - Caching logic lives on server (Redis, in-memory)
302
+ - Frontend just receives cached responses
303
+
304
+ ---
305
+
306
+ ### Edge Case 2: "Add optimistic UI updates"
307
+
308
+ **Question:** frontend or uxui-frontend?
309
+
310
+ **Answer:** **frontend** agent
311
+
312
+ **Reasoning:**
313
+ - Requires API integration logic
314
+ - State management (update before API response)
315
+ - Not pure UI work
316
+
317
+ ---
318
+
319
+ ### Edge Case 3: "Create API documentation"
320
+
321
+ **Question:** Which agent?
322
+
323
+ **Answer:** **backend** agent (if OpenAPI/Swagger) OR **manual task** (if writing docs)
324
+
325
+ **Reasoning:**
326
+ - Backend agent can generate OpenAPI spec
327
+ - But writing long-form docs → outside agent scope
328
+
329
+ ---
330
+
331
+ ### Edge Case 4: "Migrate from mock data to real API"
332
+
333
+ **Question:** frontend or uxui-frontend?
334
+
335
+ **Answer:** **frontend** agent
336
+
337
+ **Reasoning:**
338
+ - uxui-frontend creates UI with mock
339
+ - frontend replaces mock with real API
340
+
341
+ ---
342
+
343
+ ### Edge Case 5: "Add rate limiting to API"
344
+
345
+ **Question:** backend or database?
346
+
347
+ **Answer:** **backend** agent
348
+
349
+ **Reasoning:**
350
+ - Middleware logic (backend layer)
351
+ - May use Redis (external service)
352
+ - Not database schema work
353
+
354
+ ---
355
+
356
+ ## Part 4: Multi-Agent Tasks (How to Break Down)
357
+
358
+ ### Example: "Build a blog system"
359
+
360
+ **Step 1: Break down into sub-tasks**
361
+ ```markdown
362
+ 1. UI Components (uxui-frontend)
363
+ - Blog post list page
364
+ - Single post detail page
365
+ - Create post form
366
+
367
+ 2. Backend API (backend)
368
+ - GET /api/posts (list)
369
+ - GET /api/posts/:id (detail)
370
+ - POST /api/posts (create)
371
+
372
+ 3. Database (database)
373
+ - Post model (id, title, content, authorId, createdAt)
374
+ - User → Posts relationship (1:N)
375
+ - Indexes (authorId, createdAt)
376
+
377
+ 4. Integration (integration)
378
+ - Verify contracts for all 3 endpoints
379
+
380
+ 5. Connect UI to API (frontend)
381
+ - List page: fetch from GET /api/posts
382
+ - Detail page: fetch from GET /api/posts/:id
383
+ - Form: POST to /api/posts
384
+
385
+ 6. Testing (test-debug)
386
+ - Unit tests (components, API)
387
+ - Integration tests (full flow)
388
+ ```
389
+
390
+ **Step 2: Determine execution order**
391
+ ```
392
+ Phase 1 (Sequential):
393
+ 1.1 uxui-frontend → Create UI (all pages)
394
+
395
+ Phase 2 (Parallel):
396
+ 2.1 backend → Create API endpoints
397
+ 2.2 database → Create Post model + migration
398
+
399
+ Phase 2.5 (Sequential):
400
+ 2.5 integration → Verify contracts
401
+
402
+ Phase 3 (Sequential):
403
+ 3.1 frontend → Connect UI to API
404
+
405
+ Phase 4 (Sequential):
406
+ 4.1 test-debug → Run tests, fix bugs
407
+ ```
408
+
409
+ ---
410
+
411
+ ## Part 5: Ultra-Strict Boundaries (Reference)
412
+
413
+ ### What Each Agent CAN and CANNOT Do
414
+
415
+ #### uxui-frontend (Blue)
416
+ **CAN:**
417
+ - ✅ Create React/Vue/Svelte components
418
+ - ✅ Design layouts (CSS, Tailwind)
419
+ - ✅ Add client-side validation UI (show error messages)
420
+ - ✅ Use mock data (setTimeout, hardcoded values)
421
+ - ✅ Add loading states (visual only)
422
+
423
+ **CANNOT:**
424
+ - ❌ Call real APIs (even fetch)
425
+ - ❌ Add state management (Zustand, Redux)
426
+ - ❌ Write Server Actions
427
+ - ❌ Connect to backend
428
+
429
+ ---
430
+
431
+ #### frontend (Green)
432
+ **CAN:**
433
+ - ✅ Replace mock data with real API calls
434
+ - ✅ Add state management (Zustand, Redux, Context)
435
+ - ✅ Error handling (client-side)
436
+ - ✅ Write Server Actions (Next.js)
437
+ - ✅ Data fetching (TanStack Query, SWR)
438
+
439
+ **CANNOT:**
440
+ - ❌ Design UI components (no styling work)
441
+ - ❌ Create API endpoints
442
+ - ❌ Write database queries
443
+
444
+ ---
445
+
446
+ #### backend (Purple)
447
+ **CAN:**
448
+ - ✅ Create API endpoints (routes, handlers)
449
+ - ✅ Request validation (Pydantic, Zod)
450
+ - ✅ Business logic (calculations, rules)
451
+ - ✅ Simple database queries (findOne, findMany, create, update)
452
+ - ✅ Authentication logic (JWT, bcrypt)
453
+
454
+ **CANNOT:**
455
+ - ❌ Design database schema → database agent
456
+ - ❌ Complex queries (JOINs, subqueries) → database agent
457
+ - ❌ Write migrations → database agent
458
+ - ❌ UI work
459
+
460
+ ---
461
+
462
+ #### database (Pink)
463
+ **CAN:**
464
+ - ✅ Design schemas (models, tables)
465
+ - ✅ Write migrations
466
+ - ✅ Complex queries (JOINs, aggregations, subqueries)
467
+ - ✅ Add indexes, optimize queries
468
+ - ✅ Define relationships (1:N, M:N)
469
+
470
+ **CANNOT:**
471
+ - ❌ Create API endpoints → backend agent
472
+ - ❌ Business logic → backend agent
473
+ - ❌ UI work
474
+
475
+ ---
476
+
477
+ #### test-debug (Red)
478
+ **CAN:**
479
+ - ✅ Run tests (unit, integration, e2e)
480
+ - ✅ Fix bugs (max 3-4 iterations)
481
+ - ✅ Add new tests
482
+ - ✅ Debug errors
483
+
484
+ **CANNOT:**
485
+ - ❌ Design features → other agents
486
+ - ❌ Write implementation from scratch (only fix bugs)
487
+
488
+ ---
489
+
490
+ #### integration (Orange)
491
+ **CAN:**
492
+ - ✅ Read frontend API calls
493
+ - ✅ Read backend responses
494
+ - ✅ Compare contracts
495
+ - ✅ Report mismatches
496
+ - ✅ Recommend fixes
497
+
498
+ **CANNOT:**
499
+ - ❌ Fix code (only report)
500
+ - ❌ Run tests → test-debug
501
+ - ❌ Orchestrate workflows
502
+
503
+ ---
504
+
505
+ ## Summary: When in Doubt
506
+
507
+ 1. **Read Part 1 (Quick Reference)** - covers 80% of cases
508
+ 2. **Still uncertain?** → Check Part 2 (Detailed Scenarios) for similar examples
509
+ 3. **Very tricky?** → Check Part 3 (Edge Cases)
510
+ 4. **Multi-step task?** → Check Part 4 (Break down example)
511
+ 5. **Still confused?** → **Ask the user to clarify!**
512
+
513
+ **Golden Rule:** When ambiguous, prefer **ultra-strict interpretation**:
514
+ - "login" alone → uxui-frontend (assume UI unless stated otherwise)
515
+ - If user wants more → they will clarify
516
+
517
+ **Remember:** It's better to under-deliver and ask for clarification than to over-deliver and create scope creep.
518
+
519
+ ---
520
+
521
+ ## Optional: TDD Classification
522
+
523
+ For TDD-specific task classification, see `@/.claude/contexts/patterns/tdd-classification.md`.