mindsystem-cc 3.12.0 → 3.13.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.
Files changed (33) hide show
  1. package/agents/ms-consolidator.md +4 -4
  2. package/agents/ms-executor.md +19 -351
  3. package/agents/ms-flutter-code-quality.md +7 -6
  4. package/agents/ms-mock-generator.md +51 -138
  5. package/agents/ms-plan-checker.md +170 -175
  6. package/agents/ms-plan-writer.md +120 -115
  7. package/agents/ms-verifier.md +22 -18
  8. package/commands/ms/check-phase.md +3 -3
  9. package/commands/ms/execute-phase.md +8 -6
  10. package/commands/ms/plan-phase.md +4 -3
  11. package/commands/ms/verify-work.md +7 -7
  12. package/mindsystem/references/goal-backward.md +10 -25
  13. package/mindsystem/references/mock-patterns.md +149 -240
  14. package/mindsystem/references/plan-format.md +326 -247
  15. package/mindsystem/references/scope-estimation.md +29 -24
  16. package/mindsystem/references/tdd-execution.md +70 -0
  17. package/mindsystem/references/tdd.md +53 -194
  18. package/mindsystem/templates/UAT.md +16 -16
  19. package/mindsystem/templates/phase-prompt.md +51 -367
  20. package/mindsystem/templates/roadmap.md +1 -1
  21. package/mindsystem/templates/verification-report.md +2 -2
  22. package/mindsystem/workflows/adhoc.md +16 -21
  23. package/mindsystem/workflows/execute-phase.md +71 -49
  24. package/mindsystem/workflows/execute-plan.md +183 -1054
  25. package/mindsystem/workflows/plan-phase.md +47 -38
  26. package/mindsystem/workflows/verify-phase.md +16 -20
  27. package/mindsystem/workflows/verify-work.md +54 -67
  28. package/package.json +1 -1
  29. package/scripts/update-state.sh +59 -0
  30. package/scripts/validate-execution-order.sh +102 -0
  31. package/skills/flutter-code-quality/SKILL.md +4 -3
  32. package/mindsystem/templates/summary.md +0 -293
  33. package/mindsystem/workflows/generate-mocks.md +0 -261
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ms-plan-writer
3
- description: Generates framework-specific PLAN.md files from task breakdown. Spawned by /ms:plan-phase after task identification.
4
- model: sonnet
3
+ description: Generates pure markdown PLAN.md files and EXECUTION-ORDER.md from task breakdown. Spawned by /ms:plan-phase after task identification.
4
+ model: opus
5
5
  tools: Read, Write, Bash, Glob, Grep
6
6
  color: blue
7
7
  ---
@@ -11,7 +11,7 @@ You are a Mindsystem plan writer. You receive a structured task breakdown from t
11
11
 
12
12
  You are spawned by `/ms:plan-phase` orchestrator AFTER task identification is complete.
13
13
 
14
- Your job: Transform task lists into parallel-optimized PLAN.md files with proper dependencies, wave assignments, must_haves, and risk assessment.
14
+ Your job: Transform task lists into parallel-optimized PLAN.md files with wave groups, must-haves, and risk assessment.
15
15
 
16
16
  **What you receive:**
17
17
  - Task list with needs/creates/tdd_candidate flags
@@ -20,8 +20,9 @@ Your job: Transform task lists into parallel-optimized PLAN.md files with proper
20
20
  - Relevant learnings from past work (debug resolutions, adhoc insights, established patterns, prior decisions, curated cross-milestone learnings)
21
21
 
22
22
  **What you produce:**
23
- - PLAN.md files following phase-prompt template
24
- - Git commit of plans
23
+ - Pure markdown PLAN.md files (no YAML frontmatter, no XML containers)
24
+ - EXECUTION-ORDER.md with wave groups and dependency notes
25
+ - Git commit of all plan files
25
26
  - Risk score with top factors
26
27
 
27
28
  **Critical mindset:** Plans are prompts that Claude executes. Optimize for parallel execution, explicit dependencies, and goal-backward verification.
@@ -30,12 +31,13 @@ Your job: Transform task lists into parallel-optimized PLAN.md files with proper
30
31
  <required_reading>
31
32
  Load these references for plan writing:
32
33
 
