mindsystem-cc 4.4.2 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +17 -8
  2. package/agents/ms-designer.md +25 -47
  3. package/agents/ms-executor.md +1 -1
  4. package/agents/ms-mockup-designer.md +7 -4
  5. package/agents/ms-plan-checker.md +32 -27
  6. package/agents/ms-plan-writer.md +12 -8
  7. package/commands/ms/adhoc.md +11 -1
  8. package/commands/ms/config.md +47 -9
  9. package/commands/ms/design-phase.md +83 -63
  10. package/commands/ms/discuss-phase.md +1 -0
  11. package/commands/ms/doctor.md +7 -3
  12. package/commands/ms/execute-phase.md +1 -5
  13. package/commands/ms/help.md +6 -5
  14. package/commands/ms/remove-phase.md +7 -25
  15. package/commands/ms/research-phase.md +13 -0
  16. package/commands/ms/review-design.md +1 -1
  17. package/commands/ms/verify-work.md +1 -3
  18. package/mindsystem/references/design-directions.md +2 -2
  19. package/mindsystem/references/plan-format.md +2 -13
  20. package/mindsystem/references/prework-status.md +6 -32
  21. package/mindsystem/references/routing/next-phase-routing.md +7 -41
  22. package/mindsystem/references/scope-estimation.md +8 -4
  23. package/mindsystem/templates/config.json +6 -0
  24. package/mindsystem/templates/design.md +1 -1
  25. package/mindsystem/workflows/adhoc.md +63 -0
  26. package/mindsystem/workflows/discuss-phase.md +12 -0
  27. package/mindsystem/workflows/doctor-fixes.md +71 -0
  28. package/mindsystem/workflows/execute-phase.md +19 -6
  29. package/mindsystem/workflows/execute-plan.md +1 -7
  30. package/mindsystem/workflows/mockup-generation.md +1 -1
  31. package/mindsystem/workflows/plan-phase.md +41 -77
  32. package/mindsystem/workflows/verify-work.md +8 -77
  33. package/package.json +1 -1
  34. package/scripts/ms-tools.py +481 -0
  35. package/agents/ms-verify-fixer.md +0 -125
@@ -13,7 +13,7 @@ allowed-tools:
13
13
  <objective>
14
14
  Create design specifications for a phase. Spawns ms-designer agent with phase context.
15
15
 
16
- **Orchestrator role:** Parse phase, validate against roadmap, check existing design, gather context chain (CONTEXT.md → project UI skill → codebase), adaptive Q&A if gaps, spawn designer agent, enable conversational refinement.
16
+ **Orchestrator role:** Parse phase, validate against roadmap, check existing design, gather context chain (CONTEXT.md → design skill → codebase extraction), adaptive Q&A if gaps, spawn designer agent, enable conversational refinement.
17
17
 
18
18
  **When to use:**
19
19
  - UI-heavy phases with significant new interface work
@@ -70,27 +70,23 @@ Wait for response and act accordingly.
70
70
 
71
71
  **If doesn't exist:** Continue to gather context.
72
72
 
73
- ## 3. Discover Relevant Skills
73
+ ## 3. Load Design Skills
74
74
 
75
- Before gathering context, check for skills that provide design-relevant conventions.
76
-
77
- **3a. Scan available skills:**
75
+ ```bash
76
+ DESIGN_SKILLS=$(ms-tools config-get skills.design --default "[]")
77
+ ```
78
78
 
79
- Scan skills in your system-reminder for matches. Look for skills related to:
80
- - The platform or framework (Flutter, React, web, etc.)
81
- - UI conventions, design systems, or component patterns
82
- - The specific domain of this phase (from the ROADMAP.md phase description extracted in step 1)
79
+ **If skills configured:** Invoke each via the Skill tool.
83
80
 
84
- **3b. Confirm with user:**
81
+ After loading, check if the skill content contains project-specific design tokens (hex colors in palette context, spacing scales with values, font family names). If it does, these are the authoritative aesthetic — skip step 4c. If it contains only design methodology or you're uncertain, proceed to codebase extraction in step 4c.
85
82
 
86
- Present via AskUserQuestion with `multiSelect: true`:
87
- - Each matching skill is one option (label: skill name, description: what it provides)
88
- - Always include a "None — skip skill loading" option
89
- - User selects which to load, skips, or types a skill name in the free-text field
83
+ **If no skills configured:**
90
84
 
91
- **3c. Load selected skills:**
85
+ ```
86
+ Tip: Configuring design skills in /ms:config can improve design and mockup quality. Run /ms:config to set them up.
87
+ ```
92
88
 
93
- Invoke each confirmed skill via the Skill tool. Extract aesthetic patterns (colors, components, spacing, typography) from loaded content for the `<existing_aesthetic>` block in step 6.
89
+ Non-blocking. Proceed to codebase extraction in step 4c.
94
90
 
