mindsystem-cc 3.2.3 → 3.3.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 (51) hide show
  1. package/README.md +2 -2
  2. package/agents/ms-code-simplifier.md +215 -0
  3. package/agents/ms-consolidator.md +377 -0
  4. package/agents/ms-executor.md +32 -261
  5. package/{commands/ms/simplify-flutter.md → agents/ms-flutter-simplifier.md} +41 -49
  6. package/agents/ms-researcher.md +2 -2
  7. package/commands/ms/complete-milestone.md +24 -3
  8. package/commands/ms/do-work.md +17 -3
  9. package/commands/ms/execute-phase.md +29 -14
  10. package/commands/ms/help.md +1 -1
  11. package/commands/ms/new-milestone.md +42 -30
  12. package/commands/ms/progress.md +1 -1
  13. package/commands/ms/research-project.md +8 -0
  14. package/commands/ms/review-design.md +1 -1
  15. package/mindsystem/references/git-integration.md +2 -2
  16. package/mindsystem/references/goal-backward.md +2 -2
  17. package/mindsystem/references/principles.md +1 -1
  18. package/mindsystem/templates/adhoc-summary.md +3 -0
  19. package/mindsystem/templates/codebase/architecture.md +2 -2
  20. package/mindsystem/templates/codebase/structure.md +1 -1
  21. package/mindsystem/templates/config.json +2 -1
  22. package/mindsystem/templates/decisions.md +145 -0
  23. package/mindsystem/workflows/complete-milestone.md +66 -15
  24. package/mindsystem/workflows/create-milestone.md +60 -20
  25. package/mindsystem/workflows/do-work.md +81 -4
  26. package/mindsystem/workflows/execute-phase.md +66 -0
  27. package/mindsystem/workflows/map-codebase.md +9 -1
  28. package/mindsystem/workflows/verify-work.md +1 -1
  29. package/package.json +1 -1
  30. package/scripts/generate-adhoc-patch.sh +79 -0
  31. package/scripts/ms-lookup/uv.lock +17 -17
  32. package/commands/ms/discuss-milestone.md +0 -48
  33. package/commands/ms/linear.md +0 -195
  34. package/mindsystem/templates/milestone-context.md +0 -93
  35. package/scripts/ms-linear/ms_linear/__init__.py +0 -3
  36. package/scripts/ms-linear/ms_linear/__main__.py +0 -6
  37. package/scripts/ms-linear/ms_linear/__pycache__/__init__.cpython-314.pyc +0 -0
  38. package/scripts/ms-linear/ms_linear/__pycache__/__main__.cpython-314.pyc +0 -0
  39. package/scripts/ms-linear/ms_linear/__pycache__/cli.cpython-314.pyc +0 -0
  40. package/scripts/ms-linear/ms_linear/__pycache__/client.cpython-314.pyc +0 -0
  41. package/scripts/ms-linear/ms_linear/__pycache__/config.cpython-314.pyc +0 -0
  42. package/scripts/ms-linear/ms_linear/__pycache__/errors.cpython-314.pyc +0 -0
  43. package/scripts/ms-linear/ms_linear/__pycache__/output.cpython-314.pyc +0 -0
  44. package/scripts/ms-linear/ms_linear/cli.py +0 -604
  45. package/scripts/ms-linear/ms_linear/client.py +0 -503
  46. package/scripts/ms-linear/ms_linear/config.py +0 -104
  47. package/scripts/ms-linear/ms_linear/errors.py +0 -29
  48. package/scripts/ms-linear/ms_linear/output.py +0 -45
  49. package/scripts/ms-linear/pyproject.toml +0 -16
  50. package/scripts/ms-linear/uv.lock +0 -196
  51. package/scripts/ms-linear-wrapper.sh +0 -22
@@ -61,38 +61,45 @@ Phase: $ARGUMENTS
61
61
  - Collect summaries from all plans
62
62
  - Report phase completion status
63
63
 
64
- 6. **Verify phase goal**
64
+ 6. **Simplify code (optional)**
65
+ - Read `simplifier` from config.json (default: `ms-code-simplifier`)
66
+ - If `"skip"`: proceed to step 7
67
+ - Spawn simplifier agent with phase file scope
68
+ - If changes made: commit as `refactor({phase}): simplify phase code`
69
+
70
+ 7. **Verify phase goal**
65
71
  - Spawn `ms-verifier` subagent with phase directory and goal