33
- 1. `~/.claude/mindsystem/templates/phase-prompt.md` — PLAN.md structure
34
- 2. `~/.claude/mindsystem/references/plan-format.md` — Format conventions
34
+ 1. `~/.claude/mindsystem/templates/phase-prompt.md` — Process guidance for plan generation
35
+ 2. `~/.claude/mindsystem/references/plan-format.md` — Plan format specification
35
36
  3. `~/.claude/mindsystem/references/scope-estimation.md` — Context budgets
36
- 4. `~/.claude/mindsystem/references/tdd.md` — TDD plan structure
37
- 6. `~/.claude/mindsystem/references/goal-backward.md` — must_haves derivation
38
- 7. `~/.claude/mindsystem/references/plan-risk-assessment.md` — Risk scoring
37
+ 4. `~/.claude/mindsystem/references/goal-backward.md` — Must-haves derivation
38
+ 5. `~/.claude/mindsystem/references/plan-risk-assessment.md` — Risk scoring
39
+
40
+ Read `~/.claude/mindsystem/references/tdd.md` only if any task has `tdd_candidate: true`. Conditional loading saves ~1,000 tokens for non-TDD phases.
39
41
  </required_reading>
40
42
 
41
43
  <input_format>
@@ -90,8 +92,14 @@ Read required references to understand plan structure and scope rules.
90
92
 
91
93
  ```bash
92
94
  cat ~/.claude/mindsystem/templates/phase-prompt.md
95
+ cat ~/.claude/mindsystem/references/plan-format.md
93
96
  cat ~/.claude/mindsystem/references/scope-estimation.md
94
97
  ```
98
+
99
+ If any task has `tdd_candidate: true`, also read:
100
+ ```bash
101
+ cat ~/.claude/mindsystem/references/tdd.md
102
+ ```
95
103
  </step>
96
104
 
97
105
  <step name="build_dependency_graph">
@@ -138,6 +146,8 @@ Verify:
138
146
  - All roots have wave = 1
139
147
  - Dependents have wave > all dependencies
140
148
  - No cycles exist (error if found)
149
+
150
+ Wave assignments are written to EXECUTION-ORDER.md, not to individual plans.
141
151
  </step>
142
152
 
143
153
  <step name="group_into_plans">
@@ -147,7 +157,8 @@ Rules:
147
157
  1. **Same-wave tasks with no file conflicts → parallel plans**
148
158
  2. **Tasks with shared files → same plan**
149
159
  3. **TDD candidates → dedicated plans (one feature per TDD plan)**
150
- 5. **2-3 tasks per plan, ~50% context target**
160
+ 4. **2-3 tasks per plan, ~50% context target**
161
+ 5. **Default to 3 tasks for simple-medium work, 2 for complex**
151
162
 
152
163
  Grouping algorithm:
153
164
  ```
@@ -159,37 +170,27 @@ Grouping algorithm:
159
170
  ```
160
171
 
161
172
  **Plan assignment:**
162
- - Each plan gets a number (01, 02, 03...)
163
- - Plans inherit wave from their highest-wave task
164
- - Plans inherit depends_on from task dependencies (translated to plan IDs)
173
+ - Each plan gets a sequential number (01, 02, 03...)
165
174
  </step>
166
175
 
167
176
  <step name="derive_must_haves">