95
91
  ## 4. Gather Context Chain
96
92
 
@@ -148,31 +144,57 @@ If knowledge files exist, extract:
148
144
 
149
145
  Pass the extracted knowledge to ms-designer in the design prompt (see step 6 `<prior_knowledge>` block).
150
146
 
151
- **4c. Optional context - codebase analysis:**
147
+ **4c. Optional context - codebase aesthetic extraction:**
152
148
 
153
- ```bash
154
- # Platform detection
155
- if [ -f "pubspec.yaml" ]; then
156
- echo "Platform: Flutter (pubspec.yaml found)"
157
- # Search Flutter project structure
158
- find lib -name "*.dart" 2>/dev/null | head -20
159
- grep -r "colors\|theme\|spacing" lib/ --include="*.dart" 2>/dev/null | head -10
160
- elif [ -f "package.json" ]; then
161
- echo "Platform: Web (package.json found)"
162
- grep -E "react|vue|angular|svelte" package.json 2>/dev/null | head -5
163
- # Search web project structure
164
- find src -name "*.tsx" -o -name "*.ts" -o -name "*.jsx" 2>/dev/null | head -20
165
- grep -r "colors\|theme\|spacing" src/ --include="*.ts" --include="*.tsx" 2>/dev/null | head -10
166
- fi
149
+ If authoritative aesthetic already gathered from skill in step 3 → skip this step.
150
+
151
+ Otherwise, spawn an Explore agent to extract the project's visual identity:
152
+
153
+ ```
154
+ Task(
155
+ prompt="Read `.planning/PROJECT.md` (Technical Context section) for tech stack. If PROJECT.md doesn't exist, read root dependency files (`pubspec.yaml`, `package.json`, etc.) to identify the framework.
156
+
157
+ Extract exact values for:
158
+ - **Color palette:** background, text, accent, error — hex values with semantic roles
159
+ - **Typography scale:** font families, size/weight combos
160
+ - **Spacing system:** recurring padding/margin/gap values
161
+ - **Reusable UI components:** names + visual characteristics (border-radius, shadows)
162
+ - **Layout conventions:** navigation pattern, content layout
163
+
164
+ Format findings as:
165
+
166
+ Color palette:
167
+ | Role | Value | Context |
168
+ |------|-------|---------|
169
+ | [role] | #hex | [where used] |
170
+
171
+ Typography:
172
+ | Element | Family | Size/Weight | Usage |
173
+ |---------|--------|-------------|-------|
174
+ | [element] | [family] | [size/weight] | [where used] |
175
+
176
+ Spacing scale:
177
+ [base unit and scale values]
178
+
179
+ Component inventory:
180
+ - [ComponentName] — [visual characteristics]
181
+
182
+ Layout conventions:
183
+ - [pattern description]
184
+
185
+ Extract EXACT values (hex codes, pixel values, font names). Don't summarize or approximate. Return 'not found' for sections with no data. Look in theme files, style constants, design token files, and framework-specific configuration — you know where these live for the detected framework.",
186
+ subagent_type="Explore",
187
+ description="Extract codebase aesthetic"
188
+ )
167
189
  ```
168
190
 
169
- Document discovered patterns for the designer.
191
+ If the agent returns mostly empty results → greenfield. If substantive findings → use them for the `<existing_aesthetic>` block in step 6.
170
192
 
171
193
  ## 5. Adaptive Q&A (If Gaps Exist)
172
194
 
173
195
  Assess context coverage:
174
196
  - Can platform be inferred? (from codebase or PROJECT.md)
175
- - Can visual style be inferred? (from project UI skill or codebase)
197
+ - Can visual style be inferred? (from existing aesthetic)
176
198
  - Can design priorities be inferred? (from CONTEXT.md or phase requirements)
177
199
 
178
200
  **If everything can be inferred:** Skip to step 6.
@@ -206,17 +228,7 @@ Use AskUserQuestion:
206
228
 
207
229
  **If user selects "Yes":**
208
230
 
209
- Read `~/.claude/mindsystem/workflows/mockup-generation.md` and follow the mockup-generation workflow.
210
-
211
- 1. Determine platform from context chain (or ask user)
212
- 2. Identify primary screen for the phase
213
- 3. Derive 3 design directions from feature context
214
- 4. Present directions to user for approval/tweaking
215
- 5. Read platform template (mobile or web)
216
- 6. Spawn 3 x ms-mockup-designer agents in parallel
217
- 7. Run comparison script (`compare_mockups.py`), open in browser, and present to user
218
- 8. Handle selection (single pick, combine, tweak, more variants, or skip)
219
- 9. Extract CSS specs from chosen variant into `<mockup_direction>` block
231
+ Read `~/.claude/mindsystem/workflows/mockup-generation.md` and follow the mockup-generation workflow. Generate 3 HTML mockup variants, present comparison to user, and handle selection.
220
232
 
221
233
  Pass gathered context (PROJECT.md, ROADMAP.md phase entry, existing aesthetic) to the workflow. The workflow returns either a `<mockup_direction>` block for step 6, or nothing if user skips.
222
234
 
@@ -275,7 +287,7 @@ Reference products:
275
287
 
276
288
  [If CONTEXT.md doesn't exist:]
277
289
 
278
- Vision inferred from phase requirements and PROJECT.md context.
290
+ No explicit vision provided. Derive design direction from phase requirements and product context above.
279
291
  Reference products: [From Q&A if asked, or "None specified"]
280
292
  </user_vision>
281
293
 
@@ -297,24 +309,35 @@ No prior knowledge files. First phase or no prior execution.
297
309
  </prior_knowledge>
298
310
 
299
311
  <existing_aesthetic>
300
- [If project UI skill exists:]
312
+ [Always present. Populated from skill content OR Explore agent findings OR greenfield.]
313
+
314
+ Color palette:
315
+ | Role | Value | Context |
316
+ |------|-------|---------|
317
+ | bg-primary | #hex | Main background |
318
+ | text-primary | #hex | Body text |
319
+ | accent | #hex | Interactive elements |
320
+ | ... | | |
321
+
322
+ Typography:
323
+ | Element | Family | Size/Weight | Usage |
324
+ |---------|--------|-------------|-------|
325
+ | heading | [family] | [size/weight] | Page titles |
326
+ | body | [family] | [size/weight] | General content |
327
+ | ... | | | |
301
328
 
302
- Authoritative patterns from project UI skill:
303
- - Color palette: [exact values]
304
- - Typography: [font families, sizes]
305
- - Spacing system: [scale values]
306
- - Component library: [named components]
329
+ Spacing scale:
330
+ [base unit and scale values, e.g. 4/8/12/16/24/32px]
307
331
 
308
- [If no UI skill, from codebase analysis:]
332
+ Component inventory:
333
+ - [ComponentName] — [visual characteristics]
309
334
 
310
- Discovered patterns from codebase:
311
- - Colors found: [hex values from theme/styles]
312
- - Components found: [existing component names]
313
- - Layout patterns: [grid systems, spacing used]
335
+ Layout conventions:
336
+ - [Navigation pattern, content layout, responsive breakpoints]
314
337
 
315
- [If greenfield:]
338
+ Platform: [Flutter / React / etc.]
316
339
 
317
- No existing aesthetic. Design fresh with platform conventions.
340
+ [If greenfield: "No existing aesthetic. Design fresh with platform conventions."]
318
341
  </existing_aesthetic>
319
342
 
320
343
  <mockup_direction>
@@ -413,7 +436,6 @@ After initial generation, if user wants to refine:
413
436
  **Refinement principles:**
414
437
  - Direct edits — Edit DESIGN.md directly, don't regenerate
415
438
  - Preserve decisions — Changes are incremental, not wholesale replacement
416
- - User controls pace — User decides when design is "done"
417
439
 
418
440
  **For major redesigns (multiple aspects changing):**
419
441
 
@@ -439,11 +461,9 @@ Read `~/.claude/mindsystem/templates/design-iteration.md` and use the iteration
439
461
  </process>
440
462
 
441
463
  <success_criteria>
442
- - [ ] Available skills scanned, surfaced via AskUserQuestion, and loaded via Skill tool
443
- - [ ] Codebase analyzed for existing patterns (step 4c)
464
+ - [ ] Aesthetic context gathered: skills checked for design tokens, codebase extraction run if needed
444
465
  - [ ] Adaptive Q&A completed if context gaps existed
445
- - [ ] Mockup generation offered if phase has significant new UI
446
- - [ ] Mockup direction extracted and passed to ms-designer (if generated)
466
+ - [ ] Mockup generation offered for significant UI; direction passed to ms-designer if generated
447
467
  - [ ] ms-designer spawned with quality-forcing patterns
448
468
  - [ ] DESIGN.md created with Design Direction, Design Tokens, and Screens sections and committed
449
469
  - [ ] User informed of refinement options and next steps
@@ -7,6 +7,7 @@ allowed-tools:
7
7
  - Write
8
8
  - Bash
9
9
  - Glob
10
+ - Skill
10
11
  - AskUserQuestion
11
12
  - Task
12
13
  ---
@@ -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 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.
16
+ Run health checks on project configuration. Detect and fix structural drift across 14 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, roadmap format, phase skills, and Mindsystem version.
17
17
 
18
18
  Idempotent.
19
19
  </objective>
@@ -121,6 +121,8 @@ Display results as a markdown table:
121
121
  | Research API Keys | WARN | PERPLEXITY_API_KEY not set |
122
122
  | Phase directory naming | FAIL | 1 non-canonical directory |
123
123
  | Browser Verification | WARN | Web project, missing agent-browser CLI |
124
+ | Roadmap Format | FAIL | 4 pre-work flag issues |
125
+ | Phase Skills | WARN | skills.plan, skills.design not configured |
124
126
  | Mindsystem version | WARN | v3.21.0 → v3.22.1 available |
125
127
  ```
