mindsystem-cc 3.19.0 → 3.21.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 (83) hide show
  1. package/README.md +5 -6
  2. package/agents/ms-designer.md +5 -2
  3. package/agents/ms-mockup-designer.md +1 -1
  4. package/agents/ms-plan-writer.md +8 -1
  5. package/agents/ms-product-researcher.md +69 -0
  6. package/agents/ms-research-synthesizer.md +1 -1
  7. package/agents/ms-researcher.md +8 -8
  8. package/agents/ms-roadmapper.md +9 -13
  9. package/bin/install.js +68 -5
  10. package/commands/ms/add-phase.md +30 -18
  11. package/commands/ms/adhoc.md +1 -1
  12. package/commands/ms/audit-milestone.md +12 -12
  13. package/commands/ms/complete-milestone.md +25 -22
  14. package/commands/ms/config.md +202 -0
  15. package/commands/ms/design-phase.md +34 -29
  16. package/commands/ms/discuss-phase.md +26 -22
  17. package/commands/ms/doctor.md +22 -202
  18. package/commands/ms/execute-phase.md +18 -7
  19. package/commands/ms/help.md +46 -39
  20. package/commands/ms/insert-phase.md +29 -17
  21. package/commands/ms/new-milestone.md +42 -19
  22. package/commands/ms/new-project.md +88 -103
  23. package/commands/ms/plan-milestone-gaps.md +4 -5
  24. package/commands/ms/plan-phase.md +5 -3
  25. package/commands/ms/progress.md +2 -4
  26. package/commands/ms/research-phase.md +7 -12
  27. package/commands/ms/research-project.md +12 -12
  28. package/mindsystem/references/continuation-format.md +3 -3
  29. package/mindsystem/references/plan-format.md +11 -1
  30. package/mindsystem/references/principles.md +1 -1
  31. package/mindsystem/references/questioning.md +50 -8
  32. package/mindsystem/references/routing/audit-result-routing.md +12 -11
  33. package/mindsystem/references/routing/between-milestones-routing.md +2 -2
  34. package/mindsystem/references/routing/milestone-complete-routing.md +1 -1
  35. package/mindsystem/references/routing/next-phase-routing.md +4 -2
  36. package/mindsystem/templates/context.md +7 -6
  37. package/mindsystem/templates/milestone-archive.md +5 -5
  38. package/mindsystem/templates/milestone-context.md +1 -1
  39. package/mindsystem/templates/milestone.md +9 -9
  40. package/mindsystem/templates/project.md +70 -64
  41. package/mindsystem/templates/research-subagent-prompt.md +3 -3
  42. package/mindsystem/templates/roadmap-milestone.md +14 -14
  43. package/mindsystem/templates/roadmap.md +9 -7
  44. package/mindsystem/workflows/adhoc.md +1 -1
  45. package/mindsystem/workflows/complete-milestone.md +66 -107
  46. package/mindsystem/workflows/discuss-phase.md +137 -65
  47. package/mindsystem/workflows/doctor-fixes.md +273 -0
  48. package/mindsystem/workflows/execute-phase.md +7 -3
  49. package/mindsystem/workflows/execute-plan.md +6 -5
  50. package/mindsystem/workflows/map-codebase.md +2 -2
  51. package/mindsystem/workflows/mockup-generation.md +1 -1
  52. package/mindsystem/workflows/plan-phase.md +28 -3
  53. package/mindsystem/workflows/transition.md +20 -25
  54. package/mindsystem/workflows/verify-work.md +1 -1
  55. package/package.json +1 -1
  56. package/scripts/__pycache__/ms-tools.cpython-314.pyc +0 -0
  57. package/scripts/__pycache__/test_ms_tools.cpython-314-pytest-9.0.2.pyc +0 -0
  58. package/scripts/fixtures/scan-context/.planning/ROADMAP.md +16 -0
  59. package/scripts/fixtures/scan-context/.planning/adhoc/20260220-fix-token-SUMMARY.md +12 -0
  60. package/scripts/fixtures/scan-context/.planning/config.json +3 -0
  61. package/scripts/fixtures/scan-context/.planning/debug/resolved/token-bug.md +11 -0
  62. package/scripts/fixtures/scan-context/.planning/knowledge/auth.md +11 -0
  63. package/scripts/fixtures/scan-context/.planning/phases/02-infra/02-1-SUMMARY.md +20 -0
  64. package/scripts/fixtures/scan-context/.planning/phases/04-setup/04-1-SUMMARY.md +21 -0
  65. package/scripts/fixtures/scan-context/.planning/phases/05-auth/05-1-SUMMARY.md +28 -0
  66. package/scripts/fixtures/scan-context/.planning/todos/done/setup-db.md +10 -0
  67. package/scripts/fixtures/scan-context/.planning/todos/pending/add-logout.md +10 -0
  68. package/scripts/fixtures/scan-context/expected-output.json +257 -0
  69. package/scripts/ms-tools.py +2139 -0
  70. package/scripts/test_ms_tools.py +836 -0
  71. package/commands/ms/list-phase-assumptions.md +0 -56
  72. package/mindsystem/workflows/list-phase-assumptions.md +0 -178
  73. package/scripts/__pycache__/compare_mockups.cpython-314.pyc +0 -0
  74. package/scripts/archive-milestone-files.sh +0 -68
  75. package/scripts/archive-milestone-phases.sh +0 -138
  76. package/scripts/doctor-scan.sh +0 -379
  77. package/scripts/gather-milestone-stats.sh +0 -179
  78. package/scripts/generate-adhoc-patch.sh +0 -79
  79. package/scripts/generate-phase-patch.sh +0 -169
  80. package/scripts/scan-artifact-subsystems.sh +0 -55
  81. package/scripts/scan-planning-context.py +0 -839
  82. package/scripts/update-state.sh +0 -59
  83. package/scripts/validate-execution-order.sh +0 -104
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  type: prompt
3
3
  name: ms:complete-milestone
