claude-raid 0.2.7 → 0.2.9

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 (39) hide show
  1. package/README.md +84 -23
  2. package/bin/cli.js +4 -2
  3. package/package.json +1 -1
  4. package/src/descriptions.js +10 -7
  5. package/src/init.js +36 -5
  6. package/src/merge-settings.js +53 -2
  7. package/src/remove.js +1 -1
  8. package/src/setup.js +32 -0
  9. package/src/ui.js +1 -0
  10. package/src/update.js +26 -3
  11. package/template/.claude/agents/archer.md +18 -4
  12. package/template/.claude/agents/rogue.md +18 -4
  13. package/template/.claude/agents/warrior.md +18 -4
  14. package/template/.claude/agents/wizard.md +32 -5
  15. package/template/.claude/dungeon-master-rules.md +120 -31
  16. package/template/.claude/hooks/raid-lib.sh +45 -4
  17. package/template/.claude/hooks/raid-pre-compact.sh +8 -4
  18. package/template/.claude/hooks/raid-session-end.sh +2 -2
  19. package/template/.claude/hooks/raid-session-start.sh +2 -0
  20. package/template/.claude/hooks/rtk-bridge.sh +46 -0
  21. package/template/.claude/hooks/validate-dungeon.sh +11 -3
  22. package/template/.claude/hooks/validate-file-naming.sh +6 -1
  23. package/template/.claude/hooks/validate-no-placeholders.sh +13 -2
  24. package/template/.claude/hooks/validate-write-gate.sh +7 -2
  25. package/template/.claude/party-rules.md +91 -65
  26. package/template/.claude/skills/raid-browser/SKILL.md +3 -5
  27. package/template/.claude/skills/raid-browser-chrome/SKILL.md +1 -1
  28. package/template/.claude/skills/raid-canonical-design/SKILL.md +309 -162
  29. package/template/.claude/skills/raid-canonical-implementation/SKILL.md +157 -132
  30. package/template/.claude/skills/raid-canonical-implementation-plan/SKILL.md +196 -141
  31. package/template/.claude/skills/raid-canonical-prd/SKILL.md +92 -89
  32. package/template/.claude/skills/raid-canonical-protocol/SKILL.md +29 -123
  33. package/template/.claude/skills/raid-canonical-review/SKILL.md +292 -148
  34. package/template/.claude/skills/raid-debugging/SKILL.md +1 -7
  35. package/template/.claude/skills/raid-init/SKILL.md +7 -5
  36. package/template/.claude/skills/raid-tdd/SKILL.md +5 -5
  37. package/template/.claude/skills/raid-teambuff/SKILL.md +6 -24
  38. package/template/.claude/skills/raid-verification/SKILL.md +0 -6
  39. package/template/.claude/skills/raid-wrap-up/SKILL.md +30 -29
@@ -5,212 +5,263 @@ description: "Use when Phase 3 (Plan) begins in a Canonical Quest, after the des
5
5
 
6
6
  # Raid Implementation Plan — Phase 3
7
7
 
8
- Break the design into bite-sized, battle-tested tasks through agent-driven adversarial decomposition.
8
+ Break the design into bite-sized, battle-tested tasks through the writer/reviewer/defend-concede protocol.
9
9
 
10
10
  <HARD-GATE>
11
- Do NOT start implementation until the plan is approved by the Wizard and committed to git. All assigned agents participate in plan creation AND review. No subagents.
11
+ Do NOT start implementation until the plan is approved by the human and committed to git.
12
12
  </HARD-GATE>
13
13
 
14
- ## Mode Behavior
15
-
16
- - **Full Raid**: All 3 agents decompose independently, then fight over the plan directly. Full plan doc.
17
- - **Skirmish**: 2 agents. Plan is combined with the design doc into one lightweight document.
18
- - **Scout**: Skip this skill. Wizard creates inline tasks directly.
19
-
20
14
  ## Process Flow
21
15
 
