mindsystem-cc 3.22.1 → 4.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 (43) hide show
  1. package/README.md +3 -4
  2. package/agents/ms-adhoc-planner.md +133 -0
  3. package/agents/ms-code-reviewer.md +186 -0
  4. package/agents/ms-compounder.md +144 -0
  5. package/agents/ms-roadmapper.md +4 -0
  6. package/commands/ms/add-todo.md +46 -131
  7. package/commands/ms/adhoc.md +42 -57
  8. package/commands/ms/audit-milestone.md +66 -89
  9. package/commands/ms/complete-milestone.md +6 -4
  10. package/commands/ms/compound.md +64 -0
  11. package/commands/ms/config.md +66 -49
  12. package/commands/ms/create-roadmap.md +8 -7
  13. package/commands/ms/doctor.md +29 -4
  14. package/commands/ms/help.md +52 -52
  15. package/commands/ms/new-milestone.md +4 -3
  16. package/commands/ms/progress.md +23 -3
  17. package/commands/ms/update.md +102 -0
  18. package/mindsystem/references/linear-cli.md +71 -0
  19. package/mindsystem/references/routing/audit-result-routing.md +9 -4
  20. package/mindsystem/references/todo-file.md +63 -0
  21. package/mindsystem/templates/adhoc-summary.md +4 -5
  22. package/mindsystem/templates/knowledge.md +1 -1
  23. package/mindsystem/templates/project.md +15 -4
  24. package/mindsystem/templates/state.md +3 -14
  25. package/mindsystem/templates/tech-debt.md +2 -2
  26. package/mindsystem/workflows/adhoc.md +128 -316
  27. package/mindsystem/workflows/complete-milestone.md +20 -0
  28. package/mindsystem/workflows/compound.md +121 -0
  29. package/mindsystem/workflows/doctor-fixes.md +1 -1
  30. package/mindsystem/workflows/plan-phase.md +1 -1
  31. package/package.json +1 -1
  32. package/scripts/__pycache__/ms-tools.cpython-314.pyc +0 -0
  33. package/scripts/__pycache__/test_ms_tools.cpython-314-pytest-9.0.2.pyc +0 -0
  34. package/scripts/fixtures/scan-context/.planning/adhoc/20260225-refactor-api/adhoc-01-SUMMARY.md +39 -0
  35. package/scripts/fixtures/scan-context/.planning/todos/{pending/add-logout.md → add-logout.md} +2 -2
  36. package/scripts/fixtures/scan-context/.planning/todos/done/setup-db.md +2 -2
  37. package/scripts/fixtures/scan-context/expected-output.json +21 -7
  38. package/scripts/ms-tools.py +42 -23
  39. package/scripts/test_ms_tools.py +84 -5
  40. package/skills/senior-review/SKILL.md +0 -3
  41. package/commands/ms/check-todos.md +0 -240
  42. package/commands/ms/plan-milestone-gaps.md +0 -288
  43. package/skills/senior-review/AGENTS.md +0 -531