4
- description: Archive completed milestone and prepare for next version
5
- argument-hint: <version>
4
+ description: Archive completed milestone and prepare for next milestone
5
+ argument-hint: "[name]"
6
6
  allowed-tools:
7
7
  - Read
8
8
  - Write
@@ -11,10 +11,10 @@ allowed-tools:
11
11
  ---
12
12
 
13
13
  <objective>
14
- Mark milestone {{version}} complete, archive to milestones/, and update ROADMAP.md and REQUIREMENTS.md.
14
+ Mark milestone complete, archive to milestones/, and update ROADMAP.md and REQUIREMENTS.md.
15
15
 
16
- Purpose: Create historical record of shipped version, archive milestone artifacts (roadmap + requirements), and prepare for next milestone.
17
- Output: Milestone archived (roadmap + requirements), PROJECT.md evolved, git tagged.
16
+ Purpose: Create historical record of shipped milestone, archive milestone artifacts (roadmap + requirements), and prepare for next milestone.
17
+ Output: Milestone archived (roadmap + requirements), PROJECT.md evolved.
18
18
  </objective>
19
19
 
20
20
  <execution_context>
@@ -33,16 +33,22 @@ Output: Milestone archived (roadmap + requirements), PROJECT.md evolved, git tag
33
33
 
34
34
  **User input:**
35
35
 
36
- - Version: {{version}} (e.g., "1.0", "1.1", "2.0")
36
+ - Milestone: $ARGUMENTS (optional auto-detect from PROJECT.md `## Current Milestone:` header)
37
37
  </context>
38
38
 
39
39
  <process>
40
40
 
41
41
  **Follow complete-milestone.md workflow:**
42
42
 
43
- 0. **Check for audit:**
43
+ 0. **Resolve milestone identity:**
44
44
 
45
- - Look for `.planning/v{{version}}-MILESTONE-AUDIT.md`
45
+ - If argument provided: use as milestone name, generate slug
46
+ - If no argument: parse milestone name from PROJECT.md `## Current Milestone:` header, generate slug
47
+ - If neither found: error — ask user for milestone name
48
+
49
+ 0.5. **Check for audit:**
50
+
51
+ - Look for `.planning/MILESTONE-AUDIT.md`
46
52
  - If missing or stale: recommend `/ms:audit-milestone` first
47
53
  - If audit status is `gaps_found`: recommend `/ms:plan-milestone-gaps` first