66
72
  - Verifier checks must_haves against actual codebase (not SUMMARY claims)
67
73
  - Creates VERIFICATION.md with detailed report
68
74
  - Route by status:
69
- - `passed` → continue to step 7
75
+ - `passed` → continue to step 8
70
76
  - `human_needed` → present items, get approval or feedback
71
77
  - `gaps_found` → present gaps, offer `/ms:plan-phase {X} --gaps`
72
78
 
73
- 7. **Generate phase patch**
79
+ 8. **Generate phase patch**
74
80
  - Run: `~/.claude/mindsystem/scripts/generate-phase-patch.sh ${PHASE_NUMBER}`
75
81
  - Outputs to `.planning/phases/{phase_dir}/{phase}-changes.patch`
76
82
  - Verify: patch file exists OR skip message logged
83
+ - Note: Patch captures all changes including simplifications
77
84
 
78
- 8. **Update roadmap and state**
85
+ 9. **Update roadmap and state**
79
86
  - Update ROADMAP.md, STATE.md
80
87
 
81
- 9. **Update requirements**
82
- Mark phase requirements as Complete:
83
- - Read ROADMAP.md, find this phase's `Requirements:` line (e.g., "AUTH-01, AUTH-02")
84
- - Read REQUIREMENTS.md traceability table
85
- - For each REQ-ID in this phase: change Status from "Pending" to "Complete"
86
- - Write updated REQUIREMENTS.md
87
- - Skip if: REQUIREMENTS.md doesn't exist, or phase has no Requirements line
88
+ 10. **Update requirements**
89
+ Mark phase requirements as Complete:
90
+ - Read ROADMAP.md, find this phase's `Requirements:` line (e.g., "AUTH-01, AUTH-02")
91
+ - Read REQUIREMENTS.md traceability table
92
+ - For each REQ-ID in this phase: change Status from "Pending" to "Complete"
93
+ - Write updated REQUIREMENTS.md
94
+ - Skip if: REQUIREMENTS.md doesn't exist, or phase has no Requirements line
88
95
 
89
- 10. **Commit phase completion**
96
+ 11. **Commit phase completion**
90
97
  Bundle all phase metadata updates in one commit:
91
98
  - Stage: `git add .planning/ROADMAP.md .planning/STATE.md`
92
99
  - Stage REQUIREMENTS.md if updated: `git add .planning/REQUIREMENTS.md`
93
100
  - Commit: `docs({phase}): complete {phase-name} phase`
94
101
 
95
- 11. **Offer next steps**
102
+ 12. **Offer next steps**
96
103
  - Route to next action (see `<offer_next>`)
97
104
  </process>
98
105
 
@@ -261,9 +268,16 @@ After all tasks in a plan complete:
261
268
  2. Commit with format: `docs({phase}-{plan}): complete [plan-name] plan`
262
269
  3. NO code files (already committed per-task)
263
270
 
271
+ **Simplification Commit (if changes made):**
272
+
273
+ After code simplification step:
274
+ 1. Stage only simplified files
275
+ 2. Commit with format: `refactor({phase}): simplify phase code`
276
+ 3. Include simplifier agent name and file count in commit body
277
+
264
278
  **Phase Completion Commit:**
265
279
 
266
- After all plans in phase complete (step 7):
280
+ After all plans in phase complete:
267
281
  1. Stage: ROADMAP.md, STATE.md, REQUIREMENTS.md (if updated), VERIFICATION.md
268
282
  2. Commit with format: `docs({phase}): complete {phase-name} phase`
269
283
  3. Bundles all phase-level state updates in one commit
@@ -279,6 +293,7 @@ After all plans in phase complete (step 7):
279
293
  <success_criteria>
280
294
  - [ ] All incomplete plans in phase executed
281
295
  - [ ] Each plan has SUMMARY.md
296
+ - [ ] Code simplified (or skipped if config says "skip")
282
297
  - [ ] Phase goal verified (must_haves checked against codebase)
283
298
  - [ ] VERIFICATION.md created in phase directory
284
299
  - [ ] Patch file generated OR explicitly skipped with message
@@ -158,7 +158,7 @@ Audit and improve design of already-implemented features.
158
158
  - Creates retroactive DESIGN.md if none exists
159
159
  - Presents improvements with benefits and trade-offs
160
160
  - Applies user-approved changes, runs verification
