@champpaba/claude-agent-kit 3.0.2 → 3.2.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 (51) hide show
  1. package/.claude/CHANGELOG.md +707 -0
  2. package/.claude/CLAUDE.md +128 -613
  3. package/.claude/agents/_shared/pre-work-checklist.md +108 -7
  4. package/.claude/commands/cdev.md +36 -0
  5. package/.claude/commands/csetup.md +292 -1791
  6. package/.claude/commands/cview.md +364 -364
  7. package/.claude/contexts/design/accessibility.md +611 -611
  8. package/.claude/contexts/design/layout.md +400 -400
  9. package/.claude/contexts/design/responsive.md +551 -551
  10. package/.claude/contexts/design/shadows.md +522 -522
  11. package/.claude/contexts/design/typography.md +465 -465
  12. package/.claude/contexts/domain/README.md +164 -164
  13. package/.claude/contexts/patterns/agent-coordination.md +388 -388
  14. package/.claude/contexts/patterns/development-principles.md +513 -513
  15. package/.claude/contexts/patterns/error-handling.md +478 -478
  16. package/.claude/contexts/patterns/logging.md +424 -424
  17. package/.claude/contexts/patterns/tdd-classification.md +516 -516
  18. package/.claude/contexts/patterns/testing.md +413 -413
  19. package/.claude/lib/README.md +3 -3
  20. package/.claude/lib/detailed-guides/taskmaster-analysis.md +1 -1
  21. package/.claude/lib/task-analyzer.md +144 -0
  22. package/.claude/lib/tdd-workflow.md +2 -1
  23. package/.claude/lib/validation-gates.md +484 -484
  24. package/.claude/settings.local.json +42 -42
  25. package/.claude/templates/PROJECT_STATUS.template.yml +16 -41
  26. package/.claude/templates/context-template.md +45 -45
  27. package/.claude/templates/flags-template.json +42 -42
  28. package/.claude/templates/phases-sections/accessibility-test.md +17 -17
  29. package/.claude/templates/phases-sections/api-design.md +37 -37
  30. package/.claude/templates/phases-sections/backend-tests.md +16 -16
  31. package/.claude/templates/phases-sections/backend.md +37 -37
  32. package/.claude/templates/phases-sections/business-logic-validation.md +16 -16
  33. package/.claude/templates/phases-sections/component-tests.md +17 -17
  34. package/.claude/templates/phases-sections/contract-backend.md +16 -16
  35. package/.claude/templates/phases-sections/contract-frontend.md +16 -16
  36. package/.claude/templates/phases-sections/database.md +35 -35
  37. package/.claude/templates/phases-sections/e2e-tests.md +16 -16
  38. package/.claude/templates/phases-sections/fix-implementation.md +17 -17
  39. package/.claude/templates/phases-sections/frontend-integration.md +18 -18
  40. package/.claude/templates/phases-sections/manual-flow-test.md +15 -15
  41. package/.claude/templates/phases-sections/manual-ux-test.md +16 -16
  42. package/.claude/templates/phases-sections/refactor-implementation.md +17 -17
  43. package/.claude/templates/phases-sections/refactor.md +16 -16
  44. package/.claude/templates/phases-sections/regression-tests.md +15 -15
  45. package/.claude/templates/phases-sections/responsive-test.md +16 -16
  46. package/.claude/templates/phases-sections/script-implementation.md +43 -43
  47. package/.claude/templates/phases-sections/test-coverage.md +16 -16
  48. package/.claude/templates/phases-sections/user-approval.md +14 -14
  49. package/LICENSE +21 -21
  50. package/package.json +1 -1
  51. package/.claude/lib/tdd-classifier.md +0 -345
@@ -10,8 +10,8 @@
10
10
  **`agent-executor.md`** - Agent retry & escalation logic
11
11
  Used by `/cdev` to execute agents with automatic retry, validation, and user escalation
12
12
 