126
128
 
@@ -143,7 +145,7 @@ If "Skip" → go to `report`.
143
145
 
144
146
  If "Review each" → use AskUserQuestion for each failed check with its details and options: "Fix" / "Skip". Only run fixes for accepted checks.
145
147
 
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.
148
+ Apply fixes in dependency order: fix_subsystems → fix_milestone_dirs → fix_milestone_naming → fix_phase_archival → fix_plan_cleanup → fix_phase_dirs → fix_knowledge → fix_roadmap_format. Skip any fix whose check passed or was skipped by user.
147
149
 
148
150
  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. Research API Keys check provides platform-aware setup guidance (shell export on macOS/Linux, settings.json on Windows) and checks both environment variables and `~/.claude/settings.json` env section as fallback.
149
151
  </step>
@@ -183,6 +185,8 @@ Final summary table:
183
185
  | Research API Keys | PASS | ... |
184
186
  | Phase directory naming | PASS | ... |
185
187
  | Browser Verification | PASS | ... |
188
+ | Roadmap Format | PASS | ... |
189
+ | Phase Skills | PASS | ... |
186
190
  | Mindsystem version | PASS | ... |
187
191
 
188
192
  All checks passed.
@@ -199,6 +203,6 @@ Include counts: checks total, passed, warned, fixed during this run.
199
203
  - [ ] Re-scan verifies all checks pass after fixes
