mindsystem-cc 4.3.0 → 4.4.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.
package/README.md CHANGED
@@ -1,10 +1,8 @@
1
1
  <div align="center">
2
2
 
3
- # MINDSYSTEM
3
+ ![Mindsystem Bento Grid](assets/bento-image.webp)
4
4
 
5
- **The engineer's meta-prompting system for Claude Code.**
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.
5
+ 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 lean teams and solo builders who want to multiply their output without giving up control.
8
6
 
9
7
  ```bash
10
8
  npx mindsystem-cc
@@ -13,12 +11,6 @@ npx mindsystem-cc
13
11
  [![npm version](https://img.shields.io/npm/v/mindsystem-cc?style=flat-square&logo=npm&logoColor=white&color=CB3837)](https://www.npmjs.com/package/mindsystem-cc)
14
12
  [![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](LICENSE)
15
13
 
16
- <br>
17
-
18
- ![Mindsystem Install](assets/terminal.svg)
19
-
20
- <br>
21
-
22
14
  [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
15
 
24
16
  </div>
@@ -27,9 +19,7 @@ npx mindsystem-cc
27
19
 
28
20
  ## Why Mindsystem
29
21
 
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:
22
+ Fully autonomous coding tools take a spec and run until a product emerges. That works for prototypes. Mindsystem takes the opposite approach — it follows the workflow a thorough engineer already uses, and amplifies each step:
33
23
 
34
24
  | What you'd do manually | What Mindsystem does |
35
25
  |---|---|
@@ -136,7 +126,7 @@ Requirements define what must be TRUE when you ship, not what to build. This goa
136
126
  ### 4. Discuss phase (optional, recommended)
137
127
 
138
128
  ```
139
- /ms:discuss-phase 1
129
+ /ms:discuss-phase <phase>
140
130
  ```
141
131
 
142
132
  This is where you catch misalignment before writing any code. Claude loads milestone context, feature knowledge files, and competitor research, then surfaces its assumptions with confidence levels. You validate intent, make tradeoff decisions, correct misunderstandings.
@@ -148,7 +138,7 @@ Worth taking seriously. Decisions here propagate through everything that follows
148
138
  ### 5. Design phase (optional)
149
139
 
150
140
  ```
151
- /ms:design-phase 1
141
+ /ms:design-phase <phase>
152
142
  ```
153
143
 
154
144
  Claude generates parallel HTML/CSS mockup variants and a side-by-side comparison page that opens in your browser. You pick a direction, iterate with feedback.
@@ -158,7 +148,7 @@ The output is a `DESIGN.md` with exact design tokens (hex colors, px spacing, fo
158
148
  ### 6. Research phase (optional)
159
149
 
160
150
  ```
161
- /ms:research-phase 1
151
+ /ms:research-phase <phase>
162
152
  ```
163
153
 
164
154
  Three parallel agents investigate at once: one queries external documentation through Perplexity and Context7, one analyzes your codebase for existing patterns, one surveys community best practices. Claude synthesizes findings into `RESEARCH.md` with confidence levels and source attribution.
@@ -168,21 +158,19 @@ You resolve library conflicts if any come up. Otherwise, this runs with minimal
168
158
  ### 7. Plan phase
169
159
 
170
160
  ```
171
- /ms:plan-phase 1
161
+ /ms:plan-phase <phase>
172
162
  ```
173
163
 
174
- Claude breaks the phase into tasks, groups them into plans targeting 25-45% of the context budget. Plans are pure markdown, no YAML frontmatter, no XML containers. The plan is the executable prompt, roughly 90% actionable content and 10% structure.
175
-
176
- Independent plans get grouped into waves for parallel execution. A risk score (0-100) flags complex plans so you can verify them before committing.
164
+ Claude breaks the phase into tasks and writes a single PLAN.md pure markdown, no YAML frontmatter, no XML containers. The plan is the executable prompt, roughly 90% actionable content and 10% structure.
177
165
 
178
- You approve the plan structure and can adjust granularity.
166
+ A risk score (0-100) flags complex plans so you can verify them before committing. For phases with genuinely independent work streams, enable `multi_plan` in config to restore multi-plan breakdown with wave-based parallel execution.
179
167
 
180
168
  **Creates:** `PLAN.md` files, `EXECUTION-ORDER.md`.
181
169
 
182
170
  ### 8. Execute phase
183
171
 
184
172
  ```