48
54
  - If audit status is `passed`: proceed to step 1
@@ -50,7 +56,7 @@ Output: Milestone archived (roadmap + requirements), PROJECT.md evolved, git tag
50
56
  ```markdown
51
57
  ## Pre-flight Check
52
58
 
53
- {If no v{{version}}-MILESTONE-AUDIT.md:}
59
+ {If no MILESTONE-AUDIT.md:}
54
60
  ⚠ No milestone audit found. Run `/ms:audit-milestone` first to verify
55
61
  requirements coverage, cross-phase integration, and E2E flows.
56
62
 
@@ -65,7 +71,7 @@ Output: Milestone archived (roadmap + requirements), PROJECT.md evolved, git tag
65
71
  1. **Verify readiness and gather stats:**
66
72
 
67
73
  ```bash
68
- ~/.claude/mindsystem/scripts/gather-milestone-stats.sh $PHASE_START $PHASE_END
74
+ ms-tools gather-milestone-stats $PHASE_START $PHASE_END
69
75
  ```
70
76
 
71
77
  - If NOT READY: stop and report incomplete plans
@@ -89,26 +95,26 @@ Output: Milestone archived (roadmap + requirements), PROJECT.md evolved, git tag
89
95
 
90
96
  5. **Archive milestone:**
91
97
 
92
- - Create `.planning/milestones/v{{version}}/` directory
93
- - Create `.planning/milestones/v{{version}}/ROADMAP.md` from template
98
+ - Create `.planning/milestones/{{slug}}/` directory
99
+ - Create `.planning/milestones/{{slug}}/ROADMAP.md` from template
94
100
  - Delete ROADMAP.md
95
101
 
96
102
  6. **Archive requirements:**
97
103
 
98
- - Create `.planning/milestones/v{{version}}/REQUIREMENTS.md`
104
+ - Create `.planning/milestones/{{slug}}/REQUIREMENTS.md`
99
105
  - Mark all requirements as complete with outcomes
100
106
  - Delete `.planning/REQUIREMENTS.md`
101
107
 
102
108
  7. **Archive milestone files:**
103
109
 
104
110
  ```bash
105
- ~/.claude/mindsystem/scripts/archive-milestone-files.sh v{{version}}
111
+ ms-tools archive-milestone-files {{slug}}
106
112
  ```
107
113
 
108
114
  8. **Archive and cleanup phases:**
109
115
 
110
116
  ```bash
