mindsystem-cc 4.2.1 → 4.3.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/README.md +30 -12
  2. package/agents/ms-browser-verifier.md +33 -13
  3. package/agents/ms-compounder.md +16 -15
  4. package/agents/ms-consolidator.md +14 -13
  5. package/agents/ms-researcher.md +2 -1
  6. package/agents/ms-roadmapper.md +33 -0
  7. package/commands/ms/add-phase.md +0 -4
  8. package/commands/ms/compound.md +3 -3
  9. package/commands/ms/create-roadmap.md +19 -2
  10. package/commands/ms/design-phase.md +11 -7
  11. package/commands/ms/execute-phase.md +20 -13
  12. package/commands/ms/help.md +1 -0
  13. package/commands/ms/insert-phase.md +0 -4
  14. package/commands/ms/progress.md +8 -62
  15. package/commands/ms/research-phase.md +16 -11
  16. package/commands/ms/verify-work.md +8 -2
  17. package/mindsystem/references/prework-status.md +2 -1
  18. package/mindsystem/references/routing/next-phase-routing.md +6 -5
  19. package/mindsystem/templates/knowledge.md +1 -1
  20. package/mindsystem/templates/milestone-archive.md +0 -14
  21. package/mindsystem/templates/roadmap-milestone.md +5 -16
  22. package/mindsystem/templates/roadmap.md +6 -32
  23. package/mindsystem/workflows/complete-milestone.md +0 -1
  24. package/mindsystem/workflows/compound.md +24 -6
  25. package/mindsystem/workflows/discuss-phase.md +7 -22
  26. package/mindsystem/workflows/doctor-fixes.md +1 -1
  27. package/mindsystem/workflows/execute-phase.md +13 -15
  28. package/mindsystem/workflows/execute-plan.md +3 -1
  29. package/mindsystem/workflows/mockup-generation.md +3 -2
  30. package/mindsystem/workflows/transition.md +6 -8
  31. package/mindsystem/workflows/verify-work.md +31 -15
  32. package/package.json +1 -1
  33. package/scripts/ms-tools.py +27 -4
package/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  # MINDSYSTEM
4
4
 
5
- **The engineer's meta-prompting system for Claude Code.**
5
+ **The full-cycle development system for Claude Code.**
6
6
 
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.
7
+ In lean teams and solo ventures, the person writing the code is also the person deciding what to build, researching the domain, picking the layout, and verifying the result. Mindsystem amplifies each of those steps, making them deeper and faster — discovery, research, design, planning, execution, verification so one person can cover the full cycle without cutting corners. What it learns carries forward, so phase 10 knows everything phase 1 figured out.
8
8
 
9
9
  ```bash
10
10
  npx mindsystem-cc
@@ -27,17 +27,17 @@ npx mindsystem-cc
27
27
 
28
28
  ## Why Mindsystem
29
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.
30
+ Larger organizations split product delivery across specialists — product owners, designers, researchers, QA engineers. Autonomous coding tools try to replace that entire chain with a single prompt. Both approaches lose something: the first requires headcount, the second loses your judgment.
31
31
 
32
- Mindsystem takes the opposite approach. It follows the same workflow a thorough engineer already uses — and amplifies each step:
32
+ Mindsystem is the middle ground. Each specialist role maps to a phase you control:
33
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 |
34
+ | The role | What you'd do | What Mindsystem does |
35
+ |---|---|---|
36
+ | **Product owner** | Talk through requirements, catch misalignment early | **Discuss phase** surfaces assumptions with confidence levels, forces tradeoff decisions before any code gets written |
37
+ | **Technical researcher** | 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
+ | **Designer** | Try design directions, pick the best one | **Design phase** generates parallel HTML/CSS mockups with side-by-side comparison and exact design tokens |
39
+ | **Tech lead** | Plan from what you remember about the codebase | **Plan phase** loads knowledge files capturing every decision, pattern, and pitfall from prior phases |
40
+ | **QA engineer** | Figure out what states to test, mock them manually | **Verify work** determines mock states automatically — you validate visually or programmatically |
41
41
 
42
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
43
 
@@ -187,11 +187,13 @@ You approve the plan structure and can adjust granularity.
187
187
 
188
188
  Runs without intervention. Each plan runs in a fresh subagent with the full context window available. Goal-backward verification checks that the phase achieved its intended outcome, not just that tasks got marked complete.
189
189
 
190
+ For web projects, browser verification launches a real browser against your dev server, derives a checklist from execution summaries, and verifies each route visually and programmatically. Clear mismatches get fixed inline; issues beyond visual fixes are reported with screenshot evidence for verify-work.
191
+
190
192
  Configurable code review produces separate commits for review changes. Patch files are generated for manual inspection.
191
193
 
192
194
  After execution, knowledge consolidation updates subsystem-scoped knowledge files. Future phases touching the same subsystems start with accumulated context: decisions made, patterns established, pitfalls encountered.
193
195
 
194
- **Creates:** `SUMMARY.md`, `VERIFICATION.md`, `.patch` files, knowledge file updates.
196
+ **Creates:** `SUMMARY.md`, `VERIFICATION.md`, `.patch` files, screenshots, knowledge file updates.
195
197
 
196
198
  ### 9. Verify work
197
199
 
@@ -251,6 +253,10 @@ Orchestration metadata (wave grouping, dependencies) lives in `EXECUTION-ORDER.m
251
253
 
