mindsystem-cc 4.1.2 → 4.2.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.
@@ -0,0 +1,137 @@
1
+ ---
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.
4
+ model: sonnet
5
+ tools: Read, Write, Edit, Bash, Grep, Glob
6
+ skills:
7
+ - agent-browser
8
+ color: green
9
+ ---
10
+
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.
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.
15
+ </role>
16
+
17
+ <process>
18
+
19
+ <step name="start_dev_server">
20
+ Check if dev server is already running by probing common ports (5173, 3000, 8080, 4200, 3001).
21
+
22
+ If not running:
23
+ 1. Read `package.json` scripts for dev command (`dev`, `start`, `serve`)
24
+ 2. Start via `npm run {script}` or `yarn {script}` based on lock file presence
25
+ 3. Retry port probe with backoff (1s, 2s, 4s) until ready or timeout (30s)
26
+ </step>
27
+
28
+ <step name="check_auth_state">
29
+ Auth is handled by the orchestrator before spawning this agent. If the orchestrator provides a storage state file path, load it when launching the browser to restore the authenticated session.
30
+
31
+ Open the app URL headless. If redirected to login, report auth failure and exit — do not attempt to automate auth.
32
+ </step>
33
+
34
+ <step name="environment_preflight">
35
+ Navigate to the app's main route. Screenshot `00-preflight.png`.
36
+
37
+ Evaluate:
38
+ - Does the app load?
39
+ - Visible backend errors? Console errors? Blank page?
40
+
41
+ **If systemic issue** (app won't load, white screen, critical error):
42
+ - Screenshot the failure
43
+ - Return `environment_blocked` report to orchestrator with screenshot evidence
44
+ - Stop — no point testing individual items
45
+
46
+ **If app loads with minor warnings:**
47
+ - Note warnings and proceed to checklist verification
48
+ </step>
49
+
50
+ <step name="verify_checklist">
51
+ Single loop over all checklist items with an integrated decision tree.
52
+
53
+ Create the screenshots directory:
54
+
55
+ ```bash
56
+ mkdir -p {screenshots_dir}
57
+ ```
58
+
59
+ For each checklist item:
60
+
61
+ ```
62
+ Navigate to route → Screenshot → Evaluate
63
+
64
+ Match expected?
65
+ YES → PASSED, next item
66
+ NO → Environment issue? (API error, 404, empty data, console network errors)
67
+ YES → ENVIRONMENT_BLOCKED for this item
68
+ Same error on 2+ consecutive items? → stop, return report
69
+ 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
72
+ → Root cause found → Fix attempt → re-screenshot
73
+ Fix worked? → FIXED (commit), next item
74
+ Fix failed? → Different root-cause theory available?
75
+ YES → Second fix attempt (same flow)
76
+ NO → revert all changes (git checkout -- {files}), ISSUE, next item
77
+ ```
78
+
79
+ **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)
83
+
84
+ **Interactions:** If the checklist item includes an interaction (click, type, submit), perform it and screenshot the result.
85
+ </step>
86
+
87
+ <step name="close_and_report">
88
+ Close the browser. Return a structured report to the orchestrator:
89
+
90
+ ```
91
+ ## Browser Verification Report
92
+
93
+ **Status:** {all_passed | has_issues | has_fixes | environment_blocked}
94
+ **Tested:** {count} | **Passed:** {count} | **Fixed:** {count} | **Issues:** {count} | **Blocked:** {count}
95
+
96
+ ### Screenshots
97
+
98
+ | # | Item | Status | Screenshot |
99
+ |---|------|--------|------------|
100
+ | 1 | {name} | PASSED | {filename} |
101
+ | 2 | {name} | FIXED | {filename} |
102
+ | 3 | {name} | ISSUE | {filename} |
103
+
104
+ ### Fixes Applied
105
+ - {what was wrong} → {what was fixed} | Commit: {hash}
106
+
107
+ ### Issues Found
108
+ - {description} | Screenshot: {filename} | Evidence: {what the screenshot shows}
109
+
110
+ ### Environment Blockers
111
+ - {description} | Screenshot: {filename}
112
+ ```
113
+ </step>
114
+
115
+ </process>
116
+
117
+ <rules>
118
+
119
+ ## Screenshots
120
+ - Save all screenshots to `{screenshots_dir}` — never to temp or working directory
121
+ - Re-snapshot after every DOM change (element refs go stale)
122
+ - Wait for networkidle before evaluating
123
+
124
+ ## Investigation boundaries
125
+ - Only read project source files — never node_modules, dist, build output, or generated directories
126
+ - 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
128
+ - If 2+ consecutive items show the same failure pattern, identify the shared root cause rather than investigating each individually
129
+
130
+ ## Fix discipline
131
+ - Fix the specific visual mismatch — don't restructure, refactor, or "improve" surrounding code
132
+ - A second fix attempt must be based on a different root-cause theory, not a variation of the first
133
+ - After 3 edit-screenshot cycles on one item without resolution, it's an ISSUE regardless
134
+ - Revert all failed fix attempts (`git checkout -- {files}`) before moving on
135
+ - Commit each successful fix atomically with `fix({phase}-browser): {description}` prefix
136
+
137
+ </rules>
package/bin/install.js CHANGED
@@ -25,9 +25,8 @@ ${cyan} ███╗ ███╗██╗███╗ ██╗███
25
25
  ╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚═════╝ ╚══════╝ ╚═╝ ╚══════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝${reset}