22
16
  ```dot
23
17
  digraph plan {
24
- "Wizard reads design doc + Phase 2 design doc" -> "Wizard opens Dungeon + dispatches";
25
- "Wizard opens Dungeon + dispatches" -> "Agents decompose independently";
26
- "Agents decompose independently" -> "Agents compare and fight directly";
27
- "Agents compare and fight directly" -> "Agents test compliance collaboratively";
28
- "Agents test compliance collaboratively" -> "Agents pin agreed tasks to Dungeon";
29
- "Agents pin agreed tasks to Dungeon" -> "All requirements covered?" [shape=diamond];
30
- "All requirements covered?" -> "Agents identify and fix gaps" [label="no"];
31
- "Agents identify and fix gaps" -> "Agents test compliance collaboratively";
32
- "All requirements covered?" -> "Wizard closes: synthesizes plan from Dungeon" [label="yes"];
33
- "Wizard closes: synthesizes plan from Dungeon" -> "Write plan doc";
34
- "Write plan doc" -> "Adversarial plan review (agents attack directly)";
35
- "Adversarial plan review (agents attack directly)" -> "Self-review (6-point checklist)";
36
- "Self-review (6-point checklist)" -> "Wizard ruling + commit";
37
- "Wizard ruling + commit" -> "Archive Dungeon + invoke raid-canonical-implementation" [shape=doublecircle];
18
+ "Wizard reads design.md + phase-2-design.md" -> "Phase recap (PRD + Design)";
19
+ "Phase recap (PRD + Design)" -> "Roll dice for phase turn order";
20
+ "Roll dice for phase turn order" -> "Create phase-3-plan.md evolution log";
21
+ "Create phase-3-plan.md evolution log" -> "ROUND 1: Agent 1 WRITES all tasks";
22
+ "ROUND 1: Agent 1 WRITES all tasks" -> "Agent 2 REVIEWS for design compliance";
23
+ "Agent 2 REVIEWS for design compliance" -> "Agent 3 REVIEWS, extends findings";
24
+ "Agent 3 REVIEWS, extends findings" -> "Wizard evaluates Round 1";
25
+ "Wizard evaluates Round 1" -> "ROUND 2: Agent 1 DEFEND/CONCEDE, writes V2";
26
+ "ROUND 2: Agent 1 DEFEND/CONCEDE, writes V2" -> "Agents 2+3 review V2";
27
+ "Agents 2+3 review V2" -> "Wizard evaluates — Round 3 needed?" [shape=diamond];
28
+ "Wizard evaluates — Round 3 needed?" -> "ROUND 3 (FINAL): same cycle" [label="critical gaps"];
29
+ "Wizard evaluates Round 3 needed?" -> "Extract final plan + task files" [label="solid"];
30
+ "ROUND 3 (FINAL): same cycle" -> "Extract final plan + task files";
31
+ "Extract final plan + task files" -> "Present to human" -> "Approved?" [shape=diamond];
32
+ "Approved?" -> "Ask why, explain to agents, more rounds" [label="no"];
33
+ "Ask why, explain to agents, more rounds" -> "ROUND 2: Agent 1 DEFEND/CONCEDE, writes V2";
34
+ "Approved?" -> "Commit + report with file links" [label="yes"];
35
+ "Commit + report with file links" -> "Load raid-canonical-implementation" [shape=doublecircle];
38
36
  }
39
37
  ```
40
38
 
41
39
  ## Wizard Checklist
42
40
 
