mindsystem-cc 3.0.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 (139) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +501 -0
  3. package/agents/ms-codebase-mapper.md +739 -0
  4. package/agents/ms-debugger.md +1184 -0
  5. package/agents/ms-designer.md +414 -0
  6. package/agents/ms-executor.md +760 -0
  7. package/agents/ms-integration-checker.md +423 -0
  8. package/agents/ms-milestone-auditor.md +448 -0
  9. package/agents/ms-mock-generator.md +182 -0
  10. package/agents/ms-plan-checker.md +746 -0
  11. package/agents/ms-research-synthesizer.md +248 -0
  12. package/agents/ms-researcher.md +962 -0
  13. package/agents/ms-roadmapper.md +606 -0
  14. package/agents/ms-verifier.md +779 -0
  15. package/agents/ms-verify-fixer.md +124 -0
  16. package/bin/install.js +296 -0
  17. package/commands/ms/add-phase.md +207 -0
  18. package/commands/ms/add-todo.md +182 -0
  19. package/commands/ms/audit-milestone.md +318 -0
  20. package/commands/ms/check-phase.md +162 -0
  21. package/commands/ms/check-todos.md +217 -0
  22. package/commands/ms/complete-milestone.md +137 -0
  23. package/commands/ms/create-roadmap.md +273 -0
  24. package/commands/ms/debug.md +149 -0
  25. package/commands/ms/define-requirements.md +121 -0
  26. package/commands/ms/design-phase.md +341 -0
  27. package/commands/ms/discuss-milestone.md +48 -0
  28. package/commands/ms/discuss-phase.md +60 -0
  29. package/commands/ms/do-work.md +90 -0
  30. package/commands/ms/execute-phase.md +289 -0
  31. package/commands/ms/help.md +623 -0
  32. package/commands/ms/insert-phase.md +227 -0
  33. package/commands/ms/list-phase-assumptions.md +50 -0
  34. package/commands/ms/map-codebase.md +71 -0
  35. package/commands/ms/new-milestone.md +193 -0
  36. package/commands/ms/new-project.md +338 -0
  37. package/commands/ms/pause-work.md +123 -0
  38. package/commands/ms/plan-milestone-gaps.md +285 -0
  39. package/commands/ms/plan-phase.md +105 -0
  40. package/commands/ms/progress.md +370 -0
  41. package/commands/ms/remove-phase.md +338 -0
  42. package/commands/ms/research-phase.md +175 -0
  43. package/commands/ms/research-project.md +339 -0
  44. package/commands/ms/resume-work.md +40 -0
  45. package/commands/ms/review-design.md +484 -0
  46. package/commands/ms/simplify-flutter.md +193 -0
  47. package/commands/ms/update.md +159 -0
  48. package/commands/ms/verify-work.md +92 -0
  49. package/commands/ms/whats-new.md +124 -0
  50. package/mindsystem/references/checkpoints.md +788 -0
  51. package/mindsystem/references/continuation-format.md +255 -0
  52. package/mindsystem/references/debugging/debugging-mindset.md +11 -0
  53. package/mindsystem/references/debugging/hypothesis-testing.md +11 -0
  54. package/mindsystem/references/debugging/investigation-techniques.md +11 -0
  55. package/mindsystem/references/debugging/verification-patterns.md +11 -0
  56. package/mindsystem/references/debugging/when-to-research.md +11 -0
  57. package/mindsystem/references/git-integration.md +254 -0
  58. package/mindsystem/references/goal-backward.md +286 -0
  59. package/mindsystem/references/mock-patterns.md +294 -0
  60. package/mindsystem/references/plan-format.md +473 -0
  61. package/mindsystem/references/principles.md +73 -0
  62. package/mindsystem/references/questioning.md +140 -0
  63. package/mindsystem/references/research-pitfalls.md +233 -0
  64. package/mindsystem/references/scope-estimation.md +256 -0
  65. package/mindsystem/references/tdd.md +263 -0
  66. package/mindsystem/references/verification-patterns.md +595 -0
  67. package/mindsystem/templates/DEBUG.md +159 -0
  68. package/mindsystem/templates/UAT.md +403 -0
  69. package/mindsystem/templates/adhoc-summary.md +153 -0
  70. package/mindsystem/templates/codebase/architecture.md +255 -0
  71. package/mindsystem/templates/codebase/concerns.md +310 -0
  72. package/mindsystem/templates/codebase/conventions.md +307 -0
  73. package/mindsystem/templates/codebase/integrations.md +280 -0
  74. package/mindsystem/templates/codebase/stack.md +186 -0
  75. package/mindsystem/templates/codebase/structure.md +285 -0
  76. package/mindsystem/templates/codebase/testing.md +480 -0
  77. package/mindsystem/templates/config.json +26 -0
  78. package/mindsystem/templates/context.md +140 -0
  79. package/mindsystem/templates/continue-here.md +78 -0
  80. package/mindsystem/templates/debug-subagent-prompt.md +91 -0
  81. package/mindsystem/templates/design-iteration.md +208 -0
  82. package/mindsystem/templates/design.md +417 -0
  83. package/mindsystem/templates/discovery.md +146 -0
  84. package/mindsystem/templates/milestone-archive.md +123 -0
  85. package/mindsystem/templates/milestone-context.md +93 -0
  86. package/mindsystem/templates/milestone.md +115 -0
  87. package/mindsystem/templates/phase-prompt.md +574 -0
  88. package/mindsystem/templates/project.md +184 -0
  89. package/mindsystem/templates/requirements.md +231 -0
  90. package/mindsystem/templates/research-project/ARCHITECTURE.md +204 -0
  91. package/mindsystem/templates/research-project/FEATURES.md +147 -0
  92. package/mindsystem/templates/research-project/PITFALLS.md +200 -0
  93. package/mindsystem/templates/research-project/STACK.md +120 -0
  94. package/mindsystem/templates/research-project/SUMMARY.md +170 -0
  95. package/mindsystem/templates/research-subagent-prompt.md +92 -0
  96. package/mindsystem/templates/research.md +529 -0
  97. package/mindsystem/templates/roadmap.md +214 -0
  98. package/mindsystem/templates/state.md +224 -0
  99. package/mindsystem/templates/summary.md +269 -0
  100. package/mindsystem/templates/user-setup.md +323 -0
  101. package/mindsystem/templates/verification-report.md +322 -0
  102. package/mindsystem/workflows/complete-milestone.md +759 -0
  103. package/mindsystem/workflows/create-milestone.md +203 -0
  104. package/mindsystem/workflows/debug.md +14 -0
  105. package/mindsystem/workflows/define-requirements.md +330 -0
  106. package/mindsystem/workflows/diagnose-issues.md +241 -0
  107. package/mindsystem/workflows/discovery-phase.md +293 -0
  108. package/mindsystem/workflows/discuss-milestone.md +310 -0
  109. package/mindsystem/workflows/discuss-phase.md +237 -0
  110. package/mindsystem/workflows/do-work.md +359 -0
  111. package/mindsystem/workflows/execute-phase.md +644 -0
  112. package/mindsystem/workflows/execute-plan.md +1828 -0
  113. package/mindsystem/workflows/generate-mocks.md +187 -0
  114. package/mindsystem/workflows/list-phase-assumptions.md +178 -0
  115. package/mindsystem/workflows/map-codebase.md +289 -0
  116. package/mindsystem/workflows/plan-phase.md +876 -0
  117. package/mindsystem/workflows/research-phase.md +17 -0
  118. package/mindsystem/workflows/research-project.md +23 -0
  119. package/mindsystem/workflows/resume-project.md +311 -0
  120. package/mindsystem/workflows/transition.md +564 -0
  121. package/mindsystem/workflows/verify-phase.md +629 -0
  122. package/mindsystem/workflows/verify-work.md +823 -0
  123. package/package.json +32 -0
  124. package/scripts/generate-phase-patch.sh +169 -0
  125. package/scripts/ms-lookup/README.md +112 -0
  126. package/scripts/ms-lookup/ms_lookup/__init__.py +3 -0
  127. package/scripts/ms-lookup/ms_lookup/__main__.py +6 -0
  128. package/scripts/ms-lookup/ms_lookup/backends/__init__.py +6 -0
  129. package/scripts/ms-lookup/ms_lookup/backends/context7.py +219 -0
  130. package/scripts/ms-lookup/ms_lookup/backends/perplexity.py +145 -0
  131. package/scripts/ms-lookup/ms_lookup/cache.py +48 -0
  132. package/scripts/ms-lookup/ms_lookup/cli.py +219 -0
  133. package/scripts/ms-lookup/ms_lookup/config.py +23 -0
  134. package/scripts/ms-lookup/ms_lookup/errors.py +24 -0
  135. package/scripts/ms-lookup/ms_lookup/output.py +49 -0
  136. package/scripts/ms-lookup/ms_lookup/tokens.py +56 -0
  137. package/scripts/ms-lookup/pyproject.toml +17 -0
  138. package/scripts/ms-lookup/uv.lock +207 -0
  139. package/scripts/ms-lookup-wrapper.sh +21 -0