161
- - Use for features implemented before GSD, or periodic design audits
161
+ - Use for features implemented before Mindsystem, or periodic design audits
162
162
 
163
163
  Usage: `/ms:review-design 4` (review phase 4)
164
164
  Usage: `/ms:review-design lib/features/home/home_screen.dart`
@@ -30,9 +30,6 @@ Milestone name: $ARGUMENTS (optional - will prompt if not provided)
30
30
  @.planning/STATE.md
31
31
  @.planning/MILESTONES.md
32
32
  @.planning/config.json
33
-
34
- **Load milestone context (if exists, from /ms:discuss-milestone):**
35
- @.planning/MILESTONE-CONTEXT.md
36
33
  </context>
37
34
 
38
35
  <process>
@@ -41,14 +38,15 @@ Milestone name: $ARGUMENTS (optional - will prompt if not provided)
41
38
  - Read PROJECT.md (existing project, Validated requirements, decisions)
42
39
  - Read MILESTONES.md (what shipped previously)
43
40
  - Read STATE.md (pending todos, blockers)
44
- - Check for MILESTONE-CONTEXT.md (from /ms:discuss-milestone)
41
+ - Calculate previous milestone version from MILESTONES.md (e.g., if last shipped was v1.0, previous=1.0)
42
+ - Note: Previous milestone files will be loaded on-demand based on user's choice in step 3
43
+
44
+ **Why only the last milestone?** We load DECISIONS.md and AUDIT.md from only the immediately preceding milestone. Older decisions that remain important should already be in PROJECT.md or visible in the codebase. Older untested assumptions that weren't addressed in subsequent milestones are intentionally skipped or no longer relevant. Loading all previous milestones would bloat context for diminishing returns.
45
45
 
46
46
  2. **Present what shipped (if MILESTONES.md exists):**
47
47
 
48
48
  ```bash
49
49
  cat .planning/MILESTONES.md 2>/dev/null
50
- # Also check for assumptions from last audit
51
- cat .planning/v*-MILESTONE-AUDIT.md 2>/dev/null | grep -A 100 "assumptions:" | head -50
52
50
  ```
53
51
 
54
52
  Format the presentation:
@@ -63,7 +61,6 @@ Milestone name: $ARGUMENTS (optional - will prompt if not provided)
63
61
  **Key accomplishments:**
64
62
  - [From MILESTONES.md accomplishments]
65
63
  - [From MILESTONES.md accomplishments]
66
- - [From MILESTONES.md accomplishments]
67
64
 
68
65
  **Validated requirements:**
69
66
  - [From PROJECT.md Validated section]
@@ -71,37 +68,56 @@ Milestone name: $ARGUMENTS (optional - will prompt if not provided)
71
68
  **Pending todos (if any):**
72
69
  - [From STATE.md accumulated context]
73
70
 
74
- **Untested assumptions (if any):**
75
- - [From MILESTONE-AUDIT.md assumptions section]
76
- - Error state displays (04-comments, 05-auth)
77
- - Empty state handling (04-comments)
78
- - Session timeout behavior (05-auth)
79
-
80
- *These were skipped during UAT because required states couldn't be mocked.*
81
-
82
71
  ---