43
- 1. **Read the approved design doc** — every requirement, every constraint
44
- 2. **Read the Phase 2 design doc** carry forward verified knowledge from `{questDir}/design.md` (the deliverable) and `{questDir}/phase-2-design.md` (the scoreboard)
45
- 3. **Open the Dungeon** — create `{questDir}/phase-3-plan.md` with Phase 3 header
46
- 4. **Dispatch decomposition** — all agents decompose independently with different angles, then interact directly (round-based)
47
- 5. **Observe the fight** — agents test each other's plans, argue ordering, coverage, naming. Intervene only on triggers.
48
- 6. **Close the phase** — when Dungeon has complete, verified task list
49
- 7. **Synthesize** — write plan doc from Dungeon evidence. Create individual task files: `{questDir}/phase-3-plan-task-NN.md`
50
- 8. **Adversarial plan review** — agents attack the written plan directly
51
- 9. **Self-review** — 6-point checklist (see below)
52
- 10. **Wizard ruling** — final plan approval
53
- 11. **Commit** — `docs(quest-{slug}): phase 3 plan — {N} tasks, {summary}`
54
- 12. **Transition** — invoke `raid-canonical-implementation` and begin Phase 4
41
+ 1. **Read the approved design** — `{questDir}/spoils/design.md` (deliverable) and `{questDir}/phases/phase-2-design.md` (evolution log). Every requirement, every constraint.
42
+ 2. **Phase recap** summarize PRD + Design findings. Present what carries forward to agents and human.
43
+ 3. **Roll dice** — randomly shuffle `["warrior", "archer", "rogue"]` for this phase's turn order. Update raid-session via Bash using the jq command from protocol "Dice Roll Reference". Announce: *"The dice have spoken. Turn order for this phase: {agent1} → {agent2} → {agent3}."*
44
+ 4. **Create evolution log** — `{questDir}/phases/phase-3-plan.md`
45
+ 5. **Run rounds** — see Round Protocol below
46
+ 6. **Extract final** — write individual task files `{questDir}/spoils/tasks/phase-3-plan-task-NN.md` from the evolution log
47
+ 7. **Self-review** — 6-point checklist (see below)
48
+ 8. **Present to human** — if not approved, ask why, explain feedback to agents, run more rounds
49
+ 9. **Commit** — `docs(quest-{slug}): phase 3 plan — {N} tasks`
50
+ 10. **Report** — link task files and `phases/phase-3-plan.md` to the human
51
+ 11. **Transition** — load `raid-canonical-implementation`
52
+
53
+ ## Dispatch Templates
54
+
55
+ Dispatch carries only dynamic context. Detailed instructions are embedded in the scaffolded phase file.
55
56
 
56
- ## Opening the Dungeon
57
+ **Writer (Round 1, Turn 1):**
58
+ ```
59
+ TURN_DISPATCH: Phase 3 Plan, Round 1, Turn 1.
60
+ Quest: {description}
61
+ Phase recap: {summary of PRD + Design findings}
62
+ Your role: WRITER. Your section: "Version 1 — @{name} [R1]"
63
+
64
+ FIRST: Read the FULL document at {questDir}/phases/phase-3-plan.md before writing anything.
65
+ Understand the structure, read the embedded instructions in your section, and read the
66
+ Writing Guidance at the bottom. Then read {questDir}/spoils/design.md + codebase.
67
+ THEN: Write in your designated section following the embedded instructions.
68
+ ```
57
69
 
58
- Create `{questDir}/phase-3-plan.md`:
70
+ **Reviewer (Round 1, Turns 2-3):**
71
+ ```
72
+ TURN_DISPATCH: Phase 3 Plan, Round 1, Turn {T}.
73
+ Quest: {description}
74
+ {prior agent} wrote the task decomposition.
75
+ Your role: REVIEWER. Your section: "@{name} [R1] Review"
76
+
77
+ FIRST: Read the FULL document at {questDir}/phases/phase-3-plan.md before writing anything.
78
+ Read the tasks, read the embedded instructions in your review section.
79
+ Cross-check against {questDir}/spoils/design.md for compliance.
80
+ THEN: Write your review in your designated section following the embedded instructions.
81
+ ```
82
+
83
+ **Writer (Round 2+, Defend/Concede):**
84
+ ```
85
+ TURN_DISPATCH: Phase 3 Plan, Round {N}, Turn 1.
86
+ Quest: {description}
87
+ Round {N-1} reviews are in.
88
+ Your role: WRITER. Sections: "Defend/Concede" then "Version {N}"
89
+
90
+ FIRST: Read the FULL document at {questDir}/phases/phase-3-plan.md.
91
+ Read every finding. Read the embedded instructions in your sections.
92
+ THEN: Respond to each finding, then write Version {N}.
93
+ ```
94
+
95
+ ## Evolution Log Template
96
+
97
+ Scaffold `{questDir}/phases/phase-3-plan.md`. Replace `{writer}`, `{reviewer1}`, `{reviewer2}` with actual agent names from the dice roll:
59
98
 