@@ -1,240 +0,0 @@
1
- ---
2
- name: ms:check-todos
3
- description: List pending todos and select one to work on
4
- argument-hint: [subsystem or priority filter]
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Bash
9
- - Glob
10
- - AskUserQuestion
11
- ---
12
-
13
- <objective>
14
- List all pending todos, allow selection, load full context for the selected todo, and route to appropriate action.
15
-
16
- Enables reviewing captured ideas and deciding what to work on next.
17
- </objective>
18
-
19
- <context>
20
- @.planning/STATE.md
21
- @.planning/ROADMAP.md
22
- </context>
23
-
24
- <process>
25
-
26
- <step name="check_exist">
27
- ```bash
28
- TODO_COUNT=$(ls .planning/todos/pending/*.md 2>/dev/null | wc -l | tr -d ' ')
29
- echo "Pending todos: $TODO_COUNT"
30
- ```
31
-
32
- If count is 0:
33
- ```
34
- No pending todos.
35
-
36
- Todos are captured during work sessions with /ms:add-todo.
37
-
38
- ---
39
-
40
- Would you like to:
41
-
42
- 1. Continue with current phase (/ms:progress)
43
- 2. Add a todo now (/ms:add-todo)
44
- ```
45
-
46
- Exit.
47
- </step>
48
-
49
- <step name="parse_filter">
50
- Support multi-field filtering:
51
- - `/ms:check-todos` → show all
52
- - `/ms:check-todos p1` → filter to priority:p1 only (matches `p[1-3]`)
53
- - `/ms:check-todos api` → filter to subsystem or area matching "api"
54
- </step>
55
-
56
- <step name="list_todos">
57
- ```bash
58
- for file in .planning/todos/pending/*.md; do
59
- created=$(grep "^created:" "$file" | cut -d' ' -f2)
60
- title=$(grep "^title:" "$file" | cut -d':' -f2- | xargs)
61
- priority=$(grep "^priority:" "$file" | cut -d' ' -f2)
62
- subsystem=$(grep "^subsystem:" "$file" | cut -d' ' -f2)
63
- area=$(grep "^area:" "$file" | cut -d' ' -f2)
64
- echo "${priority:-p3}|${subsystem:-${area:-general}}|$created|$title|$file"
65
- done | sort
66
- ```
67
-
68
- Old-format todos (missing priority/subsystem) default to `p3`/`general`.
69
-
70
- Apply filter if specified:
71
- - Priority filter (`p1`-`p3`): match priority field
72
- - Subsystem/area filter: match either subsystem or area field
73
-
74
- Priority-grouped display with sequential numbering across groups. Omit empty groups. Use subsystem label (fall back to area, then "general"):
75
-
76
- ```
77
- Pending Todos (N):
78
-
79
- ### p1 — Urgent
80
- 1. auth: Fix token refresh race condition (2d ago)
81
- 2. api: Handle rate limit 429 responses (1d ago)
82
-
83
- ### p2 — Important
84
- 3. ui: Add loading states to dashboard (5h ago)
85
-
86
- ### p3 — Ideas
87
- 4. general: Explore caching strategy (3d ago)
88
-
89
- ---
90
-
91
- Reply with a number to view details, or:
92
- - `/ms:check-todos [subsystem]` to filter by subsystem
93
- - `/ms:check-todos p1` to filter by priority
94
- - `q` to exit
95
- ```
96
-
97
- Format age as relative time.
98
- </step>
99
-
100
- <step name="handle_selection">
101
- Wait for user to reply with a number.
102
-
103
- If valid: load selected todo, proceed.
104
- If invalid: "Invalid selection. Reply with a number (1-[N]) or `q` to exit."
105
- </step>
106
-
107
- <step name="load_context">
108
- Read the todo file completely. Display:
109
-
110
- ```
111
- ## [title]
112
-
113
- **Subsystem:** [subsystem] | **Priority:** [priority] | **Source:** [source]
114
- **Phase Origin:** [phase_origin]
115
- **Created:** [date] ([relative time] ago)
116
- **Tags:** [tags or "None"]
117
- **Files:** [list or "None"]
118
-
119
- ### Problem
120
- [problem section content]
121
-
122
- ### Solution
123
- [solution section content]
124
- ```
125
-
126
- Gracefully omit missing fields for old-format todos.
127
-
128
- If `files` field has entries, read and briefly summarize each.
129
- </step>
130
-
131
- <step name="check_roadmap">
132
- ```bash
133
- ls .planning/ROADMAP.md 2>/dev/null && echo "Roadmap exists"
134
- ```
135
-
136
- If roadmap exists:
137
- 1. Check if todo's subsystem or area matches an upcoming phase
138
- 2. Check if todo's files overlap with a phase's scope
139
- 3. Check if todo's tags match phase keywords
140
- 4. Note any match for action options
141
- </step>
142
-
143
- <step name="offer_actions">
144
- **If todo maps to a roadmap phase:**
145
-
146
- Use AskUserQuestion:
147
- - header: "Action"
148
- - question: "This todo relates to Phase [N]: [name]. What would you like to do?"
149
- - options:
150
- - "Work on it now" — move to done, start working
151
- - "Add to phase plan" — include when planning Phase [N]
152
- - "Brainstorm approach" — think through before deciding
153
- - "Put it back" — return to list
154
-
155
- **If no roadmap match:**
156
-
157
- Use AskUserQuestion:
158
- - header: "Action"
159
- - question: "What would you like to do with this todo?"
160
- - options:
161
- - "Work on it now" — move to done, start working
162
- - "Create a phase" — /ms:add-phase with this scope
163
- - "Brainstorm approach" — think through before deciding
164
- - "Put it back" — return to list
165
- </step>
166
-
167
- <step name="execute_action">
168
- **Work on it now:**
169
- ```bash
170
- mv ".planning/todos/pending/[filename]" ".planning/todos/done/"
171
- ```
172
- Update STATE.md todo count. Present problem/solution context. Begin work or ask how to proceed.
173
-
174
- **Add to phase plan:**
175
- Note todo reference in phase planning notes. Keep in pending. Return to list or exit.
176
-
177
- **Create a phase:**
178
- Display: `/ms:add-phase [description from todo]`
179
- Keep in pending. User runs command in fresh context.
180
-
181
- **Brainstorm approach:**
182
- Keep in pending. Start discussion about problem and approaches.
183
-
184
- **Put it back:**
185
- Return to list_todos step.
186
- </step>
187
-
188
- <step name="update_state">
189
- After any action that changes todo count:
190
-
191
- ```bash
192
- ls .planning/todos/pending/*.md 2>/dev/null | wc -l
193
- ```
194
-
195
- Update STATE.md "### Pending Todos" section if exists.
196
- </step>
197
-
198
- <step name="git_commit">
199
- If todo was moved to done/, commit the change:
200
-
201
- ```bash
202
- git add .planning/todos/done/[filename]
203
- git rm --cached .planning/todos/pending/[filename] 2>/dev/null || true
204
- [ -f .planning/STATE.md ] && git add .planning/STATE.md
205
- git commit -m "$(cat <<'EOF'
206
- docs: start work on todo - [title]
207
-
208
- Moved to done/, beginning implementation.
209
- EOF
210
- )"
211
- ```
212
-
213
- Confirm: "Committed: docs: start work on todo - [title]"
214
- </step>
215
-
216
- </process>
217
-
218
- <output>
219
- - Moved todo to `.planning/todos/done/` (if "Work on it now")
220
- - Updated `.planning/STATE.md` (if todo count changed)
221
- </output>
222
-
223
- <anti_patterns>
224
- - Don't delete todos — move to done/ when work begins
225
- - Don't start work without moving to done/ first
226
- - Don't create plans from this command — route to /ms:plan-phase or /ms:add-phase
227
- </anti_patterns>
228
-
229
- <success_criteria>
230
- - [ ] All pending todos listed grouped by priority (p1/p2/p3)
231
- - [ ] Subsystem label displayed (with area/general fallback for old todos)
232
- - [ ] Priority or subsystem filter applied if specified
233
- - [ ] Selected todo's full context loaded (subsystem, priority, source, phase, tags)
234
- - [ ] Old-format todos handled gracefully (missing fields omitted)
235
- - [ ] Roadmap context checked for phase match (subsystem, area, files, tags)
236
- - [ ] Appropriate actions offered
237
- - [ ] Selected action executed
238
- - [ ] STATE.md updated if todo count changed
239
- - [ ] Changes committed to git (if todo moved to done/)
240
- </success_criteria>
@@ -1,288 +0,0 @@
1
- ---
2
- name: ms:plan-milestone-gaps
3
- description: Create phases to close all gaps identified by milestone audit
4
- allowed-tools:
5
- - Read
6
- - Write
7
- - Bash
8
- - Glob
9
- - Grep
10
- - AskUserQuestion
11
- ---
12
-
13
- <objective>
14
- Create all phases necessary to close gaps identified by `/ms:audit-milestone`.
15
-
16
- Reads MILESTONE-AUDIT.md, groups gaps into logical phases, creates phase entries in ROADMAP.md, and offers to plan each phase.
17
-
18
- One command creates all fix phases — no manual `/ms:add-phase` per gap.
19
- </objective>
20
-
21
- <execution_context>
22
- @~/.claude/mindsystem/references/principles.md
23
- @~/.claude/mindsystem/workflows/plan-phase.md
24
- </execution_context>
25
-
26
- <context>
27
- **Audit results:**
28
- @.planning/MILESTONE-AUDIT.md
29
-
30
- **Original intent (for prioritization):**
31
- @.planning/PROJECT.md
32
- @.planning/REQUIREMENTS.md
33
-
34
- **Current state:**
35
- @.planning/ROADMAP.md
36
- @.planning/STATE.md
37
- </context>
38
-
39
- <process>
40
-
41
- ## 1. Load Audit Results
42
-
43
- ```bash
44
- cat .planning/MILESTONE-AUDIT.md
45
- ```
46
-
47
- Parse YAML frontmatter to extract structured gaps:
48
- - `gaps.requirements` — unsatisfied requirements
49
- - `gaps.integration` — missing cross-phase connections
50
- - `gaps.flows` — broken E2E flows
51
-
52
- If no audit file exists or has no gaps, error:
53
- ```
54
- No audit gaps found. Run `/ms:audit-milestone` first.
55
- ```
56
-
57
- ## 2. Prioritize Gaps
58
-
59
- Group gaps by priority from REQUIREMENTS.md:
60
-
61
- | Priority | Action |
62
- |----------|--------|
63
- | `must` | Create phase, blocks milestone |
64
- | `should` | Create phase, recommended |
65
- | `nice` | Ask user: include or defer? |
66
-
67
- For integration/flow gaps, infer priority from affected requirements.
68
-
69
- ## 3. Group Gaps into Phases
70
-
71
- Cluster related gaps into logical phases:
72
-
73
- **Grouping rules:**
74
- - Same affected phase → combine into one fix phase
75
- - Same subsystem (auth, API, UI) → combine
76
- - Dependency order (fix stubs before wiring)
77
- - Keep phases focused: 2-4 tasks each
78
-
79
- **Example grouping:**
80
- ```
81
- Gap: DASH-01 unsatisfied (Dashboard doesn't fetch)
82
- Gap: Integration Phase 1→3 (Auth not passed to API calls)
83
- Gap: Flow "View dashboard" broken at data fetch
84
-
85
- → Phase 6: "Wire Dashboard to API"
86
- - Add fetch to Dashboard.tsx
87
- - Include auth header in fetch
88
- - Handle response, update state
89
- - Render user data
90
- ```
91
-
92
- ## 4. Determine Phase Numbers
93
-
94
- Find highest existing phase:
95
- ```bash
96
- ls -d .planning/phases/*/ | sort -V | tail -1
97
- ```
98
-
99
- New phases continue from there:
100
- - If Phase 5 is highest, gaps become Phase 6, 7, 8...
101
-
102
- ## 5. Present Gap Closure Plan
103
-
104
- ```markdown
105
- ## Gap Closure Plan
106
-
107
- **Milestone:** {name}
108
- **Gaps to close:** {N} requirements, {M} integration, {K} flows
109
-
110
- ### Proposed Phases
111
-
112
- **Phase {N}: {Name}**
113
- Closes:
114
- - {REQ-ID}: {description}
115
- - Integration: {from} → {to}
116
- Tasks: {count}
117
-
118
- **Phase {N+1}: {Name}**
119
- Closes:
120
- - {REQ-ID}: {description}
121
- - Flow: {flow name}
122
- Tasks: {count}
123
-
124
- {If nice-to-have gaps exist:}
125
-
126
- ### Deferred (nice-to-have)
127
-
128
- These gaps are optional. Include them?
129
- - {gap description}
130
- - {gap description}
131
-
132
- ---
133
-
134
- Create these {X} phases? (yes / adjust / defer all optional)
135
- ```
136
-
137
- Wait for user confirmation.
138
-
139
- ## 6. Update ROADMAP.md
140
-
141
- Add new phases to current milestone:
142
-
143
- ```markdown
144
- ### Phase {N}: {Name}
145
- **Goal:** {derived from gaps being closed}
146
- **Requirements:** {REQ-IDs being satisfied}
147
- **Gap Closure:** Closes gaps from audit
148
-
149
- ### Phase {N+1}: {Name}
150
- ...
151
- ```
152
-
153
- ## 7. Create Phase Directories
154
-
155
- ```bash
156
- mkdir -p ".planning/phases/{NN}-{name}"
157
- ```
158
-
159
- ## 8. Commit Roadmap Update
160
-
161
- ```bash
162
- git add .planning/ROADMAP.md
163
- git commit -m "docs(roadmap): add gap closure phases {N}-{M}"
164
- ```
165
-
166
- ## 9. Offer Next Steps
167
-
168
- ```markdown
169
- ## ✓ Gap Closure Phases Created
170
-
171
- **Phases added:** {N} - {M}
172
- **Gaps addressed:** {count} requirements, {count} integration, {count} flows
173
-
174
- ---
175
-
176
- ## ▶ Next Up
177
-
178
- `/ms:plan-phase {N}` — plan first gap closure phase
179
-
180
- <sub>`/clear` first → fresh context window</sub>
181
-
182
- ---
183
-
184
- **Also available:**
185
- - `/ms:execute-phase {N}` — if plans already exist
186
- - `cat .planning/ROADMAP.md` — see updated roadmap
187
-
188
- ---
189
-
190
- **After all gap phases complete:**
191
-
192
- `/ms:audit-milestone` — re-audit to verify gaps closed
193
- `/ms:complete-milestone` — archive when audit passes
194
- ```
195
-
196
- ## 10. Update Last Command
197
-
198
- ```bash
199
- ms-tools set-last-command "ms:plan-milestone-gaps"
200
- ```
201
-
202
- </process>
203
-
204
- <gap_to_phase_mapping>
205
-
206
- ## How Gaps Become Tasks
207
-
208
- **Requirement gap → Tasks:**
209
- ```yaml
210
- gap:
211
- id: DASH-01
212
- description: "User sees their data"
213
- reason: "Dashboard exists but doesn't fetch from API"
214
- missing:
215
- - "useEffect with fetch to /api/user/data"
216
- - "State for user data"
217
- - "Render user data in JSX"
218
-
219
- becomes:
220
-
221
- phase: "Wire Dashboard Data"
222
- tasks:
223
- - name: "Add data fetching"
224
- files: [src/components/Dashboard.tsx]
225
- action: "Add useEffect that fetches /api/user/data on mount"
226
-
227
- - name: "Add state management"
228
- files: [src/components/Dashboard.tsx]
229
- action: "Add useState for userData, loading, error states"
230
-
231
- - name: "Render user data"
232
- files: [src/components/Dashboard.tsx]
233
- action: "Replace placeholder with userData.map rendering"
234
- ```
235
-
236
- **Integration gap → Tasks:**
237
- ```yaml
238
- gap:
239
- from_phase: 1
240
- to_phase: 3
241
- connection: "Auth token → API calls"
242
- reason: "Dashboard API calls don't include auth header"
243
- missing:
244
- - "Auth header in fetch calls"
245
- - "Token refresh on 401"
246
-
247
- becomes:
248
-
249
- phase: "Add Auth to Dashboard API Calls"
250
- tasks:
251
- - name: "Add auth header to fetches"
252
- files: [src/components/Dashboard.tsx, src/lib/api.ts]
253
- action: "Include Authorization header with token in all API calls"
254
-
255
- - name: "Handle 401 responses"
256
- files: [src/lib/api.ts]
257
- action: "Add interceptor to refresh token or redirect to login on 401"
258
- ```
259
-
260
- **Flow gap → Tasks:**
261
- ```yaml
262
- gap:
263
- name: "User views dashboard after login"
264
- broken_at: "Dashboard data load"
265
- reason: "No fetch call"
266
- missing:
267
- - "Fetch user data on mount"
268
- - "Display loading state"
269
- - "Render user data"
270
-
271
- becomes:
272
-
273
- # Usually same phase as requirement/integration gap
274
- # Flow gaps often overlap with other gap types
275
- ```
276
-
277
- </gap_to_phase_mapping>
278
-
279
- <success_criteria>
280
- - [ ] MILESTONE-AUDIT.md loaded and gaps parsed
281
- - [ ] Gaps prioritized (must/should/nice)
282
- - [ ] Gaps grouped into logical phases
283
- - [ ] User confirmed phase plan
284
- - [ ] ROADMAP.md updated with new phases
285
- - [ ] Phase directories created
286
- - [ ] Changes committed
287
- - [ ] User knows to run `/ms:plan-phase` next
288
- </success_criteria>