252
254
  Unnecessary instructions aren't wasted space — they interfere with the ones that matter. Each instruction passes a reliability test: does removing this degrade output in the actual runtime context? Every command, workflow, and agent definition gets audited to cut that interference. Audited agents show 35-39% context reduction with no behavioral regression.
253
255
 
256
+ ### Browser verification
257
+
258
+ During execute-phase, web projects get automatic visual QA via [agent-browser](https://github.com/anthropics/agent-browser). A checklist is derived from execution summaries, then each route is verified with screenshots and programmatic diagnostics (console logs, JS errors, network failures). Clear mismatches get fixed inline; anything deeper is reported with screenshot evidence for verify-work. Enabled by default — disable per-project via `/ms:config`.
259
+
254
260
  ### Built-in code review
255
261
 
256
262
  Configurable per tier: adhoc, phase, or milestone. Runs after execution and produces separate commits for inspection. Ships with structural analysis (`ms-code-reviewer`) and clarity-focused simplification (`ms-code-simplifier`), but you can point any tier at your own custom reviewer agent via `.planning/config.json`.
@@ -296,6 +302,11 @@ Requirements you want but haven't shipped yet are tracked in `PROJECT.md` with o
296
302
  - [uv](https://docs.astral.sh/uv/) — Python package runner used by CLI scripts (`curl -LsSf https://astral.sh/uv/install.sh | sh`)
297
303
  - Python 3.10+ (used by uv for scripts)
298
304
 
305
+ **Optional (for web projects):**
306
+
307
+ - [agent-browser](https://github.com/anthropics/agent-browser) — enables browser verification during execute-phase (`npm install -g agent-browser`)
308
+ - `cwebp` — optimizes verification screenshots to WebP (`brew install webp`)
309
+
299
310
  ---
300
311
 
301
312
  ## Quick start
@@ -452,6 +463,13 @@ Mindsystem stores project config in `.planning/config.json`. Run `/ms:config` to
452
463
  // "auto" (default) | "ask" | "off"
453
464
  "open_mockups": "auto",
454
465
 
466
+ // Browser verification during execute-phase (web projects only).
467
+ // Launches a real browser, derives checklist from summaries,
468
+ // screenshots + console/network diagnostics.
469
+ "browser_verification": {
470
+ "enabled": true // default: true for web projects
471
+ },
472
+
455
473
  // External task tracker integration (Linear only for now).
456
474
  // null → disabled (default)
457
475
  "task_tracker": {
@@ -34,13 +34,22 @@ Open the app URL headless. If redirected to login, report auth failure and exit
34
34
  <step name="environment_preflight">
35
35
  Navigate to the app's main route. Screenshot `00-preflight.png`.
36
36
 
37
+ Read diagnostics:
38
+ ```bash
39
+ agent-browser console
40
+ agent-browser errors
41
+ agent-browser network requests
42
+ ```
43
+
37
44
  Evaluate:
38
- - Does the app load?
39
- - Visible backend errors? Console errors? Blank page?
45
+ - Does the app load visually?
46
+ - Console errors or uncaught exceptions?
47
+ - Failed network requests (4xx/5xx)?
48
+ - Blank page?
40
49
 
41
- **If systemic issue** (app won't load, white screen, critical error):
50
+ **If systemic issue** (app won't load, white screen, critical error, cascade of failed requests):
42
51
  - Screenshot the failure
43
- - Return `environment_blocked` report to orchestrator with screenshot evidence
52
+ - Return `environment_blocked` report to orchestrator with screenshot and diagnostic output
44
53
  - Stop — no point testing individual items
45
54
 
46
55
  **If app loads with minor warnings:**
@@ -59,16 +68,23 @@ mkdir -p {screenshots_dir}
59
68
  For each checklist item:
60
69
 
61
70
  ```
71
+ agent-browser errors --clear ← isolate errors per item
72
+
62
73
  Navigate to route → Screenshot → Evaluate
63
74
 
64
75
  Match expected?
65
76
  YES → PASSED, next item
66
- NO → Environment issue? (API error, 404, empty data, console network errors)
77
+ NO → Read diagnostics:
78
+ agent-browser errors
79
+ agent-browser console
80
+ agent-browser network requests
81
+
82
+ Environment issue? (uncaught exception, failed API request, 4xx/5xx, empty data)
67
83
  YES → ENVIRONMENT_BLOCKED for this item
68
84
  Same error on 2+ consecutive items? → stop, return report
69
85
  Otherwise → next item
70
- NO → Investigate in project source files
71
- → Hit a stop signal? (see Investigation boundaries + Fix discipline) → ISSUE with screenshot evidence, next item
86
+ NO → Investigate in project source files (diagnostics narrow the search)
87
+ → Hit a stop signal? (see Investigation boundaries + Fix discipline) → ISSUE with screenshot and diagnostic evidence, next item
72
88
  → Root cause found → Fix attempt → re-screenshot
73
89
  Fix worked? → FIXED (commit), next item
74
90
  Fix failed? → Different root-cause theory available?
@@ -77,9 +93,9 @@ NO → Environment issue? (API error, 404, empty data, console network errors)
77
93
  ```
78
94
 
79
95
  **Per-item screenshots:**
80
- - `{NN}-{item-slug}.png` — initial state
81
- - `{NN}-{item-slug}-result.png` — after interaction (if applicable)
82
- - `{NN}-{item-slug}-fixed.png` — after fix (if applicable)
96
+ - `{NN}-{item-slug}.webp` — initial state (`.png` if cwebp unavailable)
97
+ - `{NN}-{item-slug}-result.webp` — after interaction (if applicable)
98
+ - `{NN}-{item-slug}-fixed.webp` — after fix (if applicable)
83
99
 
84
100
  **Interactions:** If the checklist item includes an interaction (click, type, submit), perform it and screenshot the result.
85
101
  </step>
@@ -105,10 +121,10 @@ Close the browser. Return a structured report to the orchestrator:
105
121
  - {what was wrong} → {what was fixed} | Commit: {hash}
106
122
 
107
123
  ### Issues Found
108
- - {description} | Screenshot: {filename} | Evidence: {what the screenshot shows}
124
+ - {description} | Screenshot: {filename} | Evidence: {what the screenshot shows} | Diagnostics: {console errors, failed network requests, or "none"}
109
125
 
110
126
  ### Environment Blockers
111
- - {description} | Screenshot: {filename}
127
+ - {description} | Screenshot: {filename} | Diagnostics: {error messages, failed requests}
112
128
  ```
113
129
  </step>
114
130
 
@@ -120,11 +136,15 @@ Close the browser. Return a structured report to the orchestrator:
120
136
  - Save all screenshots to `{screenshots_dir}` — never to temp or working directory
121
137
  - Re-snapshot after every DOM change (element refs go stale)
122
138
  - Wait for networkidle before evaluating
139
+ - Convert screenshots to WebP after capture:
140
+ 1. Check once during preflight: `which cwebp`
141
+ 2. If available, after each screenshot: `cwebp -q 80 {file}.png -o {file}.webp && rm {file}.png`
142
+ 3. If unavailable: keep PNGs as-is
123
143
 
124
144
  ## Investigation boundaries
125
145
  - Only read project source files — never node_modules, dist, build output, or generated directories
126
146
  - Never read framework/library source to understand why something doesn't work internally
127
- - Check network responses and console errors before investigating code — if the data source is the problem, it's ENVIRONMENT_BLOCKED
147
+ - Read `agent-browser errors`, `agent-browser console`, and `agent-browser network requests` before investigating source code — if diagnostics show a failed API call or server error, it's ENVIRONMENT_BLOCKED, not a code fix
128
148
  - If 2+ consecutive items show the same failure pattern, identify the shared root cause rather than investigating each individually
129
149
 
130
150
  ## Fix discipline
@@ -2,7 +2,7 @@
2
2
  name: ms-compounder
3
3
  description: Compounds raw code changes into per-subsystem knowledge files. Spawned by compound workflow.
4
4
  model: sonnet
5
- tools: Read, Write, Bash, Grep, Glob
5
+ tools: Read, Edit, Write, Bash, Grep, Glob
6
6
  color: yellow
7
7
  ---
8
8
 
@@ -19,7 +19,7 @@ You are a Mindsystem knowledge compounder spawned by the compound workflow to up
19
19
  ## Required Context (provided by compound workflow)
20
20
 
21
21
  - **Input mode:** `git`, `file`, or `description`
22
- - **Change reference:** Git ref/range (git mode), file path (file mode), or description + exploration summary (description mode)
22
+ - **Change reference:** Git ref/range (git mode), file path (file mode), or description/conversation summary (description mode)
23
23
  - **Affected subsystems:** List confirmed by user in main context
24
24
  - **Subsystem vocabulary:** From config.json (for alignment validation)
25
25
 
@@ -47,7 +47,7 @@ Retrieve the raw changes based on input mode:
47
47
 
48
48
  - **Git mode:** `git show <ref>` for single commit, `git diff <range>` for ranges. Include `--stat` for file overview.
49
49
  - **File mode:** Read the file content. Run `git log --oneline -5 -- <path>` for recent history context.
50
- - **Description mode:** Use the provided exploration summary as change context. No additional reads needed.
50
+ - **Description mode:** Use the provided summary (from exploration or conversation context) as change context. No additional reads needed.
51
51
 
52
52
  ## Step 2: Read Existing Knowledge Files
53
53
 
@@ -71,23 +71,23 @@ Focus on:
71
71
 
72
72
  ## Step 4: Merge Into Existing Knowledge
73
73
 
74
- For each affected subsystem, merge extracted content into the knowledge file:
74
+ For each affected subsystem, edit the knowledge file to reflect current state:
75
75
 
76
- - **Decisions:** Add new entries, update superseded decisions, remove contradicted ones.
77
- - **Architecture:** Update structural descriptions with new components and patterns.
78
- - **Design:** Add new specs, update changed specs.
79
- - **Pitfalls:** Add new entries, deduplicate with existing.
80
- - **Key Files:** Add new paths, remove renamed or deleted files.
76
+ - **Decisions:** Append new entries. Edit superseded decisions in place. Delete contradicted ones.
77
+ - **Architecture:** Edit structural descriptions with new components and patterns.
78
+ - **Design:** Append new specs, edit changed specs.
79
+ - **Pitfalls:** Append new entries. Delete duplicates of existing entries.
80
+ - **Key Files:** Append new paths, delete renamed or deleted files.
81
81
 
82
- Rewrite the full filenot append. The result is the current state of knowledge.
82
+ Use `Edit` for existing files targeted changes preserve content you haven't inspected. Use `Write` only for new files (subsystem has no knowledge file yet).
83
83
 
84
- ## Step 5: Write Knowledge Files and Return Report
84
+ ## Step 5: Update Knowledge Files and Return Report
85
85
 
86
86
  ```bash
87
87
  mkdir -p .planning/knowledge/
88
88
  ```
89
89
 
90
- Write one file per affected subsystem. Follow the template format from `~/.claude/mindsystem/templates/knowledge.md`. Omit sections with no content.
90
+ For new subsystems (no existing file), use `Write` to create the file following the template format from `~/.claude/mindsystem/templates/knowledge.md`. For existing files, all changes should already be applied via `Edit` in step 4. Omit empty sections.
91
91
 
92
92
  Return a structured report to the compound workflow.
93
93
 
@@ -123,11 +123,11 @@ If changes suggest a subsystem not in the confirmed list, note it as a proposal
123
123
 
124
124
  **Preserve rationale.** The "because" part is the value. Decisions without rationale are just facts.
125
125
 
126
- **Rewrite, not append.** Each update produces the current state. Superseded decisions get updated, not duplicated.
126
+ **Edit to reflect current state.** Update superseded decisions, remove outdated patterns, append new entries. Use `Edit` for existing files, `Write` only for new files.
127
127
 
128
128
  **Omit empty sections.** If a subsystem has no design work, do not include a Design section.
129
129
 
130
- **No commits.** Write files only — the compound workflow orchestrator handles commits.
130
+ **No commits.** Edit/write files only — the compound workflow orchestrator handles commits.
131
131
 
132
132
  **Only write files for confirmed affected subsystems.** Do not invent subsystems or write knowledge files for subsystems not in the confirmed list.
133
133
 
@@ -136,7 +136,8 @@ If changes suggest a subsystem not in the confirmed list, note it as a proposal
136
136
  </critical_rules>
137
137
 
138
138
  <success_criteria>
139
- - [ ] Merge uses rewrite semantics (update, remove, deduplicate not just add)
139
+ - [ ] Existing files modified via Edit (not Write)targeted changes, no full-file replacement
140
+ - [ ] Merge reflects current state (update, remove, deduplicate — not just append)
140
141
  - [ ] No commits made
141
142
  - [ ] Report returned with update counts
142
143
  - [ ] Empty sections omitted from knowledge files
@@ -2,7 +2,7 @@
2
2
  name: ms-consolidator
3
3
  description: Consolidates phase artifacts into per-subsystem knowledge files. Spawned by execute-phase after plan execution.
4
4
  model: sonnet
5
- tools: Read, Write, Bash, Grep, Glob
5
+ tools: Read, Edit, Write, Bash, Grep, Glob
6
6
  color: yellow
7
7
  ---
8
8
 
@@ -137,25 +137,25 @@ Extract knowledge, not descriptions. "Using React" is not knowledge. "Using Reac
137
137
 
138
138
  ## Step 6: Merge Into Knowledge Files
139
139
 
140
- For each affected subsystem, merge extracted content into the knowledge file:
140
+ For each affected subsystem, edit the knowledge file to reflect current state:
141
141
 
142
- - **Decisions:** Add new entries, update superseded decisions, remove contradicted ones.
143
- - **Architecture:** Update structural descriptions with new components and patterns.
144
- - **Design:** Add new specs, update changed specs.
145
- - **Pitfalls:** Add new entries, deduplicate with existing.
146
- - **Key Files:** Add new paths, remove renamed or deleted files.
142
+ - **Decisions:** Append new entries. Edit superseded decisions in place. Delete contradicted ones.
143
+ - **Architecture:** Edit structural descriptions with new components and patterns.
144
+ - **Design:** Append new specs, edit changed specs.
145
+ - **Pitfalls:** Append new entries. Delete duplicates of existing entries.
146
+ - **Key Files:** Append new paths, delete renamed or deleted files.
147
147
 
148
- Rewrite the full filenot append. The result is the current state of knowledge.
148
+ Use `Edit` for existing files targeted changes preserve content you haven't inspected. Use `Write` only for new files (subsystem has no knowledge file yet).
149
149
 
150
- ## Step 7: Write Knowledge Files
150
+ ## Step 7: Update Knowledge Files
151
151
 
152
152
  ```bash
153
153
  mkdir -p .planning/knowledge/
154
154
  ```
155
155
 
156
- Write one file per affected subsystem. Follow the template format from `~/.claude/mindsystem/templates/knowledge.md`. Omit sections with no content.
156
+ For new subsystems (no existing file), use `Write` to create the file following the template format from `~/.claude/mindsystem/templates/knowledge.md`. For existing files, all changes should already be applied via `Edit` in step 6. Omit empty sections.
157
157
 
158
- Only write files for subsystems found in SUMMARY.md frontmatter.
158
+ Only update files for subsystems found in SUMMARY.md frontmatter.
159
159
 
160
160
  ## Step 8: Delete PLAN.md Files
161
161
 
@@ -203,7 +203,7 @@ Use `+N` for new entries added, `updated` for sections rewritten with changes, `
203
203
 
204
204
  **Preserve rationale.** The "because" part is the value. Decisions without rationale are just facts.
205
205
 
206
- **Rewrite, not append.** Each consolidation produces the current state. Superseded decisions get updated, not duplicated.
206
+ **Edit to reflect current state.** Update superseded decisions, remove outdated patterns, append new entries. Use `Edit` for existing files, `Write` only for new files.
207
207
 
208
208
  **Handle missing files gracefully.** Not all phases have CONTEXT, DESIGN, or RESEARCH files. This is normal.
209
209
 
@@ -220,7 +220,8 @@ Use `+N` for new entries added, `updated` for sections rewritten with changes, `
220
220
  <success_criteria>
221
221
  - [ ] Subsystem alignment validated against config.json
222
222
  - [ ] Content extracted and distributed per extraction guide
223
- - [ ] Knowledge files written to `.planning/knowledge/`
223
+ - [ ] Existing knowledge files modified via Edit (not Write) — targeted changes, no full-file replacement
224
+ - [ ] New knowledge files created with Write in `.planning/knowledge/`
224
225
  - [ ] Empty sections omitted from knowledge files
225
226
  - [ ] PLAN.md files deleted from phase directory
226
227
  - [ ] CONTEXT.md, DESIGN.md, RESEARCH.md, SUMMARY.md preserved
@@ -483,7 +483,8 @@ Orchestrator provides:
483
483
 
484
484
  ```bash
485
485
  # For phase research, check for CONTEXT.md from discuss-phase
486
- PHASE_DIR=$(ls -d .planning/phases/${PHASE}-* 2>/dev/null | head -1)
486
+ ms-tools find-phase "${PHASE}"
487
+ # Extract PHASE_DIR from the `dir` field of the JSON output
487
488
  if [ -n "$PHASE_DIR" ]; then
488
489
  cat "${PHASE_DIR}"/*-CONTEXT.md 2>/dev/null
489
490
  fi
@@ -534,6 +534,19 @@ Verify 100% requirement mapping:
534
534
 
535
535
  If gaps found, include in draft for user decision.
536
536
 
537
+ ## Step 6b: Evaluate Subsystem Coverage
538
+
539
+ Compare phase domains against config.json `subsystems` array. Phases may introduce domains not in the current subsystem vocabulary.
540
+
541
+ 1. Parse `subsystems` from config.json (provided in planning context)
542
+ 2. For each phase, identify its primary domain (e.g., "Payment Processing" maps to `payments`)
543
+ 3. Match against existing subsystems — exact or close synonym counts as covered
544
+ 4. Collect unmatched domains as proposed additions
545
+
546
+ Include proposals in the return under `### Subsystem Proposals`. Do not modify config.json — the orchestrator handles confirmation and update.
547
+
548
+ If all phase domains map to existing subsystems, omit the section.
549
+
537
550
  ## Step 7: Write Files Immediately
538
551
 
539
552
  **Write files first, then return.** This ensures artifacts persist even if context is lost.
@@ -613,6 +626,16 @@ When files are written and returning to orchestrator:
613
626
 
614
627
  {For phases with Likely recommendations, include topics/focus}
615
628
 
629
+ {If new subsystems proposed:}
630
+
631
+ ### Subsystem Proposals
632
+
633
+ New domains detected that don't match existing subsystems:
634
+
635
+ | Proposed | Source Phase | Rationale |
636
+ |----------|-------------|-----------|
637
+ | {name} | Phase {N}: {phase-name} | {why this needs its own subsystem} |
638
+
616
639
  ### Files Ready for Review
617
640
 
618
641
  User can review actual files:
@@ -644,6 +667,16 @@ After incorporating user feedback and updating files:
644
667
  - .planning/ROADMAP.md
645
668
  - .planning/STATE.md (if needed)
646
669
 
670
+ {If new subsystems proposed:}
671
+
672
+ ### Subsystem Proposals
673
+
674
+ New domains detected that don't match existing subsystems:
675
+
676
+ | Proposed | Source Phase | Rationale |
677
+ |----------|-------------|-----------|
678
+ | {name} | Phase {N}: {phase-name} | {why this needs its own subsystem} |
679
+
647
680
  ### Updated Summary
648
681
 
649
682
  | Phase | Goal | Requirements |
@@ -148,10 +148,6 @@ Add the new phase entry to the roadmap:
148
148
  **Design focus**: {focus} ← only if Likely
149
149
  **Research**: {Likely (reason) | Unlikely (reason)}
150
150
  **Research topics**: {topics} ← only if Likely
151
- **Plans:** 0 plans
152
-
153
- Plans:
154
- - [ ] TBD (run /ms:plan-phase {N} to break down)
155
151
 
156
152
  **Details:**
157
153
  [To be added during planning]
@@ -19,7 +19,7 @@ Input modes:
19
19
  - **Git reference:** SHA, range (`HEAD~3..HEAD`), or any git ref
20
20
  - **File path:** Path to a changed file
21
21
  - **Description:** Free-text description of changes
22
- - **No args:** Infer from current conversation context
22
+ - **No args:** Reflect on current conversation context + git data
23
23
  </objective>
24
24
 
25
25
  <execution_context>
@@ -34,7 +34,7 @@ Validate active project: check `.planning/config.json` exists.
34
34
  </step>
35
35
 
36
36
  <step name="resolve_change_context">
37
- Gather lightweight change context. Git mode: diff stats. File mode: recent git log. Description mode: spawn Explore agents to find relevant changes.
37
+ Gather lightweight change context. Git mode: diff stats. File mode: recent git log. No-args mode: reflect on conversation context + git diff/log; if context is thin, ask user for intent. Description mode: spawn Explore agents to find relevant changes.
38
38
  </step>
39
39
 
40
40
  <step name="determine_subsystems">
@@ -50,7 +50,7 @@ Spawn ms-compounder with input mode, change reference, confirmed subsystems, and
50
50
  </step>
51
51
 
52
52
  <step name="finalize">
53
- Update config.json if new subsystems confirmed. Commit knowledge file changes. Set last command.
53
+ Update config.json if new subsystems confirmed. Commit knowledge file changes. Set last command. Report results.
54
54
  </step>
55
55
 
56
56
  </process>
@@ -136,8 +136,9 @@ Task(
136
136
  5. Map every v1 requirement to exactly one phase
137
137
  6. Derive 2-5 success criteria per phase (observable user behaviors)
138
138
  7. Validate 100% coverage
139
- 8. Write files immediately (REQUIREMENTS.md, ROADMAP.md, STATE.md)
140
- 9. Return ROADMAP CREATED with combined requirements + roadmap summary
139
+ 8. Evaluate subsystem coverage — compare phase domains against config.json subsystems, propose additions for unmatched domains
140
+ 9. Write files immediately (REQUIREMENTS.md, ROADMAP.md, STATE.md)
141
+ 10. Return ROADMAP CREATED with combined requirements + roadmap summary
141
142
 
142
143
  Write files first, then return. This ensures artifacts persist even if context is lost.
143
144
  </instructions>
@@ -200,6 +201,18 @@ Pre-work: Research [Likely/Unlikely] | Discuss [Likely/Unlikely] | Design [Likel
200
201
 
201
202
  [... continue for all phases ...]
202
203
 
204
+ {If roadmapper returned Subsystem Proposals:}
205
+
206
+ ### New Subsystems
207
+
208
+ The roadmap introduces domains not covered by current subsystems:
209
+
210
+ | Proposed | Source Phase | Rationale |
211
+ |----------|-------------|-----------|
212
+ | {name} | Phase {N} | {reason} |
213
+
214
+ These will be added to config.json upon approval.
215
+
203
216
  ---
204
217
  ```
205
218
  </step>
@@ -275,7 +288,11 @@ Return ROADMAP REVISED with changes made.
275
288
  **Update state and commit:**
276
289
 
277
290
  ```bash
291
+ # For each subsystem proposal the user approved (skip any rejected during revision):
292
+ ms-tools config-set subsystems --append "{subsystem-name}"
293
+
278
294
  git add .planning/REQUIREMENTS.md .planning/ROADMAP.md .planning/STATE.md
295
+ git diff --quiet .planning/config.json 2>/dev/null || git add .planning/config.json
279
296
  git commit -m "$(cat <<'EOF'
280
297
  docs: define requirements and create roadmap
281
298
 
@@ -30,9 +30,14 @@ Create design specifications for a phase. Spawns ms-designer agent with phase co
30
30
  <context>
31
31
  Phase number: $ARGUMENTS (required)
32
32
 
33
+ Resolve phase directory:
34
+ ```bash
35
+ ms-tools find-phase "$ARGUMENTS"
36
+ ```
37
+
33
38
  Check for existing design:
34
39
  ```bash
35
- ls .planning/phases/${PHASE}-*/*DESIGN.md 2>/dev/null
40
+ ls ${PHASE_DIR}/*DESIGN.md 2>/dev/null
36
41
  ```
37
42
  </context>
38
43
 
@@ -52,8 +57,7 @@ ms-tools find-phase "$ARGUMENTS"
52
57
  ## 2. Check Existing Design
53
58
 
54
59
  ```bash
55
- # Check for existing DESIGN.md
56
- PHASE_DIR=$(ls -d .planning/phases/${PHASE}-* 2>/dev/null | head -1)
60
+ # PHASE_DIR already resolved from find-phase in <context>
57
61
  ls "${PHASE_DIR}"/*-DESIGN.md 2>/dev/null
58
62
  ```
59
63
 
@@ -119,7 +123,7 @@ Extract from ROADMAP.md:
119
123
  **4b. Optional context - CONTEXT.md (from discuss-phase):**
120
124
 
121
125
  ```bash
122
- cat .planning/phases/${PHASE}-*/${PHASE}-CONTEXT.md 2>/dev/null
126
+ cat ${PHASE_DIR}/*-CONTEXT.md 2>/dev/null
123
127
  ```
124
128
 
125
129
  If exists, extract:
@@ -377,7 +381,7 @@ Task(
377
381
 
378
382
  ```bash
379
383
  ms-tools set-last-command "ms:design-phase $ARGUMENTS"
380
- git add .planning/phases/${PHASE}-*/*-DESIGN.md .planning/STATE.md
384
+ git add ${PHASE_DIR}/*-DESIGN.md .planning/STATE.md
381
385
  git commit -m "docs: create design for phase ${PHASE}"
382
386
  ```
383
387
 
@@ -387,12 +391,12 @@ Display summary from agent response:
387
391
  - Screens designed
388
392
  - Key design decisions
389
393
 
390
- Then present pre-work status: Read `~/.claude/mindsystem/references/prework-status.md` and show what's done vs still needed for this phase.
391
-
392
394
  Also offer:
393
395
  - **Refine design** — Discuss changes conversationally
394
396
  - **View full design** — Display DESIGN.md
395
397
 
398
+ Read `~/.claude/mindsystem/references/prework-status.md` and present what's done vs still needed for this phase.
399
+
396
400
  **`## DESIGN NEEDS CLARIFICATION`:**
397
401
 
398
402
  Present the question to user. Get response. Spawn continuation with the clarification.
@@ -145,14 +145,14 @@ Then route based on status:
145
145
  | Status | Route |
146
146
  |--------|-------|
147
147
  | `gaps_found` | Route C (gap closure) |
148
- | `passed` + more phases | Route A (verify + next phase) |
148
+ | `passed` + more phases | Route A (verify) |
149
149
  | `passed` + last phase | Route B (verify + milestone complete) |
150
150
 
151
151
  Thoroughness by default: verify-work is the primary "Next Up" in both routes. Assess skip context per workflow `offer_next` step.
152
152
 
153
153
  ---
154
154
 
155
- **Route A: Phase verified, more phases remain**
155
+ **Shared steps (Routes A and B):**
156
156
 
157
157
  1. Show phase completion summary:
158
158
  ```
@@ -174,26 +174,33 @@ All {Y} plans finished. Phase goal verified.
174
174
  {If skip context: "Phase involved only {description} with no user-facing changes — skip if structural verification is sufficient."}
175
175
  ```
176
176
 
177
- 4. Read `~/.claude/mindsystem/references/routing/next-phase-routing.md` to determine the most appropriate command for Phase {Z+1}. Present next phase context and options:
178
- ```
179
- **Phase {Z+1}: {Name}** — {Goal}
180
- {If pre-work flagged: brief note about recommendations}
177
+ **Then branch by route:**
181
178
 
182
- **Also available:**
183
- - `/ms:{suggested} {Z+1}` — {reason}
184
- - `/ms:plan-phase {Z+1}` — skip pre-work, plan directly
185
- ```
179
+ **Route A: More phases remain**
186
180
 
187
- ---
181
+ 4. **If skip context applies:** Determine next phase's primary suggestion:
182
+ - From ROADMAP.md (already in context), get Phase {Z+1} pre-work flags
183
+ - Check: CONTEXT.md exists? DESIGN.md? RESEARCH.md? in next phase dir
184
+ - Priority: discuss (if Likely + no CONTEXT.md) > design (if Likely + no DESIGN.md) > research (if Likely + no RESEARCH.md) > plan-phase
185
+ - Present ONE "Also available" entry:
186
+ ```
187
+ ---
188
+ **Also available:**
189
+ - `/ms:{suggested} {Z+1}` — skip verify, start Phase {Z+1}: {Name}
190
+ ---
191
+ ```
192
+ **If skip context does NOT apply:** No "Also available" — verify-work is the sole suggestion.
188
193
 
189
- **Route B: Phase verified, milestone complete**
194
+ **Route B: Milestone complete**
190
195
 
191
- Follow Route A steps 1-3, then present milestone options:
196
+ 4. Present milestone options:
192
197
  ```
198
+ ---
193
199
  **Also available:**
194
200
  - `/ms:audit-milestone` — verify requirements, cross-phase integration, E2E flows
195
201
  - `/ms:complete-milestone` — skip audit, archive directly
196
202
  - `/ms:add-phase <description>` — add another phase first
203
+ ---
197
204
  ```
198
205
 
199
206
  ---
@@ -136,6 +136,7 @@ Define requirements and create roadmap with phases.
136
136
  - Creates `.planning/ROADMAP.md` (phase breakdown)
137
137
  - Creates `.planning/STATE.md` (project memory)
138
138
  - Creates `.planning/phases/` directories
139
+ - Evaluates subsystem coverage — proposes new subsystems if phases introduce unmatched domains
139
140
 
140
141
  Usage: `/ms:create-roadmap`
141
142
 
@@ -163,10 +163,6 @@ Insert the new phase entry into the roadmap:
163
163
  **Design focus**: {focus} ← only if Likely
164
164
  **Research**: {Likely (reason) | Unlikely (reason)}
165
165
  **Research topics**: {topics} ← only if Likely
166
- **Plans:** 0 plans
167
-
168
- Plans:
169
- - [ ] TBD (run /ms:plan-phase {decimal_phase} to break down)
170
166
 
171
167
  **Details:**
172
168
  [To be added during planning]