60
99
  ```markdown
61
- # Phase 3: Implementation Plan
62
- ## Quest: Decompose <design topic> into implementation tasks
63
- ## Mode: <Full Raid | Skirmish>
100
+ # Phase 3: Plan — Evolution Log
64
101
 
65
- ### Discoveries
102
+ ## Quest: [quest description]
103
+ ## Quest Type: Canonical Quest
104
+ ## Turn Order: @{agent1} → @{agent2} → @{agent3}
66
105
 
67
- ### Active Battles
106
+ ## References
107
+ - PRD: `{questDir}/spoils/prd.md` (if exists)
108
+ - Design: `{questDir}/spoils/design.md`
109
+ - Design Evolution: `{questDir}/phases/phase-2-design.md`
68
110
 
69
- ### Resolved
111
+ ## Quest Goal
112
+ <!-- Wizard writes 2-3 lines: what this plan must produce,
113
+ how many requirements from the design need task coverage,
114
+ and any dependency constraints discovered during design -->
70
115
 
71
- ### Shared Knowledge
116
+ ---
72
117
 
73
- ### Escalations
74
- ```
118
+ ## File Map — @{writer} [R1]
75
119
 
76
- ## File Structure Mapping
120
+ <!-- @{writer}: Map ALL files before writing tasks. Each task should produce
121
+ self-contained changes to a subset of these files.
122
+ | File | Action | Purpose |
123
+ |------|--------|---------|
124
+ Files that change together belong in the same task. -->
77
125
 
78
- Before defining tasks, map ALL files to be created or modified:
126
+ ## Version 1 @{writer} [R1]
79
127
 
80
- ```markdown
81
- ## File Map
82
-
83
- | File | Action | Responsibility |
84
- |------|--------|---------------|
85
- | `src/auth/handler.ts` | Create | Token validation and refresh |
86
- | `src/auth/types.ts` | Create | Auth types and interfaces |
87
- | `tests/auth/handler.test.ts` | Create | Unit tests for handler |
88
- | `src/middleware.ts` | Modify (L45-60) | Add auth middleware hook |
89
- ```
128
+ <!-- @{writer}: WRITER. Decompose design.md into numbered tasks.
129
+ Every requirement maps to a task. Dependency order — each buildable independently.
130
+ Task granularity: one TDD cycle (2-5 min). Use this structure per task: -->
90
131
 
91
- - Each file should have one clear responsibility
92
- - Files that change together should live together
93
- - Follow existing codebase patterns — don't restructure unless it serves the current goal
94
- - This map informs the task decomposition: each task should produce self-contained changes
132
+ ### Task 1: [Component Name]
95
133
 
96
- ## Plan Document Header
134
+ **Files:**
135
+ - Create: `exact/path/to/file.ext`
136
+ - Modify: `exact/path/to/existing.ext`
137
+ - Test: `tests/exact/path/to/test.ext`
97
138
 
98
- Every plan MUST start with:
139
+ **Acceptance Criteria:**
140
+ <!-- Each criterion must be verifiable by running a test or checking a concrete output.
141
+ Bad: "handles errors properly"
142
+ Good: "returns 401 with {error: 'token_expired'} when JWT is past expiry"
143
+ Good: "throws ValidationError when input.name exceeds 255 characters" -->
144
+ - [ ] [Specific, verifiable criterion]
145
+ - [ ] All tests pass
146
+ - [ ] No regressions
99
147
 
100
- ```markdown
101
- # [Feature Name] Implementation Plan
148
+ **Steps:**
149
+ - [ ] Write the failing test
150
+ - [ ] Run test, verify it fails for the right reason
151
+ - [ ] Write minimal implementation to pass
152
+ - [ ] Run test + full suite, verify all pass
153
+ - [ ] Commit: `feat(scope): descriptive message`
102
154
 
103
- **Goal:** [One sentence describing what this builds]
104
- **Architecture:** [2-3 sentences about approach]
105
- **Tech Stack:** [Key technologies/libraries]
106
- ```
155
+ **Implementation Notes:**
156
+ <!-- Left empty. Agent fills this AFTER implementing the task in Phase 4.
157
+ When filling: state what was built, key decisions made during implementation,
158
+ and any deviations from the plan with reasoning. -->
107
159
 