185
- /ms:execute-phase 1
173
+ /ms:execute-phase <phase>
186
174
  ```
187
175
 
188
176
  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.
@@ -198,7 +186,7 @@ After execution, knowledge consolidation updates subsystem-scoped knowledge file
198
186
  ### 9. Verify work
199
187
 
200
188
  ```
201
- /ms:verify-work 1
189
+ /ms:verify-work <phase>
202
190
  ```
203
191
 
204
192
  You run manual acceptance tests presented in batches of 4. Claude fixes issues inline or via subagent, then asks you to re-test until passing.
@@ -470,6 +458,11 @@ Mindsystem stores project config in `.planning/config.json`. Run `/ms:config` to
470
458
  "enabled": true // default: true for web projects
471
459
  },
472
460
 
461
+ // Plan mode for plan-phase.
462
+ // false (default) → single plan per phase, optimal for 1M context
463
+ // true → multi-plan with wave-based parallel execution
464
+ "multi_plan": false,
465
+
473
466
  // External task tracker integration (Linear only for now).
474
467
  // null → disabled (default)
475
468
  "task_tracker": {
@@ -492,7 +485,7 @@ Full docs live in `/ms:help`.
492
485
  | `/ms:help` | Show the full command reference |
493
486
  | `/ms:progress` | Show where you are and what to run next |
494
487
  | `/ms:new-project` | Initialize `.planning/` and capture project intent |
495
- | `/ms:config` | Configure code reviewers, mockups, gitignore, git remote |
488
+ | `/ms:config` | Configure code reviewers, mockups, plan mode, gitignore, git remote |
496
489
  | `/ms:map-codebase` | Document existing repo's stack, structure, and conventions |
497
490
  | `/ms:research-milestone` | Milestone-scoped research saved to `.planning/MILESTONE-RESEARCH.md` |
498
491
  | `/ms:create-roadmap` | Define requirements and create phases mapped to them |
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ms-browser-verifier
3
- description: Visual PR review via browser. Verifies delivered UI against a checklist, fixes trivial issues inline, reports blockers with screenshot evidence.
3
+ description: Visual PR review via browser. Completes user journeys end-to-end, fixes trivial issues inline, reports blockers with screenshot evidence.
4
4
  model: sonnet
5
5
  tools: Read, Write, Edit, Bash, Grep, Glob
6
6
  skills:
@@ -9,9 +9,9 @@ color: green
9
9
  ---
10
10
 
11
11
  <role>
12
- You are a senior engineer doing a visual PR review. You receive a browser checklist from the orchestrator and verify each item by navigating to the app, taking screenshots, and evaluating what you see. Fix clear visual mismatches in project source code. Report blockers with screenshot evidence.
12
+ You are a senior engineer doing a visual PR review. You receive user journeys from the orchestrator and complete each journey end-to-end clicking through UI, filling forms, submitting actions, verifying outcomes. Fix clear visual mismatches in project source code. Report blockers with screenshot evidence.
13
13
 
14
- **Critical mindset:** Verify delivered views, not framework internals. If your investigation leads outside project source files, stop — that's an ISSUE to report, not a rabbit hole to explore.
14
+ **Critical mindset:** Use each feature as a real user would, not framework internals. If your investigation leads outside project source files, stop — that's an ISSUE to report, not a rabbit hole to explore.
15
15
  </role>
16
16
 
17
17
  <process>
@@ -53,11 +53,11 @@ Evaluate:
53
53
  - Stop — no point testing individual items
54
54
 
55
55
  **If app loads with minor warnings:**
56
- - Note warnings and proceed to checklist verification
56
+ - Note warnings and proceed to journey testing
57
57
  </step>
58
58
 
59
- <step name="verify_checklist">
60
- Single loop over all checklist items with an integrated decision tree.
59
+ <step name="test_journeys">
60
+ Single loop over all user journeys with an integrated decision tree.
61
61
 
62
62
  Create the screenshots directory:
63
63
 
@@ -65,39 +65,52 @@ Create the screenshots directory:
65
65
  mkdir -p {screenshots_dir}
66
66
  ```
67
67
 
