claude-cook 1.10.8 → 1.11.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/agents/cook-pm.md +140 -59
- package/commands/cook/help.md +110 -417
- package/commands/cook/pm-start.md +86 -117
- package/cook/workflows/pm-check.md +9 -8
- package/cook/workflows/pm-cycle.md +87 -21
- package/package.json +1 -1
- package/scripts/pm-loop.sh +30 -10
- package/agents/cook-debugger.md +0 -1203
- package/agents/cook-executor.md +0 -784
- package/agents/cook-integration-checker.md +0 -423
- package/agents/cook-phase-researcher.md +0 -641
- package/agents/cook-verifier.md +0 -778
- package/commands/cook/add-todo.md +0 -193
- package/commands/cook/audit-milestone.md +0 -277
- package/commands/cook/check-todos.md +0 -228
- package/commands/cook/debug.md +0 -169
- package/commands/cook/discuss-phase.md +0 -86
- package/commands/cook/execute-phase.md +0 -339
- package/commands/cook/list-phase-assumptions.md +0 -50
- package/commands/cook/pause-work.md +0 -134
- package/commands/cook/plan-milestone-gaps.md +0 -295
- package/commands/cook/quick.md +0 -309
- package/commands/cook/research-phase.md +0 -200
- package/commands/cook/resume-work.md +0 -40
- package/commands/cook/verify-work.md +0 -219
- package/cook/references/checkpoints.md +0 -1078
- package/cook/references/tdd.md +0 -263
- package/cook/references/verification-patterns.md +0 -612
- package/cook/templates/DEBUG.md +0 -159
- package/cook/templates/UAT.md +0 -247
- package/cook/templates/debug-subagent-prompt.md +0 -91
- package/cook/templates/verification-report.md +0 -322
- package/cook/workflows/diagnose-issues.md +0 -231
- package/cook/workflows/discuss-phase.md +0 -433
- package/cook/workflows/execute-phase.md +0 -671
- package/cook/workflows/execute-plan.md +0 -1844
- package/cook/workflows/list-phase-assumptions.md +0 -178
- package/cook/workflows/verify-phase.md +0 -628
- package/cook/workflows/verify-work.md +0 -596
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
# Verification Report Template
|
|
2
|
-
|
|
3
|
-
Template for `.planning/phases/XX-name/{phase}-VERIFICATION.md` — phase goal verification results.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## File Template
|
|
8
|
-
|
|
9
|
-
```markdown
|
|
10
|
-
---
|
|
11
|
-
phase: XX-name
|
|
12
|
-
verified: YYYY-MM-DDTHH:MM:SSZ
|
|
13
|
-
status: passed | gaps_found | human_needed
|
|
14
|
-
score: N/M must-haves verified
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
# Phase {X}: {Name} Verification Report
|
|
18
|
-
|
|
19
|
-
**Phase Goal:** {goal from ROADMAP.md}
|
|
20
|
-
**Verified:** {timestamp}
|
|
21
|
-
**Status:** {passed | gaps_found | human_needed}
|
|
22
|
-
|
|
23
|
-
## Goal Achievement
|
|
24
|
-
|
|
25
|
-
### Observable Truths
|
|
26
|
-
|
|
27
|
-
| # | Truth | Status | Evidence |
|
|
28
|
-
|---|-------|--------|----------|
|
|
29
|
-
| 1 | {truth from must_haves} | ✓ VERIFIED | {what confirmed it} |
|
|
30
|
-
| 2 | {truth from must_haves} | ✗ FAILED | {what's wrong} |
|
|
31
|
-
| 3 | {truth from must_haves} | ? UNCERTAIN | {why can't verify} |
|
|
32
|
-
|
|
33
|
-
**Score:** {N}/{M} truths verified
|
|
34
|
-
|
|
35
|
-
### Required Artifacts
|
|
36
|
-
|
|
37
|
-
| Artifact | Expected | Status | Details |
|
|
38
|
-
|----------|----------|--------|---------|
|
|
39
|
-
| `src/components/Chat.tsx` | Message list component | ✓ EXISTS + SUBSTANTIVE | Exports ChatList, renders Message[], no stubs |
|
|
40
|
-
| `src/app/api/chat/route.ts` | Message CRUD | ✗ STUB | File exists but POST returns placeholder |
|
|
41
|
-
| `prisma/schema.prisma` | Message model | ✓ EXISTS + SUBSTANTIVE | Model defined with all fields |
|
|
42
|
-
|
|
43
|
-
**Artifacts:** {N}/{M} verified
|
|
44
|
-
|
|
45
|
-
### Key Link Verification
|
|
46
|
-
|
|
47
|
-
| From | To | Via | Status | Details |
|
|
48
|
-
|------|----|----|--------|---------|
|
|
49
|
-
| Chat.tsx | /api/chat | fetch in useEffect | ✓ WIRED | Line 23: `fetch('/api/chat')` with response handling |
|
|
50
|
-
| ChatInput | /api/chat POST | onSubmit handler | ✗ NOT WIRED | onSubmit only calls console.log |
|
|
51
|
-
| /api/chat POST | database | prisma.message.create | ✗ NOT WIRED | Returns hardcoded response, no DB call |
|
|
52
|
-
|
|
53
|
-
**Wiring:** {N}/{M} connections verified
|
|
54
|
-
|
|
55
|
-
## Requirements Coverage
|
|
56
|
-
|
|
57
|
-
| Requirement | Status | Blocking Issue |
|
|
58
|
-
|-------------|--------|----------------|
|
|
59
|
-
| {REQ-01}: {description} | ✓ SATISFIED | - |
|
|
60
|
-
| {REQ-02}: {description} | ✗ BLOCKED | API route is stub |
|
|
61
|
-
| {REQ-03}: {description} | ? NEEDS HUMAN | Can't verify WebSocket programmatically |
|
|
62
|
-
|
|
63
|
-
**Coverage:** {N}/{M} requirements satisfied
|
|
64
|
-
|
|
65
|
-
## Anti-Patterns Found
|
|
66
|
-
|
|
67
|
-
| File | Line | Pattern | Severity | Impact |
|
|
68
|
-
|------|------|---------|----------|--------|
|
|
69
|
-
| src/app/api/chat/route.ts | 12 | `// TODO: implement` | ⚠️ Warning | Indicates incomplete |
|
|
70
|
-
| src/components/Chat.tsx | 45 | `return <div>Placeholder</div>` | 🛑 Blocker | Renders no content |
|
|
71
|
-
| src/hooks/useChat.ts | - | File missing | 🛑 Blocker | Expected hook doesn't exist |
|
|
72
|
-
|
|
73
|
-
**Anti-patterns:** {N} found ({blockers} blockers, {warnings} warnings)
|
|
74
|
-
|
|
75
|
-
## Human Verification Required
|
|
76
|
-
|
|
77
|
-
{If no human verification needed:}
|
|
78
|
-
None — all verifiable items checked programmatically.
|
|
79
|
-
|
|
80
|
-
{If human verification needed:}
|
|
81
|
-
|
|
82
|
-
### 1. {Test Name}
|
|
83
|
-
**Test:** {What to do}
|
|
84
|
-
**Expected:** {What should happen}
|
|
85
|
-
**Why human:** {Why can't verify programmatically}
|
|
86
|
-
|
|
87
|
-
### 2. {Test Name}
|
|
88
|
-
**Test:** {What to do}
|
|
89
|
-
**Expected:** {What should happen}
|
|
90
|
-
**Why human:** {Why can't verify programmatically}
|
|
91
|
-
|
|
92
|
-
## Gaps Summary
|
|
93
|
-
|
|
94
|
-
{If no gaps:}
|
|
95
|
-
**No gaps found.** Phase goal achieved. Ready to proceed.
|
|
96
|
-
|
|
97
|
-
{If gaps found:}
|
|
98
|
-
|
|
99
|
-
### Critical Gaps (Block Progress)
|
|
100
|
-
|
|
101
|
-
1. **{Gap name}**
|
|
102
|
-
- Missing: {what's missing}
|
|
103
|
-
- Impact: {why this blocks the goal}
|
|
104
|
-
- Fix: {what needs to happen}
|
|
105
|
-
|
|
106
|
-
2. **{Gap name}**
|
|
107
|
-
- Missing: {what's missing}
|
|
108
|
-
- Impact: {why this blocks the goal}
|
|
109
|
-
- Fix: {what needs to happen}
|
|
110
|
-
|
|
111
|
-
### Non-Critical Gaps (Can Defer)
|
|
112
|
-
|
|
113
|
-
1. **{Gap name}**
|
|
114
|
-
- Issue: {what's wrong}
|
|
115
|
-
- Impact: {limited impact because...}
|
|
116
|
-
- Recommendation: {fix now or defer}
|
|
117
|
-
|
|
118
|
-
## Recommended Fix Plans
|
|
119
|
-
|
|
120
|
-
{If gaps found, generate fix plan recommendations:}
|
|
121
|
-
|
|
122
|
-
### {phase}-{next}-PLAN.md: {Fix Name}
|
|
123
|
-
|
|
124
|
-
**Objective:** {What this fixes}
|
|
125
|
-
|
|
126
|
-
**Tasks:**
|
|
127
|
-
1. {Task to fix gap 1}
|
|
128
|
-
2. {Task to fix gap 2}
|
|
129
|
-
3. {Verification task}
|
|
130
|
-
|
|
131
|
-
**Estimated scope:** {Small / Medium}
|
|
132
|
-
|
|
133
|
-
---
|
|
134
|
-
|
|
135
|
-
### {phase}-{next+1}-PLAN.md: {Fix Name}
|
|
136
|
-
|
|
137
|
-
**Objective:** {What this fixes}
|
|
138
|
-
|
|
139
|
-
**Tasks:**
|
|
140
|
-
1. {Task}
|
|
141
|
-
2. {Task}
|
|
142
|
-
|
|
143
|
-
**Estimated scope:** {Small / Medium}
|
|
144
|
-
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
## Verification Metadata
|
|
148
|
-
|
|
149
|
-
**Verification approach:** Goal-backward (derived from phase goal)
|
|
150
|
-
**Must-haves source:** {PLAN.md frontmatter | derived from ROADMAP.md goal}
|
|
151
|
-
**Automated checks:** {N} passed, {M} failed
|
|
152
|
-
**Human checks required:** {N}
|
|
153
|
-
**Total verification time:** {duration}
|
|
154
|
-
|
|
155
|
-
---
|
|
156
|
-
*Verified: {timestamp}*
|
|
157
|
-
*Verifier: Claude (subagent)*
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
---
|
|
161
|
-
|
|
162
|
-
## Guidelines
|
|
163
|
-
|
|
164
|
-
**Status values:**
|
|
165
|
-
- `passed` — All must-haves verified, no blockers
|
|
166
|
-
- `gaps_found` — One or more critical gaps found
|
|
167
|
-
- `human_needed` — Automated checks pass but human verification required
|
|
168
|
-
|
|
169
|
-
**Evidence types:**
|
|
170
|
-
- For EXISTS: "File at path, exports X"
|
|
171
|
-
- For SUBSTANTIVE: "N lines, has patterns X, Y, Z"
|
|
172
|
-
- For WIRED: "Line N: code that connects A to B"
|
|
173
|
-
- For FAILED: "Missing because X" or "Stub because Y"
|
|
174
|
-
|
|
175
|
-
**Severity levels:**
|
|
176
|
-
- 🛑 Blocker: Prevents goal achievement, must fix
|
|
177
|
-
- ⚠️ Warning: Indicates incomplete but doesn't block
|
|
178
|
-
- ℹ️ Info: Notable but not problematic
|
|
179
|
-
|
|
180
|
-
**Fix plan generation:**
|
|
181
|
-
- Only generate if gaps_found
|
|
182
|
-
- Group related fixes into single plans
|
|
183
|
-
- Keep to 2-3 tasks per plan
|
|
184
|
-
- Include verification task in each plan
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
## Example
|
|
189
|
-
|
|
190
|
-
```markdown
|
|
191
|
-
---
|
|
192
|
-
phase: 03-chat
|
|
193
|
-
verified: 2025-01-15T14:30:00Z
|
|
194
|
-
status: gaps_found
|
|
195
|
-
score: 2/5 must-haves verified
|
|
196
|
-
---
|
|
197
|
-
|
|
198
|
-
# Phase 3: Chat Interface Verification Report
|
|
199
|
-
|
|
200
|
-
**Phase Goal:** Working chat interface where users can send and receive messages
|
|
201
|
-
**Verified:** 2025-01-15T14:30:00Z
|
|
202
|
-
**Status:** gaps_found
|
|
203
|
-
|
|
204
|
-
## Goal Achievement
|
|
205
|
-
|
|
206
|
-
### Observable Truths
|
|
207
|
-
|
|
208
|
-
| # | Truth | Status | Evidence |
|
|
209
|
-
|---|-------|--------|----------|
|
|
210
|
-
| 1 | User can see existing messages | ✗ FAILED | Component renders placeholder, not message data |
|
|
211
|
-
| 2 | User can type a message | ✓ VERIFIED | Input field exists with onChange handler |
|
|
212
|
-
| 3 | User can send a message | ✗ FAILED | onSubmit handler is console.log only |
|
|
213
|
-
| 4 | Sent message appears in list | ✗ FAILED | No state update after send |
|
|
214
|
-
| 5 | Messages persist across refresh | ? UNCERTAIN | Can't verify - send doesn't work |
|
|
215
|
-
|
|
216
|
-
**Score:** 1/5 truths verified
|
|
217
|
-
|
|
218
|
-
### Required Artifacts
|
|
219
|
-
|
|
220
|
-
| Artifact | Expected | Status | Details |
|
|
221
|
-
|----------|----------|--------|---------|
|
|
222
|
-
| `src/components/Chat.tsx` | Message list component | ✗ STUB | Returns `<div>Chat will be here</div>` |
|
|
223
|
-
| `src/components/ChatInput.tsx` | Message input | ✓ EXISTS + SUBSTANTIVE | Form with input, submit button, handlers |
|
|
224
|
-
| `src/app/api/chat/route.ts` | Message CRUD | ✗ STUB | GET returns [], POST returns { ok: true } |
|
|
225
|
-
| `prisma/schema.prisma` | Message model | ✓ EXISTS + SUBSTANTIVE | Message model with id, content, userId, createdAt |
|
|
226
|
-
|
|
227
|
-
**Artifacts:** 2/4 verified
|
|
228
|
-
|
|
229
|
-
### Key Link Verification
|
|
230
|
-
|
|
231
|
-
| From | To | Via | Status | Details |
|
|
232
|
-
|------|----|----|--------|---------|
|
|
233
|
-
| Chat.tsx | /api/chat GET | fetch | ✗ NOT WIRED | No fetch call in component |
|
|
234
|
-
| ChatInput | /api/chat POST | onSubmit | ✗ NOT WIRED | Handler only logs, doesn't fetch |
|
|
235
|
-
| /api/chat GET | database | prisma.message.findMany | ✗ NOT WIRED | Returns hardcoded [] |
|
|
236
|
-
| /api/chat POST | database | prisma.message.create | ✗ NOT WIRED | Returns { ok: true }, no DB call |
|
|
237
|
-
|
|
238
|
-
**Wiring:** 0/4 connections verified
|
|
239
|
-
|
|
240
|
-
## Requirements Coverage
|
|
241
|
-
|
|
242
|
-
| Requirement | Status | Blocking Issue |
|
|
243
|
-
|-------------|--------|----------------|
|
|
244
|
-
| CHAT-01: User can send message | ✗ BLOCKED | API POST is stub |
|
|
245
|
-
| CHAT-02: User can view messages | ✗ BLOCKED | Component is placeholder |
|
|
246
|
-
| CHAT-03: Messages persist | ✗ BLOCKED | No database integration |
|
|
247
|
-
|
|
248
|
-
**Coverage:** 0/3 requirements satisfied
|
|
249
|
-
|
|
250
|
-
## Anti-Patterns Found
|
|
251
|
-
|
|
252
|
-
| File | Line | Pattern | Severity | Impact |
|
|
253
|
-
|------|------|---------|----------|--------|
|
|
254
|
-
| src/components/Chat.tsx | 8 | `<div>Chat will be here</div>` | 🛑 Blocker | No actual content |
|
|
255
|
-
| src/app/api/chat/route.ts | 5 | `return Response.json([])` | 🛑 Blocker | Hardcoded empty |
|
|
256
|
-
| src/app/api/chat/route.ts | 12 | `// TODO: save to database` | ⚠️ Warning | Incomplete |
|
|
257
|
-
|
|
258
|
-
**Anti-patterns:** 3 found (2 blockers, 1 warning)
|
|
259
|
-
|
|
260
|
-
## Human Verification Required
|
|
261
|
-
|
|
262
|
-
None needed until automated gaps are fixed.
|
|
263
|
-
|
|
264
|
-
## Gaps Summary
|
|
265
|
-
|
|
266
|
-
### Critical Gaps (Block Progress)
|
|
267
|
-
|
|
268
|
-
1. **Chat component is placeholder**
|
|
269
|
-
- Missing: Actual message list rendering
|
|
270
|
-
- Impact: Users see "Chat will be here" instead of messages
|
|
271
|
-
- Fix: Implement Chat.tsx to fetch and render messages
|
|
272
|
-
|
|
273
|
-
2. **API routes are stubs**
|
|
274
|
-
- Missing: Database integration in GET and POST
|
|
275
|
-
- Impact: No data persistence, no real functionality
|
|
276
|
-
- Fix: Wire prisma calls in route handlers
|
|
277
|
-
|
|
278
|
-
3. **No wiring between frontend and backend**
|
|
279
|
-
- Missing: fetch calls in components
|
|
280
|
-
- Impact: Even if API worked, UI wouldn't call it
|
|
281
|
-
- Fix: Add useEffect fetch in Chat, onSubmit fetch in ChatInput
|
|
282
|
-
|
|
283
|
-
## Recommended Fix Plans
|
|
284
|
-
|
|
285
|
-
### 03-04-PLAN.md: Implement Chat API
|
|
286
|
-
|
|
287
|
-
**Objective:** Wire API routes to database
|
|
288
|
-
|
|
289
|
-
**Tasks:**
|
|
290
|
-
1. Implement GET /api/chat with prisma.message.findMany
|
|
291
|
-
2. Implement POST /api/chat with prisma.message.create
|
|
292
|
-
3. Verify: API returns real data, POST creates records
|
|
293
|
-
|
|
294
|
-
**Estimated scope:** Small
|
|
295
|
-
|
|
296
|
-
---
|
|
297
|
-
|
|
298
|
-
### 03-05-PLAN.md: Implement Chat UI
|
|
299
|
-
|
|
300
|
-
**Objective:** Wire Chat component to API
|
|
301
|
-
|
|
302
|
-
**Tasks:**
|
|
303
|
-
1. Implement Chat.tsx with useEffect fetch and message rendering
|
|
304
|
-
2. Wire ChatInput onSubmit to POST /api/chat
|
|
305
|
-
3. Verify: Messages display, new messages appear after send
|
|
306
|
-
|
|
307
|
-
**Estimated scope:** Small
|
|
308
|
-
|
|
309
|
-
---
|
|
310
|
-
|
|
311
|
-
## Verification Metadata
|
|
312
|
-
|
|
313
|
-
**Verification approach:** Goal-backward (derived from phase goal)
|
|
314
|
-
**Must-haves source:** 03-01-PLAN.md frontmatter
|
|
315
|
-
**Automated checks:** 2 passed, 8 failed
|
|
316
|
-
**Human checks required:** 0 (blocked by automated failures)
|
|
317
|
-
**Total verification time:** 2 min
|
|
318
|
-
|
|
319
|
-
---
|
|
320
|
-
*Verified: 2025-01-15T14:30:00Z*
|
|
321
|
-
*Verifier: Claude (subagent)*
|
|
322
|
-
```
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
<purpose>
|
|
2
|
-
Orchestrate parallel debug agents to investigate UAT gaps and find root causes.
|
|
3
|
-
|
|
4
|
-
After UAT finds gaps, spawn one debug agent per gap. Each agent investigates autonomously with symptoms pre-filled from UAT. Collect root causes, update UAT.md gaps with diagnosis, then hand off to plan-phase --gaps with actual diagnoses.
|
|
5
|
-
|
|
6
|
-
Orchestrator stays lean: parse gaps, spawn agents, collect results, update UAT.
|
|
7
|
-
</purpose>
|
|
8
|
-
|
|
9
|
-
<paths>
|
|
10
|
-
DEBUG_DIR=.planning/debug
|
|
11
|
-
|
|
12
|
-
Debug files use the `.planning/debug/` path (hidden directory with leading dot).
|
|
13
|
-
</paths>
|
|
14
|
-
|
|
15
|
-
<core_principle>
|
|
16
|
-
**Diagnose before planning fixes.**
|
|
17
|
-
|
|
18
|
-
UAT tells us WHAT is broken (symptoms). Debug agents find WHY (root cause). plan-phase --gaps then creates targeted fixes based on actual causes, not guesses.
|
|
19
|
-
|
|
20
|
-
Without diagnosis: "Comment doesn't refresh" → guess at fix → maybe wrong
|
|
21
|
-
With diagnosis: "Comment doesn't refresh" → "useEffect missing dependency" → precise fix
|
|
22
|
-
</core_principle>
|
|
23
|
-
|
|
24
|
-
<process>
|
|
25
|
-
|
|
26
|
-
<step name="parse_gaps">
|
|
27
|
-
**Extract gaps from UAT.md:**
|
|
28
|
-
|
|
29
|
-
Read the "Gaps" section (YAML format):
|
|
30
|
-
```yaml
|
|
31
|
-
- truth: "Comment appears immediately after submission"
|
|
32
|
-
status: failed
|
|
33
|
-
reason: "User reported: works but doesn't show until I refresh the page"
|
|
34
|
-
severity: major
|
|
35
|
-
test: 2
|
|
36
|
-
artifacts: []
|
|
37
|
-
missing: []
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
For each gap, also read the corresponding test from "Tests" section to get full context.
|
|
41
|
-
|
|
42
|
-
Build gap list:
|
|
43
|
-
```
|
|
44
|
-
gaps = [
|
|
45
|
-
{truth: "Comment appears immediately...", severity: "major", test_num: 2, reason: "..."},
|
|
46
|
-
{truth: "Reply button positioned correctly...", severity: "minor", test_num: 5, reason: "..."},
|
|
47
|
-
...
|
|
48
|
-
]
|
|
49
|
-
```
|
|
50
|
-
</step>
|
|
51
|
-
|
|
52
|
-
<step name="report_plan">
|
|
53
|
-
**Report diagnosis plan to user:**
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
## Diagnosing {N} Gaps
|
|
57
|
-
|
|
58
|
-
Spawning parallel debug agents to investigate root causes:
|
|
59
|
-
|
|
60
|
-
| Gap (Truth) | Severity |
|
|
61
|
-
|-------------|----------|
|
|
62
|
-
| Comment appears immediately after submission | major |
|
|
63
|
-
| Reply button positioned correctly | minor |
|
|
64
|
-
| Delete removes comment | blocker |
|
|
65
|
-
|
|
66
|
-
Each agent will:
|
|
67
|
-
1. Create DEBUG-{slug}.md with symptoms pre-filled
|
|
68
|
-
2. Investigate autonomously (read code, form hypotheses, test)
|
|
69
|
-
3. Return root cause
|
|
70
|
-
|
|
71
|
-
This runs in parallel - all gaps investigated simultaneously.
|
|
72
|
-
```
|
|
73
|
-
</step>
|
|
74
|
-
|
|
75
|
-
<step name="spawn_agents">
|
|
76
|
-
**Spawn debug agents in parallel:**
|
|
77
|
-
|
|
78
|
-
For each gap, fill the debug-subagent-prompt template and spawn:
|
|
79
|
-
|
|
80
|
-
```
|
|
81
|
-
Task(
|
|
82
|
-
prompt=filled_debug_subagent_prompt,
|
|
83
|
-
subagent_type="general-purpose",
|
|
84
|
-
description="Debug: {truth_short}"
|
|
85
|
-
)
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
**All agents spawn in single message** (parallel execution).
|
|
89
|
-
|
|
90
|
-
Template placeholders:
|
|
91
|
-
- `{truth}`: The expected behavior that failed
|
|
92
|
-
- `{expected}`: From UAT test
|
|
93
|
-
- `{actual}`: Verbatim user description from reason field
|
|
94
|
-
- `{errors}`: Any error messages from UAT (or "None reported")
|
|
95
|
-
- `{reproduction}`: "Test {test_num} in UAT"
|
|
96
|
-
- `{timeline}`: "Discovered during UAT"
|
|
97
|
-
- `{goal}`: `find_root_cause_only` (UAT flow - plan-phase --gaps handles fixes)
|
|
98
|
-
- `{slug}`: Generated from truth
|
|
99
|
-
</step>
|
|
100
|
-
|
|
101
|
-
<step name="collect_results">
|
|
102
|
-
**Collect root causes from agents:**
|
|
103
|
-
|
|
104
|
-
Each agent returns with:
|
|
105
|
-
```
|
|
106
|
-
## ROOT CAUSE FOUND
|
|
107
|
-
|
|
108
|
-
**Debug Session:** ${DEBUG_DIR}/{slug}.md
|
|
109
|
-
|
|
110
|
-
**Root Cause:** {specific cause with evidence}
|
|
111
|
-
|
|
112
|
-
**Evidence Summary:**
|
|
113
|
-
- {key finding 1}
|
|
114
|
-
- {key finding 2}
|
|
115
|
-
- {key finding 3}
|
|
116
|
-
|
|
117
|
-
**Files Involved:**
|
|
118
|
-
- {file1}: {what's wrong}
|
|
119
|
-
- {file2}: {related issue}
|
|
120
|
-
|
|
121
|
-
**Suggested Fix Direction:** {brief hint for plan-phase --gaps}
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
Parse each return to extract:
|
|
125
|
-
- root_cause: The diagnosed cause
|
|
126
|
-
- files: Files involved
|
|
127
|
-
- debug_path: Path to debug session file
|
|
128
|
-
- suggested_fix: Hint for gap closure plan
|
|
129
|
-
|
|
130
|
-
If agent returns `## INVESTIGATION INCONCLUSIVE`:
|
|
131
|
-
- root_cause: "Investigation inconclusive - manual review needed"
|
|
132
|
-
- Note which issue needs manual attention
|
|
133
|
-
- Include remaining possibilities from agent return
|
|
134
|
-
</step>
|
|
135
|
-
|
|
136
|
-
<step name="update_uat">
|
|
137
|
-
**Update UAT.md gaps with diagnosis:**
|
|
138
|
-
|
|
139
|
-
For each gap in the Gaps section, add artifacts and missing fields:
|
|
140
|
-
|
|
141
|
-
```yaml
|
|
142
|
-
- truth: "Comment appears immediately after submission"
|
|
143
|
-
status: failed
|
|
144
|
-
reason: "User reported: works but doesn't show until I refresh the page"
|
|
145
|
-
severity: major
|
|
146
|
-
test: 2
|
|
147
|
-
root_cause: "useEffect in CommentList.tsx missing commentCount dependency"
|
|
148
|
-
artifacts:
|
|
149
|
-
- path: "src/components/CommentList.tsx"
|
|
150
|
-
issue: "useEffect missing dependency"
|
|
151
|
-
missing:
|
|
152
|
-
- "Add commentCount to useEffect dependency array"
|
|
153
|
-
- "Trigger re-render when new comment added"
|
|
154
|
-
debug_session: .planning/debug/comment-not-refreshing.md
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
Update status in frontmatter to "diagnosed".
|
|
158
|
-
|
|
159
|
-
**Check planning config:**
|
|
160
|
-
|
|
161
|
-
```bash
|
|
162
|
-
COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
|
|
163
|
-
git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
**If `COMMIT_PLANNING_DOCS=false`:** Skip git operations
|
|
167
|
-
|
|
168
|
-
**If `COMMIT_PLANNING_DOCS=true` (default):**
|
|
169
|
-
|
|
170
|
-
Commit the updated UAT.md:
|
|
171
|
-
```bash
|
|
172
|
-
git add ".planning/phases/XX-name/{phase}-UAT.md"
|
|
173
|
-
git commit -m "docs({phase}): add root causes from diagnosis"
|
|
174
|
-
```
|
|
175
|
-
</step>
|
|
176
|
-
|
|
177
|
-
<step name="report_results">
|
|
178
|
-
**Report diagnosis results and hand off:**
|
|
179
|
-
|
|
180
|
-
Display:
|
|
181
|
-
```
|
|
182
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
183
|
-
COOK ► DIAGNOSIS COMPLETE
|
|
184
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
185
|
-
|
|
186
|
-
| Gap (Truth) | Root Cause | Files |
|
|
187
|
-
|-------------|------------|-------|
|
|
188
|
-
| Comment appears immediately | useEffect missing dependency | CommentList.tsx |
|
|
189
|
-
| Reply button positioned correctly | CSS flex order incorrect | ReplyButton.tsx |
|
|
190
|
-
| Delete removes comment | API missing auth header | api/comments.ts |
|
|
191
|
-
|
|
192
|
-
Debug sessions: ${DEBUG_DIR}/
|
|
193
|
-
|
|
194
|
-
Proceeding to plan fixes...
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
Return to verify-work orchestrator for automatic planning.
|
|
198
|
-
Do NOT offer manual next steps - verify-work handles the rest.
|
|
199
|
-
</step>
|
|
200
|
-
|
|
201
|
-
</process>
|
|
202
|
-
|
|
203
|
-
<context_efficiency>
|
|
204
|
-
Agents start with symptoms pre-filled from UAT (no symptom gathering).
|
|
205
|
-
Agents only diagnose—plan-phase --gaps handles fixes (no fix application).
|
|
206
|
-
</context_efficiency>
|
|
207
|
-
|
|
208
|
-
<failure_handling>
|
|
209
|
-
**Agent fails to find root cause:**
|
|
210
|
-
- Mark gap as "needs manual review"
|
|
211
|
-
- Continue with other gaps
|
|
212
|
-
- Report incomplete diagnosis
|
|
213
|
-
|
|
214
|
-
**Agent times out:**
|
|
215
|
-
- Check DEBUG-{slug}.md for partial progress
|
|
216
|
-
- Can resume with /cook:debug
|
|
217
|
-
|
|
218
|
-
**All agents fail:**
|
|
219
|
-
- Something systemic (permissions, git, etc.)
|
|
220
|
-
- Report for manual investigation
|
|
221
|
-
- Fall back to plan-phase --gaps without root causes (less precise)
|
|
222
|
-
</failure_handling>
|
|
223
|
-
|
|
224
|
-
<success_criteria>
|
|
225
|
-
- [ ] Gaps parsed from UAT.md
|
|
226
|
-
- [ ] Debug agents spawned in parallel
|
|
227
|
-
- [ ] Root causes collected from all agents
|
|
228
|
-
- [ ] UAT.md gaps updated with artifacts and missing
|
|
229
|
-
- [ ] Debug sessions saved to ${DEBUG_DIR}/
|
|
230
|
-
- [ ] Hand off to verify-work for automatic planning
|
|
231
|
-
</success_criteria>
|