200
204
  - [ ] Each fix group committed atomically
201
205
  - [ ] Fixes applied in dependency order: subsystems → dirs → milestone naming → archival → cleanup → knowledge
202
- - [ ] All 12 categories reported with PASS/FAIL/WARN/SKIP
206
+ - [ ] All 14 categories reported with PASS/FAIL/WARN/SKIP
203
207
  - [ ] Clean project reports all PASS with no fix prompts
204
208
  </success_criteria>
@@ -178,11 +178,7 @@ All {Y} plans finished. Phase goal verified.
178
178
 
179
179
  **Route A: More phases remain**
180
180
 
181
- 4. **If skip context applies:** Determine next phase's primary suggestion:
182
- - From ROADMAP.md (already in context), get Phase {Z+1} pre-work flags
183
- - Check: CONTEXT.md exists? DESIGN.md? RESEARCH.md? in next phase dir
184
- - Priority: discuss (if Likely + no CONTEXT.md) > design (if Likely + no DESIGN.md) > research (if Likely + no RESEARCH.md) > plan-phase
185
- - Present ONE "Also available" entry:
181
+ 4. **If skip context applies:** Run `ms-tools prework-status {Z+1}` and use the Suggested line for the "Also available" entry:
186
182
  ```
187
183
  ---
188
184
  **Also available:**
@@ -38,7 +38,7 @@ Output ONLY the reference content below. Do NOT add:
38
38
  2. `/ms:map-codebase` — Analyze existing code for patterns and conventions
39
39
  3. `/ms:doctor` — Validate config and generate knowledge files from source code
40
40
 
41
- Optional: `/ms:config` — Configure code reviewers, gitignore, and other preferences
41
+ Optional: `/ms:config` — Configure skills, code reviewers, gitignore, and other preferences
42
42
 
43
43
  ### Building features (repeat per milestone)
44
44
 
@@ -108,9 +108,9 @@ Initialize new project with brief and configuration.
108
108
  Usage: `/ms:new-project`
109
109
 
110
110
  **`/ms:config`**
111
- Configure Mindsystem preferences — code reviewers, mockup preferences, browser verification, plan mode, gitignore patterns, git remote, task tracker.
111
+ Configure Mindsystem preferences — per-phase skills, code reviewers, mockup preferences, browser verification, plan mode, gitignore patterns, git remote, task tracker.
112
112
 
113
- - Use when: you want to set up code review agents, mockup open behavior, manage which .planning/ artifacts are git-ignored, or push your repo to GitHub.
113
+ - Use when: you want to configure per-phase skills, set up code review agents, mockup open behavior, manage which .planning/ artifacts are git-ignored, or push your repo to GitHub.
114
114
  - Edits `.planning/config.json` and `.gitignore`
115
115
  - Suggests code reviewers based on tech stack (needs PROJECT.md)
116
116
  - Idempotent — run anytime to reconfigure
@@ -366,6 +366,7 @@ Execute discovered work with knowledge-aware planning and execution.
366
366
  - Use when: you discover work mid-session that can be completed in a single context window without multi-phase orchestration.
367
367
  - Bridges the gap between `/ms:add-todo` (capture for later) and `/ms:insert-phase` (multi-plan coordination)
368
368
  - Knowledge-aware: loads relevant knowledge files before planning, consolidates learnings after execution
369
+ - Browser verification for web projects (same flow as execute-phase)
369
370
  - Accepts Linear ticket IDs when task tracker is configured via `/ms:config` — auto-fetches context, tags commits, and finalizes the ticket on completion
370
371
  - Spawns Explore agents for codebase understanding, ms-adhoc-planner for plan creation, ms-executor for execution
371
372
  - Creates per-execution artifacts in `.planning/adhoc/{timestamp}-{slug}/`
@@ -381,7 +382,7 @@ Usage: `/ms:adhoc Refactor API error handling to use consistent format`
381
382
  Health check and fix project configuration — subsystems, milestone structure, knowledge files.
382
383
 
383
384
  - Use when: project has structural drift, missing config, or periodic health check
384
- - Runs 6 checks: subsystem vocabulary, milestone directories, phase archival, knowledge files, phase summaries, PLAN cleanup
385
+ - Runs 14 checks: subsystem vocabulary, milestone directories, milestone naming, phase archival, knowledge files, phase summaries, PLAN cleanup, CLI wrappers, API keys, phase directory naming, browser verification prerequisites, roadmap format, phase skills, version freshness
385
386
  - Presents results table, then offers to fix all issues in dependency order
386
387
  - Each fix group gets its own atomic commit
387
388
  - Idempotent — safe to run repeatedly
@@ -480,7 +481,7 @@ Usage: `/ms:release-notes`
480
481
  /ms:doctor # Validate config, generate knowledge files
481
482
  ```