111
- ~/.claude/mindsystem/scripts/archive-milestone-phases.sh $PHASE_START $PHASE_END v{{version}}
117
+ ms-tools archive-milestone-phases $PHASE_START $PHASE_END {{slug}}
112
118
  ```
113
119
 
114
120
  9. **Update STATE.md:**
@@ -116,12 +122,10 @@ Output: Milestone archived (roadmap + requirements), PROJECT.md evolved, git tag
116
122
  - Update project reference with current core value and next focus
117
123
  - Reset current position for next milestone
118
124
 
119
- 10. **Commit and tag:**
125
+ 10. **Commit:**
120
126
 
121
127
  - Stage: MILESTONES.md, PROJECT.md, STATE.md, archive files, deletions
122
- - Commit: `chore: archive v{{version}} milestone`
123
- - Tag: `git tag -a v{{version}} -m "[milestone summary]"`
124
- - Ask about pushing tag
128
+ - Commit: `chore: archive {{name}} milestone`
125
129
 
126
130
  11. **Offer next steps:**
127
131
  - `/ms:new-milestone` — discover goals and update PROJECT.md
@@ -136,10 +140,9 @@ Output: Milestone archived (roadmap + requirements), PROJECT.md evolved, git tag
136
140
  - PROJECT.md full evolution review completed (What This Is, Core Value, Requirements, Key Decisions, Context)
137
141
  - All shipped requirements moved to Validated in PROJECT.md
138
142
  - Key Decisions updated with outcomes
139
- - Milestone archived to `.planning/milestones/v{{version}}/ROADMAP.md`
140
- - Requirements archived to `.planning/milestones/v{{version}}/REQUIREMENTS.md`
143
+ - Milestone archived to `.planning/milestones/{{slug}}/ROADMAP.md`
144
+ - Requirements archived to `.planning/milestones/{{slug}}/REQUIREMENTS.md`
141
145
  - `.planning/REQUIREMENTS.md` deleted (fresh for next milestone)
142
- - Git tag v{{version}} created
143
146
  </success_criteria>
144
147
 
145
148
  <critical_rules>
@@ -0,0 +1,202 @@
1
+ ---
2
+ name: ms:config
3
+ description: Configure Mindsystem preferences — code reviewers, gitignore, git remote
4
+ allowed-tools:
5
+ - Read
6
+ - Write
7
+ - Bash
8
+ - AskUserQuestion
9
+ ---
10
+
11
+ <objective>
12
+
13
+ Configure Mindsystem preferences for the current project.
14
+
15
+ Manages code reviewer agents, .gitignore patterns for `.planning/` artifacts, and git remote setup. Run anytime to reconfigure — idempotent.
16
+
17
+ </objective>
18
+
19
+ <process>
20
+
21
+ <step name="load_context">
22
+
23
+ **Load current state:**
24
+
25
+ ```bash
26
+ # Check for existing config
27
+ [ -f .planning/config.json ] && cat .planning/config.json || echo "NO_CONFIG"
28
+
29
+ # Check for PROJECT.md (tech stack detection)
30
+ [ -f .planning/PROJECT.md ] && echo "HAS_PROJECT" || echo "NO_PROJECT"
31
+
32
+ # Check for STACK.md (precise tech detection)
33
+ [ -f .planning/codebase/STACK.md ] && echo "HAS_STACK" || echo "NO_STACK"
34
+
35
+ # Check git remote
36
+ git remote -v 2>/dev/null || echo "NO_REMOTE"
37
+ ```
38
+
39
+ **Run this before proceeding.**
40
+
41
+ </step>
42
+
43
+ <step name="git_remote">
44
+
45
+ **Skip if remote already configured.**
46
+
47
+ If no remote exists:
48
+
49
+ Explain: "Your project has a local git repo but no remote. Want to create one on GitHub?"
50
+
51
+ Use AskUserQuestion:
52
+ - header: "Git remote"
53
+ - question: "Create a GitHub repository for this project?"
54
+ - options:
55
+ - "Create with gh CLI" — Run `gh repo create` to set up remote and push
56
+ - "Skip for now" — Continue without remote
57
+
58
+ If "Create with gh CLI":
59
+ - Derive repo name from directory name
60
+ - Show the command: `gh repo create [name] --source=. --push`
61
+ - Confirm with user before executing
62
+ - Execute via Bash tool
63
+
64
+ </step>
65
+
66
+ <step name="code_reviewers">
67
+
68
+ Show current code_review values from config.json (if loaded).
69
+
70
+ **If PROJECT.md or STACK.md exists:** Detect tech stack and suggest appropriate reviewers:
71
+
72
+ - **Flutter/Dart:** adhoc=`ms-flutter-code-quality`, phase=`ms-flutter-code-quality`, milestone=`ms-flutter-reviewer`
73
+ - **All others:** adhoc=`ms-code-simplifier`, phase=`ms-code-simplifier`, milestone=null
74
+
75
+ **If no PROJECT.md or STACK.md:** Warn: "No PROJECT.md found — can't suggest reviewers based on tech stack. Run `/ms:new-project` first, or pick manually."
76
+
77
+ Use AskUserQuestion:
78
+ - header: "Code review"
79
+ - question: "Which code reviewer configuration do you want?"
80
+ - options:
81
+ - "[Suggested based on stack]" — e.g., "Flutter reviewers (ms-flutter-code-quality)" (Recommended)
82
+ - "Skip code review" — Disable review for all tiers
83
+ - "Custom" — I'll specify reviewers manually
84
+
85
+ If "Custom": ask for each tier (adhoc, phase, milestone) individually.
86
+
87
+ If "Skip code review": set all three values to `"skip"`.
88
+
89
+ Update config.json with selected values.
90
+
91
+ </step>
92
+
93
+ <step name="gitignore_patterns">
94
+
95
+ Check if `.gitignore` exists and current `.planning/` ignore patterns:
96
+
97
+ ```bash
98
+ [ -f .gitignore ] && grep -n "planning" .gitignore || echo "NO_PLANNING_PATTERNS"
99
+ ```
100
+
101
+ Explain: "We recommend committing `.planning/` to git — it's your project's memory (decisions, requirements, knowledge files). But some artifacts are large or environment-specific."
102
+
103
+ Use AskUserQuestion (multiSelect):
104
+ - header: "Gitignore"
105
+ - question: "Which `.planning/` artifacts should be git-ignored?"
106
+ - options:
107
+ - "Phase patch files (`.planning/phases/**/*.patch`)" — Large binary diffs, regeneratable
108
+ - "Design mockups (`.planning/phases/**/*.html`)" — Generated HTML mockups from design-phase
109
+
110
+ Apply selected patterns to `.gitignore`. Create the file if needed.
111
+
112
+ If no selections: skip gitignore changes.
113
+
114
+ </step>
115
+
116
+ <step name="validation_summary">
117
+
118
+ Show final config state:
119
+
120
+ ```
121
+ Configuration updated:
122
+
123
+ - Code reviewers: [adhoc / phase / milestone values]
124
+ - Gitignore: [patterns added, or "no changes"]
125
+ - Git remote: [remote URL, or "none configured"]
126
+ ```
127
+
128
+ Check subsystems in config.json. If empty or missing, note:
129
+ "Subsystems are derived during `/ms:new-project`. Run `/ms:doctor` to update or verify them."
130
+
131
+ </step>
132
+
133
+ <step name="commit">
134
+
135
+ **Skip if no changes made.**
136
+
137
+ ```bash
138
+ git add .planning/config.json .gitignore
139
+ git commit -m "$(cat <<'EOF'
140
+ chore: configure mindsystem preferences
141
+ EOF
142
+ )"
143
+ ```
144
+
145
+ </step>
146
+
147
+ <step name="done">
148
+
149
+ Present next steps:
150
+
151
+ **If PROJECT.md exists:**
152
+
153
+ ```
154
+ ---
155
+
156
+ ## ▶ Next Up
157
+
158
+ `/ms:new-milestone` — Discover what to build next, create requirements and roadmap
159
+
160
+ <sub>`/clear` first → fresh context window</sub>
161
+
162
+ ---
163
+
164
+ **Also available:**
165
+ - `/ms:doctor` — Verify subsystems and artifact health
166
+
167
+ ---
168
+ ```
169
+
170
+ **If no PROJECT.md:**
171
+
172
+ ```
173
+ ---
174
+
175
+ ## ▶ Next Up
176
+
177
+ `/ms:new-project` — Initialize project with business context and vision
178
+
179
+ <sub>`/clear` first → fresh context window</sub>
180
+
181
+ ---
182
+
183
+ **Also available:**
184
+ - `/ms:doctor` — Verify subsystems and artifact health
185
+
186
+ ---
187
+ ```
188
+
189
+ </step>
190
+
191
+ </process>
192
+
193
+ <success_criteria>
194
+
195
+ - [ ] Changes committed (if any)
196
+ - [ ] User routed to next step
197
+ - [ ] Gitignore patterns applied (if selected)
198
+ - [ ] Git remote offered (if missing)
199
+ - [ ] Validation summary displayed
200
+ - [ ] Config.json code_review values set (or preserved if skipped)
201
+
202
+ </success_criteria>
@@ -15,8 +15,6 @@ Create design specifications for a phase. Spawns ms-designer agent with phase co
15
15
 
16
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.
17
17
 
18
- **Why subagent:** Design requires focused attention with quality-forcing patterns. Fresh 200k context for design generation. Main context reserved for user refinement conversation.
19
-
20
18
  **When to use:**
21
19
  - UI-heavy phases with significant new interface work
22
20
  - Novel flows/components not deducible from existing patterns
@@ -43,17 +41,12 @@ ls .planning/phases/${PHASE}-*/*DESIGN.md 2>/dev/null
43
41
  ## 1. Parse and Validate Phase
44
42
 
45
43
  ```bash