68
- For each checklist item:
68
+ For each journey:
69
69
 
70
70
  ```
71
- agent-browser errors --clear ← isolate errors per item
71
+ agent-browser errors --clear ← isolate errors per journey
72
+
73
+ 1. Navigate to journey's start page via UI (sidebar, nav — NOT by typing URL)
74
+ → Cannot reach start page? → UNREACHABLE with screenshot evidence, next journey
75
+ 2. Screenshot starting state
76
+ 3. Execute each step in order:
77
+ - Perform action (click, fill, select, toggle)
78
+ - Wait for response (networkidle, element change)
79
+ - Screenshot key states (after significant interactions)
80
+ - Check errors after state-modifying actions:
81
+ agent-browser errors
82
+ agent-browser console
83
+ agent-browser network requests
72
84
 
73
- Navigate to route Screenshot Evaluate
85
+ 4. After all steps: evaluate success criteria against final state
74
86
 
75
- Match expected?
76
- YES → PASSED, next item
87
+ Success criteria met?
88
+ YES → PASSED, next journey
77
89
  NO → Read diagnostics:
78
90
  agent-browser errors
79
91
  agent-browser console
80
92
  agent-browser network requests
81
93
 
82
94
  Environment issue? (uncaught exception, failed API request, 4xx/5xx, empty data)
83
- YES → ENVIRONMENT_BLOCKED for this item
84
- Same error on 2+ consecutive items? → stop, return report
85
- Otherwise → next item
95
+ YES → ENVIRONMENT_BLOCKED for this journey
96
+ Same error on 2+ consecutive journeys? → stop, return report
97
+ Otherwise → next journey
86
98
  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
88
- → Root cause found → Fix attempt → re-screenshot
89
- Fix worked? → FIXED (commit), next item
99
+ → Hit a stop signal? (see Investigation boundaries + Fix discipline) → ISSUE with screenshot and diagnostic evidence, next journey
100
+ → Root cause found → Fix attempt → resume journey from fixed step → re-screenshot
101
+ Fix worked? → FIXED (commit), next journey
90
102
  Fix failed? → Different root-cause theory available?
91
103
  YES → Second fix attempt (same flow)
92
- NO → revert all changes (git checkout -- {files}), ISSUE, next item
104
+ NO → revert all changes (git checkout -- {files}), ISSUE, next journey
93
105
  ```
94
106
 
95
- **Per-item screenshots:**
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)
107
+ **Per-journey screenshots:**
108
+ - `{NN}-{journey-slug}.webp` — starting state (`.png` if cwebp unavailable)
109
+ - `{NN}-{journey-slug}-{step}.webp` — key interaction states
110
+ - `{NN}-{journey-slug}-result.webp` — final state after journey completion
111
+ - `{NN}-{journey-slug}-fixed.webp` — after fix (if applicable)
99
112
 
100
- **Interactions:** If the checklist item includes an interaction (click, type, submit), perform it and screenshot the result.
113
+ **Actions are COMPLETED:** Forms are submitted (not just filled). Modals are confirmed (not just opened). Toggles are toggled back. Every journey ends with verifying the outcome.
101
114
  </step>
102
115
 
103
116
  <step name="close_and_report">
@@ -107,15 +120,16 @@ Close the browser. Return a structured report to the orchestrator:
107
120
  ## Browser Verification Report
108
121
 
109
122
  **Status:** {all_passed | has_issues | has_fixes | environment_blocked}
110
- **Tested:** {count} | **Passed:** {count} | **Fixed:** {count} | **Issues:** {count} | **Blocked:** {count}
123
+ **Tested:** {count} | **Passed:** {count} | **Fixed:** {count} | **Issues:** {count} | **Blocked:** {count} | **Unreachable:** {count}
111
124
 
112
125
  ### Screenshots
113
126
 
114
- | # | Item | Status | Screenshot |
115
- |---|------|--------|------------|
116
- | 1 | {name} | PASSED | {filename} |
117
- | 2 | {name} | FIXED | {filename} |
118
- | 3 | {name} | ISSUE | {filename} |
127
+ | # | Journey | Status | Screenshots |
128
+ |---|---------|--------|-------------|
129
+ | 1 | {name} | PASSED | {start}, {result} |
130
+ | 2 | {name} | FIXED | {start}, {result}, {fixed} |
131
+ | 3 | {name} | ISSUE | {start}, {result} |
132
+ | 4 | {name} | UNREACHABLE | {start} |
119
133
 