482
483
 
483
- Optional: `/ms:config` — configure code reviewers, gitignore, and other preferences
484
+ Optional: `/ms:config` — configure skills, code reviewers, gitignore, and other preferences
484
485
 
485
486
  **Building features (repeat per milestone):**
486
487
 
@@ -168,37 +168,19 @@ fi
168
168
  If directory doesn't exist, note: "No directory to delete (phase not yet created)"
169
169
  </step>
170
170
 
171
- <step name="renumber_directories">
172
- Rename all subsequent phase directories:
173
-
174
- For each phase directory that needs renumbering (in reverse order to avoid conflicts):
171
+ <step name="renumber_phases">
172
+ Renumber all subsequent phase directories and their files:
175
173
 
176
174
  ```bash
177
- # Example: renaming 18-dashboard to 17-dashboard
178
- mv ".planning/phases/18-dashboard" ".planning/phases/17-dashboard"
175
+ ms-tools phase-renumber "$PHASE"
179
176
  ```
180
177
 
181
- Process in descending order (20→19, then 19→18, then 18→17) to avoid overwriting.
182
-
183
- Also rename decimal phase directories:
184
- - `17.1-fix-bug` → `16.1-fix-bug` (if removing integer 17)
185
- - `17.2-hotfix` → `17.1-hotfix` (if removing decimal 17.1)
186
- </step>
187
-
188
- <step name="rename_files_in_directories">
189
- Rename plan files inside renumbered directories:
178
+ Renames all phase directories with numbers greater than the removed phase (decrementing by 1), and renames phase-prefixed files inside those directories.
190
179
 
191
- For each renumbered directory, rename files that contain the phase number:
192
-
193
- ```bash
194
- # Inside 17-dashboard (was 18-dashboard):
195
- mv "18-01-PLAN.md" "17-01-PLAN.md"
196
- mv "18-02-PLAN.md" "17-02-PLAN.md"
197
- mv "18-01-SUMMARY.md" "17-01-SUMMARY.md" # if exists
198
- # etc.
199
- ```
180
+ For integer removal: subsequent integers and their decimals are decremented. Decimals under the removed integer fold into the prior integer (17.1 → 16.1).
181
+ For decimal removal: only subsequent decimals in the same series are decremented. Integer phases unchanged.
200
182
 