46
- # Extract and normalize phase number from arguments
47
- PHASE_ARG="$ARGUMENTS"
48
- PHASE=$(printf "%02d" "$PHASE_ARG" 2>/dev/null || echo "$PHASE_ARG")
49
-
50
- # Validate phase exists in roadmap
51
- grep -A5 "Phase ${PHASE}:" .planning/ROADMAP.md 2>/dev/null
44
+ ms-tools find-phase "$ARGUMENTS"
52
45
  ```
53
46
 
54
- **If not found:** Error and exit with message: "Phase ${PHASE} not found in ROADMAP.md"
47
+ **If not found (dir is null):** Error and exit with message: "Phase not found in ROADMAP.md"
55
48
 
56
- **If found:** Extract phase number, name, description. Store for later use.
49
+ **If found:** Extract phase number, name, description from the returned JSON and ROADMAP.md.
57
50
 
58
51
  ## 2. Check Existing Design
59
52
 
@@ -108,7 +101,10 @@ grep -A30 "Phase ${PHASE}:" .planning/ROADMAP.md 2>/dev/null
108
101
  Extract from PROJECT.md:
109
102
  - What This Is (product type)
110
103
  - Core Value (design must serve this)
111
- - Context (target audience)
104
+ - Who It's For (target audience and their context)
105
+ - Core Problem (what the design must address)
106
+ - How It's Different (competitive context, differentiators)
107
+ - Key User Flows (primary interactions that drive hierarchy)
112
108
  - Constraints (platform, technical limits)
113
109
 
114
110
  Extract from ROADMAP.md:
@@ -148,18 +144,18 @@ Pass the extracted knowledge to ms-designer in the design prompt (see step 6 `<p
148
144
 