120
134
  ### Fixes Applied
121
135
  - {what was wrong} → {what was fixed} | Commit: {hash}
@@ -123,6 +137,9 @@ Close the browser. Return a structured report to the orchestrator:
123
137
  ### Issues Found
124
138
  - {description} | Screenshot: {filename} | Evidence: {what the screenshot shows} | Diagnostics: {console errors, failed network requests, or "none"}
125
139
 
140
+ ### Unreachable Features
141
+ - {journey name} | Screenshot: {filename} | Dead-end: {where navigation broke down — e.g., "no link to /settings found in sidebar or nav"}
142
+
126
143
  ### Environment Blockers
127
144
  - {description} | Screenshot: {filename} | Diagnostics: {error messages, failed requests}
128
145
  ```
@@ -132,6 +149,12 @@ Close the browser. Return a structured report to the orchestrator:
132
149
 
133
150
  <rules>
134
151
 
152
+ ## Navigation
153
+ - Never navigate by typing a URL into the browser
154
+ - Always reach pages through UI clicks (sidebar, nav links, buttons)
155
+ - Only exception: the app root URL during environment_preflight
156
+ - If a journey's start page cannot be reached via UI navigation, report as UNREACHABLE
157
+
135
158
  ## Screenshots
136
159
  - Save all screenshots to `{screenshots_dir}` — never to temp or working directory
137
160
  - Re-snapshot after every DOM change (element refs go stale)
@@ -145,12 +168,12 @@ Close the browser. Return a structured report to the orchestrator:
145
168
  - Only read project source files — never node_modules, dist, build output, or generated directories
146
169
  - Never read framework/library source to understand why something doesn't work internally
147
170
  - 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
148
- - If 2+ consecutive items show the same failure pattern, identify the shared root cause rather than investigating each individually
171
+ - If 2+ consecutive journeys show the same failure pattern, identify the shared root cause rather than investigating each individually
149
172
 
150
173
  ## Fix discipline
151
174
  - Fix the specific visual mismatch — don't restructure, refactor, or "improve" surrounding code
152
175
  - A second fix attempt must be based on a different root-cause theory, not a variation of the first
153
- - After 3 edit-screenshot cycles on one item without resolution, it's an ISSUE regardless
176
+ - After 3 edit-screenshot cycles on one journey without resolution, it's an ISSUE regardless
154
177
  - Revert all failed fix attempts (`git checkout -- {files}`) before moving on
155
178
  - Commit each successful fix atomically with `fix({phase}-browser): {description}` prefix
156
179
 
@@ -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
 
@@ -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
@@ -6,19 +6,21 @@ allowed-tools:
6
6
  - Read
7
7
  - Write
8
8
  - Bash
9
+ - AskUserQuestion
9
10
  ---
10
11
 
11
12
  <objective>
12
- Add a new integer phase to the end of the current milestone in the roadmap.
13
+ Add a new integer phase to the end of the current milestone, fully specified with goal, success criteria, and requirements.
13
14
 
14
- This command appends sequential phases to the current milestone's phase list, automatically calculating the next phase number based on existing phases.
15
+ The phase is set up identically to phases created by the roadmapper same ROADMAP.md entry format, same requirements in REQUIREMENTS.md with traceability mapping. Downstream commands (discuss-phase, plan-phase, execute-phase, verify-work) work without degradation.
15
16
 
16
- Purpose: Add planned work discovered during execution that belongs at the end of current milestone.
17
+ Purpose: Add discovered work at the end of current milestone with full pipeline support.
17
18
  </objective>
18
19
 
19
20
  <execution_context>
20
21
  @.planning/ROADMAP.md
21
22
  @.planning/STATE.md
23
+ @.planning/REQUIREMENTS.md
22
24
  </execution_context>
23
25
 
24
26
  <process>
@@ -40,8 +42,8 @@ Example: /ms:add-phase Add authentication system
40
42
  Exit.
41
43
  </step>
42
44
 
43
- <step name="load_roadmap">
44
- Load the roadmap file:
45
+ <step name="load_context">
46
+ Load project context:
45
47
 
46
48
  ```bash