168
- **Derive must_haves from phase goal using goal-backward analysis.**
169
-
170
- For EACH plan, derive:
171
-
172
- ```yaml
173
- must_haves:
174
- truths:
175
- - "Observable behavior 1 from user perspective"
176
- - "Observable behavior 2 from user perspective"
177
- artifacts:
178
- - path: "src/path/to/file.ts"
179
- provides: "What this delivers"
180
- min_lines: 30 # Optional
181
- key_links:
182
- - from: "src/component.tsx"
183
- to: "/api/endpoint"
184
- via: "fetch in useEffect"
177
+ **Derive must-haves from phase goal using goal-backward analysis.**
178
+
179
+ For EACH plan, derive a markdown checklist:
180
+
181
+ ```markdown
182
+ ## Must-Haves
183
+ - [ ] Valid credentials return 200 with Set-Cookie header
184
+ - [ ] Invalid credentials return 401
185
+ - [ ] Passwords compared with bcrypt, never plaintext
185
186
  ```
186
187
 
187
188
  **Process:**
188
189
  1. What must be TRUE for tasks in this plan to achieve their goals?
189
- 2. What artifacts must EXIST with real implementation?
190
- 3. What connections (key_links) must be WIRED between artifacts?
190
+ 2. Each item is a user-observable truth, not an implementation detail
191
+ 3. 3-7 items per plan
191
192
 
192
- Truths should be user-observable, not implementation details.
193
+ The verifier derives artifacts and key_links from the plan's ## Changes section.
193
194
  </step>
194
195
 
195
196
  <step name="estimate_scope">
@@ -205,115 +206,113 @@ If any plan exceeds:
205
206
  - 10+ files: Split by subsystem
206
207
  - Complex domain (auth, payments): Consider extra split
207
208
 
209
+ Default to 3 tasks for simple-medium work, 2 for complex. Executor overhead reduction creates headroom for the third task.
208
210
  </step>
209
211
 
210
212
  <step name="write_plan_files">
211
- **Write PLAN.md files following template structure.**
213
+ **Write PLAN.md files following pure markdown format.**
212
214
 
213
215
  For each plan, create `.planning/phases/{phase_dir}/{phase}-{plan}-PLAN.md`:
214
216
 
215
217
  ```markdown
216
- ---
217
- phase: {phase_number}-{phase_name}
218
- plan: {plan_number}
219
- type: execute # or tdd
220
- wave: {wave_number}
221
- depends_on: [{plan_ids}]
222
- files_modified: [{files}]
223
- subsystem_hint: {from phase_context, for executor SUMMARY.md}
224
- user_setup: [] # If external services needed
225
-
226
- must_haves:
227
- truths:
228
- - {observable_behaviors}
229
- artifacts:
230
- - path: {file_path}
231
- provides: {description}
232
- key_links:
233
- - from: {source}
234
- to: {target}
235
- via: {method}
236
- ---
218
+ # Plan {NN}: {Descriptive Title}
237
219
 
238
- <objective>
239
- {plan_goal}
220
+ **Subsystem:** {subsystem_hint} | **Type:** tdd
240
221
 
241
- Purpose: {why_this_matters}
242
- Output: {artifacts_created}
243
- </objective>
222
+ ## Context
223
+ {Why this work exists. Approach chosen and WHY.}
244
224
 
245
- <execution_context>
246
- @~/.claude/mindsystem/workflows/execute-plan.md
247
- @~/.claude/mindsystem/templates/summary.md
248
- </execution_context>
225
+ ## Changes
249
226
 
250
- <context>
251
- @.planning/PROJECT.md
252
- @.planning/ROADMAP.md
253
- @.planning/STATE.md
254
- {Prior SUMMARYs only if genuinely needed}
255
- {If debug resolution directly relevant to a plan task: @.planning/debug/resolved/{slug}.md}
256
- {Relevant source files}
257
- </context>
227
+ ### 1. {Change title}
228
+ **Files:** `{file_path}`
258
229
 
259
- <tasks>
260
- {Task XML from input, expanded with full structure}
261
- </tasks>
230
+ {Implementation details. Reference existing utilities with paths.}
262
231
 
263
- <verification>
264
- - [ ] {verification_checks}
265
- </verification>
232
+ ### 2. {Another change}
233
+ **Files:** `{file_path}`, `{another_path}`
266
234
 
267
- <success_criteria>
268
- - All tasks completed
269
- - {plan_specific_criteria}
270
- </success_criteria>
235
+ {Details with inline code blocks where needed.}
271
236
 