13
- **`tdd-classifier.md`** - TDD classification logic
14
- Used by `/csetup` to automatically determine which phases require TDD workflow
13
+ **`task-analyzer.md`** - Task analysis with TDD classification (v3.1.0)
14
+ Used by `/csetup` to analyze tasks and determine TDD requirements. Step 2.6 contains TDD classification logic.
15
15
 
16
16
  **`flags-updater.md`** - Progress tracking protocol
17
17
  Ensures Main Claude updates flags.json after EVERY phase completion. Provides helper functions for extracting files, tasks, and calculating duration.
@@ -78,4 +78,4 @@ These are **logic specifications** (not executable code). Main Claude reads thes
78
78
  - `.claude/contexts/patterns/validation-framework.md` - Agent validation checklists
79
79
  - `.claude/contexts/patterns/agent-discovery.md` - Agent discovery flow
80
80
  - `.claude/commands/cdev.md` - How /cdev uses agent-executor.md
81
- - `.claude/commands/csetup.md` - How /csetup uses tdd-classifier.md
81
+ - `.claude/commands/csetup.md` - How /csetup uses task-analyzer.md
@@ -260,4 +260,4 @@ User: "Build login system"
260
260
 
261
261
  - `../../commands/csetup.md` - /csetup command (uses TaskMaster)
262
262
  - `../task-analyzer.md` - Complete analysis logic implementation
263
- - `../tdd-classifier.md` - TDD decision logic (integrated with TaskMaster)
263
+ - `../task-analyzer.md` Step 2.6 - TDD classification logic (integrated with task analysis)
@@ -157,6 +157,150 @@ Determine if this task needs milestone-based execution:
157
157
  - Low risk, low complexity
