mindsystem-cc 4.0.4 → 4.1.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 (35) hide show
  1. package/README.md +80 -42
  2. package/agents/ms-researcher.md +3 -3
  3. package/agents/ms-roadmapper.md +11 -6
  4. package/bin/install.js +2 -2
  5. package/commands/ms/audit-milestone.md +35 -42
  6. package/commands/ms/create-roadmap.md +7 -25
  7. package/commands/ms/help.md +52 -38
  8. package/commands/ms/map-codebase.md +1 -1
  9. package/commands/ms/new-milestone.md +3 -3
  10. package/commands/ms/new-project.md +6 -2
  11. package/commands/ms/research-milestone.md +339 -0
  12. package/mindsystem/references/questioning.md +1 -1
  13. package/mindsystem/references/routing/between-milestones-routing.md +1 -1
  14. package/mindsystem/templates/milestone-context.md +1 -1
  15. package/mindsystem/templates/milestone-research.md +89 -0
  16. package/mindsystem/templates/requirements.md +1 -1
  17. package/mindsystem/templates/roadmap.md +20 -0
  18. package/mindsystem/templates/tech-debt.md +4 -4
  19. package/mindsystem/workflows/complete-milestone.md +4 -4
  20. package/mindsystem/workflows/define-requirements.md +12 -14
  21. package/mindsystem/workflows/doctor-fixes.md +60 -9
  22. package/mindsystem/workflows/map-codebase.md +27 -4
  23. package/mindsystem/workflows/verify-work.md +14 -49
  24. package/package.json +1 -1
  25. package/scripts/ms-tools.py +234 -6
  26. package/agents/ms-integration-checker.md +0 -424
  27. package/agents/ms-research-synthesizer.md +0 -248
  28. package/commands/ms/research-project.md +0 -353
  29. package/mindsystem/templates/research-project/ARCHITECTURE.md +0 -204
  30. package/mindsystem/templates/research-project/FEATURES.md +0 -147
  31. package/mindsystem/templates/research-project/PITFALLS.md +0 -200
  32. package/mindsystem/templates/research-project/STACK.md +0 -120
  33. package/mindsystem/templates/research-project/SUMMARY.md +0 -170
  34. package/mindsystem/templates/research-project-output.md +0 -81
  35. package/mindsystem/workflows/research-project.md +0 -23
package/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  # MINDSYSTEM
4
4
 
5
- **A meta-prompting and context engineering system for Claude Code.**
5
+ **The engineer's meta-prompting system for Claude Code.**
6
6
 
7
- Every piece of work makes the next one better. Mindsystem structures your Claude Code sessions into plannable, executable, verifiable phases, and compounds what it learns into persistent knowledge files that survive `/clear`. Context rot stops being the bottleneck. Every prompt in the system is tested against research on how LLMs actually follow instructions, so quality stays consistent from phase 1 to phase 20.
7
+ Amplifies every step of the development workflow you already follow discovery, research, design, planning, execution, verification. Each one refined, parallelized, and compounded into persistent knowledge. Built for engineers who want to multiply their output without giving up control.
8
8
 
9
9
  ```bash
10
10
  npx mindsystem-cc
@@ -19,18 +19,41 @@ npx mindsystem-cc
19
19
 
20
20
  <br>
21
21
 
22
- [How it works](#how-it-works) · [Walkthrough](#end-to-end-walkthrough) · [Features](#features) · [Quick start](#quick-start) · [.planning](#the-planning-directory) · [Config](#configuration) · [Commands](#command-reference) · [Troubleshooting](#troubleshooting)
22
+ [Why Mindsystem](#why-mindsystem) · [How it works](#how-it-works) · [Walkthrough](#end-to-end-walkthrough) · [Features](#features) · [Quick start](#quick-start) · [.planning](#the-planning-directory) · [Config](#configuration) · [Commands](#command-reference) · [Troubleshooting](#troubleshooting)
23
23
 
24
24
  </div>
25
25
 
26
26
  ---
27
27
 
28
+ ## Why Mindsystem
29
+
30
+ Fully autonomous coding tools take a spec and run for hours until a product emerges. That works for prototypes and one-shot projects.
31
+
32
+ Mindsystem takes the opposite approach. It follows the same workflow a thorough engineer already uses — and amplifies each step:
33
+
34
+ | What you'd do manually | What Mindsystem does |
35
+ |---|---|
36
+ | Talk through requirements, catch misalignment early | **Discuss phase** surfaces assumptions with confidence levels, forces tradeoff decisions before any code gets written |
37
+ | Google libraries, read a few docs | **Research phase** runs 3 parallel agents across documentation, your codebase, and community practices — 10x more sources, synthesized in minutes |
38
+ | Try design directions, pick the best one | **Design phase** generates parallel HTML/CSS mockups with side-by-side comparison and exact design tokens |
39
+ | Plan from what you remember about the codebase | **Plan phase** loads knowledge files capturing every decision, pattern, and pitfall from prior phases |
40
+ | Figure out what states to test, mock them manually | **Verify work** determines mock states automatically — you validate visually or programmatically |
41
+
42
+ The workflow stays yours. Each step finishes in minutes instead of hours. Everything learned compounds into knowledge that survives context resets — phase 10 starts with everything the project learned from phases 1–9.
43
+
44
+ This is not an autopilot. It's a force multiplier.
45
+
46
+ ---
47
+
28
48
  ## How it works
29
49
 
30
50
  ```