26
26
 
27
27
  Mindsystem ${dim}v${pkg.version}${reset}
28
- A meta-prompting, context engineering and spec-driven
29
- development system for Claude Code by Roland Tolnay.
30
- Based on GSD by TÂCHES.
28
+ The engineer's meta-prompting system for Claude Code.
29
+ Amplify your workflow. Compound your knowledge.
31
30
  `;
32
31
 
33
32
  // Parse args
@@ -101,12 +101,12 @@ subsystem: [from config.json]
101
101
  </step>
102
102
 
103
103
  <step name="git_commit">
104
+
105
+ **Update state and commit:**
106
+
104
107
  ```bash
105
108
  git add .planning/todos/[filename]
106
- git commit -m "$(cat <<'EOF'
107
- todo: [title] [subsystem|priority|estimate]
108
- EOF
109
- )"
109
+ git commit -m "todo: [title] [subsystem|priority|estimate]"
110
110
  ```
111
111
  </step>
112
112
 
@@ -57,7 +57,8 @@ Create execution directory, assemble context, spawn ms-adhoc-planner.
57
57
  </step>
58
58
 
59
59
  <step name="review_plan">
60
- Read generated plan, show summary to user, allow edits.
60
+ Read generated plan, show summary to user.
61
+ AskUserQuestion: approve, request edits, or abort.
61
62
  </step>
62
63
 
63
64
  <step name="spawn_executor">
@@ -202,7 +202,7 @@ Skip code review step (proceed to next steps).
202
202
  ```bash
203
203
  # Find first commit in milestone (first phase commit)