@@ -0,0 +1,149 @@
1
+ ---
2
+ name: ms:debug
3
+ description: Systematic debugging with persistent state across context resets
4
+ argument-hint: [issue description]
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Task
9
+ - AskUserQuestion
10
+ ---
11
+
12
+ <objective>
13
+ Debug issues using scientific method with subagent isolation.
14
+
15
+ **Orchestrator role:** Gather symptoms, spawn ms-debugger agent, handle checkpoints, spawn continuations.
16
+
17
+ **Why subagent:** Investigation burns context fast (reading files, forming hypotheses, testing). Fresh 200k context per investigation. Main context stays lean for user interaction.
18
+ </objective>
19
+
20
+ <context>
21
+ User's issue: $ARGUMENTS
22
+
23
+ Check for active sessions:
24
+ ```bash
25
+ ls .planning/debug/*.md 2>/dev/null | grep -v resolved | head -5
26
+ ```
27
+ </context>
28
+
29
+ <process>
30
+
31
+ ## 1. Check Active Sessions
32
+
33
+ If active sessions exist AND no $ARGUMENTS:
34
+ - List sessions with status, hypothesis, next action
35
+ - User picks number to resume OR describes new issue
36
+
37
+ If $ARGUMENTS provided OR user describes new issue:
38
+ - Continue to symptom gathering
39
+
40
+ ## 2. Gather Symptoms (if new issue)
41
+
42
+ Use AskUserQuestion for each:
43
+
44
+ 1. **Expected behavior** - What should happen?
45
+ 2. **Actual behavior** - What happens instead?
46
+ 3. **Error messages** - Any errors? (paste or describe)
47
+ 4. **Timeline** - When did this start? Ever worked?
48
+ 5. **Reproduction** - How do you trigger it?
49
+
50
+ After all gathered, confirm ready to investigate.
51
+
52
+ ## 3. Spawn ms-debugger Agent
53
+
54
+ Fill prompt and spawn:
55
+
56
+ ```markdown
57
+ <objective>
58
+ Investigate issue: {slug}
59
+
60
+ **Summary:** {trigger}
61
+ </objective>
62
+
63
+ <symptoms>
64
+ expected: {expected}
65
+ actual: {actual}
66
+ errors: {errors}
67
+ reproduction: {reproduction}
68
+ timeline: {timeline}
69
+ </symptoms>
70
+
71
+ <mode>
72
+ symptoms_prefilled: true
73
+ goal: find_and_fix
74
+ </mode>
75
+
76
+ <debug_file>
77
+ Create: .planning/debug/{slug}.md
78
+ </debug_file>
79
+ ```
80
+
81
+ ```
82
+ Task(
83
+ prompt=filled_prompt,
84
+ subagent_type="ms-debugger",
85
+ description="Debug {slug}"
86
+ )
87
+ ```
88
+
89
+ ## 4. Handle Agent Return
90
+
91
+ **If `## ROOT CAUSE FOUND`:**
92
+ - Display root cause and evidence summary
93
+ - Offer options:
94
+ - "Fix now" - spawn fix subagent
95
+ - "Plan fix" - suggest /ms:plan-phase --gaps
96
+ - "Manual fix" - done
97
+
98
+ **If `## CHECKPOINT REACHED`:**
99
+ - Present checkpoint details to user
100
+ - Get user response
101
+ - Spawn continuation agent (see step 5)
102
+
103
+ **If `## INVESTIGATION INCONCLUSIVE`:**
104
+ - Show what was checked and eliminated
105
+ - Offer options:
106
+ - "Continue investigating" - spawn new agent with additional context
107
+ - "Manual investigation" - done
108
+ - "Add more context" - gather more symptoms, spawn again
109
+
110
+ ## 5. Spawn Continuation Agent (After Checkpoint)
111
+
112
+ When user responds to checkpoint, spawn fresh agent:
113
+
114
+ ```markdown
115
+ <objective>
116
+ Continue debugging {slug}. Evidence is in the debug file.
117
+ </objective>
118
+
119
+ <prior_state>
120
+ Debug file: @.planning/debug/{slug}.md
121
+ </prior_state>
122
+
123
+ <checkpoint_response>
124
+ **Type:** {checkpoint_type}
125
+ **Response:** {user_response}
126
+ </checkpoint_response>
127
+
128
+ <mode>
129
+ goal: find_and_fix
130
+ </mode>
131
+ ```
132
+
133
+ ```
134
+ Task(
135
+ prompt=continuation_prompt,
136
+ subagent_type="ms-debugger",
137
+ description="Continue debug {slug}"
138
+ )
139
+ ```
140
+
141
+ </process>
142
+
143
+ <success_criteria>
144
+ - [ ] Active sessions checked
145
+ - [ ] Symptoms gathered (if new)
146
+ - [ ] ms-debugger spawned with context
147
+ - [ ] Checkpoints handled correctly
148
+ - [ ] Root cause confirmed before fixing
149
+ </success_criteria>
@@ -0,0 +1,121 @@
1
+ ---
2
+ name: ms:define-requirements
3
+ description: Define what "done" looks like with checkable requirements
4
+ allowed-tools:
5
+ - Read
6
+ - Write
7
+ - Bash
8
+ - Glob
9
+ - AskUserQuestion
10
+ ---
11
+
12
+ <objective>
13
+ Define concrete, checkable requirements for v1.
14
+
15
+ Two modes:
16
+ 1. **With research** — Transform FEATURES.md into scoped requirements
17
+ 2. **Without research** — Gather requirements through questioning
18
+
19
+ Run before `/ms:create-roadmap`.
20
+
21
+ Output: `.planning/REQUIREMENTS.md`
22
+ </objective>
23
+
24
+ <execution_context>
25
+ @~/.claude/mindsystem/references/principles.md
26
+ @~/.claude/mindsystem/workflows/define-requirements.md
27
+ @~/.claude/mindsystem/templates/requirements.md
28
+ </execution_context>
29
+
30
+ <context>
31
+ @.planning/PROJECT.md
32
+ @.planning/research/FEATURES.md (if exists)
33
+ @.planning/research/SUMMARY.md (if exists)
34
+ </context>
35
+
36
+ <process>
37
+
38
+ <step name="validate">
39
+ ```bash
40
+ # Verify project exists
41
+ [ -f .planning/PROJECT.md ] || { echo "ERROR: No PROJECT.md found. Run /ms:new-project first."; exit 1; }
42
+
43
+ # Check for research
44
+ [ -f .planning/research/FEATURES.md ] && echo "HAS_RESEARCH" || echo "NO_RESEARCH"
45
+
46
+ # Check if requirements already exist
47
+ [ -f .planning/REQUIREMENTS.md ] && echo "REQUIREMENTS_EXISTS" || echo "NO_REQUIREMENTS"
48
+ ```
49
+ </step>
50
+
51
+ <step name="check_existing">
52
+ **If REQUIREMENTS_EXISTS:**
53
+
54
+ Use AskUserQuestion:
55
+ - header: "Requirements exist"
56
+ - question: "Requirements already defined. What would you like to do?"
57
+ - options:
58
+ - "View existing" — Show current requirements
59
+ - "Replace" — Define requirements fresh (will overwrite)
60
+ - "Cancel" — Keep existing requirements
61
+
62
+ If "View existing": Read and display `.planning/REQUIREMENTS.md`, then exit
63
+ If "Cancel": Exit
64
+ If "Replace": Continue with workflow
65
+ </step>
66
+
67
+ <step name="execute">
68
+ **If HAS_RESEARCH:**
69
+ Follow the define-requirements.md workflow:
70
+ - Load research features from FEATURES.md
71
+ - Present features by category
72
+ - Ask user to scope each category (v1 / v2 / out of scope)
73
+ - Capture any additions research missed
74
+ - Generate REQUIREMENTS.md with checkable list
75
+
76
+ **If NO_RESEARCH:**
77
+ Gather requirements through questioning:
78
+ - Read PROJECT.md for core value and context
79
+ - Ask: "What are the main things users need to be able to do?"
80
+ - For each capability mentioned, probe for specifics
81
+ - Group into categories (Authentication, Content, etc.)
82
+ - For each category, ask what's v1 vs v2 vs out of scope
83
+ - Generate REQUIREMENTS.md with checkable list
84
+
85
+ Same output format either way — the difference is source (research vs conversation).
86
+ </step>
87
+
88
+ <step name="done">
89
+ ```
90
+ Requirements defined:
91
+
92
+ - Requirements: .planning/REQUIREMENTS.md
93
+ - v1 scope: [N] requirements across [M] categories
94
+ - v2 scope: [X] requirements deferred
95
+ - Out of scope: [Y] requirements excluded
96
+
97
+ ---
98
+
99
+ ## ▶ Next Up
100
+
101
+ **Create roadmap** — phases mapped to requirements
102
+
103
+ `/ms:create-roadmap`
104
+
105
+ <sub>`/clear` first → fresh context window</sub>
106
+
107
+ ---
108
+ ```
109
+ </step>
110
+
111
+ </process>
112
+
113
+ <success_criteria>
114
+ - [ ] PROJECT.md validated
115
+ - [ ] Features gathered (from research OR questioning)
116
+ - [ ] User scoped each category (v1/v2/out of scope)
117
+ - [ ] User had opportunity to add missing requirements
118
+ - [ ] REQUIREMENTS.md created with checkable list
119
+ - [ ] Requirements committed to git
120
+ - [ ] User knows next step (create-roadmap)
121
+ </success_criteria>
@@ -0,0 +1,341 @@
1
+ ---
2
+ name: ms:design-phase
3
+ description: Create visual/UX design specifications before planning
4
+ argument-hint: "[phase]"
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Task
9
+ - AskUserQuestion
10
+ ---
11
+
12
+ <objective>
13
+ Create design specifications for a phase. Spawns ms-designer agent with phase context.
14
+
15
+ **Orchestrator role:** Parse phase, validate against roadmap, check existing design, gather context chain (CONTEXT.md → implement-ui → codebase), adaptive Q&A if gaps, spawn designer agent, enable conversational refinement.
16
+
17
+ **Why subagent:** Design requires focused attention with quality-forcing patterns. Fresh 200k context for design generation. Main context reserved for user refinement conversation.
18
+
19
+ **When to use:**
20
+ - UI-heavy phases with significant new interface work
21
+ - Novel flows/components not deducible from existing patterns
22
+ - Features requiring careful UX consideration
23
+ - Cross-platform work needing coordinated design
24
+
25
+ **Not needed for:**
26
+ - Backend-only phases
27
+ - Minor UI tweaks using existing patterns
28
+ - Phases where established patterns suffice
29
+ </objective>
30
+
31
+ <context>
32
+ Phase number: $ARGUMENTS (required)
33
+
34
+ Check for existing design:
35
+ ```bash
36
+ ls .planning/phases/${PHASE}-*/*DESIGN.md 2>/dev/null
37
+ ```
38
+ </context>
39
+
40
+ <process>
41
+
42
+ ## 1. Parse and Validate Phase
43
+
44
+ ```bash
45
+ # Extract phase number from arguments
46
+ PHASE_ARG="$ARGUMENTS"
47
+
48
+ # Validate phase exists in roadmap
49
+ grep -A5 "Phase ${PHASE_ARG}:" .planning/ROADMAP.md 2>/dev/null
50
+ ```
51
+
52
+ **If not found:** Error and exit with message: "Phase ${PHASE_ARG} not found in ROADMAP.md"
53
+
54
+ **If found:** Extract phase number, name, description. Store for later use.
55
+
56
+ ## 2. Check Existing Design
57
+
58
+ ```bash
59
+ # Check for existing DESIGN.md
60
+ PHASE_DIR=$(ls -d .planning/phases/${PHASE_ARG}-* 2>/dev/null | head -1)
61
+ ls "${PHASE_DIR}"/*-DESIGN.md 2>/dev/null
62
+ ```
63
+
64
+ **If exists:** Use AskUserQuestion to offer:
65
+ 1. **Update design** — Spawn designer with existing design as context
66
+ 2. **View existing** — Display current DESIGN.md
67
+ 3. **Skip** — Proceed to research/planning without changes
68
+
69
+ Wait for response and act accordingly.
70
+
71
+ **If doesn't exist:** Continue to gather context.
72
+
73
+ ## 3. Gather Context Chain
74
+
75
+ Load context in order of priority:
76
+
77
+ **3a. Mandatory context:**
78
+
79
+ ```bash
80
+ # Load PROJECT.md for product context
81
+ cat .planning/PROJECT.md 2>/dev/null
82
+
83
+ # Load ROADMAP.md for phase requirements
84
+ grep -A30 "Phase ${PHASE_ARG}:" .planning/ROADMAP.md 2>/dev/null
85
+ ```
86
+
87
+ Extract from PROJECT.md:
88
+ - What This Is (product type)
89
+ - Core Value (design must serve this)
90
+ - Context (target audience)
91
+ - Constraints (platform, technical limits)
92
+
93
+ Extract from ROADMAP.md:
94
+ - Phase goal
95
+ - Success criteria
96
+ - Requirements mapped
97
+
98
+ **3b. Optional context - CONTEXT.md (from discuss-phase):**
99
+
100
+ ```bash
101
+ cat .planning/phases/${PHASE_ARG}-*/${PHASE_ARG}-CONTEXT.md 2>/dev/null
102
+ ```
103
+
104
+ If exists, extract:
105
+ - How This Should Work (vision)
106
+ - What Must Be Nailed (essentials)
107
+ - Specific Ideas (references to products)
108
+
109
+ **3c. Optional context - implement-ui skill:**
110
+
111
+ ```bash
112
+ # Check for implement-ui skill
113
+ ls .claude/skills/*implement-ui* 2>/dev/null
114
+ ```
115
+
116
+ If exists, load it as the authoritative source of existing patterns.
117
+
118
+ **3d. Optional context - codebase analysis:**
119
+
120
+ ```bash
121
+ # Platform detection
122
+ if [ -f "package.json" ]; then
123
+ echo "Platform: Web (package.json found)"
124
+ grep -E "react|vue|angular|svelte" package.json 2>/dev/null | head -5
125
+ fi
126
+
127
+ if [ -f "pubspec.yaml" ]; then
128
+ echo "Platform: Flutter (pubspec.yaml found)"
129
+ fi
130
+
131
+ # Find existing component/theme files
132
+ find src -name "*.tsx" -o -name "*.dart" 2>/dev/null | head -20
133
+ grep -r "colors\|theme\|spacing" src/ --include="*.ts" --include="*.dart" 2>/dev/null | head -10
134
+ ```
135
+
136
+ Document discovered patterns for the designer.
137
+
138
+ ## 4. Adaptive Q&A (If Gaps Exist)
139
+
140
+ Assess context coverage:
141
+ - Can platform be inferred? (from codebase or PROJECT.md)
142
+ - Can visual style be inferred? (from implement-ui or codebase)
143
+ - Can design priorities be inferred? (from CONTEXT.md or phase requirements)
144
+
145
+ **If everything can be inferred:** Skip to step 5.
146
+
147
+ **If gaps exist:** Use AskUserQuestion with targeted questions.
148
+
149
+ Most valuable question (if reference products not in CONTEXT.md):
150
+ > "Are there apps or sites whose design you'd like this to feel like?"
151
+
152
+ Other potential questions (only if genuine gaps):
153
+ - Visual direction (if no existing aesthetic)
154
+ - Density preference (if not inferrable)
155
+ - Platform priority (if multi-platform)
156
+
157
+ **Decision gate after Q&A:**
158
+ Use AskUserQuestion to confirm:
159
+ 1. **Create DESIGN.md** — Proceed to spawn designer
160
+ 2. **Ask more questions** — Continue gathering context
161
+ 3. **Add context** — Let user provide additional information
162
+
163
+ ## 5. Spawn ms-designer Agent
164
+
165
+ Assemble the design prompt from gathered context:
166
+
167
+ ```markdown
168
+ <design_context>
169
+ Product: [From PROJECT.md - What This Is]
170
+ Platform: [Inferred from codebase or PROJECT.md constraints]
171
+ Phase: [N]: [Phase name from ROADMAP.md]
172
+
173
+ Target audience:
174
+ [From PROJECT.md - Context section]
175
+
176
+ Core value this design must serve:
177
+ [From PROJECT.md - Core Value section]
178
+
179
+ Technical constraints:
180
+ [From PROJECT.md - Constraints section]
181
+ </design_context>
182
+
183
+ <phase_requirements>
184
+ Goal: [From ROADMAP.md phase entry]
185
+
186
+ Success criteria:
187
+ [From ROADMAP.md - what this phase must achieve]
188
+
189
+ Requirements mapped:
190
+ [From ROADMAP.md - specific features/behaviors]
191
+ </phase_requirements>
192
+
193
+ <user_vision>
194
+ [If CONTEXT.md exists:]
195
+
196
+ How this should work:
197
+ [From CONTEXT.md - How This Should Work section]
198
+
199
+ What must be nailed:
200
+ [From CONTEXT.md - What Must Be Nailed section]
201
+
202
+ Reference products:
203
+ [From CONTEXT.md - Specific Ideas section, or from Q&A]
204
+
205
+ [If CONTEXT.md doesn't exist:]
206
+
207
+ Vision inferred from phase requirements and PROJECT.md context.
208
+ Reference products: [From Q&A if asked, or "None specified"]
209
+ </user_vision>
210
+
211
+ <existing_aesthetic>
212
+ [If implement-ui skill exists:]
213
+
214
+ Authoritative patterns from implement-ui skill:
215
+ - Color palette: [exact values]
216
+ - Typography: [font families, sizes]
217
+ - Spacing system: [scale values]
218
+ - Component library: [named components]
219
+
220
+ [If no skill, from codebase analysis:]
221
+
222
+ Discovered patterns from codebase:
223
+ - Colors found: [hex values from theme/styles]
224
+ - Components found: [existing component names]
225
+ - Layout patterns: [grid systems, spacing used]
226
+
227
+ [If greenfield:]
228
+
229
+ No existing aesthetic. Design fresh with platform conventions.
230
+ </existing_aesthetic>
231
+
232
+ <quality_expectation>
233
+ Commercial benchmark: This design must look like a [benchmark] with intentional decisions, not defaults.
234
+
235
+ Pre-emptive criticism: Assume the user will say "This looks like generic AI output." Generate something that proves them wrong.
236
+
237
+ Accountability check: Could you show this design to a professional UI designer and claim it as skilled work? If not, it's not done.
238
+ </quality_expectation>
239
+
240
+ <output_specification>
241
+ Generate: DESIGN.md following template structure
242
+
243
+ Location: .planning/phases/{phase}-{slug}/{phase}-DESIGN.md
244
+
245
+ Required sections:
246
+ 1. Visual Identity (philosophy, direction, inspiration)
247
+ 2. Screen Layouts (ASCII wireframes with dimensions)
248
+ 3. Component Specifications (visual, states, content)
249
+ 4. UX Flows (entry, steps, decisions, completion, errors)
250
+ 5. Design System Decisions (colors, typography, spacing with rationale)
251
+ 6. Platform-Specific Notes (responsive, touch targets, accessibility)
252
+ 7. Verification Criteria (observable behaviors proving correct implementation)
253
+ </output_specification>
254
+ ```
255
+
256
+ Spawn the agent:
257
+
258
+ ```
259
+ Task(
260
+ prompt=assembled_design_prompt,
261
+ subagent_type="ms-designer",
262
+ description="Design Phase {phase}"
263
+ )
264
+ ```
265
+
266
+ ## 6. Handle Agent Return
267
+
268
+ **`## DESIGN COMPLETE`:**
269
+
270
+ Commit the design file:
271
+
272
+ ```bash
273
+ git add .planning/phases/${PHASE_ARG}-*/*-DESIGN.md
274
+ git commit -m "docs: create design for phase ${PHASE_ARG}"
275
+ ```
276
+
277
+ Display summary from agent response:
278
+ - Platform designed for
279
+ - Aesthetic source used
280
+ - Screens designed
281
+ - Key design decisions
282
+
283
+ Then offer next steps:
284
+ 1. **Proceed to research** — `/ms:research-phase {phase}`
285
+ 2. **Refine design** — Discuss changes conversationally
286
+ 3. **View full design** — Display DESIGN.md
287
+ 4. **Done for now** — Exit
288
+
289
+ **`## DESIGN NEEDS CLARIFICATION`:**
290
+
291
+ Present the question to user. Get response. Spawn continuation with the clarification.
292
+
293
+ ## 7. Conversational Refinement
294
+
295
+ After initial generation, if user wants to refine:
296
+
297
+ - Read DESIGN.md directly
298
+ - Discuss changes conversationally
299
+ - Edit DESIGN.md directly (no subagent needed for small changes)
300
+ - For major redesign, spawn ms-designer again with structured feedback
301
+
302
+ **Refinement principles:**
303
+ - Direct edits — Edit DESIGN.md directly, don't regenerate
304
+ - Preserve decisions — Changes are incremental, not wholesale replacement
305
+ - User controls pace — User decides when design is "done"
306
+
307
+ **For major redesigns (multiple aspects changing):**
308
+
309
+ Use the iteration template from `~/.claude/mindsystem/templates/design-iteration.md`:
310
+
311
+ 1. Capture feedback using the structured format:
312
+ - What worked well (KEEP)
313
+ - What needs improvement (FIX)
314
+ - New requirements (ADD)
315
+ - Primary focus for this iteration
316
+
317
+ 2. Spawn ms-designer with iteration context:
318
+ - Include `<previous_design>` with relevant sections
319
+ - Include `<feedback_on_previous>` with structured feedback
320
+ - Include `<specific_focus>` identifying the ONE thing
321
+ - Include `<constraints>` noting what must NOT change
322
+
323
+ 3. After iteration completes:
324
+ - Verify "what worked well" was preserved
325
+ - Verify "what needs improvement" was addressed
326
+ - Update design version in DESIGN.md frontmatter
327
+
328
+ </process>
329
+
330
+ <success_criteria>
331
+ - [ ] Phase validated against roadmap
332
+ - [ ] Existing design checked and handled appropriately
333
+ - [ ] Context chain loaded (PROJECT.md, ROADMAP.md, CONTEXT.md if exists)
334
+ - [ ] implement-ui skill loaded if exists
335
+ - [ ] Codebase analyzed for existing patterns
336
+ - [ ] Adaptive Q&A completed if gaps existed
337
+ - [ ] ms-designer spawned with quality-forcing patterns
338
+ - [ ] DESIGN.md created with all 7 sections
339
+ - [ ] DESIGN.md committed
340
+ - [ ] User informed of refinement options and next steps
341
+ </success_criteria>
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: ms:discuss-milestone
3
+ description: Gather context for next milestone through adaptive questioning
4
+ ---
5
+
6
+ <objective>
7
+ Help you figure out what to build in the next milestone through collaborative thinking.
8
+
9
+ Purpose: After completing a milestone, explore what features you want to add, improve, or fix. Features first — scope and phases derive from what you want to build.
10
+ Output: Context gathered, then routes to /ms:new-milestone
11
+ </objective>
12
+
13
+ <execution_context>
14
+ @~/.claude/mindsystem/references/principles.md
15
+ @~/.claude/mindsystem/workflows/discuss-milestone.md
16
+ </execution_context>
17
+
18
+ <context>
19
+ **Load project state first:**
20
+ @.planning/STATE.md
21
+
22
+ **Load project:**
23
+ @.planning/PROJECT.md
24
+
25
+ **Load milestones (if exists):**
26
+ @.planning/MILESTONES.md
27
+ </context>
28
+
29
+ <process>
30
+ 1. Verify previous milestone complete (or acknowledge active milestone)
31
+ 2. Present context from previous milestone (accomplishments, phase count)
32
+ 3. Follow discuss-milestone.md workflow with **ALL questions using AskUserQuestion**:
33
+ - Use AskUserQuestion: "What do you want to add, improve, or fix?" with feature categories
34
+ - Use AskUserQuestion to dig into features they mention
35
+ - Use AskUserQuestion to help them articulate what matters most
36
+ - Use AskUserQuestion for decision gate (ready / ask more / let me add context)
37
+ 4. Hand off to /ms:new-milestone with gathered context
38
+
39
+ **CRITICAL: ALL questions use AskUserQuestion. Never ask inline text questions.**
40
+ </process>
41
+
42
+ <success_criteria>
43
+
44
+ - Project state loaded and presented
45
+ - Previous milestone context summarized
46
+ - Milestone scope gathered through adaptive questioning
47
+ - Context handed off to /ms:new-milestone
48
+ </success_criteria>