272
- <output>
273
- After completion, create `.planning/phases/{phase_dir}/{phase}-{plan}-SUMMARY.md`
274
- </output>
275
- ```
237
+ ## Verification
238
+ - `{bash command}` {expected result}
239
+ - `{another command}` {expected result}
276
240
 
277
- **Task expansion:** Convert input task hints to full task structure:
278
- ```xml
279
- <task type="{type}">
280
- <name>Task {N}: {name}</name>
281
- <files>{creates}</files>
282
- <action>{action_hint expanded}</action>
283
- <verify>{verify_hint}</verify>
284
- <done>{done_hint}</done>
285
- </task>
241
+ ## Must-Haves
242
+ - [ ] {observable truth}
243
+ - [ ] {observable truth}
286
244
  ```
287
245
 
288
- **Learnings-aware expansion:** When expanding `action_hint` to full `<action>`, check `<learnings>` for entries relevant to this specific task:
289
- - Debug resolution whose domain matches task files or subsystem
290
- - Established pattern that applies to this task's implementation
291
- - Curated learning matching the task's technical area
246
+ **Format rules:**
247
+ - Omit `| **Type:** tdd` when type is execute (type defaults to execute)
248
+ - Plans carry no `<execution_context>`, `<context>`, or @-references — the executor loads its own workflow and project files via its agent definition
249
+ - No `<tasks>`, `<verification>`, `<success_criteria>`, `<output>` XML containers
292
250
 
293
- For each relevant learning, append a directive to `<action>`:
251
+ **Learnings integration:** When expanding tasks to ## Changes subsections, check `<learnings>` for entries relevant to each change:
294
252
 
295
- ```xml
296
- <action>
297
- {expanded action_hint}
253
+ ```markdown
254
+ ### 2. Create auth endpoint
255
+ **Files:** `src/api/auth/login.ts`
256
+
257
+ POST endpoint accepting {email, password}...
298
258
 
299
- Based on prior learning ({source}): {actionable directive}
300
- </action>
259
+ **From prior work:** CommonJS libraries fail silently in Edge runtime — verify ESM compat.
301
260
  ```
302
261
 
303
262
  Rules:
304
- - Maximum 2 learning directives per task (context budget)
263
+ - Maximum 2 learning directives per change
305
264
  - Only include learnings that change what the executor would do
306
265
  - Phrase as imperative directives, not history
307
- - If no learnings match a task, add nothing
266
+ - If no learnings match a change, add nothing
308
267
 
309
- **TDD plans:** Use `type: tdd` with feature structure instead of tasks.
268
+ **TDD plans:** When type is tdd, use RED/GREEN/REFACTOR structure in ## Changes:
269
+
270
+ ```markdown
271
+ ### 1. RED — Write failing tests
272
+ **Files:** `src/lib/__tests__/validate-email.test.ts`
273
+
274
+ {Test cases and expectations.}
275
+
276
+ ### 2. GREEN — Implement minimal solution
277
+ **Files:** `src/lib/validate-email.ts`
278
+
279
+ {Minimal implementation to pass tests.}
280
+
281
+ ### 3. REFACTOR — Improve structure
282
+ **Files:** `src/lib/validate-email.ts`
283
+
284
+ {Structural improvements. Run tests — all must still pass.}
285
+ ```
286
+ </step>
287
+
288
+ <step name="write_execution_order">
289
+ **Generate EXECUTION-ORDER.md alongside plans.**
290
+
291
+ Create `.planning/phases/{phase_dir}/EXECUTION-ORDER.md`:
292
+
293
+ ```markdown
294
+ # Execution Order
295
+
296
+ ## Wave 1 (parallel)
297
+ - 01-PLAN.md — {description}
298
+ - 02-PLAN.md — {description}
299
+
300
+ ## Wave 2 (parallel)
301
+ - 03-PLAN.md — {description} (depends on 01 for {reason})
302
+ ```
303
+
304
+ Rules:
305
+ - One wave per dependency level
306
+ - Plans within a wave execute in parallel
307
+ - Brief dependency notes for waves > 1
308
+ - All plans listed
310
309
  </step>
311
310
 
312
311
  <step name="git_commit">
313
312
  **Commit all plan files.**
314
313
 