204
204
  FIRST_PHASE=$(ls -d .planning/phases/*/ | sort -V | head -1 | xargs basename | cut -d- -f1)
205
- FIRST_COMMIT=$(git log --oneline --grep="(${FIRST_PHASE}-" --format="%H" | tail -1)
205
+ FIRST_COMMIT=$(ms-tools find-phase-commits ${FIRST_PHASE} | tail -1)
206
206
 
207
207
  # Get all implementation files changed since first commit
208
208
  CHANGED_FILES=$(git diff --name-only ${FIRST_COMMIT}^..HEAD | grep -E '\.(dart|ts|tsx|js|jsx|swift|kt|py|go|rs)$')
@@ -373,10 +373,11 @@ After code review (all sources now available), generate or update `.planning/TEC
373
373
  5. **Assign `TD-{N}` IDs** continuing from highest existing ID
374
374
  6. **Write/update** `.planning/TECH-DEBT.md` — group items under `## Critical`, `## High`, `## Medium`, `## Low` sections per template. Omit empty sections.
375
375
 
376
- ## 8. Commit Audit Report
376
+ ## 8. Update state and commit:
377
377
 
378
378
  ```bash
379
- git add .planning/MILESTONE-AUDIT.md .planning/TECH-DEBT.md
379
+ ms-tools set-last-command "ms:audit-milestone $ARGUMENTS"
380
+ git add .planning/MILESTONE-AUDIT.md .planning/TECH-DEBT.md .planning/STATE.md
380
381
  git commit -m "$(cat <<'EOF'
381
382
  docs(milestone): complete {name} audit
382
383
 
@@ -124,16 +124,15 @@ Output: Milestone archived (roadmap + requirements), PROJECT.md evolved.
124
124
  - Update project reference with current core value and next focus
125
125
  - Reset current position for next milestone
126
126
 
127
- 10. **Commit:**
127
+ 10. **Update state and commit:**
128
128
 
129
+ - Run: `ms-tools set-last-command "ms:complete-milestone $ARGUMENTS"`
129
130
  - Stage: MILESTONES.md, PROJECT.md, STATE.md, archive files, deletions
130
131
  - Commit: `chore: archive {{name}} milestone`
131
132
 
132
133
  11. **Offer next steps:**
133
134
  - `/ms:new-milestone` — discover goals and update PROJECT.md
134
135
 
135
- 12. **Update last command:** `ms-tools set-last-command "ms:complete-milestone $ARGUMENTS"`
136
-
137
136
  </process>
138
137
 
139
138
  <success_criteria>
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ms:config
3
- description: Configure Mindsystem preferences — code reviewers, mockups, gitignore, git remote, task tracker
3
+ description: Configure Mindsystem preferences — code reviewers, mockups, browser verification, gitignore, git remote, task tracker
4
4
  allowed-tools:
5
5
  - Read
6
6
  - Write
@@ -12,7 +12,7 @@ allowed-tools:
12
12
 
13
13
  Configure Mindsystem preferences for the current project.
14
14
 
15
- Manages code reviewer agents, mockup preferences, .gitignore patterns for `.planning/` artifacts, git remote setup, and task tracker integration. Run anytime to reconfigure — idempotent.
15
+ Manages code reviewer agents, mockup preferences, browser verification, .gitignore patterns for `.planning/` artifacts, git remote setup, and task tracker integration. Run anytime to reconfigure — idempotent.
16
16
 
17
17
  </objective>
18
18
 
@@ -33,6 +33,36 @@ Manages code reviewer agents, mockup preferences, .gitignore patterns for `.plan
33
33
  git remote -v 2>/dev/null || echo "NO_REMOTE"
34
34
  ```
35
35
 
36
+ **Determine mode** from `code_review` values in config.json:
37
+
38
+ - **Setup mode** — all `code_review` values are null (or no config file): first-time configuration.
39
+ - **Edit mode** — any `code_review` value is non-null: reconfiguration.
40
+
41
+ </step>
42
+
43
+ <step name="route">
44
+
45
+ **Setup mode:** Proceed through all setting steps sequentially (git_remote → code_reviewers → gitignore_patterns → mockup_preferences → browser_verification → task_tracker). Then go to `validation_summary`.
46
+
47
+ **Edit mode:** Display all current settings with values from config.json, git remote, and .gitignore:
48
+
49
+ ```
50
+ ## Current Settings
51
+
52
+ 1. **Git remote** — {remote URL or "none configured"}
53
+ 2. **Code reviewers** — adhoc: {value or "not set"}, phase: {value or "not set"}, milestone: {value or "not set"}
54
+ 3. **Gitignore** — {current .planning/ patterns or "no .planning/ patterns"}
55
+ 4. **Mockups** — open: {auto / ask / off}
56
+ 5. **Browser verification** — {enabled / disabled}
57
+ 6. **Task tracker** — {type + cli path, or "none"}
58
+ ```
59
+
60
+ Ask: "Which settings would you like to change? Enter the numbers (e.g. 1, 3, 5), 'all' to reconfigure everything, or 'done' if everything looks good."
61
+
62
+ - **"done"** → skip to `validation_summary` (no changes)
63
+ - **"all"** → proceed through all setting steps sequentially
64
+ - **Specific numbers** → proceed through only the corresponding setting steps, skip the rest
65
+
36
66
  </step>
37
67
 
38
68
  <step name="git_remote">
@@ -100,12 +130,14 @@ Use AskUserQuestion (multiSelect):
100
130
  - options:
101
131
  - "Phase patch files (`.planning/phases/**/*.patch`)" — Large binary diffs, regeneratable
102
132
  - "Design mockups (`.planning/phases/**/*.html`)" — Generated HTML mockups from design-phase
133
+ - "Browser screenshots (`.planning/phases/**/screenshots/`)" — Browser verification screenshots
103
134
 
104
135
  Apply selected patterns to `.gitignore`. Create the file if needed:
105
136
 
106
137
  ```bash
107
- echo '.planning/phases/**/*.patch' >> .gitignore # if selected
108
- echo '.planning/phases/**/*.html' >> .gitignore # if selected
138
+ echo '.planning/phases/**/*.patch' >> .gitignore # if selected
139
+ echo '.planning/phases/**/*.html' >> .gitignore # if selected
140
+ echo '.planning/phases/**/screenshots/' >> .gitignore # if selected
109
141
  ```
110
142
 
111
143
  If no selections: skip gitignore changes.
@@ -142,6 +174,34 @@ ms-tools config-set open_mockups "$VALUE"
142
174
 
143
175
  </step>
144
176
 
177
+ <step name="browser_verification">
178
+
179
+ Read current value:
180
+
181
+ ```bash
182
+ CURRENT=$(ms-tools config-get browser_verification.enabled --default "true")
183
+ echo "Current browser_verification.enabled: $CURRENT"
184
+ ```
185
+
186
+ Use AskUserQuestion:
187
+ - header: "Browser verification"
188
+ - question: "Enable automated browser verification during execute-phase? (Tests your web UI after code changes)"
189
+ - options:
190
+ - "Enabled (Recommended)" — Automatically test web UI after phase execution
191
+ - "Disabled" — Skip browser verification
192
+
193
+ Map selection:
194
+ - "Enabled" → `true`
195
+ - "Disabled" → `false`
196
+
197
+ Update config.json:
198
+
199
+ ```bash
200
+ ms-tools config-set browser_verification --json '{"enabled": true}' # or false
201
+ ```
202
+
203
+ </step>
204
+
145
205
  <step name="task_tracker">
146
206
 
147
207
  Read current value:
@@ -193,6 +253,7 @@ Configuration updated:
193
253
 
194
254
  - Code reviewers: [adhoc / phase / milestone values]
195
255
  - Mockup open: [auto / ask / off]
256
+ - Browser verification: [enabled / disabled]
196
257
  - Gitignore: [patterns added, or "no changes"]
197
258
  - Git remote: [remote URL, or "none configured"]
198
259
  - Task tracker: [type + cli path, or "none"]
@@ -207,38 +268,26 @@ Check subsystems in config.json. If empty or missing, note:
207
268
 
208
269
  **Skip if no changes made.**
209
270
 
271
+ **Update state and commit:**
272
+
210
273
  ```bash
211
274
  git add .planning/config.json .gitignore
212
- git commit -m "$(cat <<'EOF'
213
- chore: configure mindsystem preferences
214
- EOF
215
- )"
275
+ git commit -m "chore: configure mindsystem preferences"
216
276
  ```
217
277
 
218
278
  </step>
219
279
 
220
- <step name="done">
221
-
222
- Present next steps using the "Next Up" format:
223
-
224
- - **If PROJECT.md exists:** recommend `/ms:new-milestone` — Discover what to build next, create requirements and roadmap
225
- - **If no PROJECT.md:** recommend `/ms:new-project` — Initialize project with business context and vision
226
-
227
- Also list: `/ms:doctor` — Verify subsystems and artifact health
228
-
229
- </step>
230
-
231
280
  </process>
232
281
 
233
282
  <success_criteria>
234
283
 
284
+ - [ ] Setup mode triggered when all code_review values null; edit mode otherwise
285
+ - [ ] Edit mode displays numbered settings with current values
286
+ - [ ] Only user-selected settings modified in edit mode
235
287
  - [ ] Changes committed (if any)
236
- - [ ] User routed to next step
237
288
  - [ ] Gitignore patterns applied (if selected)
238
289
  - [ ] Git remote offered (if missing)
239
290
  - [ ] Validation summary displayed
240
- - [ ] Config.json code_review values set (or preserved if skipped)
241
- - [ ] Config.json open_mockups value set (or preserved if skipped)
242
- - [ ] Config.json task_tracker value set (or preserved if skipped)
291
+ - [ ] Terminates after commit/summary no Next Up routing
243
292
 
244
293
  </success_criteria>
@@ -271,7 +271,8 @@ Return ROADMAP REVISED with changes made.
271
271
  </step>
272
272
 
273
273
  <step name="commit">
274
- After user approval:
274
+
275
+ **Update state and commit:**
275
276
 
276
277
  ```bash