31
51
  [ new-milestone ] Define what to build next
32
52
 
33
53
 
54
+ [ research-milestone ] (optional) Research domain before roadmapping
55
+
56
+
34
57
  [ create-roadmap ] Derive requirements, map to phases
35
58
 
36
59
 
@@ -72,6 +95,12 @@ Execution happens in fresh subagent contexts, so each plan gets up to 200k token
72
95
 
73
96
  ## End-to-end walkthrough
74
97
 
98
+ ### Project setup
99
+
100
+ Before building features, initialize the project once with `/ms:new-project`. For existing codebases, also run `/ms:map-codebase` (analyzes your stack, conventions, and architecture into 7 structured documents) and `/ms:doctor` (validates config and generates per-subsystem knowledge files from source code). See [Quick start](#quick-start) for the exact sequences.
101
+
102
+ Everything below is the feature-building loop, identical for new and existing projects.
103
+
75
104
  ### 1. New milestone
76
105
 
77
106
  ```
@@ -82,7 +111,17 @@ Claude reads your project history (tech debt, deferred requirements, validated d
82
111
 
83
112
  Think of it as guided brainstorming: Claude asks the right questions rather than prescribing answers, helping you figure out what to build next.
84
113
 
85
- ### 2. Create roadmap
114
+ ### 2. Research milestone (optional)
115
+
116
+ ```
117
+ /ms:research-milestone
118
+ ```
119
+
120
+ Spawns 2-5 research agents adapted to your milestone scope — ecosystem/stack, product landscape, codebase feasibility, architecture, pitfalls. You approve which dimensions to research, then agents run in parallel.
121
+
122
+ Produces `MILESTONE-RESEARCH.md` that the roadmapper consumes for better phase breakdowns. Valuable when entering unfamiliar domains, evaluating new tech stacks, or starting a project's first milestone.
123
+
124
+ ### 3. Create roadmap
86
125
 
87
126
  ```
88
127
  /ms:create-roadmap
@@ -94,7 +133,7 @@ Requirements define what must be TRUE when you ship, not what to build. This goa
94
133
 
95
134
  **Creates:** `REQUIREMENTS.md`, `ROADMAP.md`, `STATE.md`, phase directories.
96
135
 
97
- ### 3. Discuss phase (optional, recommended)
136
+ ### 4. Discuss phase (optional, recommended)
98
137
 
99
138
  ```
100
139
  /ms:discuss-phase 1
@@ -106,7 +145,7 @@ Worth taking seriously. Decisions here propagate through everything that follows
106
145
 
107
146
  **Creates:** `CONTEXT.md` with vision, essentials, and reasoning-backed decisions.
108
147
 
109
- ### 4. Design phase (optional)
148
+ ### 5. Design phase (optional)
110
149
 
111
150
  ```
112
151
  /ms:design-phase 1
@@ -116,7 +155,7 @@ Claude generates parallel HTML/CSS mockup variants and a side-by-side comparison
116
155
 
117
156
  The output is a `DESIGN.md` with exact design tokens (hex colors, px spacing, font weights), not descriptions of what things should look like.
118
157
 
119
- ### 5. Research phase (optional)
158
+ ### 6. Research phase (optional)
120
159
 
121
160
  ```
122
161
  /ms:research-phase 1
@@ -126,7 +165,7 @@ Three parallel agents investigate at once: one queries external documentation th
126
165
 
127
166
  You resolve library conflicts if any come up. Otherwise, this runs with minimal input.
128
167
 
129
- ### 6. Plan phase
168
+ ### 7. Plan phase
130
169
 
131
170
  ```
132
171
  /ms:plan-phase 1
@@ -140,7 +179,7 @@ You approve the plan structure and can adjust granularity.
140
179
 
141
180
  **Creates:** `PLAN.md` files, `EXECUTION-ORDER.md`.
142
181
 
143
- ### 7. Execute phase
182
+ ### 8. Execute phase
144
183
 
145
184
  ```
146
185
  /ms:execute-phase 1
@@ -154,7 +193,7 @@ After execution, knowledge consolidation updates subsystem-scoped knowledge file
154
193
 
155
194
  **Creates:** `SUMMARY.md`, `VERIFICATION.md`, `.patch` files, knowledge file updates.
156
195
 
157
- ### 8. Verify work
196
+ ### 9. Verify work
158
197
 
159
198
  ```
160
199
  /ms:verify-work 1
@@ -168,21 +207,21 @@ Fixes compound into knowledge files through automatic consolidation. This is whe
168
207
 
169
208
  **Creates:** `UAT.md`, `uat-fixes.patch`, knowledge file updates.
170
209
 
171
- ### 9. Repeat
210
+ ### 10. Repeat
172
211
 
173
- Run steps 3-8 for each phase. Pick the preparation depth each phase needs.
212
+ Run steps 4-9 for each phase. Pick the preparation depth each phase needs.
174
213
 
175
- ### 10. Audit milestone
214
+ ### 11. Audit milestone
176
215
 
177
216
  ```
178
217
  /ms:audit-milestone
179
218
  ```
180
219
 
181
- Claude checks requirements coverage against `REQ-IDs`, spawns an integration checker for cross-phase wiring, aggregates untested UAT assumptions, and consolidates tech debt into `TECH-DEBT.md` with severity tiers and `TD-IDs`.
220
+ Claude checks requirements coverage against `REQ-IDs`, verifies cross-phase wiring from verification artifacts, aggregates untested UAT assumptions, and consolidates tech debt into `TECH-DEBT.md` with severity tiers and `TD-IDs`.
182
221
 
183
222
  Optional code review with quality-phase decisions for high-impact findings. You decide what gets fixed vs. accepted as debt.
184
223
 
185
- ### 11. Complete milestone
224
+ ### 12. Complete milestone
186
225
 
187
226
  ```
188
227
  /ms:complete-milestone
@@ -261,31 +300,37 @@ Requirements you want but haven't shipped yet are tracked in `PROJECT.md` with o
261
300
 
262
301
  ## Quick start
263
302
 
264
- ### New project
303
+ ### Project setup (one-time)
304
+
305
+ **New project:**
265
306
 
266
307
  ```
267
308
  /ms:new-project
268
- /ms:new-milestone
269
- /ms:create-roadmap
270
- /ms:plan-phase 1
271
- /ms:execute-phase 1
272
- /ms:verify-work 1
273
309
  ```
274
310
 
275
- You'll get `.planning/` with your project vision, milestone context, requirements, roadmap, and the first phase implemented with commits, patch files, and knowledge files.
311
+ **Existing codebase:**
312
+
313
+ ```
314
+ /ms:new-project # Business context and vision
315
+ /ms:map-codebase # Analyze code → 7 structured documents
316
+ /ms:doctor # Validate config, generate knowledge files
317
+ ```
318
+
319
+ Optional: `/ms:config` — configure code reviewers, gitignore, and other preferences.
320
+
321
+ ### Building features
276
322
 
277
- ### Existing project
323
+ Once the project is set up, the workflow is the same for new and existing codebases:
278
324
 
279
325
  ```
280
- /ms:new-project
281
- /ms:map-codebase
282
- /ms:new-milestone
283
- /ms:create-roadmap
284
- /ms:plan-phase 1
285
- /ms:execute-phase 1
326
+ /ms:new-milestone # Discover what to build next
327
+ /ms:create-roadmap # Define requirements, map to phases
328
+ /ms:plan-phase 1 # Create detailed plan
329
+ /ms:execute-phase 1 # Run in fresh subagents
330
+ /ms:verify-work 1 # Manual acceptance testing
286
331
  ```
287
332
 
288
- Codebase mapping produces 7 documents covering your stack, conventions, and architecture. Then you define what to build, and all downstream planning respects what's already there.
333
+ Repeat for each milestone. All downstream planning automatically loads codebase docs and knowledge files.
289
334
 
290
335
  **Returning after a break?** Run `/ms:progress` to see where you left off and what to do next.
291
336
 
@@ -302,6 +347,7 @@ Every artifact Mindsystem generates lives in `.planning/` — a markdown knowled
302
347
 
303
348
  ├── STATE.md # Active phase, blockers, recent decisions
304
349
  ├── MILESTONE-CONTEXT.md # new-milestone → brainstorm that grounds the roadmap
350
+ ├── MILESTONE-RESEARCH.md # research-milestone → domain research before roadmapping
305
351
  ├── ROADMAP.md # Phase breakdown with goals and success criteria
306
352
  ├── REQUIREMENTS.md # Checkable REQ-IDs mapped to phases
307
353
 
@@ -346,13 +392,6 @@ Every artifact Mindsystem generates lives in `.planning/` — a markdown knowled
346
392
  │ ├── CONTEXT.md # discussed, not yet planned
347
393
  │ └── 02-01-PLAN.md # planned, not yet executed
348
394
 
349
- ├── research/ # /ms:research-project → domain ecosystem
350
- │ ├── STACK.md # Technology recommendations for this domain
351
- │ ├── ARCHITECTURE.md # Common system structure patterns
352
- │ ├── FEATURES.md # Feature landscape in this domain
353
- │ ├── PITFALLS.md # Mistakes to avoid
354
- │ └── SUMMARY.md # Synthesized findings with roadmap implications
355
-
356
395
  ├── adhoc/ # /ms:adhoc → out-of-pipeline work
357
396
  │ └── 2026-01-15-fix-token/
358
397
  │ ├── adhoc-01-SUMMARY.md # Execution results and learnings
@@ -373,10 +412,9 @@ Every artifact Mindsystem generates lives in `.planning/` — a markdown knowled
373
412
  ├── ROADMAP.md # Historical phase breakdown
374
413
  ├── REQUIREMENTS.md # Final requirement status
375
414
  ├── PHASE-SUMMARIES.md # Consolidated execution summaries
376
- ├── MILESTONE-AUDIT.md # Requirements coverage, integration check
415
+ ├── MILESTONE-AUDIT.md # Requirements coverage, cross-phase wiring check
377
416
  ├── CONTEXT.md # Original milestone brainstorm
378
- ├── research/ # Archived domain research
379
- │ └── ...
417
+ ├── MILESTONE-RESEARCH.md # Archived domain research (if existed)
380
418
  └── phases/ # Archived phase artifacts
381
419
  └── 01-foundation/
382
420
  ├── 01-changes.patch # code diffs retained
@@ -438,7 +476,7 @@ Full docs live in `/ms:help`.
438
476
  | `/ms:new-project` | Initialize `.planning/` and capture project intent |
439
477
  | `/ms:config` | Configure code reviewers, mockups, gitignore, git remote |
440
478
  | `/ms:map-codebase` | Document existing repo's stack, structure, and conventions |
441
- | `/ms:research-project` | Domain research saved to `.planning/research/` |
479
+ | `/ms:research-milestone` | Milestone-scoped research saved to `.planning/MILESTONE-RESEARCH.md` |
442
480
  | `/ms:create-roadmap` | Define requirements and create phases mapped to them |
443
481
  | `/ms:new-milestone [name]` | Discover what to build next, start new milestone |
444
482
  | `/ms:discuss-phase <number>` | Product-informed collaborative thinking before planning |
@@ -515,4 +553,4 @@ MIT License. See [LICENSE](LICENSE) for details.
515
553
 
516
554
  ---
517
555
 
518
- Inspired by [GSD](https://github.com/gsd-build/get-shit-done) and [Compound Engineering](https://github.com/EveryInc/compound-engineering-plugin).
556
+ Originally rooted in [GSD](https://github.com/gsd-build/get-shit-done), now an independent system with its own philosophy. Knowledge compounding inspired by [Compound Engineering](https://github.com/EveryInc/compound-engineering-plugin).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ms-researcher
3
- description: Conducts comprehensive research using systematic methodology, source verification, and structured output. Spawned by /ms:research-phase and /ms:research-project orchestrators.
3
+ description: Conducts comprehensive research using systematic methodology, source verification, and structured output. Spawned by /ms:research-phase and /ms:research-milestone orchestrators.
4
4
  model: opus
5
5
  tools: Read, Write, Bash, Grep, Glob, WebSearch, WebFetch
6
6
  color: cyan
@@ -12,7 +12,7 @@ You are a Mindsystem researcher. You conduct comprehensive research using system
12
12
  You are spawned by:
13
13
 
14
14
  - `/ms:research-phase` orchestrator (phase-specific research before planning)
15
- - `/ms:research-project` orchestrator (project-wide research before roadmap)
15
+ - `/ms:research-milestone` orchestrator (milestone-scoped research before roadmap)
16
16
 
17
17
  Your job: Answer research questions with verified, actionable findings. Produce structured output files that inform quality planning.
18
18
  </role>
@@ -461,7 +461,7 @@ Output format templates are in `~/.claude/mindsystem/templates/`. Read the match
461
461
  | Research Type | Template |
462
462
  |---------------|----------|
463
463
  | Phase research | `~/.claude/mindsystem/templates/research.md` |
464
- | Project research | `~/.claude/mindsystem/templates/research-project-output.md` |
464
+ | Milestone research | `~/.claude/mindsystem/templates/milestone-research.md` |
465
465
  | Comparison | `~/.claude/mindsystem/templates/research-comparison-output.md` |
466
466
  | Feasibility | `~/.claude/mindsystem/templates/research-feasibility-output.md` |
467
467
 
@@ -52,7 +52,7 @@ Parse the milestone context for:
52
52
 
53
53
  If PROJECT.md has a `## Deferred` section, treat those items as v1 candidates for this milestone. Cross-reference deferred items with milestone context — if the milestone naturally covers a deferred item, promote to v1; if not relevant to this milestone, keep deferred.
54
54
 
55
- If research/FEATURES.md exists, cross-reference:
55
+ If MILESTONE-RESEARCH.md exists, cross-reference Product Landscape:
56
56
  - Table stakes → strong v1 candidates
57
57
  - Differentiators → contextual (include if aligned with milestone priorities)
58
58
  - Anti-features → out of scope
@@ -413,9 +413,12 @@ Use template from `~/.claude/mindsystem/templates/roadmap.md`.
413
413
 
414
414
  Key sections:
415
415
  - Overview (2-3 sentences)
416
+ - Research Conclusions (when MILESTONE-RESEARCH.md was provided)
416
417
  - Phases with Goal, Dependencies, Requirements, Success Criteria
417
418
  - Progress table
418
419
 
420
+ **Research Conclusions:** When MILESTONE-RESEARCH.md is provided, add a `## Research Conclusions` section between Overview and Phases. Subsections: Technology Stack, Key Constraints, Architecture Decisions, Risk Mitigations. Extract from MILESTONE-RESEARCH.md sections. This is the mechanism for downstream passthrough — plan-phase, discuss-phase, and research-phase consume this implicitly by reading ROADMAP.md.
421
+
419
422
  ## STATE.md Structure
420
423
 
421
424
  Use template from `~/.claude/mindsystem/templates/state.md`.
@@ -492,8 +495,7 @@ Approve roadmap or provide feedback for revision.
492
495
  Orchestrator provides:
493
496
  - MILESTONE-CONTEXT.md content (or gathered context from user questioning)
494
497
  - PROJECT.md content (core value, constraints)
495
- - research/FEATURES.md content (if exists - feature categorization)
496
- - research/SUMMARY.md content (if exists - phase suggestions)
498
+ - MILESTONE-RESEARCH.md content (if exists - technology decisions, product landscape, architecture, risks)
497
499
  - config.json (starting phase number)
498
500
 
499
501
  Parse and confirm understanding before proceeding.
@@ -506,9 +508,12 @@ Apply `<requirements_derivation>` process. Write REQUIREMENTS.md immediately usi
506
508
 
507
509
  ## Step 3: Load Research Context (if exists)
508
510
 
509
- If research/SUMMARY.md provided:
510
- - Extract suggested phase structure from "Implications for Roadmap"
511
- - Note research flags (which phases need deeper research)
511
+ If MILESTONE-RESEARCH.md provided:
512
+ - Extract technology decisions and constraints
513
+ - Use Architecture & Dependencies for phase ordering
514
+ - Use Pitfalls for pre-work Research indicator enrichment
515
+ - Use Feasibility constraints for phase boundary decisions
516
+ - Use Open Questions to populate per-phase Research topics
512
517
  - Use as input, not mandate
513
518
 
514
519
  Research informs phase identification but requirements drive coverage.
package/bin/install.js CHANGED
@@ -471,8 +471,8 @@ function ensurePathHook(claudeDir, isGlobal, configDir) {
471
471
  });