315
314
  ```bash
316
- git add .planning/phases/${PHASE}*/*-PLAN.md
315
+ git add .planning/phases/${PHASE_DIR}/*-PLAN.md .planning/phases/${PHASE_DIR}/EXECUTION-ORDER.md
317
316
  git commit -m "$(cat <<'EOF'
318
317
  docs(${PHASE}): create phase plans
319
318
 
@@ -346,8 +345,8 @@ if plan_count >= 5:
346
345
  score += 15
347
346
  factors.append(f"{plan_count} plans in phase")
348
347
 
349
- # External services (from user_setup)
350
- services = collect from user_setup frontmatter
348
+ # External services (from task descriptions)
349
+ services = external services mentioned in task descriptions
351
350
  if services:
352
351
  score += min(len(services) * 10, 20)
353
352
  factors.append(f"External services: {', '.join(services)}")
@@ -411,6 +410,7 @@ Return structured markdown to orchestrator:
411
410
 
412
411
  ### Files Created
413
412
 
413
+ - `.planning/phases/{phase_dir}/EXECUTION-ORDER.md`
414
414
  - `.planning/phases/{phase_dir}/{phase}-01-PLAN.md`
415
415
  - `.planning/phases/{phase_dir}/{phase}-02-PLAN.md`
416
416
  - ...
@@ -421,6 +421,10 @@ The orchestrator parses this to present risk via AskUserQuestion and offer next
421
421
 
422
422
  <anti_patterns>
423
423
 
424
+ **DO NOT use YAML frontmatter or XML containers in plans.** Plans are pure markdown.
425
+
426
+ **DO NOT put wave numbers or dependencies in individual plans.** Use EXECUTION-ORDER.md.
427
+
424
428
  **DO NOT reflexively chain dependencies.**
425
429
  Plan 02 does not depend on Plan 01 just because 01 comes first. Check actual needs/creates.
426
430
 
@@ -444,12 +448,13 @@ Only reference prior SUMMARYs if this plan genuinely imports types/exports from
444
448
 
445
449
  Plan writing complete when:
446
450
 
447
- - [ ] References loaded (phase-prompt, scope-estimation, etc.)
451
+ - [ ] References loaded (phase-prompt, plan-format, scope-estimation, + tdd if needed)
448
452
  - [ ] Dependency graph built from needs/creates
449
453
  - [ ] Waves assigned (all roots wave 1, dependents correct)
450
454
  - [ ] Tasks grouped into plans (2-3 tasks, ~50% context)
451
- - [ ] must_haves derived for each plan
452
- - [ ] PLAN.md files written with full structure
455
+ - [ ] Must-haves derived as markdown checklists
456
+ - [ ] PLAN.md files written with pure markdown format
457
+ - [ ] EXECUTION-ORDER.md generated with wave groups
453
458
  - [ ] Plans committed to git
454
459
  - [ ] Risk score calculated with factors
455
460
  - [ ] Structured result returned to orchestrator
@@ -74,33 +74,37 @@ Extract phase goal from ROADMAP.md. This is the outcome to verify, not the tasks
74
74
 
75
75
  Determine what must be verified. In re-verification mode, must-haves come from Step 0.
76
76
 
77
- **Option A: Must-haves in PLAN frontmatter**
77
+ **Option A: Must-Haves from PLAN.md**
78
78
 
79
- Check if any PLAN.md has `must_haves` in frontmatter:
79
+ Check if any PLAN.md has a `## Must-Haves` section:
80
80
 
81
81
  ```bash
82
- grep -l "must_haves:" "$PHASE_DIR"/*-PLAN.md 2>/dev/null
82
+ grep -l "## Must-Haves" "$PHASE_DIR"/*-PLAN.md 2>/dev/null
83
83
  ```
84
84
 
85
- If found, extract and use:
85
+ If found, parse the markdown checklist items:
86
86
 
87
- ```yaml
88
- must_haves:
89
- truths:
90
- - "User can see existing messages"
91
- - "User can send a message"
92
- artifacts:
93
- - path: "src/components/Chat.tsx"
94
- provides: "Message list rendering"
95
- key_links:
96
- - from: "Chat.tsx"
97
- to: "api/chat"
98
- via: "fetch in useEffect"
87
+ ```markdown
88
+ ## Must-Haves
89
+ - [ ] User can see existing messages
90
+ - [ ] User can send a message
99
91
  ```
100
92
 
93
+ Each `- [ ]` item is a **truth** to verify.
94
+
95
+ **Derive artifacts** from `## Changes` section by parsing `**Files:**` lines:
96
+
97
+ ```bash
98
+ grep "^\*\*Files:\*\*" "$PHASE_DIR"/*-PLAN.md
99
+ ```
100
+
101
+ Each `**Files:**` line identifies artifacts to verify (existence, substantiveness, wiring).
102
+
103
+ **Derive key_links** from `## Changes` content — look for references between components (fetch calls, imports, database queries mentioned in implementation details).
104
+
101
105
  **Option B: Derive from phase goal**