201
- Also handle CONTEXT.md and DISCOVERY.md (these don't have phase prefixes, so no rename needed).
183
+ Review the JSON output to confirm expected renames before proceeding.
202
184
  </step>
203
185
 
204
186
  <step name="update_roadmap">
@@ -7,6 +7,7 @@ allowed-tools:
7
7
  - Bash
8
8
  - Task
9
9
  - Write
10
+ - Skill
10
11
  - AskUserQuestion
11
12
  ---
12
13
 
@@ -106,6 +107,18 @@ Spawning 3 parallel agents:
106
107
  Proceed? (yes / adjust scope / change mode)
107
108
  ```
108
109
 
110
+ ## 4b. Load Research Skills
111
+
112
+ ```bash
113
+ RESEARCH_SKILLS=$(ms-tools config-get skills.research --default "[]")
114
+ ```
115
+
116
+ **If skills configured:** Invoke each via the Skill tool. Use skill content to:
117
+ - Add brief domain context to each research agent's prompt (alongside `<prior_knowledge>`)
118
+ - Inform synthesis decisions when mapping agent findings to RESEARCH.md sections (step 6)
119
+
120
+ **If no skills configured:** Continue silently. Research agents perform well with just project context.
121
+
109
122
  ## 5. Spawn 3 Agents in Parallel
110
123
 
111
124
  Announce: "Spawning 3 research agents in parallel..."
@@ -76,7 +76,7 @@ Before analyzing, establish what this screen is trying to accomplish.
76
76
  - Read `.planning/PROJECT.md` for product type, core value, target audience
77
77
  - If phase-based, grep `.planning/ROADMAP.md` for phase requirements
78
78
  - Glob for existing DESIGN.md in `.planning/phases/` for design intent
79
- - Scan available skills in system-reminder for matches related to UI, design, or the screen's platform/framework. If matches found, present via AskUserQuestion with `multiSelect: true`: each matching skill is one option (label: skill name, description: what it provides), always include a "Noneskip skill loading" option. User selects which to load, skips, or types a skill name in the free-text field. Load selected skills via Skill tool for existing patterns.
79
+ - Load design skills from config: `ms-tools config-get skills.design --default "[]"`. If configured, invoke each via the Skill tool for existing patterns. If not configured, proceed without (no nudgereview-design is a utility command, not a core phase).
80
80
 
81
81
  **State the screen's job in one sentence:**
82
82
  > "This screen helps the user [accomplish X]."
@@ -56,8 +56,7 @@ ms-tools find-phase "$ARGUMENTS"
56
56
  - **For each issue found:**
57
57
  - On first issue: load knowledge files (match phase subsystem against `.planning/knowledge/*.md`)
58
58
  - Lightweight investigation (2-3 tool calls, informed by knowledge)
59
- - If simple: Fix inline, commit (amend previous fix commit on retry when HEAD matches fix_commit), ask for re-test
60
- - If complex: Spawn ms-verify-fixer subagent (with knowledge context in prompt)
59
+ - Fix inline, commit (amend previous fix commit on retry when HEAD matches fix_commit), ask for re-test
61
60
  - 2 retries on failed re-test, then offer options
62
61
  8. **On batch transition:**
63
62
  - If new mock_type: Revert old mocks (`git checkout -- <mocked_files>`), apply new ones
@@ -79,7 +78,6 @@ ms-tools find-phase "$ARGUMENTS"
79
78
  - Don't present more than 4 tests at a time
80
79
  - Don't run automated tests — this is manual user validation
81
80
  - Don't skip investigation — always try 2-3 tool calls before escalating
82
- - Don't fix complex issues inline — spawn fixer subagent for multi-file or architectural changes
83
81
  - Don't commit mock code — stash mocked files before fixing, restore after
84
82
  - Don't re-present skipped tests — assumptions stand
85
83
  - Don't Read/Edit UAT.md for field updates — use `ms-tools uat-update`
@@ -93,7 +93,7 @@ Rule: If you can only tell variants apart by squinting at colors, they are not d
93
93
 
94
94
  <existing_aesthetic_constraint>
95
95
 
96
- When the project has an existing visual aesthetic (project UI skill, established codebase patterns):
96
+ When `<existing_aesthetic>` contains concrete values:
97
97
 
98
98
  **ALL variants use the same colors, fonts, and component shapes.** Directions differ ONLY in:
99
99
  - Layout and spatial organization
@@ -104,7 +104,7 @@ When the project has an existing visual aesthetic (project UI skill, established
104
104
 
105
105
  This constraint is non-negotiable. Mockup directions explore layout alternatives, not brand alternatives. An existing product stays visually cohesive across all variants.
106
106
 
107
- When the project is greenfield (no existing aesthetic):
107
+ When `<existing_aesthetic>` states no existing aesthetic:
108
108
  - Each variant MAY propose a different color palette
109
109
  - Each variant MAY propose different typography
110
110
  - Structural differences remain the primary differentiator
@@ -43,7 +43,7 @@ Details referencing existing utilities: "Use `comparePassword` in `src/lib/crypt
43
43
  | Section | Purpose | Required |
44
44
  |---------|---------|----------|
45
45
  | `# Plan NN: Title` | H1 with plan number and descriptive title | Yes |
46
- | `**Subsystem:** X \| **Type:** Y \| **Skills:** Z` | Inline metadata (replaces YAML frontmatter) | Yes (type defaults to `execute`, skills optional) |
46
+ | `**Subsystem:** X \| **Type:** Y` | Inline metadata (replaces YAML frontmatter) | Yes (type defaults to `execute`) |
47
47
  | `## Context` | Why this work exists, why this approach | Yes |
48
48
  | `## Changes` | Numbered subsections with files and implementation details | Yes |
49
49
  | `## Verification` | Bash commands and observable checks | Yes |
@@ -130,17 +130,6 @@ Matches vocabulary from the project's `config.json`. Used by the executor when g
130
130
 
131
131
  When `**Type:**` is omitted, the plan defaults to `execute`.
132
132
 
133
- ### Skills
134
-
135
- | Value | Behavior |
136
- |-------|----------|
137
- | *(omitted)* | No skills loaded. Skill discovery happens during `/ms:plan-phase` — absence means none were relevant. |
138
- | `skill-a, skill-b` | Executor invokes listed skills via Skill tool before implementing. |
139
-
140
- Skills are confirmed by the user during `/ms:plan-phase` and encoded into plans. Comma-separated list of skill names matching entries in the system-reminder.
141
-
142
- ---
143
-
144
133
  ## Must-Haves Specification
145
134
 
146
135
  The `## Must-Haves` section is a markdown checklist consumed by ms-verifier. Each item is a user-observable truth — not an implementation detail.
@@ -199,7 +188,7 @@ Execution order lives in a single `EXECUTION-ORDER.md` file alongside the plans.
199
188
  | What triggers TDD lazy-loading? | `**Type:** tdd` in inline metadata |
200
189
  | How does the executor know why an approach was chosen? | Reads `## Context` section |
201
190
  | How does the executor find existing utilities? | Reads `**Files:**` lines and inline references in `## Changes` |
202
- | What triggers skill loading in executor? | `**Skills:**` in inline metadata. No skills loaded if omitted. |
191
+ | How do skills influence plans? | Skill conventions are woven into plan content during `/ms:plan-phase`. No runtime skill loading by executor. |
203
192
 
204
193
  ---
205
194
 
@@ -6,46 +6,20 @@ Reference for showing what pre-work is done vs still needed for the CURRENT phas
6
6
 
7
7
  After completing one pre-work command, show what else is recommended before planning.
8
8
 
9
- ## Information to Extract
9
+ ## Data
10
10
 
11
- From ROADMAP.md, get the current phase details:
11
+ Run `ms-tools prework-status` to get pre-work flags, completion status, and routing suggestion:
12
12
 
13
13
  ```bash
14
- grep -A 25 "### Phase ${PHASE}:" .planning/ROADMAP.md
14
+ ms-tools prework-status "${PHASE}"
15
15
  ```
16
16
 
17
- Extract:
18
- - `**Research**: Likely/Unlikely (reason)`
19
- - `**Discuss**: Likely/Unlikely (reason)`
20
- - `**Design**: Likely/Unlikely (reason)`
21
-
22
- Check what context files already exist:
23
-
24
- ```bash
25
- ms-tools find-phase "${PHASE}"
26
- # Extract PHASE_DIR from the `dir` field of the JSON output
27
- [ -f "$PHASE_DIR"/*-CONTEXT.md ] && echo "CONTEXT_EXISTS"
28
- [ -f "$PHASE_DIR"/*-DESIGN.md ] && echo "DESIGN_EXISTS"
29
- [ -f "$PHASE_DIR"/*-RESEARCH.md ] && echo "RESEARCH_EXISTS"
30
- ```
31
-
32
- ## Routing Logic
33
-
34
- Suggest the next incomplete Likely pre-work:
35
-
36
- ```
37
- IF Discuss: Likely AND no CONTEXT.md:
38
- SUGGEST = discuss-phase
39
- ELSE IF Design: Likely AND no DESIGN.md:
40
- SUGGEST = design-phase
41
- ELSE IF Research: Likely AND no RESEARCH.md:
42
- SUGGEST = research-phase
43
- ELSE:
44
- SUGGEST = plan-phase (ready to plan)
45
- ```
17
+ Output includes phase name, goal, pre-work flags with status (done/not started), existing artifacts, and the suggested next command with reason.
46
18
 
47
19
  ## Output Format
48
20
 
21
+ Use the `prework-status` output to populate this template:
22
+
49
23
  ```markdown
50
24
  ---
51
25
 
@@ -6,54 +6,20 @@ Reference for presenting "Next Up" guidance for a phase. Used by progress (curre
6
6
 
7
7
  Help user decide between Discuss/Research/Design/Plan for a target phase using ROADMAP.md pre-work flags.
8
8
 
9
- ## Information to Extract
9
+ ## Data
10
10
 
11
- From ROADMAP.md, get the target phase details:
11
+ Run `ms-tools prework-status` to get phase info, pre-work status, and routing suggestion:
12
12
 
13
13
  ```bash
14
- grep -A 25 "### Phase ${TARGET_PHASE}:" .planning/ROADMAP.md
14
+ ms-tools prework-status "${TARGET_PHASE}"
15
15
  ```
16
16
 
17
- Extract:
18
- - Phase name and goal
19
- - `**Research**: Likely/Unlikely (reason)`
20
- - `**Research topics**: ...` (if Likely)
21
- - `**Discuss**: Likely/Unlikely (reason)`
22
- - `**Discuss topics**: ...` (if Likely)
23
- - `**Design**: Likely/Unlikely (reason)`
24
- - `**Design focus**: ...` (if Likely)
25
-
26
- Check for existing context files:
27
-
28
- ```bash
29
- ms-tools find-phase "${TARGET_PHASE}"
30
- # Extract PHASE_DIR from the `dir` field of the JSON output
31
- [ -f "$PHASE_DIR"/*-CONTEXT.md ] && echo "CONTEXT_EXISTS"
32
- [ -f "$PHASE_DIR"/*-DESIGN.md ] && echo "DESIGN_EXISTS"
33
- [ -f "$PHASE_DIR"/*-RESEARCH.md ] && echo "RESEARCH_EXISTS"
34
- ```
35
-
36
- ## Routing Logic
37
-
38
- Determine primary suggestion (priority order):
39
-
40
- ```
41
- IF Discuss: Likely AND no CONTEXT.md:
42
- PRIMARY = discuss-phase
43
- REASON = from Discuss parenthetical
44
- ELSE IF Design: Likely AND no DESIGN.md:
45
- PRIMARY = design-phase
46
- REASON = from Design parenthetical
47
- ELSE IF Research: Likely AND no RESEARCH.md:
48
- PRIMARY = research-phase
49
- REASON = from Research parenthetical
50
- ELSE:
51
- PRIMARY = plan-phase
52
- REASON = "ready to plan"
53
- ```
17
+ Output includes phase name, goal, pre-work flags with status (done/not started), existing artifacts, and the suggested next command with reason.
54
18
 
55
19
  ## Output Format
56
20
 
21
+ Use the `prework-status` output to populate this template:
22
+
57
23
  ```markdown
58
24
  ---
59
25
 
@@ -77,7 +43,7 @@ ELSE:
77
43
 
78
44
  ### Suggested
79
45
 
80
- `/ms:{primary} {N}` — {reason}
46
+ `/ms:{suggested command} {N}` — {reason}
81
47
 
82
48
  <sub>`/clear` first → fresh context window</sub>
83
49
 
@@ -41,9 +41,13 @@ Why 50% not 80%?
41
41
  </task_rule>
42
42
 
43
43
  <tdd_plans>
44
- **TDD features get their own plans. Target ~40% context.**
44
+ **In multi-plan mode, TDD features get their own plans. Target ~40% context.**
45
45
 
46
- TDD requires 2-3 execution cycles (RED → GREEN → REFACTOR), each with file reads, test runs, and potential debugging. This is fundamentally heavier than linear task execution. TDD features are inherently heavy-weight (~25-40% marginal) and are always isolated into dedicated plans.
46
+ TDD requires 2-3 execution cycles (RED → GREEN → REFACTOR), each with file reads, test runs, and potential debugging. This is fundamentally heavier than linear task execution.
47
+
48
+ In **multi-plan mode** (`multi_plan: true`), TDD features are isolated into dedicated plans — the orchestrator proposes them as standalone plans during grouping.
49
+
50
+ In **single-plan mode** (default), TDD tasks are included inline alongside other tasks. The orchestrator already determined that all tasks fit within one plan's context budget. Do not split TDD tasks into separate plans in single-plan mode.
47
51
 
48
52
  | TDD Feature Complexity | Context Usage |
49
53
  |------------------------|---------------|
@@ -51,9 +55,9 @@ TDD requires 2-3 execution cycles (RED → GREEN → REFACTOR), each with file r
51
55
  | Business logic with edge cases | ~35-40% |
52
56
  | Complex algorithm | ~40-50% |
53
57
 
54
- **One feature per TDD plan.** If features are trivial enough to batch, they're trivial enough to skip TDD.
58
+ **One feature per TDD plan (multi-plan mode only).** If features are trivial enough to batch, they're trivial enough to skip TDD.
55
59
 
56
- **Why TDD plans are separate:**
60
+ **Why TDD plans are separate in multi-plan mode:**
57
61
  - TDD consumes 40-50% context for a single feature
58
62
  - Dedicated plans ensure full quality throughout RED-GREEN-REFACTOR
59
63
  - Each TDD feature gets fresh context, peak quality