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,182 @@
1
+ ---
2
+ name: ms:add-todo
3
+ description: Capture idea or task as todo from current conversation context
4
+ argument-hint: [optional description]
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Bash
9
+ - Glob
10
+ ---
11
+
12
+ <objective>
13
+ Capture an idea, task, or issue that surfaces during a Mindsystem session as a structured todo for later work.
14
+
15
+ Enables "thought → capture → continue" flow without losing context or derailing current work.
16
+ </objective>
17
+
18
+ <context>
19
+ @.planning/STATE.md
20
+ </context>
21
+
22
+ <process>
23
+
24
+ <step name="ensure_directory">
25
+ ```bash
26
+ mkdir -p .planning/todos/pending .planning/todos/done
27
+ ```
28
+ </step>
29
+
30
+ <step name="check_existing_areas">
31
+ ```bash
32
+ ls .planning/todos/pending/*.md 2>/dev/null | xargs -I {} grep "^area:" {} 2>/dev/null | cut -d' ' -f2 | sort -u
33
+ ```
34
+
35
+ Note existing areas for consistency in infer_area step.
36
+ </step>
37
+
38
+ <step name="extract_content">
39
+ **With arguments:** Use as the title/focus.
40
+ - `/ms:add-todo Add auth token refresh` → title = "Add auth token refresh"
41
+
42
+ **Without arguments:** Analyze recent conversation to extract:
43
+ - The specific problem, idea, or task discussed
44
+ - Relevant file paths mentioned
45
+ - Technical details (error messages, line numbers, constraints)
46
+
47
+ Formulate:
48
+ - `title`: 3-10 word descriptive title (action verb preferred)
49
+ - `problem`: What's wrong or why this is needed
50
+ - `solution`: Approach hints or "TBD" if just an idea
51
+ - `files`: Relevant paths with line numbers from conversation
52
+ </step>
53
+
54
+ <step name="infer_area">
55
+ Infer area from file paths:
56
+
57
+ | Path pattern | Area |
58
+ |--------------|------|
59
+ | `src/api/*`, `api/*` | `api` |
60
+ | `src/components/*`, `src/ui/*` | `ui` |
61
+ | `src/auth/*`, `auth/*` | `auth` |
62
+ | `src/db/*`, `database/*` | `database` |
63
+ | `tests/*`, `__tests__/*` | `testing` |
64
+ | `docs/*` | `docs` |
65
+ | `.planning/*` | `planning` |
66
+ | `scripts/*`, `bin/*` | `tooling` |
67
+ | No files or unclear | `general` |
68
+
69
+ Use existing area from step 2 if similar match exists.
70
+ </step>
71
+
72
+ <step name="check_duplicates">
73
+ ```bash
74
+ grep -l -i "[key words from title]" .planning/todos/pending/*.md 2>/dev/null
75
+ ```
76
+
77
+ If potential duplicate found:
78
+ 1. Read the existing todo
79
+ 2. Compare scope
80
+
81
+ If overlapping, use AskUserQuestion:
82
+ - header: "Duplicate?"
83
+ - question: "Similar todo exists: [title]. What would you like to do?"
84
+ - options:
85
+ - "Skip" — keep existing todo
86
+ - "Replace" — update existing with new context
87
+ - "Add anyway" — create as separate todo
88
+ </step>
89
+
90
+ <step name="create_file">
91
+ ```bash
92
+ timestamp=$(date "+%Y-%m-%dT%H:%M")
93
+ date_prefix=$(date "+%Y-%m-%d")
94
+ ```
95
+
96
+ Generate slug from title (lowercase, hyphens, no special chars).
97
+
98
+ Write to `.planning/todos/pending/${date_prefix}-${slug}.md`:
99
+
100
+ ```markdown
101
+ ---
102
+ created: [timestamp]
103
+ title: [title]
104
+ area: [area]
105
+ files:
106
+ - [file:lines]
107
+ ---
108
+
109
+ ## Problem
110
+
111
+ [problem description - enough context for future Claude to understand weeks later]
112
+
113
+ ## Solution
114
+
115
+ [approach hints or "TBD"]
116
+ ```
117
+ </step>
118
+
119
+ <step name="update_state">
120
+ If `.planning/STATE.md` exists:
121
+
122
+ 1. Count todos: `ls .planning/todos/pending/*.md 2>/dev/null | wc -l`
123
+ 2. Update "### Pending Todos" under "## Accumulated Context"
124
+ </step>
125
+
126
+ <step name="git_commit">
127
+ Commit the todo and any updated state:
128
+
129
+ ```bash
130
+ git add .planning/todos/pending/[filename]
131
+ [ -f .planning/STATE.md ] && git add .planning/STATE.md
132
+ git commit -m "$(cat <<'EOF'
133
+ docs: capture todo - [title]
134
+
135
+ Area: [area]
136
+ EOF
137
+ )"
138
+ ```
139
+
140
+ Confirm: "Committed: docs: capture todo - [title]"
141
+ </step>
142
+
143
+ <step name="confirm">
144
+ ```
145
+ Todo saved: .planning/todos/pending/[filename]
146
+
147
+ [title]
148
+ Area: [area]
149
+ Files: [count] referenced
150
+
151
+ ---
152
+
153
+ Would you like to:
154
+
155
+ 1. Continue with current work
156
+ 2. Add another todo
157
+ 3. View all todos (/ms:check-todos)
158
+ ```
159
+ </step>
160
+
161
+ </process>
162
+
163
+ <output>
164
+ - `.planning/todos/pending/[date]-[slug].md`
165
+ - Updated `.planning/STATE.md` (if exists)
166
+ </output>
167
+
168
+ <anti_patterns>
169
+ - Don't create todos for work in current plan (that's deviation rule territory)
170
+ - Don't create elaborate solution sections — captures ideas, not plans
171
+ - Don't block on missing information — "TBD" is fine
172
+ </anti_patterns>
173
+
174
+ <success_criteria>
175
+ - [ ] Directory structure exists
176
+ - [ ] Todo file created with valid frontmatter
177
+ - [ ] Problem section has enough context for future Claude
178
+ - [ ] No duplicates (checked and resolved)
179
+ - [ ] Area consistent with existing todos
180
+ - [ ] STATE.md updated if exists
181
+ - [ ] Todo and state committed to git
182
+ </success_criteria>
@@ -0,0 +1,318 @@
1
+ ---
2
+ name: ms:audit-milestone
3
+ description: Audit milestone completion against original intent before archiving
4
+ argument-hint: "[version]"
5
+ allowed-tools:
6
+ - Read
7
+ - Glob
8
+ - Grep
9
+ - Bash
10
+ - Task
11
+ - Write
12
+ ---
13
+
14
+ <objective>
15
+ Verify milestone achieved its definition of done. Check requirements coverage, cross-phase integration, and end-to-end flows.
16
+
17
+ **This command IS the orchestrator.** Reads existing VERIFICATION.md files (phases already verified during execute-phase), aggregates tech debt and deferred gaps, then spawns integration checker for cross-phase wiring.
18
+ </objective>
19
+
20
+ <execution_context>
21
+ @~/.claude/mindsystem/references/principles.md
22
+ </execution_context>
23
+
24
+ <context>
25
+ Version: $ARGUMENTS (optional — defaults to current milestone)
26
+
27
+ **Original Intent:**
28
+ @.planning/PROJECT.md
29
+ @.planning/REQUIREMENTS.md
30
+
31
+ **Planned Work:**
32
+ @.planning/ROADMAP.md
33
+ @.planning/config.json (if exists)
34
+
35
+ **Completed Work:**
36
+ Glob: .planning/phases/*/*-SUMMARY.md
37
+ Glob: .planning/phases/*/*-VERIFICATION.md
38
+ </context>
39
+
40
+ <process>
41
+
42
+ ## 1. Determine Milestone Scope
43
+
44
+ ```bash
45
+ # Get phases in milestone
46
+ ls -d .planning/phases/*/ | sort -V
47
+ ```
48
+
49
+ - Parse version from arguments or detect current from ROADMAP.md
50
+ - Identify all phase directories in scope
51
+ - Extract milestone definition of done from ROADMAP.md
52
+ - Extract requirements mapped to this milestone from REQUIREMENTS.md
53
+
54
+ ## 2. Read All Phase Verifications
55
+
56
+ For each phase directory, read the VERIFICATION.md:
57
+
58
+ ```bash
59
+ cat .planning/phases/01-*/*-VERIFICATION.md
60
+ cat .planning/phases/02-*/*-VERIFICATION.md
61
+ # etc.
62
+ ```
63
+
64
+ From each VERIFICATION.md, extract:
65
+ - **Status:** passed | gaps_found
66
+ - **Critical gaps:** (if any — these are blockers)
67
+ - **Non-critical gaps:** tech debt, deferred items, warnings
68
+ - **Anti-patterns found:** TODOs, stubs, placeholders
69
+ - **Requirements coverage:** which requirements satisfied/blocked
70
+
71
+ If a phase is missing VERIFICATION.md, flag it as "unverified phase" — this is a blocker.
72
+
73
+ ## 2.5. Read UAT Files and Aggregate Assumptions
74
+
75
+ ```bash
76
+ # Find all UAT files
77
+ find .planning/phases -name "*-UAT.md" -type f 2>/dev/null
78
+ ```
79
+
80
+ For each UAT file, extract:
81
+ - **Assumptions section:** Tests skipped because required state couldn't be mocked
82
+
83
+ Aggregate assumptions by phase:
84
+ ```yaml
85
+ assumptions:
86
+ count: [N]
87
+ by_phase:
88
+ - phase: 04-comments
89
+ items:
90
+ - name: "Error state display"
91
+ expected: "Shows error message when API fails"
92
+ reason: "Can't mock API error responses"
93
+ - phase: 05-auth
94
+ items:
95
+ - name: "Session timeout"
96
+ expected: "User redirected to login after 30min"
97
+ reason: "Can't manipulate time in tests"
98
+ ```
99
+
100
+ ## 3. Spawn Integration Checker
101
+
102
+ With phase context collected:
103
+
104
+ ```
105
+ Task(
106
+ prompt="Check cross-phase integration and E2E flows.
107
+
108
+ Phases: {phase_dirs}
109
+ Phase exports: {from SUMMARYs}
110
+ API routes: {routes created}
111
+
112
+ Verify cross-phase wiring and E2E user flows.",
113
+ subagent_type="ms-integration-checker"
114
+ )
115
+ ```
116
+
117
+ ## 4. Collect Results
118
+
119
+ Combine:
120
+ - Phase-level gaps and tech debt (from step 2)
121
+ - Integration checker's report (wiring gaps, broken flows)
122
+
123
+ ## 5. Check Requirements Coverage
124
+
125
+ For each requirement in REQUIREMENTS.md mapped to this milestone:
126
+ - Find owning phase
127
+ - Check phase verification status
128
+ - Determine: satisfied | partial | unsatisfied
129
+
130
+ ## 6. Aggregate into v{version}-MILESTONE-AUDIT.md
131
+
132
+ Create `.planning/v{version}-v{version}-MILESTONE-AUDIT.md` with:
133
+
134
+ ```yaml
135
+ ---
136
+ milestone: {version}
137
+ audited: {timestamp}
138
+ status: passed | gaps_found | tech_debt
139
+ scores:
140
+ requirements: N/M
141
+ phases: N/M
142
+ integration: N/M
143
+ flows: N/M
144
+ gaps: # Critical blockers
145
+ requirements: [...]
146
+ integration: [...]
147
+ flows: [...]
148
+ tech_debt: # Non-critical, deferred
149
+ - phase: 01-auth
150
+ items:
151
+ - "TODO: add rate limiting"
152
+ - "Warning: no password strength validation"
153
+ - phase: 03-dashboard
154
+ items:
155
+ - "Deferred: mobile responsive layout"
156
+ assumptions: # Tests skipped during UAT
157
+ count: [N]
158
+ by_phase:
159
+ - phase: 04-comments
160
+ items:
161
+ - name: "Error state display"
162
+ expected: "Shows error message when API fails"
163
+ ---
164
+ ```
165
+
166
+ Plus full markdown report with tables for requirements, phases, integration, tech debt, and assumptions.
167
+
168
+ **Assumptions section in markdown report:**
169
+
170
+ ```markdown
171
+ ## Untested Assumptions
172
+
173
+ {N} tests were skipped because required states couldn't be mocked:
174
+
175
+ | Phase | Test | Expected Behavior | Reason |
176
+ |-------|------|-------------------|--------|
177
+ | 04-comments | Error state display | Shows error message when API fails | Can't mock API errors |
178
+ | 04-comments | Empty state | Shows placeholder when no comments | Can't clear test data |
179
+ | 05-auth | Session timeout | Redirects to login after 30min | Can't manipulate time |
180
+
181
+ **Consider:** Plan test infrastructure work in next milestone to verify these assumptions.
182
+ ```
183
+
184
+ **Status values:**
185
+ - `passed` — all requirements met, no critical gaps, minimal tech debt
186
+ - `gaps_found` — critical blockers exist
187
+ - `tech_debt` — no blockers but accumulated deferred items need review
188
+
189
+ ## 7. Present Results
190
+
191
+ Route by status (see `<offer_next>`).
192
+
193
+ </process>
194
+
195
+ <offer_next>
196
+ **If passed:**
197
+
198
+ ```markdown
199
+ ## ✓ Milestone {version} — Audit Passed
200
+
201
+ **Score:** {N}/{M} requirements satisfied
202
+ **Report:** .planning/v{version}-MILESTONE-AUDIT.md
203
+
204
+ All requirements covered. Cross-phase integration verified. E2E flows complete.
205
+
206
+ [If assumptions > 0:]
207
+ ### Untested Assumptions: {N} items
208
+
209
+ These tests were skipped because required states couldn't be mocked.
210
+ See full list in MILESTONE-AUDIT.md. Consider addressing in next milestone.
211
+
212
+ ---
213
+
214
+ ## ▶ Next Up
215
+
216
+ **Complete milestone** — archive and tag
217
+
218
+ `/ms:complete-milestone {version}`
219
+
220
+ <sub>`/clear` first → fresh context window</sub>
221
+ ```
222
+
223
+ ---
224
+
225
+ **If gaps_found:**
226
+
227
+ ```markdown
228
+ ## ⚠ Milestone {version} — Gaps Found
229
+
230
+ **Score:** {N}/{M} requirements satisfied
231
+ **Report:** .planning/v{version}-MILESTONE-AUDIT.md
232
+
233
+ ### Unsatisfied Requirements
234
+
235
+ {For each unsatisfied requirement:}
236
+ - **{REQ-ID}: {description}** (Phase {X})
237
+ - {reason}
238
+
239
+ ### Cross-Phase Issues
240
+
241
+ {For each integration gap:}
242
+ - **{from} → {to}:** {issue}
243
+
244
+ ### Broken Flows
245
+
246
+ {For each flow gap:}
247
+ - **{flow name}:** breaks at {step}
248
+
249
+ ---
250
+
251
+ ## ▶ Next Up
252
+
253
+ **Plan gap closure** — create phases to complete milestone
254
+
255
+ `/ms:plan-milestone-gaps`
256
+
257
+ <sub>`/clear` first → fresh context window</sub>
258
+
259
+ ---
260
+
261
+ **Also available:**
262
+ - `cat .planning/v{version}-MILESTONE-AUDIT.md` — see full report
263
+ - `/ms:complete-milestone {version}` — proceed anyway (accept tech debt)
264
+ ```
265
+
266
+ ---
267
+
268
+ **If tech_debt (no blockers but accumulated debt):**
269
+
270
+ ```markdown
271
+ ## ⚡ Milestone {version} — Tech Debt Review
272
+
273
+ **Score:** {N}/{M} requirements satisfied
274
+ **Report:** .planning/v{version}-MILESTONE-AUDIT.md
275
+
276
+ All requirements met. No critical blockers. Accumulated tech debt needs review.
277
+
278
+ ### Tech Debt by Phase
279
+
280
+ {For each phase with debt:}
281
+ **Phase {X}: {name}**
282
+ - {item 1}
283
+ - {item 2}
284
+
285
+ ### Total: {N} items across {M} phases
286
+
287
+ [If assumptions > 0:]
288
+ ### Untested Assumptions: {N} items
289
+
290
+ These tests were skipped because required states couldn't be mocked.
291
+ See full list in MILESTONE-AUDIT.md. Consider addressing in next milestone.
292
+
293
+ ---
294
+
295
+ ## ▶ Options
296
+
297
+ **A. Complete milestone** — accept debt, track in backlog
298
+
299
+ `/ms:complete-milestone {version}`
300
+
301
+ **B. Plan cleanup phase** — address debt before completing
302
+
303
+ `/ms:plan-milestone-gaps`
304
+
305
+ <sub>`/clear` first → fresh context window</sub>
306
+ ```
307
+ </offer_next>
308
+
309
+ <success_criteria>
310
+ - [ ] Milestone scope identified
311
+ - [ ] All phase VERIFICATION.md files read
312
+ - [ ] All phase UAT.md files read for assumptions
313
+ - [ ] Tech debt and deferred gaps aggregated
314
+ - [ ] Assumptions aggregated by phase
315
+ - [ ] Integration checker spawned for cross-phase wiring
316
+ - [ ] v{version}-MILESTONE-AUDIT.md created with assumptions section
317
+ - [ ] Results presented with actionable next steps
318
+ </success_criteria>
@@ -0,0 +1,162 @@
1
+ ---
2
+ name: ms:check-phase
3
+ description: Verify phase plans before execution (optional quality gate)
4
+ arguments: phase
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Glob
9
+ - Grep
10
+ - Task
11
+ ---
12
+
13
+ <purpose>
14
+ On-demand plan verification. Use when a plan seems large or complex and you want a structured review before executing.
15
+
16
+ This spawns ms-plan-checker to analyze your PLAN.md files against the phase goal.
17
+ </purpose>
18
+
19
+ <what_it_checks>
20
+ 1. **Requirement Coverage** — Does every phase requirement have tasks addressing it?
21
+ 2. **Task Completeness** — Does every task have files, action, verify, done?
22
+ 3. **Dependency Correctness** — Are plan dependencies valid and acyclic?
23
+ 4. **Key Links Planned** — Are artifacts wired together, not just created in isolation?
24
+ 5. **Scope Sanity** — Will plans complete within context budget (2-3 tasks per plan)?
25
+ 6. **Verification Derivation** — Are must_haves user-observable, not implementation-focused?
26
+ </what_it_checks>
27
+
28
+ <process>
29
+
30
+ <step name="validate_phase">
31
+ Phase number from $ARGUMENTS (required).
32
+
33
+ ```bash
34
+ PHASE=$ARGUMENTS
35
+ PADDED=$(printf "%02d" $PHASE 2>/dev/null || echo "$PHASE")
36
+ PHASE_DIR=$(ls -d .planning/phases/${PADDED}-* .planning/phases/${PHASE}-* 2>/dev/null | head -1)
37
+
38
+ if [ -z "$PHASE_DIR" ]; then
39
+ echo "Error: Phase $PHASE not found in .planning/phases/"
40
+ exit 1
41
+ fi
42
+
43
+ echo "Phase directory: $PHASE_DIR"
44
+ ls "$PHASE_DIR"/*-PLAN.md 2>/dev/null
45
+ ```
46
+
47
+ If no PLAN.md files found, remind user to run `/ms:plan-phase` first.
48
+ </step>
49
+
50
+ <step name="load_context">
51
+ Read the phase goal from ROADMAP.md:
52
+
53
+ ```bash
54
+ grep -A 15 "Phase ${PHASE}:" .planning/ROADMAP.md | head -20
55
+ ```
56
+
57
+ Count plans and tasks:
58
+
59
+ ```bash
60
+ for plan in "$PHASE_DIR"/*-PLAN.md; do
61
+ echo "=== $(basename $plan) ==="
62
+ grep -c "<task" "$plan" 2>/dev/null || echo "0 tasks"
63
+ done
64
+ ```
65
+ </step>
66
+
67
+ <step name="spawn_checker">
68
+ Spawn the plan checker agent:
69
+
70
+ ```
71
+ Task(
72
+ subagent_type="ms-plan-checker",
73
+ prompt="""
74
+ Verify plans for phase $ARGUMENTS.
75
+
76
+ 1. Read .planning/ROADMAP.md to get the phase goal
77
+ 2. Read all *-PLAN.md files in the phase directory
78
+ 3. Run all 6 verification dimensions
79
+ 4. Return structured result
80
+
81
+ Phase directory: $PHASE_DIR
82
+ """,
83
+ description="Verify phase $ARGUMENTS plans"
84
+ )
85
+ ```
86
+ </step>
87
+
88
+ <step name="present_results">
89
+ Present the checker's findings clearly.
90
+
91
+ **Format for VERIFICATION PASSED:**
92
+
93
+ ```
94
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
95
+ PLAN VERIFICATION: PASSED
96
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
97
+
98
+ Phase: [name]
99
+ Plans: [count]
100
+ Tasks: [total count]
101
+
102
+ All checks passed:
103
+ ✓ Requirement coverage complete
104
+ ✓ All tasks have required fields
105
+ ✓ Dependency graph valid
106
+ ✓ Key links planned
107
+ ✓ Scope within budget
108
+ ✓ Verification criteria derived
109
+
110
+ Ready to execute: /ms:execute-phase $ARGUMENTS
111
+ ```
112
+
113
+ **Format for ISSUES FOUND:**
114
+
115
+ ```
116
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
117
+ PLAN VERIFICATION: ISSUES FOUND
118
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
119
+
120
+ Phase: [name]
121
+ Plans: [count]
122
+ Issues: [X blockers, Y warnings]
123
+
124
+ BLOCKERS (must fix):
125
+
126
+ 1. [dimension] [description]
127
+ Plan: [which plan]
128
+ Fix: [specific fix hint]
129
+
130
+ 2. [dimension] [description]
131
+ Plan: [which plan]
132
+ Fix: [specific fix hint]
133
+
134
+ WARNINGS (should fix):
135
+
136
+ 1. [dimension] [description]
137
+ Fix: [hint]
138
+
139
+ ---
140
+
141
+ Options:
142
+ - Fix the issues and run /ms:check-phase $ARGUMENTS again
143
+ - Proceed anyway: /ms:execute-phase $ARGUMENTS (not recommended if blockers exist)
144
+ ```
145
+ </step>
146
+
147
+ </process>
148
+
149
+ <examples>
150
+ **Check before executing a complex phase:**
151
+ ```
152
+ /ms:check-phase 5
153
+ ```
154
+
155
+ **Typical workflow:**
156
+ ```
157
+ /ms:plan-phase 5 # Interactive planning in main context
158
+ # ... review and iterate ...
159
+ /ms:check-phase 5 # Optional verification for complex plans
160
+ /ms:execute-phase 5 # Execute
161
+ ```
162
+ </examples>