83
72
  ```
84
73
 
85
- This gives users context before asking what they want to build next.
74
+ 3. **Decision gate:**
86
75
 
87
- 3. **Gather milestone goals:**
76
+ Use AskUserQuestion:
77
+ - header: "New Milestone"
78
+ - question: "How do you want to start?"
79
+ - options:
80
+ - "I know what to build" — proceed to goal gathering
81
+ - "Help me figure it out" — enter discovery mode with previous context
82
+ - "Show previous decisions first" — view DECISIONS.md and AUDIT.md, then decide
88
83
 
89
- **If MILESTONE-CONTEXT.md exists:**
90
- - Use features and scope from discuss-milestone
91
- - Present summary for confirmation
84
+ 4. **Gather milestone goals:**
92
85
 
93
- **If no context file:**
94
- - Present what shipped in last milestone
95
- - Ask: "What do you want to build next?"
86
+ **If "I know what to build":**
87
+ - Ask directly: "What do you want to build next?"
96
88
  - Use AskUserQuestion to explore features
97
89
  - Probe for priorities, constraints, scope
98
90
 
99
- 4. **Determine milestone version:**
91
+ **If "Show previous decisions first":**
92
+ - Using the previous version calculated in step 1 (e.g., "1.0"):
93
+ - Check for and read `.planning/milestones/v1.0-DECISIONS.md` if exists
94
+ - Check for and read `.planning/milestones/v1.0-MILESTONE-AUDIT.md` if exists
95
+ - Present relevant context from these files
96
+ - Return to decision gate (without this option)
97
+
98
+ **If "Help me figure it out" (Discovery Mode):**
99
+ - Using the previous version calculated in step 1:
100
+ - Check for and read `.planning/milestones/v{VERSION}-DECISIONS.md` if exists
101
+ - Check for and read `.planning/milestones/v{VERSION}-MILESTONE-AUDIT.md` if exists
102
+ - Surface untested assumptions from AUDIT.md (if found):
103
+ ```
104
+ 📋 Untested from v[previous]:
105
+ - Error state displays
106
+ - Empty state handling
107
+ - [etc. from assumptions section]
108
+ ```
109
+ - Follow questioning.md patterns for AskUserQuestion-based discovery:
110
+ - "What do you want to add, improve, or fix?"
111
+ - Options: Address untested assumptions, New features, Improvements, Bug fixes, Let me describe
112
+ - Follow up with probing questions
113
+ - Continue until clear goals emerge
114
+
115
+ 5. **Determine milestone version:**
100
116
  - Parse last version from MILESTONES.md
101
117
  - Suggest next version (v1.0 → v1.1, or v2.0 for major)
102
118
  - Confirm with user
103
119
 
104
- 5. **Update PROJECT.md:**
120
+ 6. **Update PROJECT.md:**
105
121
 
106
122
  Add/update these sections:
107
123
 
@@ -120,7 +136,7 @@ Milestone name: $ARGUMENTS (optional - will prompt if not provided)
120
136
 
121
137
  Update "Last updated" footer.
122
138
 
123
- 6. **Update STATE.md:**
139
+ 7. **Update STATE.md:**
124
140
 
125
141
  ```markdown
126
142
  ## Current Position
@@ -131,9 +147,6 @@ Milestone name: $ARGUMENTS (optional - will prompt if not provided)
131
147
  Last activity: [today] — Milestone v[X.Y] started
132
148
  ```
133
149
 
134
- 7. **Cleanup:**
135
- - Delete MILESTONE-CONTEXT.md if exists (consumed)
136
-
137
150
  8. **Git commit:**
138
151
  ```bash
139
152
  git add .planning/PROJECT.md .planning/STATE.md
@@ -187,7 +200,6 @@ Milestone name: $ARGUMENTS (optional - will prompt if not provided)
187
200
  - PROJECT.md updated with Current Milestone section
188
201
  - Active requirements reflect new milestone goals
189
202
  - STATE.md reset for new milestone
190
- - MILESTONE-CONTEXT.md consumed and deleted (if existed)
191
203
  - Git commit made
192
204
  - User routed to define-requirements (or research-project)
193
205
  </success_criteria>
@@ -380,5 +380,5 @@ Ready to plan the next milestone.
380
380
  - [ ] What's next clearly explained
381
381
  - [ ] Smart routing: /ms:execute-phase if plan exists, /ms:plan-phase if not
382
382
  - [ ] User confirms before any action
383
- - [ ] Seamless handoff to appropriate gsd command
383
+ - [ ] Seamless handoff to appropriate mindsystem command
384
384
  </success_criteria>
@@ -299,8 +299,16 @@ Create SUMMARY.md with:
299
299
  - Confidence assessment
300
300
  - Gaps to address
301
301
 
302
+ After creating SUMMARY.md, update config.json simplifier with agent name:
303
+ 1. Read recommended stack from STACK.md
304
+ 2. Map to simplifier agent name:
305
+ - Flutter/Dart → \"ms-flutter-simplifier\"
306
+ - All others → \"ms-code-simplifier\"
307
+ 3. Update .planning/config.json (create from template if needed)
308
+
302
309
  Then commit ALL research files together:
303
310
  git add .planning/research/
311
+ git add .planning/config.json
304
312
  git commit -m 'docs: complete [domain] project research'
305
313
  ",
306
314
  subagent_type="ms-research-synthesizer",
@@ -60,7 +60,7 @@ Options:
60
60
  - "Uncommitted changes" - Review files with uncommitted modifications