472
472
 
473
473
  fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2));
474
- if (removed > 0) {
475
- console.log(` ${green}✓${reset} Configured PATH hook (cleaned ${removed} duplicate(s))`);
474
+ if (removed > 1) {
475
+ console.log(` ${green}✓${reset} Configured PATH hook (cleaned ${removed - 1} duplicate(s))`);
476
476
  } else {
477
477
  console.log(` ${green}✓${reset} Configured PATH hook`);
478
478
  }
@@ -9,12 +9,13 @@ allowed-tools:
9
9
  - Bash
10
10
  - Task
11
11
  - Write
12
+ - AskUserQuestion
12
13
  ---
13
14
 
14
15
  <objective>
15
16
  Verify milestone achieved its definition of done. Check requirements coverage, cross-phase integration, and end-to-end flows.
16
17
 
17
- **This command IS the orchestrator.** Reads existing VERIFICATION.md files (phases already verified during execute-phase), generates/updates `.planning/TECH-DEBT.md` as single source of truth for tech debt, then spawns integration checker for cross-phase wiring.
18
+ **This command IS the orchestrator.** Reads existing VERIFICATION.md files (phases already verified during execute-phase), generates/updates `.planning/TECH-DEBT.md` as single source of truth for tech debt, then checks cross-phase wiring inline from verification and summary artifacts.
18
19
  </objective>
19
20
 
20
21
  <execution_context>
@@ -37,7 +38,7 @@ Glob: .planning/phases/*/*-SUMMARY.md
37
38
  Glob: .planning/phases/*/*-VERIFICATION.md
38
39
 
39
40
  **Tech Debt:**
40
- Read `.planning/TECH-DEBT.md` at Step 8.5 (lazy — only needed for de-duplication)
41
+ Read `.planning/TECH-DEBT.md` at Step 7.5 (lazy — only needed for de-duplication)
41
42
  </context>
42
43
 
43
44
  <process>
@@ -100,37 +101,33 @@ assumptions:
100
101
  reason: "Can't manipulate time in tests"
101
102
  ```
102
103
 
103
- ## 3. Spawn Integration Checker
104
+ ## 3. Cross-Phase Wiring Check
104
105
 
105
- With phase context collected:
106
+ Check aggregate cross-phase connections that per-phase verifiers miss.
106
107
 
107
- ```
108
- Task(
109
- prompt="Check cross-phase integration and E2E flows.
108
+ From the SUMMARY.md and VERIFICATION.md files already loaded in Step 2:
110
109
 
111
- Phases: {phase_dirs}
112
- Phase exports: {from SUMMARYs}
113
- API routes: {routes created}
110
+ 1. **Build provides/consumes map** — For each phase SUMMARY, extract key exports, files created, APIs defined. Identify what each phase provides and what it consumes from other phases.
114
111
 
115
- Verify cross-phase wiring and E2E user flows.",
116
- subagent_type="ms-integration-checker"
117
- )
118
- ```
112
+ 2. **Cross-reference verification results** — For each cross-phase dependency (Phase N consumes something Phase M provides), check Phase M's VERIFICATION.md:
113
+ - Provider artifact is VERIFIED → connection satisfied
114
+ - Provider artifact is STUB, MISSING, or ORPHANED → wiring gap
119
115
 
120
- ## 4. Collect Results
116
+ 3. **Flag aggregate patterns** — Multiple orphaned artifacts across phases (systemic wiring issue). APIs/exports created but consumed by no other phase's SUMMARY. A phase depending on another phase with status: gaps_found.
121
117
 
122
- Combine:
123
- - Phase-level gaps and tech debt (from step 2)
124
- - Integration checker's report (wiring gaps, broken flows)
118
+ Produce a wiring summary:
119
+ - **Connected:** N cross-phase dependencies satisfied
120
+ - **Gaps:** N unsatisfied (list each: from-phase → to-phase, what's missing)
121
+ - **Score:** wiring = connected / (connected + gaps)
125
122
 
126
- ## 5. Check Requirements Coverage
123
+ ## 4. Check Requirements Coverage
127
124
 
128
125
  For each requirement in REQUIREMENTS.md mapped to this milestone:
129
126
  - Find owning phase
130
127
  - Check phase verification status
131
128
  - Determine: satisfied | partial | unsatisfied
132
129
 
133
- ## 6. Aggregate into MILESTONE-AUDIT.md
130
+ ## 5. Aggregate into MILESTONE-AUDIT.md
134
131
 
135
132
  Create `.planning/MILESTONE-AUDIT.md` with:
136
133
 
@@ -142,12 +139,10 @@ status: passed | gaps_found | tech_debt
142
139
  scores:
143
140
  requirements: N/M
144
141
  phases: N/M
145
- integration: N/M
146
- flows: N/M
142
+ wiring: N/M
147
143
  gaps: # Critical blockers
148
144
  requirements: [...]
149
- integration: [...]
150
- flows: [...]
145
+ wiring: [...]
151
146
  tech_debt: see .planning/TECH-DEBT.md
152
147
  assumptions: # Tests skipped during UAT
153
148
  count: [N]
@@ -182,11 +177,11 @@ Plus full markdown report with tables for requirements, phases, integration, and
182
177
  - `gaps_found` — critical blockers exist
183
178
  - `tech_debt` — no blockers but accumulated deferred items need review
184
179
 
185
- ## 7. Present Results
180
+ ## 6. Present Audit Summary
186
181
 
187
- Route by status (see `<offer_next>`).
182
+ Present the audit summary (status, scores, gaps) to the user. Continue to Step 7.
188
183
 
189
- ## 8. Code Review (Milestone)
184
+ ## 7. Code Review (Milestone)
190
185
 
191
186
  Read code review agent from config:
192
187
 
@@ -202,7 +197,7 @@ Proceed to next steps.
202
197
  Report: "No milestone reviewer configured. Run `/ms:config` to set one."
203
198
  Skip code review step (proceed to next steps).
204
199
 
205
- ### Step 8.1: Get Changed Files
200
+ ### Step 7.1: Get Changed Files
206
201
 
207
202
  ```bash
208
203
  # Find first commit in milestone (first phase commit)
@@ -213,7 +208,7 @@ FIRST_COMMIT=$(git log --oneline --grep="(${FIRST_PHASE}-" --format="%H" | tail
213
208
  CHANGED_FILES=$(git diff --name-only ${FIRST_COMMIT}^..HEAD | grep -E '\.(dart|ts|tsx|js|jsx|swift|kt|py|go|rs)$')
214
209
  ```
215
210
 
216
- ### Step 8.2: Spawn Code Review Agent
211
+ ### Step 7.2: Spawn Code Review Agent
217
212
 
218
213
  ```
219
214
  Task(
@@ -246,7 +241,7 @@ Task(
246
241
  )
247
242
  ```
248
243
 
249
- ### Step 8.3: Handle Results
244
+ ### Step 7.3: Handle Results
250
245
 
251
246
  The agent controls its own behavior — it may modify files, report findings, or both. React to what actually happened.
252
247
 
@@ -295,7 +290,7 @@ Add markdown section to report body:
295
290
  {Include full findings report from reviewer}
296
291
  ```
297
292
 
298
- Code review findings flow into `.planning/TECH-DEBT.md` via Step 8.5 — do NOT add them to `tech_debt` YAML.
293
+ Code review findings flow into `.planning/TECH-DEBT.md` via Step 7.5 — do NOT add them to `tech_debt` YAML.
299
294
 
300
295
  **If any findings were reported**, present a decision gate. Recommend based on findings profile:
301
296
 
@@ -360,16 +355,16 @@ Continue to offer_next section.
360
355
 
361
356
  **If user chooses "Accept as tech debt":**
362
357
 
363
- Findings are already tracked in `.planning/TECH-DEBT.md` via Step 8.5. Continue to offer_next section.
358
+ Findings are already tracked in `.planning/TECH-DEBT.md` via Step 7.5. Continue to offer_next section.
364
359
 
365
- ## 8.5. Generate/Update TECH-DEBT.md
360
+ ## 7.5. Generate/Update TECH-DEBT.md
366
361
 
367
362
  After code review (all sources now available), generate or update `.planning/TECH-DEBT.md`:
368
363
 
369
364
  1. **Read existing** `.planning/TECH-DEBT.md` (if exists) — parse active items and dismissed list, note highest `TD-{N}` ID
370
365
  2. **Read template** from `@~/.claude/mindsystem/templates/tech-debt.md`
371
366
  3. **Collect tech debt** from all sources with severity mapping:
372
- - Integration checker bugs → **Critical**
367
+ - Cross-phase wiring gaps → **Critical**
373
368
  - Unfixed UAT issues (result: `issue`, fix_status ≠ `verified`) → **Critical** (blocker) / **High** (major) / **Medium** (minor) / **Low** (cosmetic)
374
369
  - Code review findings → pass through reviewer severity (**High** / **Medium** / **Low**)
375
370
  - Phase VERIFICATION.md anti-patterns → **Medium** or **Low** (blockers go to `gaps`, not tech debt)
@@ -378,7 +373,7 @@ After code review (all sources now available), generate or update `.planning/TEC
378
373
  5. **Assign `TD-{N}` IDs** continuing from highest existing ID
379
374
  6. **Write/update** `.planning/TECH-DEBT.md` — group items under `## Critical`, `## High`, `## Medium`, `## Low` sections per template. Omit empty sections.
380
375
 
381
- ## 9. Commit Audit Report
376
+ ## 8. Commit Audit Report
382
377
 
383
378
  ```bash
384
379
  git add .planning/MILESTONE-AUDIT.md .planning/TECH-DEBT.md
@@ -386,7 +381,7 @@ git commit -m "$(cat <<'EOF'
386
381
  docs(milestone): complete {name} audit
387
382
 
388
383
  Status: {status}
389
- Scores: Requirements {N}/{M} | Phases {N}/{M} | Integration {N}/{M} | Flows {N}/{M}
384
+ Scores: Requirements {N}/{M} | Phases {N}/{M} | Wiring {N}/{M}
390
385
  EOF
391
386
  )"
392
387
  ```
@@ -402,12 +397,10 @@ Read `~/.claude/mindsystem/references/routing/audit-result-routing.md` and follo
402
397
  - [ ] If quality phase chosen: Phase directory created, ROADMAP updated with TECH-DEBT.md scope
403
398
  - [ ] If files modified by reviewer: changes committed
404
399
  - [ ] If findings reported: parsed and added to MILESTONE-AUDIT.md
405
- - [ ] MILESTONE-AUDIT.md and TECH-DEBT.md committed to git
406
- - [ ] Tech debt collected into .planning/TECH-DEBT.md (de-duplicated, TD-{N} IDs assigned)
407
- - [ ] UAT assumptions collected and aggregated by phase
408
- - [ ] Integration checker spawned for cross-phase wiring
409
400
  - [ ] Code review completed (or skipped if config says "skip")
410
- - [ ] All phase VERIFICATION.md files read
411
- - [ ] MILESTONE-AUDIT.md created with assumptions section
401
+ - [ ] Tech debt collected into .planning/TECH-DEBT.md (de-duplicated, TD-{N} IDs assigned)
402
+ - [ ] UAT assumptions collected, aggregated by phase, and included in MILESTONE-AUDIT.md
403
+ - [ ] MILESTONE-AUDIT.md and TECH-DEBT.md committed to git
404
+ - [ ] Cross-phase wiring checked from all phase verification and summary artifacts
412
405
  - [ ] Results presented with actionable next steps
413
406
  </success_criteria>
@@ -13,7 +13,7 @@ allowed-tools:
13
13
  <objective>
14
14
  Define project requirements and create roadmap with phase breakdown.
15
15
 
16
- Run after `/ms:new-milestone` or `/ms:new-project` + optional `/ms:research-project`.
16
+ Run after `/ms:new-milestone` or `/ms:new-project` + optional `/ms:research-milestone`.
17
17
  </objective>
18
18
 
19
19
  <execution_context>
@@ -23,8 +23,7 @@ Run after `/ms:new-milestone` or `/ms:new-project` + optional `/ms:research-proj
23
23
  <context>
24
24
  @.planning/PROJECT.md
25
25
  @.planning/MILESTONE-CONTEXT.md (if exists)
26
- @.planning/research/FEATURES.md (if exists)
27
- @.planning/research/SUMMARY.md (if exists)
26
+ @.planning/MILESTONE-RESEARCH.md (if exists)
28
27
  </context>
29
28
 
30
29
  <process>
@@ -36,7 +35,7 @@ Run after `/ms:new-milestone` or `/ms:new-project` + optional `/ms:research-proj
36
35
 
37
36
  # Detect available context
38
37
  [ -f .planning/MILESTONE-CONTEXT.md ] && echo "HAS_MILESTONE_CONTEXT" || echo "NO_MILESTONE_CONTEXT"
39
- [ -d .planning/research ] && echo "HAS_RESEARCH" || echo "NO_RESEARCH"
38
+ [ -f .planning/MILESTONE-RESEARCH.md ] && echo "HAS_RESEARCH" || echo "NO_RESEARCH"
40
39
  [ -f .planning/REQUIREMENTS.md ] && echo "REQUIREMENTS_EXISTS" || echo "NO_REQUIREMENTS"
41
40
  [ -f .planning/ROADMAP.md ] && echo "ROADMAP_EXISTS" || echo "NO_ROADMAP"
42
41
  ```
@@ -64,7 +63,7 @@ If "Replace": Continue
64
63
 
65
64
  **If MILESTONE-CONTEXT.md exists:** Skip (context ready for agent).
66
65
 
67
- **If no MILESTONE-CONTEXT.md but HAS_RESEARCH:** Skip (research provides feature context).
66
+ **If no MILESTONE-CONTEXT.md but HAS_RESEARCH:** Skip (MILESTONE-RESEARCH.md provides feature context).
68
67
 
69
68
  **If neither exists (first milestone, no research):**
70
69
 
@@ -122,8 +121,7 @@ Task(
122
121
  **Starting phase number:** $START_PHASE
123
122
 
124
123
  **Research (if exists):**
125
- @.planning/research/FEATURES.md
126
- @.planning/research/SUMMARY.md
124
+ @.planning/MILESTONE-RESEARCH.md
127
125
 
128
126
  **Config:**
129
127
  @.planning/config.json
@@ -302,25 +300,9 @@ Requirements and roadmap created:
302
300
  - Roadmap: .planning/ROADMAP.md
303
301
  - State: .planning/STATE.md
304
302
  - [X] v1 requirements, [M] phases defined
305
-
306
- ---
307
-
308
- ## ▶ Next Up
309
-
310
- **Phase 1: [Name]** — [Goal from ROADMAP.md]
311
-
312
- `/ms:plan-phase 1`
313
-
314
- <sub>`/clear` first → fresh context window</sub>
315
-
316
- ---
317
-
318
- **Also available:**
319
- - `/ms:discuss-phase 1` — gather context first
320
- - `/ms:research-phase 1` — investigate unknowns
321
-
322
- ---
323
303
  ```
304
+
305
+ Read `~/.claude/mindsystem/references/routing/next-phase-routing.md` and follow its instructions to present "Next Up" with pre-work context for Phase $START_PHASE.
324
306
  </step>
325
307
 
326
308
  <step name="update_last_command">