108
- ## Dispatch for Decomposition
160
+ ### Task 2: [Component Name]
161
+ <!-- Continue numbering. Same structure for every task. -->
109
162
 
110
- **DISPATCH:**
163
+ ---
111
164
 
112
- > **@Warrior**: Decompose into tasks. Focus on structural ordering what MUST be built first? Hard dependencies? Critical path? Include tests for every task. Challenge @Archer and @Rogue's decompositions directly. Pin agreed tasks to Dungeon.
113
- >
114
- > **@Archer**: Decompose into tasks. Focus on completeness and consistency — does every requirement have a task? Are interfaces well-defined across tasks? Are naming patterns and file structure consistent with the codebase? Challenge @Warrior and @Rogue directly. Pin agreed tasks to Dungeon.
115
- >
116
- > **@Rogue**: Decompose into tasks. Focus on hidden complexity — which tasks are deceptively hard? Where will the implementer guess wrong? Which tests miss the failure path? Challenge @Warrior and @Archer directly. Pin agreed tasks to Dungeon.
117
- >
118
- > **All**: Read the Phase 1 archived Dungeon for design knowledge. Interact directly. Build on each other's decompositions. Pin agreed tasks with `DUNGEON:`. Escalate to me with `WIZARD:` only when genuinely stuck.
165
+ ## ReviewRound 1
119
166
 
120
- ## Collaborative Compliance Testing (Agent-Driven)
167
+ ### @{reviewer1} [R1] Review
121
168
 
122
- After independent decomposition, agents fight directly over the plan:
169
+ <!-- @{reviewer1}: REVIEWER. Check @{writer}'s tasks against design.md:
170
+ COVERAGE (every requirement → task), ORDERING (buildable independently),
171
+ GRANULARITY (one TDD cycle each), CRITERIA (verifiable), FILES (conventions),
172
+ TESTS (failure paths), NAMING (consistent), NO PLACEHOLDERS (TBD/TODO).
173
+ For each finding: WHAT, WHY, WHAT should change. -->
123
174
 
124
- 1. **Compare decompositions** — address each other by name, argue where they agree (high confidence) and disagree (needs resolution)
125
- 2. **Test compliance with design** — every requirement verified against the plan. Line by line. No gaps. Agents cross-check each other.
126
- 3. **Test naming consistency** — agents challenge each other's naming choices against codebase patterns
127
- 4. **Test file system consistency** — file paths follow project structure, module organization clean
128
- 5. **Test coverage** — agents challenge whether tests cover failure paths, not just happy paths
129
- 6. **Test ordering** — agents argue dependency order, build-won't-break guarantees
130
- 7. **Learn from disagreements** — resolutions often reveal a better approach. Pin lessons to Dungeon.
175
+ ### @{reviewer2} [R1] Review
131
176
 
132
- **Agents do this DIRECTLY with each other. The Wizard observes and intervenes only on triggers.**
177
+ <!-- @{reviewer2}: REVIEWER. Read tasks + @{reviewer1}'s review.
178
+ Find what was missed. Challenge with evidence. Don't repeat — add new value. -->
133
179
 
134
- ## Task Granularity
180
+ ### Wizard [R1] Synthesis
135
181
 
136
- **Each step is one action (2-5 minutes):**
137
- - "Write the failing test" — step
138
- - "Run it to verify it fails" — step
139
- - "Implement minimal code to pass" — step
140
- - "Run tests to verify pass" — step
141
- - "Commit" — step
182
+ ---
142
183
 
143
- ### Browser Test Tasks (when `browser.enabled` in raid.json)
184
+ ## Defend/Concede @{writer} [R2]
144
185
 