61
61
  - "Specific file" - I'll provide a file path
62
62
  - "Recent feature work" - Review files from recent commits
63
- - "GSD phase" - Review all code from a specific phase
63
+ - "Mindsystem phase" - Review all code from a specific phase
64
64
  ```
65
65
 
66
66
  ### Step 1.2: Resolve Phase Directory (if phase-based)
@@ -1,5 +1,5 @@
1
1
  <overview>
2
- Git integration for GSD framework.
2
+ Git integration for Mindsystem framework.
3
3
  </overview>
4
4
 
5
5
  <core_principle>
@@ -29,7 +29,7 @@ The git log should read like a changelog of what shipped, not a diary of plannin
29
29
  [ -d .git ] && echo "GIT_EXISTS" || echo "NO_GIT"
30
30
  ```
31
31
 
32
- If NO_GIT: Run `git init` silently. GSD projects always get their own repo.
32
+ If NO_GIT: Run `git init` silently. Mindsystem projects always get their own repo.
33
33
  </git_check>
34
34
 
35
35
  <commit_formats>
@@ -255,7 +255,7 @@ Key links are verification priorities. Without them, you check everything equall
255
255
 
256
256
  </common_failures>
257
257
 
258
- <integration_with_gsd>
258
+ <integration_with_mindsystem>
259
259
 
260
260
  ## In plan-phase.md
261
261
 
@@ -283,4 +283,4 @@ derive_must_haves → tasks → execute → verify → [gaps?] → fix plans →
283
283
 
284
284
  Must-haves are derived once, verified as many times as needed until all pass.
285
285
 
286
- </integration_with_gsd>
286
+ </integration_with_mindsystem>
@@ -1,6 +1,6 @@
1
1
  <principles>
2
2
 
3
- Core principles for the GSD planning system.
3
+ Core principles for the Mindsystem planning system.
4
4
 
5
5
  <solo_developer_claude>
6
6
 
@@ -17,6 +17,7 @@ files_modified:
17
17
  - [path/to/file1.ts]
18
18
  - [path/to/file2.ts]
19
19
  commit: [git hash]
20
+ patch_file: [path to .patch file, or empty if skipped]
20
21
  ---
21
22
 
22
23
  # Adhoc: [Description]
@@ -66,6 +67,7 @@ Adhoc summaries document small work items executed outside the normal phase work
66
67
  | related_phase | Yes | Current phase from STATE.md, or "none" if between phases |
67
68
  | files_modified | Yes | List of file paths changed |
68
69
  | commit | Yes | Git commit hash |
70
+ | patch_file | No | Path to generated patch file (empty if no code changes) |
69
71
 
70
72
  </frontmatter_fields>
71
73
 
@@ -100,6 +102,7 @@ files_modified:
100
102
  - src/lib/api-client.ts
101
103
  - src/hooks/useAuth.ts
102
104
  commit: abc123f
105
+ patch_file: .planning/adhoc/2026-01-20-fix-auth-token-not-refreshing-on-401.patch
103
106
  ---
104
107
 
105
108
  # Adhoc: Fix auth token not refreshing on 401
@@ -146,7 +146,7 @@ Template for `.planning/codebase/ARCHITECTURE.md` - captures conceptual code org
146
146
 
147
147
  **CLI Command Execution:**
148
148
 
149
- 1. User runs: `gsd new-project`
149
+ 1. User runs: `ms new-project`
150
150
  2. Commander parses args and flags
151
151
  3. Command handler invoked (`src/commands/new-project.ts`)
152
152
  4. Handler calls service methods (`src/services/project.ts` → `create()`)
@@ -180,7 +180,7 @@ Template for `.planning/codebase/ARCHITECTURE.md` - captures conceptual code org
180
180
 
181
181
  **CLI Entry:**
182
182
  - Location: `src/index.ts`
183
- - Triggers: User runs `gsd <command>`
183
+ - Triggers: User runs `ms <command>`
184
184
  - Responsibilities: Register commands, parse args, display help
185
185
 
186
186
  **Commands:**
@@ -145,7 +145,7 @@ mindsystem/
145
145
  - Key files: install.js - handles npx installation
146
146
  - Subdirectories: None
147
147
 