158
158
  ```
159
159
 
160
+ ### 2.6 TDD Classification (v3.1.0)
161
+
162
+ > **Source:** Uses patterns from `@/.claude/contexts/patterns/tdd-classification.md`
163
+ > **Purpose:** Determine if task requires TDD (Test-Driven Development) workflow
164
+
165
+ **Classification Algorithm:**
166
+
167
+ ```typescript
168
+ function classifyTDD(task: AnalyzedTask): TDDClassification {
169
+ const description = task.description.toLowerCase()
170
+ const agent = task.agent
171
+
172
+ // Rule 1: Database/Integration/Test agents → Never TDD
173
+ if (['database', 'integration', 'test-debug'].includes(agent)) {
174
+ return {
175
+ tdd_required: false,
176
+ workflow: 'none',
177
+ reason: 'Schema/validation work is declarative - no TDD needed'
178
+ }
179
+ }
180
+
181
+ // Rule 2: Critical Backend Patterns → Always TDD
182
+ const CRITICAL_PATTERNS = [
183
+ // Security operations
184
+ /\b(auth|login|register|password|token|jwt|oauth|session)\b/i,
185
+ /\b(encrypt|decrypt|hash|sign|permission|access.*control)\b/i,
186
+
187
+ // Financial operations
188
+ /\b(payment|stripe|paypal|charge|refund|transaction)\b/i,
189
+ /\b(calculate|compute|discount|pricing|tax|fee)\b/i,
190
+
191
+ // External integrations
192
+ /\b(webhook|callback|external.*api|third-party)\b/i,
193
+ /\b(sendgrid|twilio|s3|analytics)\b/i,
194
+
195
+ // Data transformations
196
+ /\b(serialize|deserialize|transform|convert|parse|etl)\b/i,
197
+ /\b(validate|verify|check|business.*rule)\b/i
198
+ ]
199
+
200
+ for (const pattern of CRITICAL_PATTERNS) {
201
+ if (pattern.test(description)) {
202
+ return {
203
+ tdd_required: true,
204
+ workflow: 'red-green-refactor',
205
+ reason: `Critical pattern matched: ${pattern.source}`,
206
+ confidence: 'high'
207
+ }
208
+ }
209
+ }
210
+
211
+ // Rule 3: Complex UI Patterns → TDD Required
212
+ if (agent === 'uxui-frontend' || agent === 'frontend') {
213
+ const COMPLEX_UI_PATTERNS = [
214
+ /\b(multi-step|wizard|stepper|checkout)\b/i,
215
+ /\b(state.*machine|workflow|onboarding)\b/i,
216
+ /\b(keyboard.*navigation|accessibility|aria)\b/i,
217
+ /\b(dynamic.*form|conditional.*field)\b/i
218
+ ]
219
+
220
+ for (const pattern of COMPLEX_UI_PATTERNS) {
221
+ if (pattern.test(description)) {
222
+ return {
223
+ tdd_required: true,
224
+ workflow: 'red-green-refactor',
225
+ reason: 'Complex UI logic requires TDD',
226
+ confidence: 'high'
227
+ }
228
+ }
229
+ }
230
+
231
+ // Simple UI → No TDD
232
+ return {
233
+ tdd_required: false,
234
+ workflow: 'test-alongside',
235
+ reason: 'Presentational component - test-alongside OK'
236
+ }
237
+ }
238
+
239
+ // Rule 4: Backend with Risk/Complexity threshold
240
+ if (agent === 'backend') {
241
+ // Simple CRUD reads → No TDD
242
+ if (/\b(get|list|fetch|read|retrieve|view)\b/i.test(description) &&
243
+ !CRITICAL_PATTERNS.some(p => p.test(description))) {
244
+ return {
245
+ tdd_required: false,
246
+ workflow: 'test-alongside',
247
+ reason: 'Simple CRUD read operation'
248
+ }
249
+ }
250
+
251
+ // Complex backend → TDD
252
+ if (task.complexity >= 7 || task.risk === 'HIGH') {
253
+ return {
254
+ tdd_required: true,
255
+ workflow: 'red-green-refactor',
256
+ reason: `High complexity (${task.complexity}) or risk (${task.risk})`,
257
+ confidence: 'medium'
258
+ }
259
+ }
260
+ }
261
+
262
+ // Default: No TDD required
263
+ return {
264
+ tdd_required: false,
265
+ workflow: 'test-alongside',
266
+ reason: 'Standard task - test-alongside OK',
267
+ confidence: 'low'
268
+ }
269
+ }
270
+ ```
271
+
272
+ **Output Format (added to task analysis):**
273
+
274
+ ```typescript
275
+ interface TDDClassification {
276
+ tdd_required: boolean
277
+ workflow: 'red-green-refactor' | 'test-alongside' | 'none'
278
+ reason: string
279
+ confidence?: 'high' | 'medium' | 'low'
280
+ }
281
+
282
+ // Added to each AnalyzedTask:
283
+ task.tdd = classifyTDD(task)
284
+ ```
285
+
286
+ **phases.md Output:**
287
+
288
+ When `tdd_required: true`, phases.md includes:
289
+
290
+ ```markdown
291
+ ## Phase N: Backend Implementation
292
+
293
+ **Agent:** backend
294
+ **TDD Required:** ✅ YES
295
+ **TDD Reason:** Critical pattern matched: auth/login/jwt
296
+ **TDD Workflow:** red-green-refactor
297
+
298
+ ⚠️ **TDD WORKFLOW REQUIRED:**
299
+ 1. 🔴 RED: Write tests FIRST (they should fail)
300
+ 2. ✅ GREEN: Write minimal implementation to pass tests
301
+ 3. 🔧 REFACTOR: Improve code quality while keeping tests green
302
+ ```
303
+
160
304
  ---
161
305
 
162
306
  ### Step 3: Auto-Add Best Practices
@@ -885,7 +885,8 @@ Before starting TDD workflow:
885
885
 
886
886
  ## 🔗 See Also
887
887
 
888
- - `tdd-classifier.md` - Logic to determine when `tdd_required: true`
888
+ - `task-analyzer.md` Step 2.6 - TDD classification logic (integrated with task analysis)
889
+ - `@/.claude/contexts/patterns/tdd-classification.md` - Full TDD classification patterns
889
890
  - `validation-framework.md` - Agent validation requirements
890
891
  - `context-loading-protocol.md` - How agents load testing frameworks
891
892
  - `contexts/patterns/testing.md` - General testing patterns