102
106
 
103
- If no must_haves in frontmatter, derive using goal-backward process:
107
+ If no `## Must-Haves` section found in plans, derive using goal-backward process:
104
108
 
105
109
  1. **State the goal:** Take phase goal from ROADMAP.md
106
110
 
@@ -764,7 +768,7 @@ return <div>No messages</div> // Always shows "no messages"
764
768
 
765
769
  - [ ] Previous VERIFICATION.md checked (Step 0)
766
770
  - [ ] If re-verification: must-haves loaded from previous, focus on failed items
767
- - [ ] If initial: must-haves established (from frontmatter or derived)
771
+ - [ ] If initial: must-haves established (from ## Must-Haves section or derived from phase goal)
768
772
  - [ ] All truths verified with status and evidence
769
773
  - [ ] All artifacts checked at all three levels (exists, substantive, wired)
770
774
  - [ ] All key links verified
@@ -18,11 +18,11 @@ This spawns ms-plan-checker to analyze your PLAN.md files against the phase goal
18
18
 
19
19
  <what_it_checks>
20
20
  1. **Requirement Coverage** — Does every phase requirement have tasks addressing it?
21
- 2. **Task Completeness** — Does every task have files, action, verify, done?
21
+ 2. **Task Completeness** — Does every change have Files, implementation details, and verification?
22
22
  3. **Dependency Correctness** — Are plan dependencies valid and acyclic?
23
23
  4. **Key Links Planned** — Are artifacts wired together, not just created in isolation?
24
24
  5. **Scope Sanity** — Will plans complete within context budget (2-3 tasks per plan)?
25
- 6. **Verification Derivation** — Are must_haves user-observable, not implementation-focused?
25
+ 6. **Verification Derivation** — Are Must-Haves user-observable, not implementation-focused?
26
26
  7. **Context Compliance** — Do plans honor decisions from CONTEXT.md?
27
27
  </what_it_checks>
28
28
 
@@ -60,7 +60,7 @@ Count plans and tasks:
60
60
  ```bash
61
61
  for plan in "$PHASE_DIR"/*-PLAN.md; do
62
62
  echo "=== $(basename $plan) ==="
63
- grep -c "<task" "$plan" 2>/dev/null || echo "0 tasks"
63
+ grep -c "^### " "$plan" 2>/dev/null || echo "0 changes"
64
64
  done
65
65
  ```
66
66
  </step>
@@ -17,7 +17,7 @@ allowed-tools:
17
17
  <objective>
18
18
  Execute all plans in a phase using wave-based parallel execution.
19
19
 
20
- Orchestrator stays lean: discover plans, analyze dependencies, group into waves, spawn subagents, collect results. Each subagent loads the full execute-plan context and handles its own plan.
20
+ Orchestrator stays lean: discover plans, read execution order, spawn subagents in waves, collect results. Each subagent loads the full execute-plan context and handles its own plan.
21
21
 
22
22
  Context budget: ~15% orchestrator, 100% fresh per subagent.
23
23
  </objective>
@@ -49,11 +49,12 @@ PHASE=$(printf "%02d" "$PHASE_ARG" 2>/dev/null || echo "$PHASE_ARG")
49
49
  2. **Discover plans**
50
50
  - List all *-PLAN.md files in phase directory
51
51
  - Check which have *-SUMMARY.md (already complete)
52
+ - Verify EXECUTION-ORDER.md exists
52
53
  - Build list of incomplete plans
53
54
 
54
- 3. **Group by wave**
55
- - Read `wave` from each plan's frontmatter
56
- - Group plans by wave number
55
+ 3. **Validate and read execution order**
56
+ - Run `validate-execution-order.sh` on phase directory
57
+ - Parse EXECUTION-ORDER.md wave structure
57
58
  - Report wave structure to user
58
59
 
59
60
  4. **Execute waves**
@@ -61,6 +62,7 @@ PHASE=$(printf "%02d" "$PHASE_ARG" 2>/dev/null || echo "$PHASE_ARG")
61
62
  - Spawn `ms-executor` for each plan in wave (parallel Task calls)
62
63
  - Wait for completion (Task blocks)
63
64
  - Verify SUMMARYs created
65
+ - Run `update-state.sh` to update plan progress
64
66
  - Proceed to next wave
65
67
 
66
68
  5. **Aggregate results**
@@ -75,7 +77,7 @@ PHASE=$(printf "%02d" "$PHASE_ARG" 2>/dev/null || echo "$PHASE_ARG")
75
77
 
76
78
  7. **Verify phase goal**
77
79
  - Spawn `ms-verifier` subagent with phase directory and goal
78
- - Verifier checks must_haves against actual codebase (not SUMMARY claims)
80
+ - Verifier checks Must-Haves against actual codebase (not SUMMARY claims)
79
81
  - Creates VERIFICATION.md with detailed report
80
82
  - Route by status:
81
83
  - `passed` → continue to step 8
@@ -226,7 +228,7 @@ After all plans in phase complete:
226
228
  - [ ] All incomplete plans in phase executed
227
229
  - [ ] Each plan has SUMMARY.md
228
230
  - [ ] Code review completed (or skipped if config says "skip")
229
- - [ ] Phase goal verified (must_haves checked against codebase)
231
+ - [ ] Phase goal verified (Must-Haves checked against codebase)
230
232
  - [ ] VERIFICATION.md created in phase directory
231
233
  - [ ] Patch file generated OR explicitly skipped with message
232
234
  - [ ] STATE.md reflects phase completion
@@ -112,8 +112,9 @@ Check for `.planning/codebase/` and load relevant documents based on phase type.
112
112
  <success_criteria>
113
113
 
114
114
  - One or more PLAN.md files created in .planning/phases/XX-name/
115
- - Each plan has: objective, execution_context, context, tasks, verification, success_criteria, output
116
- - must_haves derived from phase goal and documented in frontmatter (truths, artifacts, key_links)
117
- - Tasks are specific enough for Claude to execute
115
+ - Each plan has: Context, Changes, Verification, Must-Haves (pure markdown format)
116
+ - Must-Haves derived as markdown checklist of user-observable truths
117
+ - Changes are specific enough for Claude to execute
118
+ - EXECUTION-ORDER.md created with wave groups and dependencies
118
119
  - User knows next steps (execute plan or review/adjust)
119
120
  </success_criteria>
@@ -43,9 +43,9 @@ Phase: $ARGUMENTS (optional)
43
43
  4. **Extract testable deliverables** from summaries
44
44
  5. **Classify tests by mock requirements** — Use SUMMARY.md mock_hints when available; classify inline with keyword heuristics when absent. Confirm data availability with user before batching.
45
45
  6. **Group into batches** — By mock type, max 4 per batch, no-mock tests first
46
- - If any tests require mocks: Read `~/.claude/mindsystem/references/mock-patterns.md` and `~/.claude/mindsystem/workflows/generate-mocks.md` for mock generation guidance
46
+ - If any tests require transient_state mocks: Read `~/.claude/mindsystem/references/mock-patterns.md` for delay strategies
47
47
  7. **For each batch:**
48
- - If mock needed: Generate mocks, present toggle instructions, wait for confirmation
48
+ - If mock needed: Apply inline mocks (1-4 direct edits, 5+ via ms-mock-generator subagent), tell user to hot reload
49
49
  - Present tests via AskUserQuestion (Pass / Can't test / Skip / Other)
50
50
  - Process results, update UAT.md
51
51
  - **For each issue found:**
@@ -54,10 +54,10 @@ Phase: $ARGUMENTS (optional)
54
54
  - If complex: Spawn ms-verify-fixer subagent
55
55
  - 2 retries on failed re-test, then offer options
56
56
  8. **On batch transition:**
57
- - If new mock_type: Discard old mocks, generate new ones
57
+ - If new mock_type: Revert old mocks (`git checkout -- <mocked_files>`), apply new ones
58
58
  - If same mock_type: Keep mocks active
59
59
  9. **On completion:**
60
- - Discard all mocks (git stash drop)
60
+ - Revert all mocks (`git checkout -- <mocked_files>`)
61
61
  - Generate UAT fixes patch
62
62
  - Restore user's pre-existing work (if stashed)
63
63
  - Commit UAT.md, present summary
@@ -77,7 +77,7 @@ Phase: $ARGUMENTS (optional)
77
77
  - Don't run automated tests — this is manual user validation
78
78
  - Don't skip investigation — always try 2-3 tool calls before escalating
79
79
  - Don't fix complex issues inline — spawn fixer subagent for multi-file or architectural changes
80
- - Don't commit mock code — always stash before fixing
80
+ - Don't commit mock code — stash mocked files before fixing, restore after
81
81
  - Don't re-present skipped tests — assumptions stand
82
82
  </anti_patterns>
83
83
 
@@ -85,14 +85,14 @@ Phase: $ARGUMENTS (optional)
85
85
  - [ ] Dirty tree handled at start (stash/commit/abort)
86
86
  - [ ] Tests extracted from SUMMARY.md and classified
87
87
  - [ ] Tests batched by mock requirements
88
- - [ ] Mocks generated when needed with clear toggle instructions
88
+ - [ ] Mocks applied inline when needed (1-4 direct, 5+ via subagent)
89
89
  - [ ] Tests presented in batches of 4 using AskUserQuestion
90
90
  - [ ] Issues investigated with lightweight check first
91
91
  - [ ] Simple issues fixed inline with proper commit message
92
92
  - [ ] Complex issues escalated to fixer subagent
93
93
  - [ ] Failed re-tests get 2 retries then options
94
94
  - [ ] Stash conflicts auto-resolved to fix version
95
- - [ ] Mocks discarded on completion
95
+ - [ ] Mocks reverted on completion (git checkout)
96
96
  - [ ] UAT fixes patch generated
97
97
  - [ ] User's pre-existing work restored
98
98
  - [ ] UAT.md committed with final summary
@@ -117,31 +117,16 @@ Key links get extra verification attention. These are where stubs and placeholde
117
117
  </the_process>
118
118
 
119
119
  <output_format>
120
- The derive_must_haves step produces a structured list for PLAN.md frontmatter:
121
-
122
- ```yaml
123
- must_haves:
124
- truths:
125
- - "User can see existing messages"
126
- - "User can send a message"
127
- - "Messages persist across refresh"
128
- artifacts:
129
- - path: "src/components/Chat.tsx"
130
- provides: "Message list rendering"
131
- - path: "src/app/api/chat/route.ts"
132
- provides: "Message CRUD operations"
133
- - path: "prisma/schema.prisma"
134
- provides: "Message model"
135
- key_links:
136
- - from: "Chat.tsx"
137
- to: "api/chat"
138
- via: "fetch in useEffect"
139
- - from: "api/chat POST"
140
- to: "database"
141
- via: "prisma.message.create"
120
+ The derive_must_haves step produces a markdown checklist for the plan's ## Must-Haves section:
121
+
122
+ ```markdown
123
+ ## Must-Haves
124
+ - [ ] User can see existing messages
125
+ - [ ] User can send a message
126
+ - [ ] Messages persist across refresh
142
127
  ```
143
128
 
144
- This structure is machine-readable for verification after execution.
129
+ Each item is a user-observable truth. The verifier derives artifacts and key_links from the plan's ## Changes section.
145
130
  </output_format>
146
131
 
147
132
  <examples>
@@ -261,7 +246,7 @@ Key links are verification priorities. Without them, you check everything equall
261
246
 
262
247
  The `derive_must_haves` step runs after gathering context, before breaking into tasks.
263
248
 
264
- Output: `must_haves` structure written to PLAN.md frontmatter.
249
+ Output: must-haves written to the plan's ## Must-Haves section.
265
250
 
266
251
  Tasks are then designed to CREATE the artifacts and ESTABLISH the wiring.
267
252
 
@@ -269,7 +254,7 @@ Tasks are then designed to CREATE the artifacts and ESTABLISH the wiring.
269
254
 
270
255
  The `verify_phase_goal` step runs after all plans execute, before updating roadmap.
271
256
 
272
- Input: `must_haves` from PLAN.md frontmatter (or derived from goal if missing).
257
+ Input: ## Must-Haves from plan markdown (or derived from goal if missing).
273
258
 
274
259
  Process: Check each truth against codebase, verify artifacts exist and aren't stubs, trace key links.
275
260