148
- **commands/gsd/**
148
+ **commands/ms/**
149
149
  - Purpose: Slash command definitions for Claude Code
150
150
  - Contains: *.md files (one per command)
151
151
  - Key files: new-project.md, plan-phase.md, execute-plan.md
@@ -11,5 +11,6 @@
11
11
  "safety": {
12
12
  "always_confirm_destructive": true,
13
13
  "always_confirm_external_services": true
14
- }
14
+ },
15
+ "simplifier": null
15
16
  }
@@ -0,0 +1,145 @@
1
+ # Decisions Template
2
+
3
+ Template for `.planning/milestones/v{X.Y}-DECISIONS.md` — consolidated decisions from a milestone.
4
+
5
+ **Purpose:** Preserve decision rationale for future reference. When starting a new milestone, previous DECISIONS.md provides context for "why did we do it this way?"
6
+
7
+ **Created by:** `ms-consolidator` agent during `/ms:complete-milestone`
8
+
9
+ **Referenced by:** `/ms:new-milestone` during discovery mode
10
+
11
+ ---
12
+
13
+ <template>
14
+
15
+ ```markdown
16
+ # Milestone v{{VERSION}} Decisions
17
+
18
+ **Milestone:** {{NAME}}
19
+ **Phases:** {{PHASE_START}}-{{PHASE_END}}
20
+ **Consolidated:** {{DATE}}
21
+
22
+ ---
23
+
24
+ ## Technical Stack
25
+
26
+ | Decision | Rationale | Phase |
27
+ |----------|-----------|-------|
28
+ | {{DECISION}} | {{RATIONALE}} | {{PHASE}} |
29
+
30
+ ## Architecture
31
+
32
+ | Decision | Rationale | Phase |
33
+ |----------|-----------|-------|
34
+ | {{DECISION}} | {{RATIONALE}} | {{PHASE}} |
35
+
36
+ ## Data Model
37
+
38
+ | Decision | Rationale | Phase |
39
+ |----------|-----------|-------|
40
+ | {{DECISION}} | {{RATIONALE}} | {{PHASE}} |
41
+
42
+ ## API Design
43
+
44
+ | Decision | Rationale | Phase |
45
+ |----------|-----------|-------|
46
+ | {{DECISION}} | {{RATIONALE}} | {{PHASE}} |
47
+
48
+ ## UI/UX
49
+
50
+ | Decision | Rationale | Phase |
51
+ |----------|-----------|-------|
52
+ | {{DECISION}} | {{RATIONALE}} | {{PHASE}} |
53
+
54
+ ## Security
55
+
56
+ | Decision | Rationale | Phase |
57
+ |----------|-----------|-------|
58
+ | {{DECISION}} | {{RATIONALE}} | {{PHASE}} |
59
+
60
+ ## Performance
61
+
62
+ | Decision | Rationale | Phase |
63
+ |----------|-----------|-------|
64
+ | {{DECISION}} | {{RATIONALE}} | {{PHASE}} |
65
+
66
+ ---
67
+
68
+ ## Sources
69
+
70
+ Files consolidated from each phase:
71
+
72
+ | Phase | Files Found |
73
+ |-------|-------------|
74
+ | {{PHASE_NUM}} | {{FILES_LIST}} |
75
+
76
+ ---
77
+
78
+ *Consolidated: {{DATE}} during v{{VERSION}} milestone completion*
79
+ ```
80
+
81
+ </template>
82
+
83
+ <guidelines>
84
+
85
+ ## What This File Captures
86
+
87
+ **Decisions = Choices + Rationale**
88
+
89
+ This template captures WHY decisions were made, not just WHAT was built. SUMMARY.md captures what was built. DECISIONS.md captures why it was built that way.
90
+
91
+ Decisions help future milestones by:
92
+ - Explaining why certain approaches were chosen
93
+ - Documenting rejected alternatives
94
+ - Preserving constraints that influenced choices
95
+ - Providing context for "why is it this way?" questions
96
+
97
+ ## Categories Explained
98
+
99
+ | Category | Content |
100
+ |----------|---------|
101
+ | **Technical Stack** | Libraries, frameworks, versions, tools |
102
+ | **Architecture** | System structure, module boundaries, patterns |
103
+ | **Data Model** | Schema, relationships, storage approach |
104
+ | **API Design** | Endpoints, auth, errors, response format |
105
+ | **UI/UX** | Components, layouts, interactions |
106
+ | **Security** | Auth, authorization, data protection |
107
+ | **Performance** | Caching, optimization, loading patterns |
108
+
109
+ ## Usage Rules
110
+
111
+ **Remove empty categories.** If no Security decisions were made, don't include the Security section.
112
+
113
+ **Keep entries concise.** Decision in 5-10 words. Rationale in 10-20 words.
114
+
115
+ **Include phase number.** Helps trace when decisions were made.
116
+
117
+ ## Good vs Bad Entries
118
+
119
+ **Good decision entries:**
120
+ - "Use jose over jsonwebtoken | Better TypeScript support, actively maintained | 2"
121
+ - "Flat folder structure | Avoids premature abstraction, easier navigation | 1"
122
+ - "Server actions over API routes | Simpler data mutations for forms | 3"
123
+ - "Tailwind over styled-components | Team familiarity, smaller bundle | 1"
124
+
125
+ **Bad decision entries:**
126
+ - "Use React | — | 1" (no rationale)
127
+ - "Implemented authentication | Users can log in | 2" (not a decision, just work done)
128
+ - "Added tests | Testing is important | 3" (obvious, no real decision)
129
+
130
+ ## Sources Appendix
131
+
132
+ The Sources section documents which files were consolidated from each phase:
133
+
134
+ ```markdown
135
+ | Phase | Files Found |
136
+ |-------|-------------|
137
+ | 1 | PLAN.md, RESEARCH.md |
138
+ | 2 | PLAN.md, CONTEXT.md, DESIGN.md |
139
+ | 3 | PLAN.md |
140
+ | 4 | PLAN.md, RESEARCH.md, DESIGN.md |
141
+ ```
142
+
143
+ This helps understand which phases had dedicated research, design, or context discussion.
144
+
145
+ </guidelines>
@@ -22,12 +22,14 @@ This is the ritual that separates "development" from "shipped."
22
22
 
23
23
  When a milestone completes, this workflow:
24
24
 
25
- 1. Extracts full milestone details to `.planning/milestones/v[X.Y]-ROADMAP.md`
26
- 2. Archives requirements to `.planning/milestones/v[X.Y]-REQUIREMENTS.md`
27
- 3. Updates ROADMAP.md to replace milestone details with one-line summary
28
- 4. Deletes REQUIREMENTS.md (fresh one created for next milestone)
29
- 5. Performs full PROJECT.md evolution review
30
- 6. Offers to create next milestone inline
25
+ 1. Consolidates phase decisions into `.planning/milestones/v[X.Y]-DECISIONS.md`
26
+ 2. Cleans up phase artifacts (PLAN, CONTEXT, RESEARCH, DESIGN files deleted)
27
+ 3. Extracts full milestone details to `.planning/milestones/v[X.Y]-ROADMAP.md`
28
+ 4. Archives requirements to `.planning/milestones/v[X.Y]-REQUIREMENTS.md`
29
+ 5. Updates ROADMAP.md to replace milestone details with one-line summary
30
+ 6. Deletes REQUIREMENTS.md (fresh one created for next milestone)
31
+ 7. Performs full PROJECT.md evolution review
32
+ 8. Routes to `/ms:new-milestone` for next milestone
31
33
 
32
34
  **Context Efficiency:**
33
35
 
@@ -98,7 +100,50 @@ cat .planning/config.json 2>/dev/null
98
100
  Proceeding to stats gathering...
99
101
  ```
100
102
 
101
- Proceed directly to gather_stats step.
103
+ Proceed directly to consolidate_decisions step.
104
+
105
+ </step>
106
+
107
+ <step name="consolidate_decisions">
108
+
109
+ Consolidate phase decisions before archiving.
110
+
111
+ **Spawn ms-consolidator agent:**
112
+
113
+ ```
114
+ Task(
115
+ prompt="Consolidate decisions from milestone v[X.Y] [Name].
116
+
117
+ Phase range: [PHASE_START]-[PHASE_END]
118
+ Phase directories:
119
+ - .planning/phases/01-foundation
120
+ - .planning/phases/02-auth
121
+ - [etc. for all phases in milestone]
122
+
123
+ Extract decisions from PLAN, CONTEXT, RESEARCH, DESIGN files.
124
+ Create v[X.Y]-DECISIONS.md in .planning/milestones/.
125
+ Delete source files (preserve SUMMARY, VERIFICATION, UAT).",
126
+ subagent_type="ms-consolidator"
127
+ )
128
+ ```
129
+
130
+ **Wait for completion and verify:**
131
+
132
+ ```bash
133
+ ls .planning/milestones/v[X.Y]-DECISIONS.md
134
+ ```
135
+
136
+ **Present consolidation summary:**
137
+
138
+ ```
139
+ ✓ Decisions consolidated: [N] decisions in [M] categories
140
+ ✓ Source files cleaned: PLAN, CONTEXT, RESEARCH, DESIGN deleted
141
+ ✓ Preserved: SUMMARY, VERIFICATION, UAT files
142
+
143
+ Report: .planning/milestones/v[X.Y]-DECISIONS.md
144
+ ```
145
+
146
+ Continue to gather_stats step.
102
147
 
103
148
  </step>
104
149
 
@@ -604,6 +649,7 @@ Commit milestone completion including archive files and deletions.
604
649
 
605
650
  ```bash
606
651
  # Stage archive files (new)
652
+ git add .planning/milestones/v[X.Y]-DECISIONS.md
607
653
  git add .planning/milestones/v[X.Y]-ROADMAP.md
608
654
  git add .planning/milestones/v[X.Y]-REQUIREMENTS.md
609
655
  git add .planning/milestones/v[X.Y]-MILESTONE-AUDIT.md 2>/dev/null || true
@@ -621,10 +667,14 @@ git commit -m "$(cat <<'EOF'
621
667
  chore: complete v[X.Y] milestone
622
668
 
623
669
  Archived:
670
+ - milestones/v[X.Y]-DECISIONS.md (consolidated decisions)
624
671
  - milestones/v[X.Y]-ROADMAP.md
625
672
  - milestones/v[X.Y]-REQUIREMENTS.md
626
673
  - milestones/v[X.Y]-MILESTONE-AUDIT.md (if audit was run)
627
674
 
675
+ Cleaned:
676
+ - Phase PLAN, CONTEXT, RESEARCH, DESIGN files (consolidated into DECISIONS.md)
677
+
628
678
  Deleted (fresh for next milestone):
629
679
  - ROADMAP.md
630
680
  - REQUIREMENTS.md
@@ -663,20 +713,19 @@ Tag: v[X.Y]
663
713
 
664
714
  ## ▶ Next Up
665
715
 
666
- **Discuss Next Milestone** — figure out what to build next
716
+ **Start Next Milestone** — define goals and requirements
667
717
 
668
- `/ms:discuss-milestone`
718
+ `/ms:new-milestone`
669
719
 
670
720
  <sub>`/clear` first → fresh context window</sub>
671
721
 
672
722
  ---
673
723
 
674
724
  **Next milestone flow:**
675
- 1. `/ms:discuss-milestone` — thinking partner, creates context file
676
- 2. `/ms:new-milestone` — update PROJECT.md with new goals
677
- 3. `/ms:research-project` — (optional) research ecosystem
678
- 4. `/ms:define-requirements` — scope what to build
679
- 5. `/ms:create-roadmap` — plan how to build it
725
+ 1. `/ms:new-milestone` — discover what to build, update PROJECT.md with goals
726
+ 2. `/ms:research-project` — (optional) research ecosystem
727
+ 3. `/ms:define-requirements` — scope what to build
728
+ 4. `/ms:create-roadmap` — plan how to build it
680
729
 
681
730
  ---
682
731
  ```
@@ -725,6 +774,8 @@ If yes → milestone. If no → keep working.
725
774
 
726
775
  Milestone completion is successful when:
727
776
 
777
+ - [ ] Decisions consolidated (milestones/v[X.Y]-DECISIONS.md created)
778
+ - [ ] Phase artifacts cleaned (PLAN, CONTEXT, RESEARCH, DESIGN deleted)
728
779
  - [ ] MILESTONES.md entry created with stats and accomplishments
729
780
  - [ ] PROJECT.md full evolution review completed
730
781
  - [ ] All shipped requirements moved to Validated in PROJECT.md
@@ -736,6 +787,6 @@ Milestone completion is successful when:
736
787
  - [ ] STATE.md updated with fresh project reference
737
788
  - [ ] Git tag created (v[X.Y])
738
789
  - [ ] Milestone commit made (includes archive files and deletion)
739
- - [ ] User knows next steps (starting with /ms:define-requirements)
790
+ - [ ] User knows next steps (starting with /ms:new-milestone)
740
791
 
741
792
  </success_criteria>