149
145
  ```bash
150
146
  # Platform detection
151
- if [ -f "package.json" ]; then
152
- echo "Platform: Web (package.json found)"
153
- grep -E "react|vue|angular|svelte" package.json 2>/dev/null | head -5
154
- fi
155
-
156
147
  if [ -f "pubspec.yaml" ]; then
157
148
  echo "Platform: Flutter (pubspec.yaml found)"
149
+ # Search Flutter project structure
150
+ find lib -name "*.dart" 2>/dev/null | head -20
151
+ grep -r "colors\|theme\|spacing" lib/ --include="*.dart" 2>/dev/null | head -10
152
+ elif [ -f "package.json" ]; then
153
+ echo "Platform: Web (package.json found)"
154
+ grep -E "react|vue|angular|svelte" package.json 2>/dev/null | head -5
155
+ # Search web project structure
156
+ find src -name "*.tsx" -o -name "*.ts" -o -name "*.jsx" 2>/dev/null | head -20
157
+ grep -r "colors\|theme\|spacing" src/ --include="*.ts" --include="*.tsx" 2>/dev/null | head -10
158
158
  fi
159
-
160
- # Find existing component/theme files
161
- find src -name "*.tsx" -o -name "*.dart" 2>/dev/null | head -20
162
- grep -r "colors\|theme\|spacing" src/ --include="*.ts" --include="*.dart" 2>/dev/null | head -10
163
159
  ```
164
160
 
165
161
  Document discovered patterns for the designer.
@@ -202,8 +198,7 @@ Use AskUserQuestion:
202
198
 
203
199
  **If user selects "Yes":**
204
200
 
205
- Follow mockup-generation workflow:
206
- @~/.claude/mindsystem/workflows/mockup-generation.md
201
+ Read `~/.claude/mindsystem/workflows/mockup-generation.md` and follow the mockup-generation workflow.
207
202
 
208
203
  1. Determine platform from context chain (or ask user)
209
204
  2. Identify primary screen for the phase
@@ -230,11 +225,20 @@ Platform: [Inferred from codebase or PROJECT.md constraints]
230
225
  Phase: [N]: [Phase name from ROADMAP.md]
231
226
 
232
227
  Target audience:
233
- [From PROJECT.md - Context section]
228
+ [From PROJECT.md - Who It's For section]
229
+
230
+ Core problem:
231
+ [From PROJECT.md - Core Problem section]
232
+
233
+ Competitive differentiators:
234
+ [From PROJECT.md - How It's Different section]
234
235
 
235
236
  Core value this design must serve:
236
237
  [From PROJECT.md - Core Value section]
237
238
 
239
+ Primary user flows:
240
+ [From PROJECT.md - Key User Flows section]
241
+
238
242
  Technical constraints:
239
243
  [From PROJECT.md - Constraints section]
240
244
  </design_context>
@@ -329,13 +333,13 @@ User preferences:
329
333
  [If mockups were NOT generated, omit this entire block.]
330
334
  </mockup_direction>
331
335
 
332
- <quality_expectation>
333
- Commercial benchmark: This design must look like a [benchmark] with intentional decisions, not defaults.
336
+ <quality_constraints>
337
+ Specify exact values for every design token colors as hex, spacing in px/dp, typography with weight+size+line-height. No "appropriate", "suitable", or "as needed". Every decision must be explicit and implementable without interpretation.
334
338
 
335
- Pre-emptive criticism: Assume the user will say "This looks like generic AI output." Generate something that proves them wrong.
339
+ Differentiate from platform defaults: if a color, radius, or spacing matches the default system value, choose a deliberate alternative that serves the product's identity.
336
340
 
337
- Accountability check: Could you show this design to a professional UI designer and claim it as skilled work? If not, it's not done.
338
- </quality_expectation>
341
+ Assume the user will say "This looks like generic AI output." Generate something that proves them wrong. Could you show this design to a professional UI designer and claim it as skilled work? If not, it's not done.
342
+ </quality_constraints>
339
343
 
340
344
  <output_specification>
341
345
  Generate: DESIGN.md following template structure
@@ -404,7 +408,7 @@ After initial generation, if user wants to refine:
404
408
 
405
409
  **For major redesigns (multiple aspects changing):**
406
410
 
407
- Use the iteration template from `~/.claude/mindsystem/templates/design-iteration.md`:
411
+ Read `~/.claude/mindsystem/templates/design-iteration.md` and use the iteration template:
408
412
 
409
413
  1. Capture feedback using the structured format:
410
414
  - What worked well (KEEP)
@@ -441,4 +445,5 @@ Update `.planning/STATE.md` Last Command field:
441
445
  - [ ] ms-designer spawned with quality-forcing patterns
442
446
  - [ ] DESIGN.md created with Design Direction, Design Tokens, and Screens sections and committed
443
447
  - [ ] User informed of refinement options and next steps
448
+ - [ ] STATE.md Last Command updated with timestamp
444
449
  </success_criteria>
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ms:discuss-phase
3
- description: Gather phase context through adaptive questioning before planning
3
+ description: Gather phase context through product-informed collaborative thinking before planning
4
4
  argument-hint: "[phase]"
5
5
  allowed-tools:
6
6
  - Read
@@ -8,14 +8,15 @@ allowed-tools:
8
8
  - Bash
9
9
  - Glob
10
10
  - AskUserQuestion
11
+ - Task
11
12
  ---
12
13
 
13
14
  <objective>
14
- Help the user articulate their vision for a phase through collaborative thinking.
15
+ Act as a collaborative product owner loading milestone-level artifacts, surfacing assumptions, optionally researching competitors, and grounding every question in product analysis.
15
16
 
16
- Purpose: Understand HOW the user imagines this phase working what it looks like, what's essential. You're a thinking partner helping them crystallize their vision, not an interviewer gathering technical requirements.
17
+ Purpose: Understand HOW the user imagines this phase working, informed by target audience, competitive landscape, and industry patterns. You're a thinking partner with product sense helping them crystallize their vision.
17
18
 
18
- Output: {phase}-CONTEXT.md capturing the user's vision for the phase
19
+ Output: {phase}-CONTEXT.md capturing the user's vision with reasoning-backed decisions
19
20
  </objective>
20
21
 
21
22
  <execution_context>
@@ -25,10 +26,9 @@ Output: {phase}-CONTEXT.md capturing the user's vision for the phase
25
26
  <context>
26
27
  Phase number: $ARGUMENTS (required)
27
28
 
28
- **Normalize phase number:**
29
+ **Resolve phase:**
29
30
  ```bash
30
- PHASE_ARG="$ARGUMENTS"
31
- PHASE=$(printf "%02d" "$PHASE_ARG" 2>/dev/null || echo "$PHASE_ARG")
31
+ ms-tools find-phase "$ARGUMENTS"
32
32
  ```
33
33
 
34
34
  **Load project state first:**
@@ -36,31 +36,35 @@ PHASE=$(printf "%02d" "$PHASE_ARG" 2>/dev/null || echo "$PHASE_ARG")
36
36
 
37
37
  **Load roadmap:**
38
38
  @.planning/ROADMAP.md
39
+
40
+ **Load project context:**
41
+ @.planning/PROJECT.md
39
42
  </context>
40
43
 
41
44
  <process>
42
45
  1. Validate phase number argument (error if missing or invalid)
43
46
  2. Check if phase exists in roadmap
44
- 3. Check if CONTEXT.md already exists (offer to update if yes)
45
- 3.5. **Load prior knowledge** — determine relevant subsystem(s) by matching ROADMAP.md phase description against subsystem names in config.json. Load matching `.planning/knowledge/{subsystem}.md` files. If knowledge exists, present brief "What we know so far" summary before questioning.
46
- 4. Follow discuss-phase.md workflow with **ALL questions using AskUserQuestion**:
47
- - Present phase from roadmap
48
- - Use AskUserQuestion: "How do you imagine this working?" with interpretation options
49
- - Use AskUserQuestion to follow their thread probe what excites them
50
- - Use AskUserQuestion to sharpen the core what's essential for THIS phase
51
- - Use AskUserQuestion for decision gate (ready / ask more / let me add context)
52
- - Create CONTEXT.md capturing their vision
53
- 5. Present pre-work status: Read `~/.claude/mindsystem/references/prework-status.md` and show what's done vs still needed for this phase
54
- 6. Update `.planning/STATE.md` Last Command field:
55
- - Format: `Last Command: ms:discuss-phase $ARGUMENTS | YYYY-MM-DD HH:MM`
47
+ 3. **Load milestone artifacts** — extract Who It's For, Core Value, How It's Different from PROJECT.md. Parse requirements mapped to this phase from REQUIREMENTS.md. Graceful if any artifact missing.
48
+ 4. **Load prior knowledge** — determine relevant subsystem(s) by matching ROADMAP.md phase description against subsystem names in config.json. Load matching `.planning/knowledge/{subsystem}.md` files. If knowledge exists, present brief "What we know so far" summary.
49
+ 5. Check if CONTEXT.md already exists (offer to update if yes)
50
+ 6. **Assess and research** — evaluate if phase involves user-facing product decisions. If yes, offer product research via AskUserQuestion → spawn ms-product-researcher if accepted. Skip silently for backend/infra phases.
51
+ 7. **Present briefing** weave together: requirements for this phase, Claude's assumptions (approach, scope, risks with confidence levels), and research findings if available. Ask user to validate/correct assumptions.
52
+ 8. **Informed discussion** follow discuss-phase.md workflow. ALL questions use AskUserQuestion.
53
+ 9. Create CONTEXT.md capturing their vision with reasoning-backed decisions
54
+ 10. Present pre-work status: Read `~/.claude/mindsystem/references/prework-status.md` and show what's done vs still needed for this phase
55
+ 11. Update `.planning/STATE.md` Last Command field:
56
+ - Format: `Last Command: ms:discuss-phase $ARGUMENTS | YYYY-MM-DD HH:MM`
56
57
 
57
58
  **CRITICAL: ALL questions use AskUserQuestion. Never ask inline text questions.**
58
59
  </process>
59
60
 
60
61
  <success_criteria>
61
62
 
62
- - Phase validated against roadmap
63
- - Vision gathered through collaborative thinking (not interrogation)
64
- - CONTEXT.md captures: how it works, what's essential
63
+ - Phase validated and milestone artifacts loaded (graceful if missing)
64
+ - Assumptions surfaced and validated before deep questioning
65
+ - Product research offered for user-facing phases
66
+ - Vision gathered through product-informed collaborative thinking (not interrogation)
67
+ - CONTEXT.md captures: how it works, what's essential, decisions with inline reasoning
68
+ - CONTEXT.md committed and STATE.md Last Command updated
65
69
  - User knows next steps (research or plan the phase)
66
70
  </success_criteria>