145
- When a task involves browser-facing code, the plan must include browser test steps alongside unit tests:
146
- - "Write failing Playwright test (`tests/e2e/<feature>.spec.ts`)" — step
147
- - "Run `{execCommand} playwright test` to verify it fails" — step
148
- - "Implement the feature" — step
149
- - "Run Playwright test to verify it passes" — step
150
- - "Run full suite (unit + browser) to verify no regressions" — step
186
+ <!-- @{writer}: Read EVERY finding from @{reviewer1} and @{reviewer2}.
187
+ Respond to EACH finding explicitly:
151
188
 
152
- Not every task needs a browser test. Include them for user-facing flows, UI interactions, client-side routing, and visual state changes. State reasoning — challengers will attack this decision.
189
+ DEFEND: [finding reference] [counter-evidence]
190
+ CONCEDE: [finding reference] — [what you'll change in V2]
153
191
 
154
- ## Task Structure
192
+ No silent ignoring. Every finding gets a response. -->
155
193
 
156
- ````markdown
157
- ### Task N: [Component Name]
194
+ ## Version 2 — @{writer} [R2]
158
195
 
159
- **Files:**
160
- - Create: `exact/path/to/file.ext`
161
- - Modify: `exact/path/to/existing.ext`
162
- - Test: `tests/exact/path/to/test.ext`
196
+ <!-- @{writer}: Revised task list incorporating all conceded findings.
197
+ Mark what changed from V1 (added tasks, reordered, revised criteria). -->
163
198
 
164
- **Acceptance Criteria:**
165
- - [ ] [Specific, verifiable criterion]
166
- - [ ] All tests pass
167
- - [ ] No regressions
168
- - [ ] Naming follows established patterns
199
+ [Same task structure as Version 1]
169
200
 
170
- **Steps:**
171
- - [ ] Step 1: Write the failing test
172
- - [ ] Step 2: Run test, verify it fails for the right reason
173
- - [ ] Step 3: Write minimal implementation
174
- - [ ] Step 4: Run test, verify it passes + full suite passes
175
- - [ ] Step 5: Commit with descriptive message
176
- ````
201
+ ---
202
+
203
+ ## Review Round 2
204
+
205
+ ### @{reviewer1} [R2] Review
206
+ <!-- @{reviewer1}: Focus on V2 changes. Were findings addressed? New issues? -->
207
+
208
+ ### @{reviewer2} [R2] Review
209
+ <!-- @{reviewer2}: Same focus. Challenge defenses. Confirm concessions incorporated. -->
210
+
211
+ ### Wizard [R2] Synthesis
212
+
213
+ ---
214
+
215
+ ## Final Extraction Notes — Wizard
216
+ <!-- How many tasks extracted. Dependency graph summary.
217
+ What changed between V1 and final. -->
218
+
219
+ ---
220
+
221
+ ## Writing Guidance
222
+ - Sign all work: `@{name} [R{N}]`
223
+ - Evidence-based: reference design.md section numbers, file paths, concrete examples
224
+ - No placeholders: no TBD, TODO, "implement later", "similar to Task N", "handle edge cases"
225
+ - Each task must be independently buildable and committable
226
+ - Acceptance criteria must be verifiable by running a test or checking concrete output
227
+ - Reviewers: respond to EVERY finding — no silent ignoring
228
+ ```
229
+
230
+ **Round 3:** If needed, wizard appends Round 3 sections before dispatching. Do NOT pre-scaffold.
231
+
232
+ ### Browser Test Tasks (when `browser.enabled` in raid.json)
233
+
234
+ When a task involves browser-facing code, the plan must include Playwright test steps alongside unit tests. Not every task needs browser tests — include them for user-facing flows, UI interactions, client-side routing, and visual state changes.
177
235
 
178
236
  ## No Placeholders — Ever
179
237
 
180
238
  These are plan failures. Never write:
181
239
  - "TBD", "TODO", "implement later", "fill in details"
182
240
  - "Add appropriate error handling" (specify WHAT error handling)
183
- - "Write tests for the above" (without actual test code)
184
- - "Similar to Task N" (repeat the code — the implementer may read tasks out of order)
241
+ - "Similar to Task N" (repeat the implementer may read tasks out of order)
185
242
  - "Handle edge cases" (specify WHICH edge cases)
186
- - Steps that describe what to do without showing how
187
243
  - References to undefined types, functions, or methods
188
244
 
189
- **Violating the letter of the "no placeholders" rule is violating its spirit.**
190
-
191
245
  ## Self-Review (6-Point Checklist)
192
246
 
193
247
  After writing the complete plan:
194
248
 
195
- 1. **Spec coverage:** Skim each requirement in the design doc. Point to the task that implements it. List any gaps.
196
- 2. **Placeholder scan:** Search for TBD, TODO, vague descriptions, missing code. Fix them.
249
+ 1. **Spec coverage:** Skim each requirement in `spoils/design.md`. Point to the task that implements it. List any gaps.
250
+ 2. **Placeholder scan:** Search for TBD, TODO, vague descriptions. Fix them.
197
251
  3. **Type/name consistency:** Do types, method signatures, property names match across ALL tasks?
198
252
  4. **File structure consistency:** Do all file paths follow the project's conventions?
199
- 5. **Test quality:** Does every task have tests? Do tests cover failure paths? When `browser.enabled`: do browser-facing tasks include Playwright tests?
253
+ 5. **Test quality:** Does every task have tests? Do tests cover failure paths?
200
254
  6. **Ordering:** Can each task be built and committed independently without breaking the build?
201
255
 
202
- Fix issues inline. If a spec requirement has no task, add the task.
203
-
204
256
  ## Red Flags
205
257
 
206
258
  | Thought | Reality |
207
259
  |---------|---------|
208
- | "The plan is obvious from the design" | Plans expose complexity that specs hide. Decompose anyway. |
209
- | "We can figure out the details during implementation" | Details in implementation = placeholders in the plan. |
210
- | "I'll wait for the Wizard to synthesize" | You own the phase. Debate with teammates directly. |
260
+ | "The plan is obvious from the design" | Plans expose complexity that specs hide. |
261
+ | "We can figure out details during implementation" | Details in implementation = placeholders in the plan. |
211
262
  | "These tasks are similar enough to batch" | Each task must be independently buildable and testable. |
212
263
  | "Tests can be added later" | TDD means tests are in the plan. No test = no task. |
213
- | "The naming will be consistent enough" | Check it explicitly. Naming drift is the #1 source of bugs. |
264
+ | "Let me silently ignore that finding" | Every finding must get DEFEND: or CONCEDE:. |
214
265
 
215
266
  ---
216
267
 
@@ -218,12 +269,16 @@ Fix issues inline. If a spec requirement has no task, add the task.
218
269
 
219
270
  When the plan is approved and committed:
220
271
 
221
- 1. Update `.claude/raid-session` phase via Bash (write gate blocks Write/Edit on this file):
272
+ 1. Update raid-session phase via Bash:
222
273
  ```bash
223
274
  jq '.phase="implementation"' .claude/raid-session > .claude/raid-session.tmp && mv .claude/raid-session.tmp .claude/raid-session
224
275
  ```
225
- 2. **Commit**: `docs(quest-{slug}): phase 3 plan — {N} tasks, {summary}`
226
- 3. **Send phase report to human**: task count, dependency graph, estimated scope
227
- 4. **Load the `raid-canonical-implementation` skill now and begin Phase 4.**
276
+ 2. **Commit:** `docs(quest-{slug}): phase 3 plan — {N} tasks`
277
+ 3. **Report:** Link task files and `phases/phase-3-plan.md` file paths to the human.
278
+ 4. **Load `raid-canonical-implementation` and begin Phase 4.**
279
+
280
+ ## Phase Spoils
228
281
 
229
- Do not wait. Do not ask. The next action after committing the plan doc is loading the next skill.
282
+ **Two outputs:**
283
+ - `{questDir}/phases/phase-3-plan.md` — Full evolution timeline (all versions, reviews, defend/concede)
284
+ - `{questDir}/spoils/tasks/phase-3-plan-task-NN.md` — Individual task files with files, acceptance criteria, TDD steps