mindsystem-cc 4.0.3 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +39 -22
  2. package/agents/ms-researcher.md +3 -3
  3. package/agents/ms-roadmapper.md +11 -6
  4. package/bin/install.js +29 -8
  5. package/commands/ms/audit-milestone.md +35 -42
  6. package/commands/ms/create-roadmap.md +5 -7
  7. package/commands/ms/doctor.md +3 -3
  8. package/commands/ms/help.md +14 -14
  9. package/commands/ms/new-milestone.md +3 -3
  10. package/commands/ms/research-milestone.md +339 -0
  11. package/mindsystem/references/questioning.md +1 -1
  12. package/mindsystem/references/routing/between-milestones-routing.md +1 -1
  13. package/mindsystem/templates/milestone-context.md +1 -1
  14. package/mindsystem/templates/milestone-research.md +89 -0
  15. package/mindsystem/templates/requirements.md +1 -1
  16. package/mindsystem/templates/roadmap.md +20 -0
  17. package/mindsystem/templates/tech-debt.md +4 -4
  18. package/mindsystem/workflows/complete-milestone.md +4 -4
  19. package/mindsystem/workflows/define-requirements.md +12 -14
  20. package/mindsystem/workflows/verify-work.md +14 -49
  21. package/package.json +1 -1
  22. package/scripts/ms-tools.py +290 -14
  23. package/agents/ms-integration-checker.md +0 -424
  24. package/agents/ms-research-synthesizer.md +0 -248
  25. package/commands/ms/research-project.md +0 -353
  26. package/mindsystem/templates/research-project/ARCHITECTURE.md +0 -204
  27. package/mindsystem/templates/research-project/FEATURES.md +0 -147
  28. package/mindsystem/templates/research-project/PITFALLS.md +0 -200
  29. package/mindsystem/templates/research-project/STACK.md +0 -120
  30. package/mindsystem/templates/research-project/SUMMARY.md +0 -170
  31. package/mindsystem/templates/research-project-output.md +0 -81
  32. package/mindsystem/workflows/research-project.md +0 -23
package/README.md CHANGED
@@ -31,6 +31,9 @@ npx mindsystem-cc
31
31
  [ new-milestone ] Define what to build next
32
32
 
33
33
 
34
+ [ research-milestone ] (optional) Research domain before roadmapping
35
+
36
+
34
37
  [ create-roadmap ] Derive requirements, map to phases
35
38
 
36
39
 
