@champpaba/claude-agent-kit 3.0.3 → 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.
- package/.claude/CHANGELOG.md +180 -0
- package/.claude/CLAUDE.md +30 -27
- package/.claude/agents/_shared/pre-work-checklist.md +57 -9
- package/.claude/commands/cdev.md +36 -0
- package/.claude/commands/csetup.md +227 -1791
- package/.claude/contexts/patterns/tdd-classification.md +1 -1
- package/.claude/lib/README.md +3 -3
- package/.claude/lib/detailed-guides/taskmaster-analysis.md +1 -1
- package/.claude/lib/task-analyzer.md +144 -0
- package/.claude/lib/tdd-workflow.md +2 -1
- package/package.json +1 -1
- package/.claude/lib/tdd-classifier.md +0 -345
|
@@ -104,7 +104,7 @@ Classify tasks to determine if Test-Driven Development (TDD) is required, regard
|
|
|
104
104
|
- Transactions, financial operations
|
|
105
105
|
- Audit logging
|
|
106
106
|
|
|
107
|
-
**Keywords:** auth, authenticate, authorize, JWT, OAuth, encrypt, decrypt, hash, sign, permission, access control, transaction, rollback, commit, audit
|
|
107
|
+
**Keywords:** auth, authenticate, authorize, JWT, OAuth, session, encrypt, decrypt, hash, sign, permission, access control, transaction, rollback, commit, audit
|
|
108
108
|
|
|
109
109
|
**Examples:**
|
|
110
110
|
```
|
package/.claude/lib/README.md
CHANGED
|
@@ -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
|
-
**`
|
|
14
|
-
Used by `/csetup` to
|
|
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
|
|
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
|
-
- `../
|
|
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
|
-
- `
|
|
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
|
package/package.json
CHANGED
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
# TDD Classification Logic
|
|
2
|
-
|
|
3
|
-
> **Automatically determines which phases require TDD workflow**
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 🎯 Purpose
|
|
8
|
-
|
|
9
|
-
Provides logic to classify tasks and determine whether they require TDD (Test-Driven Development) workflow. Ensures consistent TDD decisions across all changes.
|
|
10
|
-
|
|
11
|
-
**Result Format:**
|
|
12
|
-
```
|
|
13
|
-
TDD Decision:
|
|
14
|
-
required: true/false
|
|
15
|
-
reason: "Why TDD is/isn't required"
|
|
16
|
-
workflow: "red-green-refactor" | "test-alongside" | "none"
|
|
17
|
-
confidence: "high" | "medium" | "low"
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## 🔍 Classification Rules
|
|
23
|
-
|
|
24
|
-
### Rule 1: Backend API Endpoints
|
|
25
|
-
|
|
26
|
-
**Always TDD:**
|
|
27
|
-
- Authentication logic (login, register, password, JWT)
|
|
28
|
-
- Authorization logic (permissions, roles, access)
|
|
29
|
-
- Payment processing (Stripe, charges, refunds)
|
|
30
|
-
- Financial calculations
|
|
31
|
-
- Data validation with business rules
|
|
32
|
-
- External API integrations (SendGrid, webhooks)
|
|
33
|
-
|
|
34
|
-
**Test-Alongside OK:**
|
|
35
|
-
- Simple CRUD operations (basic findOne, findMany, create, update, delete)
|
|
36
|
-
- Read-only endpoints with no business logic
|
|
37
|
-
- Health check endpoints
|
|
38
|
-
|
|
39
|
-
### Rule 2: Frontend UI
|
|
40
|
-
|
|
41
|
-
**TDD Required:**
|
|
42
|
-
- Multi-step forms with complex validation
|
|
43
|
-
- State machines (wizards, checkout flows, onboarding)
|
|
44
|
-
- Complex client-side calculations
|
|
45
|
-
|
|
46
|
-
**Test-Alongside OK:**
|
|
47
|
-
- Presentational components
|
|
48
|
-
- Simple forms
|
|
49
|
-
- Static pages
|
|
50
|
-
|
|
51
|
-
### Rule 3: Database
|
|
52
|
-
|
|
53
|
-
**Never TDD:**
|
|
54
|
-
- Schema design
|
|
55
|
-
- Migration files
|
|
56
|
-
- Database setup scripts
|
|
57
|
-
|
|
58
|
-
**Reason:** Schemas are declarative, not imperative logic
|
|
59
|
-
|
|
60
|
-
### Rule 4: Integration
|
|
61
|
-
|
|
62
|
-
**Never TDD:**
|
|
63
|
-
- Contract validation (validation itself, not implementation)
|
|
64
|
-
- Report generation
|
|
65
|
-
- Documentation
|
|
66
|
-
|
|
67
|
-
### Rule 5: Test-Debug
|
|
68
|
-
|
|
69
|
-
**Never TDD:**
|
|
70
|
-
- Test-debug agent writes tests - no TDD needed
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
## 🤖 Classification Logic
|
|
75
|
-
|
|
76
|
-
**Main Claude should follow this logic in `/csetup` when generating phases.md:**
|
|
77
|
-
|
|
78
|
-
### Step 1: Determine Phase Type
|
|
79
|
-
|
|
80
|
-
Identify agent type from phase:
|
|
81
|
-
- backend, api, endpoint → Backend rules
|
|
82
|
-
- frontend, ui, uxui-frontend → Frontend rules
|
|
83
|
-
- database, schema, migration → Database rules
|
|
84
|
-
- integration, contract, validation → Integration rules
|
|
85
|
-
- test, test-debug → Test rules
|
|
86
|
-
|
|
87
|
-
### Step 2: Check Critical Keywords (Backend Only)
|
|
88
|
-
|
|
89
|
-
**Critical keywords** (always TDD):
|
|
90
|
-
- auth, login, register, password, token, jwt
|
|
91
|
-
- payment, stripe, charge, refund, transaction
|
|
92
|
-
- permission, role, access, authorization
|
|
93
|
-
- email, notification, sendgrid, sms
|
|
94
|
-
- webhook, callback, integration
|
|
95
|
-
- calculation, formula, compute
|
|
96
|
-
- validation, business rule, constraint
|
|
97
|
-
|
|
98
|
-
**If found:**
|
|
99
|
-
- TDD Required: YES
|
|
100
|
-
- Reason: "Critical backend logic requires TDD for correctness"
|
|
101
|
-
- Workflow: red-green-refactor
|
|
102
|
-
- Confidence: high
|
|
103
|
-
|
|
104
|
-
### Step 3: Check CRUD Pattern (Backend Only)
|
|
105
|
-
|
|
106
|
-
**CRUD keywords:**
|
|
107
|
-
- list, get, fetch, read, retrieve, view
|
|
108
|
-
|
|
109
|
-
**If simple CRUD:**
|
|
110
|
-
- TDD Required: NO
|
|
111
|
-
- Reason: "Simple CRUD read operation - test-alongside OK"
|
|
112
|
-
- Workflow: test-alongside
|
|
113
|
-
- Confidence: high
|
|
114
|
-
|
|
115
|
-
### Step 4: Check Complexity
|
|
116
|
-
|
|
117
|
-
**Backend:**
|
|
118
|
-
- Complex → TDD required (red-green-refactor, medium confidence)
|
|
119
|
-
- Medium/Simple → test-alongside OK
|
|
120
|
-
|
|
121
|
-
**Frontend:**
|
|
122
|
-
- Check for complex UI keywords:
|
|
123
|
-
- multi-step, wizard, stepper
|
|
124
|
-
- state machine, workflow
|
|
125
|
-
- validation, form validation
|
|
126
|
-
- calculation, formula
|
|
127
|
-
- checkout, payment form, onboarding
|
|
128
|
-
- If found → TDD required (red-green-refactor, high confidence)
|
|
129
|
-
- Otherwise → test-alongside OK
|
|
130
|
-
|
|
131
|
-
**Database/Integration/Test:**
|
|
132
|
-
- Always NO TDD (workflow: none, high confidence)
|
|
133
|
-
|
|
134
|
-
---
|
|
135
|
-
|
|
136
|
-
## 🔧 Complexity Estimation
|
|
137
|
-
|
|
138
|
-
**How to estimate complexity:**
|
|
139
|
-
|
|
140
|
-
1. **Time-based scoring:**
|
|
141
|
-
- < 30 minutes → +0 points
|
|
142
|
-
- 30-90 minutes → +1 point
|
|
143
|
-
- > 90 minutes → +2 points
|
|
144
|
-
|
|
145
|
-
2. **Keyword-based scoring:**
|
|
146
|
-
- Contains: multiple, complex, advanced, sophisticated → +1 point
|
|
147
|
-
- Contains: integration, calculation, validation → +1 point
|
|
148
|
-
- Contains: business logic, algorithm, optimization → +1 point
|
|
149
|
-
|
|
150
|
-
3. **Length-based scoring:**
|
|
151
|
-
- Description > 500 chars → +1 point
|
|
152
|
-
- Description > 10 lines → +1 point
|
|
153
|
-
- Keywords > 5 → +1 point
|
|
154
|
-
|
|
155
|
-
4. **Classification:**
|
|
156
|
-
- Score ≤ 2 → simple
|
|
157
|
-
- Score 3-5 → medium
|
|
158
|
-
- Score > 5 → complex
|
|
159
|
-
|
|
160
|
-
---
|
|
161
|
-
|
|
162
|
-
## 📊 Usage in /csetup
|
|
163
|
-
|
|
164
|
-
**When generating phases.md:**
|
|
165
|
-
|
|
166
|
-
For each phase:
|
|
167
|
-
1. Extract task description from tasks.md
|
|
168
|
-
2. Extract keywords from description
|
|
169
|
-
3. Estimate complexity (time + keywords + length)
|
|
170
|
-
4. Classify TDD (phase type + keywords + complexity)
|
|
171
|
-
5. Add TDD metadata to phases.md
|
|
172
|
-
|
|
173
|
-
**Phase metadata includes:**
|
|
174
|
-
```markdown
|
|
175
|
-
| TDD | YES/NO |
|
|
176
|
-
| TDD Reason | {reason} |
|
|
177
|
-
| TDD Workflow | red-green-refactor / test-alongside / none |
|
|
178
|
-
| Complexity | simple / medium / complex |
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
---
|
|
182
|
-
|
|
183
|
-
## 📝 Phase Metadata Format
|
|
184
|
-
|
|
185
|
-
**Example output in phases.md:**
|
|
186
|
-
|
|
187
|
-
```markdown
|
|
188
|
-
## Phase 7: Backend Implementation
|
|
189
|
-
|
|
190
|
-
| Metadata | Value |
|
|
191
|
-
|----------|-------|
|
|
192
|
-
| Phase | Backend Implementation |
|
|
193
|
-
| Agent | backend |
|
|
194
|
-
| TDD | YES |
|
|
195
|
-
| TDD Reason | Critical backend logic requires TDD for correctness |
|
|
196
|
-
| TDD Workflow | red-green-refactor |
|
|
197
|
-
| Complexity | complex |
|
|
198
|
-
| Estimated | 120 minutes |
|
|
199
|
-
|
|
200
|
-
**TDD Required:** ✅ This phase MUST follow RED-GREEN-REFACTOR workflow.
|
|
201
|
-
|
|
202
|
-
**Why TDD:**
|
|
203
|
-
Critical backend logic requires TDD for correctness.
|
|
204
|
-
Detected keywords: auth, login, jwt, validation
|
|
205
|
-
|
|
206
|
-
**Workflow:**
|
|
207
|
-
1. 🔴 RED: Write tests FIRST (they should fail)
|
|
208
|
-
2. ✅ GREEN: Write minimal implementation to pass tests
|
|
209
|
-
3. 🔧 REFACTOR: Improve code quality while keeping tests green
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
---
|
|
213
|
-
|
|
214
|
-
## 🎯 Example Classifications
|
|
215
|
-
|
|
216
|
-
### Example 1: Authentication Endpoint
|
|
217
|
-
|
|
218
|
-
**Input:**
|
|
219
|
-
- Phase: backend
|
|
220
|
-
- Task: "Implement POST /api/auth/login with JWT token generation"
|
|
221
|
-
- Complexity: complex
|
|
222
|
-
- Keywords: auth, login, jwt, password, validation
|
|
223
|
-
|
|
224
|
-
**Output:**
|
|
225
|
-
- TDD Required: YES
|
|
226
|
-
- Reason: "Critical backend logic requires TDD for correctness"
|
|
227
|
-
- Workflow: red-green-refactor
|
|
228
|
-
- Confidence: high
|
|
229
|
-
|
|
230
|
-
### Example 2: Simple List Endpoint
|
|
231
|
-
|
|
232
|
-
**Input:**
|
|
233
|
-
- Phase: backend
|
|
234
|
-
- Task: "Implement GET /api/posts to list all posts"
|
|
235
|
-
- Complexity: simple
|
|
236
|
-
- Keywords: get, list, read
|
|
237
|
-
|
|
238
|
-
**Output:**
|
|
239
|
-
- TDD Required: NO
|
|
240
|
-
- Reason: "Simple CRUD read operation - test-alongside OK"
|
|
241
|
-
- Workflow: test-alongside
|
|
242
|
-
- Confidence: high
|
|
243
|
-
|
|
244
|
-
### Example 3: Multi-Step Form
|
|
245
|
-
|
|
246
|
-
**Input:**
|
|
247
|
-
- Phase: uxui-frontend
|
|
248
|
-
- Task: "Create multi-step checkout wizard with validation"
|
|
249
|
-
- Complexity: complex
|
|
250
|
-
- Keywords: multi-step, wizard, checkout, validation
|
|
251
|
-
|
|
252
|
-
**Output:**
|
|
253
|
-
- TDD Required: YES
|
|
254
|
-
- Reason: "Complex UI state machine requires TDD"
|
|
255
|
-
- Workflow: red-green-refactor
|
|
256
|
-
- Confidence: high
|
|
257
|
-
|
|
258
|
-
### Example 4: Simple UI Component
|
|
259
|
-
|
|
260
|
-
**Input:**
|
|
261
|
-
- Phase: uxui-frontend
|
|
262
|
-
- Task: "Create a product card component"
|
|
263
|
-
- Complexity: simple
|
|
264
|
-
- Keywords: card, component, display
|
|
265
|
-
|
|
266
|
-
**Output:**
|
|
267
|
-
- TDD Required: NO
|
|
268
|
-
- Reason: "Presentational component - test-alongside OK"
|
|
269
|
-
- Workflow: test-alongside
|
|
270
|
-
- Confidence: high
|
|
271
|
-
|
|
272
|
-
### Example 5: Database Schema
|
|
273
|
-
|
|
274
|
-
**Input:**
|
|
275
|
-
- Phase: database
|
|
276
|
-
- Task: "Create User table with email, password fields"
|
|
277
|
-
- Complexity: simple
|
|
278
|
-
- Keywords: schema, table, migration
|
|
279
|
-
|
|
280
|
-
**Output:**
|
|
281
|
-
- TDD Required: NO
|
|
282
|
-
- Reason: "Schema design is declarative - no TDD needed"
|
|
283
|
-
- Workflow: none
|
|
284
|
-
- Confidence: high
|
|
285
|
-
|
|
286
|
-
---
|
|
287
|
-
|
|
288
|
-
## 🔄 Integration Points
|
|
289
|
-
|
|
290
|
-
### 1. In /csetup Command
|
|
291
|
-
|
|
292
|
-
**Step 5: Generate phases.md with TDD metadata**
|
|
293
|
-
|
|
294
|
-
For each phase in template:
|
|
295
|
-
1. Get phase info (agent, estimated time)
|
|
296
|
-
2. Extract task description from tasks.md
|
|
297
|
-
3. Extract keywords from description
|
|
298
|
-
4. Estimate complexity using scoring system
|
|
299
|
-
5. Classify TDD using rules above
|
|
300
|
-
6. Write phase with TDD metadata to phases.md
|
|
301
|
-
|
|
302
|
-
### 2. In /cdev Command
|
|
303
|
-
|
|
304
|
-
**Step 3: Build agent prompt with TDD requirement**
|
|
305
|
-
|
|
306
|
-
Read current phase from phases.md:
|
|
307
|
-
- If `TDD | YES` found in phase metadata:
|
|
308
|
-
- Add TDD requirement to agent prompt:
|
|
309
|
-
```
|
|
310
|
-
⚠️ TDD REQUIRED FOR THIS PHASE
|
|
311
|
-
|
|
312
|
-
Workflow: {tdd_workflow}
|
|
313
|
-
Reason: {tdd_reason}
|
|
314
|
-
|
|
315
|
-
You MUST follow RED-GREEN-REFACTOR:
|
|
316
|
-
1. Write tests FIRST (they should fail)
|
|
317
|
-
2. Write minimal implementation
|
|
318
|
-
3. Refactor while keeping tests green
|
|
319
|
-
|
|
320
|
-
Your first response MUST show RED phase (failing tests).
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
### 3. In Validation
|
|
324
|
-
|
|
325
|
-
**Check TDD compliance in pre-work validation**
|
|
326
|
-
|
|
327
|
-
If phase has `TDD | YES`:
|
|
328
|
-
- Required items:
|
|
329
|
-
- "TDD Workflow"
|
|
330
|
-
- "RED-GREEN-REFACTOR"
|
|
331
|
-
- "RED Phase: Tests written and failing" (for backend)
|
|
332
|
-
|
|
333
|
-
---
|
|
334
|
-
|
|
335
|
-
## 🎯 Benefits
|
|
336
|
-
|
|
337
|
-
✅ **Consistent TDD decisions** - No guessing, automated
|
|
338
|
-
✅ **Clear guidance for agents** - TDD metadata in phases.md
|
|
339
|
-
✅ **Enforced by validation** - Agents can't skip TDD when required
|
|
340
|
-
✅ **Flexible** - Test-alongside still allowed for simple tasks
|
|
341
|
-
✅ **Auditable** - TDD reason documented in phases.md
|
|
342
|
-
|
|
343
|
-
---
|
|
344
|
-
|
|
345
|
-
**This classification ensures TDD is used WHERE it matters, not EVERYWHERE!** 🎯
|