mindsystem-cc 4.3.1 → 4.4.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.
package/README.md CHANGED
@@ -1,43 +1,55 @@
1
1
  <div align="center">
2
2
 
3
- # MINDSYSTEM
3
+ ![Mindsystem Bento Grid](assets/bento-image.webp)
4
4
 
5
- **The full-cycle development system for Claude Code.**
5
+ # Mindsystem
6
6
 
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.
7
+ Amplifies every step of the development workflow you already follow.
8
+
9
+ [![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)
10
+ [![npm downloads](https://img.shields.io/npm/dm/mindsystem-cc?style=flat-square)](https://www.npmjs.com/package/mindsystem-cc)
11
+ [![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](LICENSE)
12
+ [![Built for Claude Code](https://img.shields.io/badge/built_for-Claude_Code-D97706?style=flat-square)](https://docs.anthropic.com/en/docs/claude-code)
13
+
14
+ 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.
15
+
16
+ [Quick start](#quick-start) · [Walkthrough](#end-to-end-walkthrough) · [Features](#features) · [Commands](#command-reference)
17
+
18
+ </div>
19
+
20
+ ---
21
+
22
+ ## Quick start
8
23
 
9
24
  ```bash
10
25
  npx mindsystem-cc
11
26
  ```
12
27
 
13
- [![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
- [![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](LICENSE)
15
-
16
- <br>
28
+ Then `/ms:new-project` to initialize. See the [full walkthrough](#end-to-end-walkthrough) for the complete feature-building loop, or `/ms:progress` to pick up where you left off.
17
29
 
18
- ![Mindsystem Install](assets/terminal.svg)
30
+ ---
19
31
 
20
- <br>
32
+ ## What's new in v4.4
21
33
 
22
- [Why Mindsystem](#why-mindsystem) · [How it works](#how-it-works) · [Walkthrough](#end-to-end-walkthrough) · [Features](#features) · [Quick start](#quick-start) · [.planning](#the-planning-directory) · [Config](#configuration) · [Commands](#command-reference) · [Troubleshooting](#troubleshooting)
34
+ - **User journey browser verification** end-to-end click/fill/submit testing instead of screenshot-only observation. Catches unreachable pages with no navigation path from the UI.
35
+ - **Single-plan mode (default)** — one plan per phase, eliminating multi-agent orchestration overhead with 1M context windows.
36
+ - **Full phase specification** for add-phase and insert-phase — both commands now derive goal, success criteria, and requirements mapping.
23
37
 
24
- </div>
38
+ See [CHANGELOG.md](CHANGELOG.md) for the complete history.
25
39
 
26
40
  ---
27
41
 
28
42
  ## Why Mindsystem
29
43
 
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
-
32
- Mindsystem is the middle ground. Each specialist role maps to a phase you control:
44
+ 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
45
 
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 |
46
+ | What you'd do manually | What Mindsystem does |
47
+ |---|---|
48
+ | Talk through requirements, catch misalignment early | **Discuss phase** surfaces assumptions with confidence levels, forces tradeoff decisions before any code gets written |
49
+ | 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 |
50
+ | Try design directions, pick the best one | **Design phase** generates parallel HTML/CSS mockups with side-by-side comparison and exact design tokens |
51
+ | Plan from what you remember about the codebase | **Plan phase** loads knowledge files capturing every decision, pattern, and pitfall from prior phases |
52
+ | Figure out what states to test, mock them manually | **Verify work** determines mock states automatically — you validate visually or programmatically |
41
53
 
42
54
  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
55
 
@@ -97,7 +109,7 @@ Execution happens in fresh subagent contexts, so each plan gets up to 200k token
97
109
 
98
110
  ### Project setup
99
111
 
100
- Before building features, initialize the project once with `/ms:new-project`. For existing codebases, also run `/ms:map-codebase` (analyzes your stack, conventions, and architecture into 7 structured documents) and `/ms:doctor` (validates config and generates per-subsystem knowledge files from source code). See [Quick start](#quick-start) for the exact sequences.
112
+ Before building features, initialize the project once with `/ms:new-project`. For existing codebases, also run `/ms:map-codebase` (analyzes your stack, conventions, and architecture into 7 structured documents) and `/ms:doctor` (validates config and generates per-subsystem knowledge files from source code). See [Getting started](#getting-started) for the exact sequences.
101
113
 
102
114
  Everything below is the feature-building loop, identical for new and existing projects.
103
115
 
@@ -136,7 +148,7 @@ Requirements define what must be TRUE when you ship, not what to build. This goa
136
148
  ### 4. Discuss phase (optional, recommended)
137
149
 
138
150
  ```
139
- /ms:discuss-phase 1
151
+ /ms:discuss-phase <phase>
140
152
  ```
141
153
 
142
154
  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 +160,7 @@ Worth taking seriously. Decisions here propagate through everything that follows
148
160
  ### 5. Design phase (optional)
149
161
 
150
162
  ```
151
- /ms:design-phase 1
163
+ /ms:design-phase <phase>
152
164
  ```
153
165
 
154
166
  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 +170,7 @@ The output is a `DESIGN.md` with exact design tokens (hex colors, px spacing, fo
158
170
  ### 6. Research phase (optional)
159
171
 
160
172
  ```
161
- /ms:research-phase 1
173
+ /ms:research-phase <phase>
162
174
  ```
163
175
 
164
176
  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 +180,19 @@ You resolve library conflicts if any come up. Otherwise, this runs with minimal
168
180
  ### 7. Plan phase
169
181
 
170
182
  ```
171
- /ms:plan-phase 1
183
+ /ms:plan-phase <phase>
172
184
  ```
173
185
 
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.
186
+ 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.
175
187
 
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.
177
-
178
- You approve the plan structure and can adjust granularity.
188
+ 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
189
 
180
190
  **Creates:** `PLAN.md` files, `EXECUTION-ORDER.md`.
181
191
 
182
192
  ### 8. Execute phase
183
193
 
184
194
  ```
185
- /ms:execute-phase 1
195
+ /ms:execute-phase <phase>
186
196
  ```
187
197
 
188
198
  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 +208,7 @@ After execution, knowledge consolidation updates subsystem-scoped knowledge file
198
208
  ### 9. Verify work
199
209
 
200
210
  ```
201
- /ms:verify-work 1
211
+ /ms:verify-work <phase>
202
212
  ```
203
213
 
204
214
  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.
@@ -289,6 +299,10 @@ Requirements you want but haven't shipped yet are tracked in `PROJECT.md` with o
289
299
 
290
300
  `/ms:add-todo` with Linear-inspired metadata: priority (1-4), estimate (XS-XL), inferred subsystem. Todos live as flat files in `.planning/todos/`. Address them later via `/ms:adhoc`, which reads the problem description, executes the work, and moves the todo to `done/`.
291
301
 
302
+ ### Task tracker integration
303
+
304
+ Configure a Linear connection via `/ms:config` and pass ticket IDs directly to `/ms:adhoc` (e.g., `/ms:adhoc MIN-123`). The system auto-fetches the ticket's title and description as work context, tags commits with the ticket ID, and on completion posts a solution summary, attaches the commit, and marks the ticket done. Zero overhead when unconfigured — the integration is lazy-loaded only when a ticket ID is detected.
305
+
292
306
  ### Codebase mapping
293
307
 
294
308
  `/ms:map-codebase` spawns 4 parallel agents producing 7 structured documents: stack, architecture, conventions, testing, integrations, directory structure, and concerns. Use on brownfield projects so Mindsystem respects your existing patterns.
@@ -309,7 +323,7 @@ Requirements you want but haven't shipped yet are tracked in `PROJECT.md` with o
309
323
 
310
324
  ---
311
325
 
312
- ## Quick start
326
+ ## Getting started
313
327
 
314
328
  ### Project setup (one-time)
315
329
 
@@ -336,6 +350,7 @@ Once the project is set up, the workflow is the same for new and existing codeba
336
350
  ```
337
351
  /ms:new-milestone # Discover what to build next
338
352
  /ms:create-roadmap # Define requirements, map to phases
353
+ /ms:discuss-phase 1 # Gather context before planning
339
354
  /ms:plan-phase 1 # Create detailed plan
340
355
  /ms:execute-phase 1 # Run in fresh subagents
341
356
  /ms:verify-work 1 # Manual acceptance testing
@@ -470,6 +485,11 @@ Mindsystem stores project config in `.planning/config.json`. Run `/ms:config` to
470
485
  "enabled": true // default: true for web projects
471
486
  },
472
487
 
488
+ // Plan mode for plan-phase.
489
+ // false (default) → single plan per phase, optimal for 1M context
490
+ // true → multi-plan with wave-based parallel execution
491
+ "multi_plan": false,
492
+
473
493
  // External task tracker integration (Linear only for now).
474
494
  // null → disabled (default)
475
495
  "task_tracker": {
@@ -492,7 +512,7 @@ Full docs live in `/ms:help`.
492
512
  | `/ms:help` | Show the full command reference |
493
513
  | `/ms:progress` | Show where you are and what to run next |
494
514
  | `/ms:new-project` | Initialize `.planning/` and capture project intent |
495
- | `/ms:config` | Configure code reviewers, mockups, gitignore, git remote |
515
+ | `/ms:config` | Configure code reviewers, mockups, plan mode, gitignore, git remote |
496
516
  | `/ms:map-codebase` | Document existing repo's stack, structure, and conventions |
497
517
  | `/ms:research-milestone` | Milestone-scoped research saved to `.planning/MILESTONE-RESEARCH.md` |
498
518
  | `/ms:create-roadmap` | Define requirements and create phases mapped to them |
@@ -505,7 +525,7 @@ Full docs live in `/ms:help`.
505
525
  | `/ms:execute-phase <number>` | Run all unexecuted plans in fresh subagents |
506
526
  | `/ms:verify-work [number]` | Batched manual UAT with inline fixes |
507
527
  | `/ms:debug [description]` | Structured debugging that survives `/clear` |
508
- | `/ms:adhoc <description>` | Knowledge-aware execution for discovered work |
528
+ | `/ms:adhoc <description>` | Knowledge-aware execution for discovered work or Linear ticket IDs |
509
529
  | `/ms:compound [input]` | Compound out-of-pipeline changes into knowledge files |
510
530
  | `/ms:add-phase <description>` | Append a new phase to the roadmap |
511
531
  | `/ms:insert-phase <after> <description>` | Insert urgent work between phases |
@@ -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
 
@@ -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,46 +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
-
152
- **Details:**
153
- [To be added during planning]
154
- ```
190
+ **3. Update progress table** — append row:
191
+ ```
192
+ | {N}. {Name} | Not started | - |
193
+ ```
155
194
 
156
- 4. Write updated roadmap back to file
195
+ Write updated roadmap back to file.
157
196
 
158
197
  Preserve all other content exactly (formatting, spacing, other phases).
159
198
  </step>
@@ -176,13 +215,16 @@ Present completion summary:
176
215
 
177
216
  ```
178
217
  Phase {N} added to current milestone:
179
- - Description: {description}
218
+ - Goal: {goal}
219
+ - Requirements: {REQ-IDs}
220
+ - Success criteria: {count}
180
221
  - Directory: .planning/phases/{phase-num}-{slug}/
181
222
  - Status: Not planned yet
182
223
 
183
- Roadmap updated: {roadmap-path}
184
- Project state updated: .planning/STATE.md
185
-
224
+ Files updated:
225
+ - .planning/ROADMAP.md
226
+ - .planning/REQUIREMENTS.md
227
+ - .planning/STATE.md
186
228
  ```
187
229
 
188
230
  Read `~/.claude/mindsystem/references/routing/next-phase-routing.md` and follow its instructions
@@ -207,15 +249,17 @@ ms-tools set-last-command "ms:add-phase $ARGUMENTS"
207
249
  - Don't use decimal numbering (that's /ms:insert-phase)
208
250
  - Don't create plans yet (that's /ms:plan-phase)
209
251
  - Don't commit changes (user decides when to commit)
210
- </anti_patterns>
252
+ - Don't write skeletal "[To be planned]" entries — derive a real goal and success criteria
253
+ </anti_patterns>
211
254
 
212
255
  <success_criteria>
213
256
  Phase addition is complete when:
214
257
 
215
- - [ ] Phase directory created: `.planning/phases/{NN}-{slug}/`
216
- - [ ] 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)
217
262
  - [ ] STATE.md updated with roadmap evolution note
218
- - [ ] New phase appears at end of current milestone
219
- - [ ] Next phase number calculated correctly (ignoring decimals)
263
+ - [ ] User approved specification before writing
220
264
  - [ ] User informed of next steps
221
- </success_criteria>
265
+ </success_criteria>