47
49
  if [ -f .planning/ROADMAP.md ]; then
@@ -50,9 +52,33 @@ else
50
52
  echo "ERROR: No roadmap found (.planning/ROADMAP.md)"
51
53
  exit 1
52
54
  fi
55
+
56
+ if [ ! -f .planning/REQUIREMENTS.md ]; then
57
+ echo "ERROR: No REQUIREMENTS.md found"
58
+ exit 1
59
+ fi
60
+ ```
61
+
62
+ If REQUIREMENTS.md is missing, display:
63
+
64
+ ```
65
+ Phase addition requires an active milestone with requirements tracking.
66
+ No .planning/REQUIREMENTS.md found.
67
+
68
+ Instead, consider:
69
+ - `/ms:new-milestone` — start a new milestone with requirements
70
+ - `/ms:create-roadmap` — if milestone context exists but roadmap wasn't created yet
71
+ - `/ms:adhoc "<description>"` — for work that doesn't need milestone tracking
53
72
  ```
54
73
 
55
- Read roadmap content for parsing.
74
+ Exit command.
75
+
76
+ Read ROADMAP.md and REQUIREMENTS.md.
77
+
78
+ From REQUIREMENTS.md, extract:
79
+ - Existing REQ-ID categories and their prefixes (e.g., AUTH, SUB, CONTENT)
80
+ - Highest REQ-ID number per category (e.g., AUTH-04 → next is AUTH-05)
81
+ - Traceability table structure
56
82
  </step>
57
83
 
58
84
  <step name="find_current_milestone">
@@ -88,6 +114,14 @@ Example: If phases are 4, 5, 5.1, 6 → next is 7
88
114
  Format as two-digit: `printf "%02d" $next_phase`
89
115
  </step>
90
116
 
117
+ <step name="derive_phase_specification">
118
+ Read `~/.claude/mindsystem/references/derive-phase-specification.md` and follow its algorithm.
119
+
120
+ Variables: `{PHASE_ID}` = `{N}`, `{PHASE_MARKER}` = (empty).
121
+
122
+ Input: user's description + project context (PROJECT.md, ROADMAP.md phases, REQUIREMENTS.md categories).
123
+ </step>
124
+
91
125
  <step name="generate_slug">
92
126
  Convert the phase description to a kebab-case slug:
93
127
 
@@ -114,50 +148,51 @@ mkdir -p "$phase_dir"
114
148
  Confirm: "Created directory: $phase_dir"
115
149
  </step>
116
150
 
151
+ <step name="update_requirements">
152
+ Follow the requirements update procedure in `~/.claude/mindsystem/references/derive-phase-specification.md`.
153
+
154
+ Use Phase `{N}` for traceability table references and footer dating.
155
+ </step>
156
+
117
157
  <step name="update_roadmap">
118
158
  Add the new phase entry to the roadmap:
119
159
 
120
- 1. Find the insertion point (after last phase in current milestone, before "---" separator)
121
-
122
- 2. Before writing the phase entry, analyze the description to determine pre-work flags:
160
+ **1. Update phase checklist** (under `## Phases`):
123
161
 
124
- **Discuss**: Default Likely enumerate 2-4 assumptions or open questions specific
125
- to the phase. Unlikely only for fully mechanical zero-decision work (version bump,
126
- rename-only refactor, config-only change, pure deletion/cleanup).
162
+ Find the last `- [ ]` or `- [x]` phase line in the current milestone and append:
163
+ ```
164
+ - [ ] **Phase {N}: {Name}** - {One-line description}
165
+ ```
127
166
 
128
- **Design**: Likely when description involves UI work, visual elements, forms,
129
- dashboards, or multi-screen flows. Unlikely for backend-only, API, infrastructure,
130
- or established UI patterns.
167
+ **2. Add phase details** (under `## Phase Details`):
131
168
 
132
- **Research**: Likely when description mentions external APIs/services, new
133
- libraries/frameworks, or unclear technical approach. Unlikely for established
134
- internal patterns or well-documented conventions.
169
+ Find the insertion point (after last phase in current milestone, before "---" separator or `## Progress`).
135
170
 