@@ -82,7 +85,17 @@ Claude reads your project history (tech debt, deferred requirements, validated d
82
85
 
83
86
  Think of it as guided brainstorming: Claude asks the right questions rather than prescribing answers, helping you figure out what to build next.
84
87
 
85
- ### 2. Create roadmap
88
+ ### 2. Research milestone (optional)
89
+
90
+ ```
91
+ /ms:research-milestone
92
+ ```
93
+
94
+ 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.
95
+
96
+ 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.
97
+
98
+ ### 3. Create roadmap
86
99
 
87
100
  ```
88
101
  /ms:create-roadmap
@@ -94,7 +107,7 @@ Requirements define what must be TRUE when you ship, not what to build. This goa
94
107
 
95
108
  **Creates:** `REQUIREMENTS.md`, `ROADMAP.md`, `STATE.md`, phase directories.
96
109
 
97
- ### 3. Discuss phase (optional, recommended)
110
+ ### 4. Discuss phase (optional, recommended)
98
111
 
99
112
  ```
100
113
  /ms:discuss-phase 1
@@ -106,7 +119,7 @@ Worth taking seriously. Decisions here propagate through everything that follows
106
119
 
107
120
  **Creates:** `CONTEXT.md` with vision, essentials, and reasoning-backed decisions.
108
121
 
109
- ### 4. Design phase (optional)
122
+ ### 5. Design phase (optional)
110
123
 
111
124
  ```
112
125
  /ms:design-phase 1
@@ -116,7 +129,7 @@ Claude generates parallel HTML/CSS mockup variants and a side-by-side comparison
116
129
 
117
130
  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
131
 
119
- ### 5. Research phase (optional)
132
+ ### 6. Research phase (optional)
120
133
 
121
134
  ```
122
135
  /ms:research-phase 1
@@ -126,7 +139,7 @@ Three parallel agents investigate at once: one queries external documentation th
126
139
 
127
140
  You resolve library conflicts if any come up. Otherwise, this runs with minimal input.
128
141
 
129
- ### 6. Plan phase
142
+ ### 7. Plan phase
130
143
 
131
144
  ```
132
145
  /ms:plan-phase 1
@@ -140,7 +153,7 @@ You approve the plan structure and can adjust granularity.
140
153
 
141
154
  **Creates:** `PLAN.md` files, `EXECUTION-ORDER.md`.
142
155
 
143
- ### 7. Execute phase
156
+ ### 8. Execute phase
144
157
 
145
158
  ```
146
159
  /ms:execute-phase 1
@@ -154,7 +167,7 @@ After execution, knowledge consolidation updates subsystem-scoped knowledge file
154
167
 
155
168
  **Creates:** `SUMMARY.md`, `VERIFICATION.md`, `.patch` files, knowledge file updates.
156
169
 
157
- ### 8. Verify work
170
+ ### 9. Verify work
158
171
 
159
172
  ```
160
173
  /ms:verify-work 1
@@ -168,21 +181,21 @@ Fixes compound into knowledge files through automatic consolidation. This is whe
168
181
 
169
182
  **Creates:** `UAT.md`, `uat-fixes.patch`, knowledge file updates.
170
183
 
171
- ### 9. Repeat
184
+ ### 10. Repeat
172
185
 
173
- Run steps 3-8 for each phase. Pick the preparation depth each phase needs.
186
+ Run steps 4-9 for each phase. Pick the preparation depth each phase needs.
174
187
 
175
- ### 10. Audit milestone
188
+ ### 11. Audit milestone
176
189
 
177
190
  ```
178
191
  /ms:audit-milestone
179
192
  ```
180
193
 
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`.
194
+ 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
195
 
183
196
  Optional code review with quality-phase decisions for high-impact findings. You decide what gets fixed vs. accepted as debt.
184
197
 
185
- ### 11. Complete milestone
198
+ ### 12. Complete milestone
186
199
 
187
200
  ```
188
201
  /ms:complete-milestone
@@ -250,6 +263,15 @@ Requirements you want but haven't shipped yet are tracked in `PROJECT.md` with o
250
263
 
251
264
  ---
252
265
 
266
+ ## Prerequisites
267
+
268
+ - [Claude Code](https://docs.anthropic.com/en/docs/claude-code)
269
+ - [Node.js](https://nodejs.org/) (for `npx`)
270
+ - [uv](https://docs.astral.sh/uv/) — Python package runner used by CLI scripts (`curl -LsSf https://astral.sh/uv/install.sh | sh`)
271
+ - Python 3.10+ (used by uv for scripts)
272
+
273
+ ---
274
+
253
275
  ## Quick start
254
276
 
255
277
  ### New project
@@ -337,12 +359,8 @@ Every artifact Mindsystem generates lives in `.planning/` — a markdown knowled
337
359
  │ ├── CONTEXT.md # discussed, not yet planned
338
360
  │ └── 02-01-PLAN.md # planned, not yet executed
339
361
 
340
- ├── research/ # /ms:research-project → domain ecosystem
341
- ├── STACK.md # Technology recommendations for this domain
342
- │ ├── ARCHITECTURE.md # Common system structure patterns
343
- │ ├── FEATURES.md # Feature landscape in this domain
344
- │ ├── PITFALLS.md # Mistakes to avoid
345
- │ └── SUMMARY.md # Synthesized findings with roadmap implications
362
+ ├── MILESTONE-RESEARCH.md # /ms:research-milestone → domain ecosystem
363
+ # Technology, product landscape, architecture, risks
346
364
 
347
365
  ├── adhoc/ # /ms:adhoc → out-of-pipeline work
348
366
  │ └── 2026-01-15-fix-token/
@@ -364,10 +382,9 @@ Every artifact Mindsystem generates lives in `.planning/` — a markdown knowled
364
382
  ├── ROADMAP.md # Historical phase breakdown
365
383
  ├── REQUIREMENTS.md # Final requirement status
366
384
  ├── PHASE-SUMMARIES.md # Consolidated execution summaries
367
- ├── MILESTONE-AUDIT.md # Requirements coverage, integration check
385
+ ├── MILESTONE-AUDIT.md # Requirements coverage, cross-phase wiring check
368
386
  ├── CONTEXT.md # Original milestone brainstorm
369
- ├── research/ # Archived domain research
370
- │ └── ...
387
+ ├── MILESTONE-RESEARCH.md # Archived domain research (if existed)
371
388
  └── phases/ # Archived phase artifacts
372
389
  └── 01-foundation/
373
390
  ├── 01-changes.patch # code diffs retained
@@ -429,7 +446,7 @@ Full docs live in `/ms:help`.
429
446
  | `/ms:new-project` | Initialize `.planning/` and capture project intent |
430
447
  | `/ms:config` | Configure code reviewers, mockups, gitignore, git remote |
431
448
  | `/ms:map-codebase` | Document existing repo's stack, structure, and conventions |
432
- | `/ms:research-project` | Domain research saved to `.planning/research/` |
449
+ | `/ms:research-milestone` | Milestone-scoped research saved to `.planning/MILESTONE-RESEARCH.md` |
433
450
  | `/ms:create-roadmap` | Define requirements and create phases mapped to them |
434
451
  | `/ms:new-milestone [name]` | Discover what to build next, start new milestone |
435
452
  | `/ms:discuss-phase <number>` | Product-informed collaborative thinking before planning |
@@ -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
@@ -420,9 +420,9 @@ function generateWrappers(claudeDir) {
420
420
  fs.mkdirSync(binDir, { recursive: true });
421
421
 
422
422
  const wrappers = {
423
- 'ms-tools': '#!/usr/bin/env bash\nexec uv run "$(dirname "$0")/../mindsystem/scripts/ms-tools.py" "$@"\n',
423
+ 'ms-tools': '#!/usr/bin/env bash\n[ -f "$HOME/.local/bin/env" ] && . "$HOME/.local/bin/env"\nexec uv run "$(dirname "$0")/../mindsystem/scripts/ms-tools.py" "$@"\n',
424
424
  'ms-lookup': '#!/usr/bin/env bash\nexec "$(dirname "$0")/../mindsystem/scripts/ms-lookup-wrapper.sh" "$@"\n',
425
- 'ms-compare-mockups': '#!/usr/bin/env bash\nexec uv run "$(dirname "$0")/../mindsystem/scripts/compare_mockups.py" "$@"\n',
425
+ 'ms-compare-mockups': '#!/usr/bin/env bash\n[ -f "$HOME/.local/bin/env" ] && . "$HOME/.local/bin/env"\nexec uv run "$(dirname "$0")/../mindsystem/scripts/compare_mockups.py" "$@"\n',
426
426
  };
427
427
 
428
428
  for (const [name, content] of Object.entries(wrappers)) {
@@ -444,11 +444,6 @@ function ensurePathHook(claudeDir, isGlobal, configDir) {
444
444
  if (!Array.isArray(settings.hooks.SessionStart))
445
445
  settings.hooks.SessionStart = [];
446
446
 
447
- // Idempotent — skip if already present
448
- const marker = 'mindsystem/bin';
449
- if (settings.hooks.SessionStart.some(e => JSON.stringify(e).includes(marker)))
450
- return;
451
-
452
447
  // Build PATH expression
453
448
  let binExpr;
454
449
  if (isGlobal) {
@@ -459,6 +454,14 @@ function ensurePathHook(claudeDir, isGlobal, configDir) {
459
454
  binExpr = '$CLAUDE_PROJECT_DIR/.claude/bin';
460
455
  }
461
456
 
457
+ // Self-healing: remove all existing Mindsystem PATH hooks, then add exactly one.
458
+ // This deduplicates any prior entries AND prevents future duplicates.
459
+ const before = settings.hooks.SessionStart.length;
460
+ settings.hooks.SessionStart = settings.hooks.SessionStart.filter(
461
+ e => !JSON.stringify(e).includes('CLAUDE_ENV_FILE')
462
+ );
463
+ const removed = before - settings.hooks.SessionStart.length;
464
+
462
465
  settings.hooks.SessionStart.push({
463
466
  matcher: '',
464
467
  hooks: [{
@@ -468,7 +471,11 @@ function ensurePathHook(claudeDir, isGlobal, configDir) {
468
471
  });
469
472
 
470
473
  fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2));
471
- console.log(` ${green}✓${reset} Configured PATH hook`);
474
+ if (removed > 0) {
475
+ console.log(` ${green}✓${reset} Configured PATH hook (cleaned ${removed} duplicate(s))`);
476
+ } else {
477
+ console.log(` ${green}✓${reset} Configured PATH hook`);
478
+ }
472
479
  }
473
480
 
474
481
  /**
@@ -654,6 +661,20 @@ async function install(isGlobal) {
654
661
  }
655
662
  }
656
663
 
664
+ // Phase 8b: Check uv
665
+ try {
666
+ const { execSync } = require('child_process');
667
+ const uvVersion = execSync('uv --version 2>&1', { encoding: 'utf8' }).trim();
668
+ console.log(` ${green}✓${reset} Found ${uvVersion}`);
669
+ } catch (e) {
670
+ const isWin = process.platform === 'win32';
671
+ const installCmd = isWin
672
+ ? 'powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"'
673
+ : 'curl -LsSf https://astral.sh/uv/install.sh | sh';
674
+ console.log(` ${yellow}⚠${reset} uv not found — CLI wrappers (ms-tools, ms-compare-mockups) require it`);
675
+ console.log(` Install: ${cyan}${installCmd}${reset}`);
676
+ }
677
+
657
678
  // Phase 9: Cleanup orphaned files
658
679
  if (orphans.length > 0) {
659
680
  console.log('');
@@ -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
@@ -13,7 +13,7 @@ allowed-tools:
13
13
  ---
14
14
 
15
15
  <objective>
16
- Run health checks on project configuration. Detect and fix structural drift across 10 categories: subsystem vocabulary, milestone directory structure, milestone naming convention, phase archival, knowledge files, phase summaries, PLAN cleanup, CLI wrappers, research API keys, and Mindsystem version.
16
+ Run health checks on project configuration. Detect and fix structural drift across 10 categories: subsystem vocabulary, milestone directory structure, milestone naming convention, phase archival, knowledge files, phase summaries, PLAN cleanup, CLI wrappers and environment diagnostics, research API keys, and Mindsystem version.
17
17
 
18
18
  Idempotent.
19
19
  </objective>
@@ -117,7 +117,7 @@ Display results as a markdown table:
117
117
  | Knowledge files | FAIL | Directory missing |
118
118
  | Phase summaries | FAIL | 2 milestones missing summaries |
119
119
  | PLAN cleanup | FAIL | 9 leftover PLAN.md files |
120
- | CLI wrappers | FAIL | ms-tools not on PATH |
120
+ | CLI wrappers | FAIL | Not resolvable; bin dir not in PATH |
121
121
  | Research API Keys | WARN | PERPLEXITY_API_KEY not set |
122
122
  | Mindsystem version | WARN | v3.21.0 → v3.22.1 available |
123
123
  ```
@@ -143,7 +143,7 @@ If "Review each" → use AskUserQuestion for each failed check with its details
143
143
 
144
144
  Apply fixes in dependency order: fix_subsystems → fix_milestone_dirs → fix_milestone_naming → fix_phase_archival → fix_plan_cleanup → fix_knowledge. Skip any fix whose check passed or was skipped by user.
145
145
 
146
- Phase summaries are resolved by fix_phase_archival. CLI wrappers require manual PATH configuration (no automated fix). WARN checks (Research API Keys) are informational — no fix offered, only displayed in the report.
146
+ Phase summaries are resolved by fix_phase_archival. CLI wrapper failures have specific fixes: bin dir not in PATH restart Claude Code session; missing wrappers or bin dir → re-run `npx mindsystem-cc`; uv not found → `curl -LsSf https://astral.sh/uv/install.sh | sh`. WARN checks (Research API Keys, missing uv) are informational — no automated fix, only displayed in the report.
147
147
  </step>
148
148
 
149
149
  <step name="apply_fixes">