277
278
  git add .planning/REQUIREMENTS.md .planning/ROADMAP.md .planning/STATE.md
@@ -292,6 +293,18 @@ EOF
292
293
  ```
293
294
  </step>
294
295
 
296
+ <step name="create_phase_dirs">
297
+
298
+ **Update state and commit:**
299
+
300
+ ```bash
301
+ ms-tools create-phase-dirs
302
+ ms-tools set-last-command "ms:create-roadmap"
303
+ git add .planning/phases/ .planning/STATE.md
304
+ git commit -m "chore: create phase directories from roadmap"
305
+ ```
306
+ </step>
307
+
295
308
  <step name="done">
296
309
  ```
297
310
  Requirements and roadmap created:
@@ -305,12 +318,6 @@ Requirements and roadmap created:
305
318
  Read `~/.claude/mindsystem/references/routing/next-phase-routing.md` and follow its instructions to present "Next Up" with pre-work context for Phase $START_PHASE.
306
319
  </step>
307
320
 
308
- <step name="update_last_command">
309
- ```bash
310
- ms-tools set-last-command "ms:create-roadmap"
311
- ```
312
- </step>
313
-
314
321
  </process>
315
322
 
316
323
  <success_criteria>
@@ -373,10 +373,11 @@ Task(
373
373
 
374
374
  **`## DESIGN COMPLETE`:**
375
375
 
376
- Commit the design file:
376
+ **Update state and commit:**
377
377
 
378
378
  ```bash
379
- git add .planning/phases/${PHASE}-*/*-DESIGN.md
379
+ ms-tools set-last-command "ms:design-phase $ARGUMENTS"
380
+ git add .planning/phases/${PHASE}-*/*-DESIGN.md .planning/STATE.md
380
381
  git commit -m "docs: create design for phase ${PHASE}"
381
382
  ```
382
383
 
@@ -431,12 +432,6 @@ Read `~/.claude/mindsystem/templates/design-iteration.md` and use the iteration
431
432
  - Verify "what needs improvement" was addressed
432
433
  - Update design version in DESIGN.md frontmatter
433
434
 
434
- ## 9. Update Last Command
435
-
436
- ```bash
437
- ms-tools set-last-command "ms:design-phase $ARGUMENTS"
438
- ```
439
-
440
435
  </process>
441
436
 
442
437
  <success_criteria>
@@ -13,7 +13,7 @@ allowed-tools:
13
13
  ---
14
14
 
15
15
  <objective>
16
- Run health checks on project configuration. Detect and fix structural drift across 10 categories: subsystem vocabulary, milestone directory structure, milestone naming convention, phase archival, knowledge files, phase summaries, PLAN cleanup, CLI wrappers and environment diagnostics, research API keys, and Mindsystem version.
16
+ Run health checks on project configuration. Detect and fix structural drift across 12 categories: subsystem vocabulary, milestone directory structure, milestone naming convention, phase archival, knowledge files, phase summaries, PLAN cleanup, CLI wrappers and environment diagnostics, research API keys, phase directory naming, browser verification prerequisites, and Mindsystem version.
17
17
 
18
18
  Idempotent.
19
19
  </objective>
@@ -119,6 +119,8 @@ Display results as a markdown table:
119
119
  | PLAN cleanup | FAIL | 9 leftover PLAN.md files |
120
120
  | CLI wrappers | FAIL | Not resolvable; bin dir not in PATH |
121
121
  | Research API Keys | WARN | PERPLEXITY_API_KEY not set |
122
+ | Phase directory naming | FAIL | 1 non-canonical directory |
123
+ | Browser Verification | WARN | Web project, missing agent-browser CLI |
122
124
  | Mindsystem version | WARN | v3.21.0 → v3.22.1 available |
123
125
  ```
124
126
 
@@ -141,7 +143,7 @@ If "Skip" → go to `report`.
141
143
 
142
144
  If "Review each" → use AskUserQuestion for each failed check with its details and options: "Fix" / "Skip". Only run fixes for accepted checks.
143
145
 
144
- Apply fixes in dependency order: fix_subsystems → fix_milestone_dirs → fix_milestone_naming → fix_phase_archival → fix_plan_cleanup → fix_knowledge. Skip any fix whose check passed or was skipped by user.
146
+ Apply fixes in dependency order: fix_subsystems → fix_milestone_dirs → fix_milestone_naming → fix_phase_archival → fix_plan_cleanup → fix_phase_dirs → fix_knowledge. Skip any fix whose check passed or was skipped by user.
145
147
 
146
148
  Phase summaries are resolved by fix_phase_archival. CLI wrapper failures have specific fixes: bin dir not in PATH → restart Claude Code session; missing wrappers or bin dir → re-run `npx mindsystem-cc`; uv not found → `curl -LsSf https://astral.sh/uv/install.sh | sh`. WARN checks (Research API Keys, missing uv) are informational — no automated fix, only displayed in the report.
147
149
  </step>
@@ -179,6 +181,8 @@ Final summary table:
179
181
  | PLAN cleanup | PASS | ... |
180
182
  | CLI wrappers | PASS | ... |
181
183
  | Research API Keys | PASS | ... |
184
+ | Phase directory naming | PASS | ... |
185
+ | Browser Verification | PASS | ... |
182
186
  | Mindsystem version | PASS | ... |
183
187
 
184
188
  All checks passed.
@@ -195,6 +199,6 @@ Include counts: checks total, passed, warned, fixed during this run.
195
199
  - [ ] Re-scan verifies all checks pass after fixes
196
200
  - [ ] Each fix group committed atomically
197
201
  - [ ] Fixes applied in dependency order: subsystems → dirs → milestone naming → archival → cleanup → knowledge
198
- - [ ] All 10 categories reported with PASS/FAIL/WARN/SKIP
202
+ - [ ] All 12 categories reported with PASS/FAIL/WARN/SKIP
199
203
  - [ ] Clean project reports all PASS with no fix prompts
200
204
  </success_criteria>
@@ -77,29 +77,35 @@ ms-tools find-phase "$ARGUMENTS"
77
77
  - `passed` → continue to step 7
78
78
  - `gaps_found` → present gaps, route via gap-closure-routing.md triage
79
79
 
80
- 7. **Code review (optional)**
80
+ 7. **Browser verification (web projects)**
81
+ - Run `ms-tools browser-check` for prerequisites
82
+ - If ready: handle auth, spawn `ms-browser-verifier` for functional testing
83
+ - Verifier tests observable truths in browser, fixes issues inline
84
+ - If skipped: not a web project or browser verification disabled
85
+
86
+ 8. **Code review (optional)**
81
87
  - Read `code_review.phase` from config.json (default: `ms-code-simplifier`)
82
- - If `"skip"`: proceed to step 8
88
+ - If `"skip"`: proceed to step 9
83
89
  - Spawn code review agent with phase file scope
84
90
  - If changes made: commit as `refactor({phase}): code review improvements`
85
91
 
86
- 8. **Generate phase patch**
92
+ 9. **Generate phase patch**
87
93
  - Run: `ms-tools generate-phase-patch ${PHASE_NUMBER}`
88
94
  - Outputs to `.planning/phases/{phase_dir}/{phase}-changes.patch`
89
95
  - Verify: patch file exists OR skip message logged
90
96
  - Note: Patch captures all changes including simplifications
91
97
 
92
- 9. **Consolidate knowledge**
93
- - Spawn `ms-consolidator` with phase directory and number
94
- - Consolidator reads phase artifacts and existing knowledge files
95
- - Produces updated `.planning/knowledge/{subsystem}.md` files
96
- - Deletes PLAN.md files (execution instructions consumed)
97
- - Verify: knowledge files written to `.planning/knowledge/`
98
+ 10. **Consolidate knowledge**
99
+ - Spawn `ms-consolidator` with phase directory and number
100
+ - Consolidator reads phase artifacts and existing knowledge files
101
+ - Produces updated `.planning/knowledge/{subsystem}.md` files
102
+ - Deletes PLAN.md files (execution instructions consumed)
103
+ - Verify: knowledge files written to `.planning/knowledge/`
98
104
 
99
- 10. **Update roadmap and state**
105
+ 11. **Update roadmap and state**
100
106
  - Update ROADMAP.md, STATE.md
101
107
 
102
- 11. **Update requirements**
108
+ 12. **Update requirements**
103
109
  Mark phase requirements as Complete:
104
110
  - Read ROADMAP.md, find this phase's `Requirements:` line (e.g., "AUTH-01, AUTH-02")
105
111
  - Read REQUIREMENTS.md traceability table
@@ -107,18 +113,16 @@ ms-tools find-phase "$ARGUMENTS"
107
113
  - Write updated REQUIREMENTS.md
108
114
  - Skip if: REQUIREMENTS.md doesn't exist, or phase has no Requirements line
109
115
 
110
- 12. **Commit phase completion**
111
- Bundle all phase metadata updates in one commit:
116
+ 13. **Update state and commit:**
117
+ - Run: `ms-tools set-last-command "ms:execute-phase $ARGUMENTS"`
112
118
  - Stage: `git add .planning/ROADMAP.md .planning/STATE.md`
113
119
  - Stage knowledge files: `git add .planning/knowledge/*.md`
114
120
  - Stage PLAN.md deletions: `git add -u .planning/phases/{phase_dir}/*-PLAN.md`
115
121
  - Stage REQUIREMENTS.md if updated: `git add .planning/REQUIREMENTS.md`
116
122
  - Commit: `docs({phase}): complete {phase-name} phase`
117
123
 
118
- 13. **Offer next steps**
124
+ 14. **Offer next steps**
119
125
  - Route to next action (see `<offer_next>`)
120
-
121
- 14. **Update last command:** `ms-tools set-last-command "ms:execute-phase $ARGUMENTS"`
122
126
  </process>
123
127
 
124
128
  <offer_next>
@@ -141,8 +145,10 @@ Then route based on status:
141
145
  | Status | Route |
142
146
  |--------|-------|
143
147
  | `gaps_found` | Route C (gap closure) |
144
- | `passed` + more phases | Route A (next phase) |
145
- | `passed` + last phase | Route B (milestone complete) |
148
+ | `passed` + more phases | Route A (verify + next phase) |
149
+ | `passed` + last phase | Route B (verify + milestone complete) |
150
+
151
+ Thoroughness by default: verify-work is the primary "Next Up" in both routes. Assess skip context per workflow `offer_next` step.
146
152
 
147
153
  ---
148
154
 
@@ -155,19 +161,40 @@ Then route based on status:
155
161
  All {Y} plans finished. Phase goal verified.
156
162
  ```
157
163
 
158
- 2. Read `~/.claude/mindsystem/references/routing/next-phase-routing.md` and follow its instructions to present the "Next Up" section with pre-work context for Phase {Z+1}.
164
+ 2. Assess skip context (see workflow `offer_next` step for criteria).
165
+
166
+ 3. Present verify-work as "Next Up":
167
+ ```
168
+ ## ▶ Next Up
169
+
170
+ `/ms:verify-work {Z}` — validate {phase name} through manual acceptance testing
171
+
172
+ <sub>`/clear` first → fresh context window</sub>
159
173
 
160
- 3. After the "Next Up" section, add:
174
+ {If skip context: "Phase involved only {description} with no user-facing changes — skip if structural verification is sufficient."}
161
175
  ```
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}
181
+
162
182
  **Also available:**
163
- - `/ms:verify-work {Z}` — manual acceptance testing before continuing
183
+ - `/ms:{suggested} {Z+1}` — {reason}
184
+ - `/ms:plan-phase {Z+1}` — skip pre-work, plan directly
164
185
  ```
165
186
 
166
187
  ---
167
188
 
168
189
  **Route B: Phase verified, milestone complete**
169
190
 
170
- Show phase completion summary, then read `~/.claude/mindsystem/references/routing/milestone-complete-routing.md` and follow its instructions to present the milestone complete section.
191
+ Follow Route A steps 1-3, then present milestone options:
192
+ ```
193
+ **Also available:**
194
+ - `/ms:audit-milestone` — verify requirements, cross-phase integration, E2E flows
195
+ - `/ms:complete-milestone` — skip audit, archive directly
196
+ - `/ms:add-phase <description>` — add another phase first
197
+ ```
171
198
 
172
199
  ---
173
200
 
@@ -247,6 +274,7 @@ After all plans in phase complete:
247
274
  - [ ] All incomplete plans in phase executed
248
275
  - [ ] Code review completed (or skipped if config says "skip")
249
276
  - [ ] Phase goal verified (Must-Haves checked against codebase)
277
+ - [ ] Browser verification completed or skipped (non-web/disabled)
250
278
  - [ ] VERIFICATION.md created in phase directory
251
279
  - [ ] Patch file generated OR explicitly skipped with message
252
280
  - [ ] Knowledge files written to .planning/knowledge/ (consolidation complete)
@@ -58,9 +58,8 @@ Check for .planning/STATE.md - loads context if project already initialized
58
58
  - Agent 4: concerns focus → writes CONCERNS.md
59
59
  4. Wait for agents to complete, collect confirmations (NOT document contents)
60
60
  5. Verify all 7 documents exist with line counts
61
- 6. Commit codebase map
61
+ 6. Update last command and commit codebase map (together with STATE.md)
62
62
  7. Offer next steps (adapts: /ms:new-project if no PROJECT.md, /ms:doctor if PROJECT.md exists)
63
- 8. **Update last command:** `ms-tools set-last-command "ms:map-codebase $ARGUMENTS"`
64
63
  </process>
65
64
 
66
65
  <success_criteria>
@@ -254,14 +254,12 @@ Milestone name: $ARGUMENTS (optional — will emerge during discovery if not pro
254
254
 
255
255
  Keep Accumulated Context (decisions, blockers) from previous milestone.
256
256
 
257
- 17. **Git commit:**
257
+ 17. **Update state and commit:**
258
258
 
259
259
  ```bash
260
+ ms-tools set-last-command "ms:new-milestone $ARGUMENTS"
260
261
  git add .planning/PROJECT.md .planning/STATE.md .planning/MILESTONE-CONTEXT.md
261
- git commit -m "$(cat <<'EOF'
262
- docs: start milestone [Name]
263
- EOF
264
- )"
262
+ git commit -m "docs: start milestone [Name]"
265
263
  ```
266
264
 
267
265
  18. **Calculate next phase number:**
@@ -302,8 +300,6 @@ Milestone name: $ARGUMENTS (optional — will emerge during discovery if not pro
302
300
  ---
303
301
  ```
304
302
 
305
- 20. **Update last command:** `ms-tools set-last-command "ms:new-milestone $ARGUMENTS"`
306
-
307
303
  </process>
308
304
 
309
305
  <success_criteria>