136
- Use binary Likely/Unlikely with parenthetical reason. Include topics/focus only when Likely.
171
+ Insert full phase entry matching roadmapper format:
137
172
 
138
- 3. Insert new phase heading with pre-work flags:
173
+ ```
174
+ ### Phase {N}: {Name}
175
+ **Goal**: {approved goal}
176
+ **Depends on**: Phase {N-1}
177
+ **Requirements**: {REQ-IDs comma-separated}
178
+ **Success Criteria** (what must be TRUE):
179
+ 1. {criterion}
180
+ 2. {criterion}
181
+ 3. {criterion}
182
+ **Discuss**: {Likely (reason) | Unlikely (reason)}
183
+ **Discuss topics**: {topics} ← only if Likely
184
+ **Design**: {Likely (reason) | Unlikely (reason)}
185
+ **Design focus**: {focus} ← only if Likely
186
+ **Research**: {Likely (reason) | Unlikely (reason)}
187
+ **Research topics**: {topics} ← only if Likely
188
+ ```
139
189
 
140
- ```
141
- ### Phase {N}: {Description}
142
-
143
- **Goal:** [To be planned]
144
- **Depends on:** Phase {N-1}
145
- **Discuss**: {Likely (reason) | Unlikely (reason)}
146
- **Discuss topics**: {topics} ← only if Likely
147
- **Design**: {Likely (reason) | Unlikely (reason)}
148
- **Design focus**: {focus} ← only if Likely
149
- **Research**: {Likely (reason) | Unlikely (reason)}
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
-
156
- **Details:**
157
- [To be added during planning]
158
- ```
190
+ **3. Update progress table** — append row:
191
+ ```
192
+ | {N}. {Name} | Not started | - |
193
+ ```
159
194
 
160
- 4. Write updated roadmap back to file
195
+ Write updated roadmap back to file.
161
196
 
162
197
  Preserve all other content exactly (formatting, spacing, other phases).
163
198
  </step>
@@ -180,13 +215,16 @@ Present completion summary:
180
215
 
181
216
  ```
182
217
  Phase {N} added to current milestone:
183
- - Description: {description}
218
+ - Goal: {goal}
219
+ - Requirements: {REQ-IDs}
220
+ - Success criteria: {count}
184
221
  - Directory: .planning/phases/{phase-num}-{slug}/
185
222
  - Status: Not planned yet
186
223
 
187
- Roadmap updated: {roadmap-path}
188
- Project state updated: .planning/STATE.md
189
-
224
+ Files updated:
225
+ - .planning/ROADMAP.md
226
+ - .planning/REQUIREMENTS.md
227
+ - .planning/STATE.md
190
228
  ```
191
229
 
192
230
  Read `~/.claude/mindsystem/references/routing/next-phase-routing.md` and follow its instructions
@@ -211,15 +249,17 @@ ms-tools set-last-command "ms:add-phase $ARGUMENTS"
211
249
  - Don't use decimal numbering (that's /ms:insert-phase)
212
250
  - Don't create plans yet (that's /ms:plan-phase)
213
251
  - Don't commit changes (user decides when to commit)
214
- </anti_patterns>
252
+ - Don't write skeletal "[To be planned]" entries — derive a real goal and success criteria
253
+ </anti_patterns>
215
254
 
216
255
  <success_criteria>
217
256
  Phase addition is complete when:
218
257
 
219
- - [ ] Phase directory created: `.planning/phases/{NN}-{slug}/`
220
- - [ ] Roadmap updated with new phase entry
258
+ - [ ] Specification derived with outcome-focused goal and 2-5 observable success criteria
259
+ - [ ] Requirements derived with REQ-IDs and REQUIREMENTS.md updated with traceability mapping
260
+ - [ ] Phase directory and roadmap entry created at end of current milestone with correct sequential number
261
+ - [ ] Roadmap entry matches roadmapper format (Goal, Requirements, Success Criteria, pre-work flags)
221
262
  - [ ] STATE.md updated with roadmap evolution note
222
- - [ ] New phase appears at end of current milestone
223
- - [ ] Next phase number calculated correctly (ignoring decimals)
263
+ - [ ] User approved specification before writing
224
264
  - [ ] User informed of next steps
225
- </success_criteria>
265
+ </success_criteria>