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,214 @@
1
+ # Roadmap Template
2
+
3
+ Template for `.planning/ROADMAP.md`.
4
+
5
+ ## Initial Roadmap (v1.0 Greenfield)
6
+
7
+ ```markdown
8
+ # Roadmap: [Project Name]
9
+
10
+ ## Overview
11
+
12
+ [One paragraph describing the journey from start to finish]
13
+
14
+ ## Phases
15
+
16
+ **Phase Numbering:**
17
+ - Integer phases (1, 2, 3): Planned milestone work
18
+ - Decimal phases (2.1, 2.2): Urgent insertions (marked with INSERTED)
19
+
20
+ Decimal phases appear between their surrounding integers in numeric order.
21
+
22
+ - [ ] **Phase 1: [Name]** - [One-line description]
23
+ - [ ] **Phase 2: [Name]** - [One-line description]
24
+ - [ ] **Phase 3: [Name]** - [One-line description]
25
+ - [ ] **Phase 4: [Name]** - [One-line description]
26
+
27
+ ## Phase Details
28
+
29
+ ### Phase 1: [Name]
30
+ **Goal**: [What this phase delivers]
31
+ **Depends on**: Nothing (first phase)
32
+ **Requirements**: [REQ-01, REQ-02, REQ-03]
33
+ **Success Criteria** (what must be TRUE):
34
+ 1. [Observable behavior from user perspective]
35
+ 2. [Observable behavior from user perspective]
36
+ 3. [Observable behavior from user perspective]
37
+ **Research**: Unlikely (established patterns)
38
+ **Plans**: [Number of plans, e.g., "3 plans" or "TBD"]
39
+
40
+ Plans:
41
+ - [ ] 01-01: [Brief description of first plan]
42
+ - [ ] 01-02: [Brief description of second plan]
43
+ - [ ] 01-03: [Brief description of third plan]
44
+
45
+ ### Phase 2: [Name]
46
+ **Goal**: [What this phase delivers]
47
+ **Depends on**: Phase 1
48
+ **Requirements**: [REQ-04, REQ-05]
49
+ **Success Criteria** (what must be TRUE):
50
+ 1. [Observable behavior from user perspective]
51
+ 2. [Observable behavior from user perspective]
52
+ **Research**: Likely (new integration)
53
+ **Research topics**: [What needs investigating]
54
+ **Plans**: [Number of plans]
55
+
56
+ Plans:
57
+ - [ ] 02-01: [Brief description]
58
+ - [ ] 02-02: [Brief description]
59
+
60
+ ### Phase 2.1: Critical Fix (INSERTED)
61
+ **Goal**: [Urgent work inserted between phases]
62
+ **Depends on**: Phase 2
63
+ **Success Criteria** (what must be TRUE):
64
+ 1. [What the fix achieves]
65
+ **Plans**: 1 plan
66
+
67
+ Plans:
68
+ - [ ] 02.1-01: [Description]
69
+
70
+ ### Phase 3: [Name]
71
+ **Goal**: [What this phase delivers]
72
+ **Depends on**: Phase 2
73
+ **Requirements**: [REQ-06, REQ-07, REQ-08]
74
+ **Success Criteria** (what must be TRUE):
75
+ 1. [Observable behavior from user perspective]
76
+ 2. [Observable behavior from user perspective]
77
+ 3. [Observable behavior from user perspective]
78
+ **Research**: Likely (external API)
79
+ **Research topics**: [What needs investigating]
80
+ **Plans**: [Number of plans]
81
+
82
+ Plans:
83
+ - [ ] 03-01: [Brief description]
84
+ - [ ] 03-02: [Brief description]
85
+
86
+ ### Phase 4: [Name]
87
+ **Goal**: [What this phase delivers]
88
+ **Depends on**: Phase 3
89
+ **Requirements**: [REQ-09, REQ-10]
90
+ **Success Criteria** (what must be TRUE):
91
+ 1. [Observable behavior from user perspective]
92
+ 2. [Observable behavior from user perspective]
93
+ **Research**: Unlikely (internal patterns)
94
+ **Plans**: [Number of plans]
95
+
96
+ Plans:
97
+ - [ ] 04-01: [Brief description]
98
+
99
+ ## Progress
100
+
101
+ **Execution Order:**
102
+ Phases execute in numeric order: 2 → 2.1 → 2.2 → 3 → 3.1 → 4
103
+
104
+ | Phase | Plans Complete | Status | Completed |
105
+ |-------|----------------|--------|-----------|
106
+ | 1. [Name] | 0/3 | Not started | - |
107
+ | 2. [Name] | 0/2 | Not started | - |
108
+ | 3. [Name] | 0/2 | Not started | - |
109
+ | 4. [Name] | 0/1 | Not started | - |
110
+ ```
111
+
112
+ <guidelines>
113
+ **Initial planning (v1.0):**
114
+ - Phase count depends on depth setting (quick: 3-5, standard: 5-8, comprehensive: 8-12)
115
+ - Each phase delivers something coherent
116
+ - Phases can have 1+ plans (split if >3 tasks or multiple subsystems)
117
+ - Plans use naming: {phase}-{plan}-PLAN.md (e.g., 01-02-PLAN.md)
118
+ - No time estimates (this isn't enterprise PM)
119
+ - Progress table updated by execute workflow
120
+ - Plan count can be "TBD" initially, refined during planning
121
+
122
+ **Success criteria:**
123
+ - 2-5 observable behaviors per phase (from user's perspective)
124
+ - Cross-checked against requirements during roadmap creation
125
+ - Flow downstream to `must_haves` in plan-phase
126
+ - Verified by verify-phase after execution
127
+ - Format: "User can [action]" or "[Thing] works/exists"
128
+
129
+ **Research flags:**
130
+ - `Research: Likely` - External APIs, new libraries, architectural decisions
131
+ - `Research: Unlikely` - Internal patterns, CRUD operations, established conventions
132
+ - Include `Research topics:` when Likely
133
+ - Flags are hints, not mandates - validate at planning time
134
+
135
+ **After milestones ship:**
136
+ - Collapse completed milestones in `<details>` tags
137
+ - Add new milestone sections for upcoming work
138
+ - Keep continuous phase numbering (never restart at 01)
139
+ </guidelines>
140
+
141
+ <status_values>
142
+ - `Not started` - Haven't begun
143
+ - `In progress` - Currently working
144
+ - `Complete` - Done (add completion date)
145
+ - `Deferred` - Pushed to later (with reason)
146
+ </status_values>
147
+
148
+ ## Milestone-Grouped Roadmap (After v1.0 Ships)
149
+
150
+ After completing first milestone, reorganize with milestone groupings:
151
+
152
+ ```markdown
153
+ # Roadmap: [Project Name]
154
+
155
+ ## Milestones
156
+
157
+ - ✅ **v1.0 MVP** - Phases 1-4 (shipped YYYY-MM-DD)
158
+ - 🚧 **v1.1 [Name]** - Phases 5-6 (in progress)
159
+ - 📋 **v2.0 [Name]** - Phases 7-10 (planned)
160
+
161
+ ## Phases
162
+
163
+ <details>
164
+ <summary>✅ v1.0 MVP (Phases 1-4) - SHIPPED YYYY-MM-DD</summary>
165
+
166
+ ### Phase 1: [Name]
167
+ **Goal**: [What this phase delivers]
168
+ **Plans**: 3 plans
169
+
170
+ Plans:
171
+ - [x] 01-01: [Brief description]
172
+ - [x] 01-02: [Brief description]
173
+ - [x] 01-03: [Brief description]
174
+
175
+ [... remaining v1.0 phases ...]
176
+
177
+ </details>
178
+
179
+ ### 🚧 v1.1 [Name] (In Progress)
180
+
181
+ **Milestone Goal:** [What v1.1 delivers]
182
+
183
+ #### Phase 5: [Name]
184
+ **Goal**: [What this phase delivers]
185
+ **Depends on**: Phase 4
186
+ **Plans**: 2 plans
187
+
188
+ Plans:
189
+ - [ ] 05-01: [Brief description]
190
+ - [ ] 05-02: [Brief description]
191
+
192
+ [... remaining v1.1 phases ...]
193
+
194
+ ### 📋 v2.0 [Name] (Planned)
195
+
196
+ **Milestone Goal:** [What v2.0 delivers]
197
+
198
+ [... v2.0 phases ...]
199
+
200
+ ## Progress
201
+
202
+ | Phase | Milestone | Plans Complete | Status | Completed |
203
+ |-------|-----------|----------------|--------|-----------|
204
+ | 1. Foundation | v1.0 | 3/3 | Complete | YYYY-MM-DD |
205
+ | 2. Features | v1.0 | 2/2 | Complete | YYYY-MM-DD |
206
+ | 5. Security | v1.1 | 0/2 | Not started | - |
207
+ ```
208
+
209
+ **Notes:**
210
+ - Milestone emoji: ✅ shipped, 🚧 in progress, 📋 planned
211
+ - Completed milestones collapsed in `<details>` for readability
212
+ - Current/future milestones expanded
213
+ - Continuous phase numbering (01-99)
214
+ - Progress table includes milestone column
@@ -0,0 +1,224 @@
1
+ # State Template
2
+
3
+ Template for `.planning/STATE.md` — the project's living memory.
4
+
5
+ ---
6
+
7
+ ## File Template
8
+
9
+ ```markdown
10
+ # Project State
11
+
12
+ ## Project Reference
13
+
14
+ See: .planning/PROJECT.md (updated [date])
15
+
16
+ **Core value:** [One-liner from PROJECT.md Core Value section]
17
+ **Current focus:** [Current phase name]
18
+
19
+ ## Current Position
20
+
21
+ Phase: [X] of [Y] ([Phase name])
22
+ Plan: [A] of [B] in current phase
23
+ Status: [Ready to plan / Planning / Ready to execute / In progress / Phase complete]
24
+ Last activity: [YYYY-MM-DD] — [What happened]
25
+
26
+ Progress: [░░░░░░░░░░] 0%
27
+
28
+ ## Performance Metrics
29
+
30
+ **Velocity:**
31
+ - Total plans completed: [N]
32
+ - Average duration: [X] min
33
+ - Total execution time: [X.X] hours
34
+
35
+ **By Phase:**
36
+
37
+ | Phase | Plans | Total | Avg/Plan |
38
+ |-------|-------|-------|----------|
39
+ | - | - | - | - |
40
+
41
+ **Recent Trend:**
42
+ - Last 5 plans: [durations]
43
+ - Trend: [Improving / Stable / Degrading]
44
+
45
+ *Updated after each plan completion*
46
+
47
+ ## Accumulated Context
48
+
49
+ ### Decisions
50
+
51
+ Decisions are logged in PROJECT.md Key Decisions table.
52
+ Recent decisions affecting current work:
53
+
54
+ - [Phase X]: [Decision summary]
55
+ - [Phase Y]: [Decision summary]
56
+
57
+ ### Pending Todos
58
+
59
+ [From .planning/todos/pending/ — ideas captured during sessions]
60
+
61
+ None yet.
62
+
63
+ ### Recent Adhoc Work
64
+
65
+ [Small work items executed via /ms:do-work]
66
+
67
+ None yet.
68
+
69
+ *See `.planning/adhoc/` for full history*
70
+
71
+ ### Blockers/Concerns
72
+
73
+ [Issues that affect future work]
74
+
75
+ None yet.
76
+
77
+ ## Session Continuity
78
+
79
+ Last session: [YYYY-MM-DD HH:MM]
80
+ Stopped at: [Description of last completed action]
81
+ Resume file: [Path to .continue-here*.md if exists, otherwise "None"]
82
+ ```
83
+
84
+ <purpose>
85
+
86
+ STATE.md is the project's short-term memory spanning all phases and sessions.
87
+
88
+ **Problem it solves:** Information is captured in summaries, issues, and decisions but not systematically consumed. Sessions start without context.
89
+
90
+ **Solution:** A single, small file that's:
91
+ - Read first in every workflow
92
+ - Updated after every significant action
93
+ - Contains digest of accumulated context
94
+ - Enables instant session restoration
95
+
96
+ </purpose>
97
+
98
+ <lifecycle>
99
+
100
+ **Creation:** After ROADMAP.md is created (during init)
101
+ - Reference PROJECT.md (read it for current context)
102
+ - Initialize empty accumulated context sections
103
+ - Set position to "Phase 1 ready to plan"
104
+
105
+ **Reading:** First step of every workflow
106
+ - progress: Present status to user
107
+ - plan: Inform planning decisions
108
+ - execute: Know current position
109
+ - transition: Know what's complete
110
+
111
+ **Writing:** After every significant action
112
+ - execute: After SUMMARY.md created
113
+ - Update position (phase, plan, status)
114
+ - Note new decisions (detail in PROJECT.md)
115
+ - Add blockers/concerns
116
+ - transition: After phase marked complete
117
+ - Update progress bar
118
+ - Clear resolved blockers
119
+ - Refresh Project Reference date
120
+ - do-work: After adhoc work completed
121
+ - Add entry to "Recent Adhoc Work" section
122
+ - Keep last 5 entries (older entries remain in .planning/adhoc/)
123
+
124
+ </lifecycle>
125
+
126
+ <sections>
127
+
128
+ ### Project Reference
129
+ Points to PROJECT.md for full context. Includes:
130
+ - Core value (the ONE thing that matters)
131
+ - Current focus (which phase)
132
+ - Last update date (triggers re-read if stale)
133
+
134
+ Claude reads PROJECT.md directly for requirements, constraints, and decisions.
135
+
136
+ ### Current Position
137
+ Where we are right now:
138
+ - Phase X of Y — which phase
139
+ - Plan A of B — which plan within phase
140
+ - Status — current state
141
+ - Last activity — what happened most recently
142
+ - Progress bar — visual indicator of overall completion
143
+
144
+ Progress calculation: (completed plans) / (total plans across all phases) × 100%
145
+
146
+ ### Performance Metrics
147
+ Track velocity to understand execution patterns:
148
+ - Total plans completed
149
+ - Average duration per plan
150
+ - Per-phase breakdown
151
+ - Recent trend (improving/stable/degrading)
152
+
153
+ Updated after each plan completion.
154
+
155
+ ### Accumulated Context
156
+
157
+ **Decisions:** Reference to PROJECT.md Key Decisions table, plus recent decisions summary for quick access. Full decision log lives in PROJECT.md.
158
+
159
+ **Pending Todos:** Ideas captured via /ms:add-todo
160
+ - Count of pending todos
161
+ - Reference to .planning/todos/pending/
162
+ - Brief list if few, count if many (e.g., "5 pending todos — see /ms:check-todos")
163
+
164
+ **Recent Adhoc Work:** Small fixes executed via /ms:do-work
165
+ - Last 5 adhoc work entries
166
+ - Format: `- [date]: [description] (.planning/adhoc/[file]-SUMMARY.md)`
167
+ - Full history remains in .planning/adhoc/ directory
168
+ - Older entries removed from STATE.md but files preserved
169
+
170
+ **Blockers/Concerns:** From "Next Phase Readiness" sections
171
+ - Issues that affect future work
172
+ - Prefix with originating phase
173
+ - Cleared when addressed
174
+
175
+ ### Session Continuity
176
+ Enables instant resumption:
177
+ - When was last session
178
+ - What was last completed
179
+ - Is there a .continue-here file to resume from
180
+
181
+ </sections>
182
+
183
+ <size_constraint>
184
+
185
+ Keep STATE.md under 100 lines.
186
+
187
+ It's a DIGEST, not an archive. If accumulated context grows too large:
188
+ - Keep only 3-5 recent decisions in summary (full log in PROJECT.md)
189
+ - Keep only active blockers, remove resolved ones
190
+
191
+ The goal is "read once, know where we are" — if it's too long, that fails.
192
+
193
+ </size_constraint>
194
+
195
+ <guidelines>
196
+
197
+ **When created:**
198
+ - During project initialization (after ROADMAP.md)
199
+ - Reference PROJECT.md (extract core value and current focus)
200
+ - Initialize empty sections
201
+
202
+ **When read:**
203
+ - Every workflow starts by reading STATE.md
204
+ - Then read PROJECT.md for full context
205
+ - Provides instant context restoration
206
+
207
+ **When updated:**
208
+ - After each plan execution (update position, note decisions, update issues/blockers)
209
+ - After phase transitions (update progress bar, clear resolved blockers, refresh project reference)
210
+ - After adhoc work via /ms:do-work (add entry to "Recent Adhoc Work")
211
+
212
+ **Size management:**
213
+ - Keep under 100 lines total
214
+ - Recent decisions only in STATE.md (full log in PROJECT.md)
215
+ - Keep only active blockers
216
+
217
+ **Sections:**
218
+ - Project Reference: Pointer to PROJECT.md with core value
219
+ - Current Position: Where we are now (phase, plan, status)
220
+ - Performance Metrics: Velocity tracking
221
+ - Accumulated Context: Recent decisions, pending todos, adhoc work, blockers
222
+ - Session Continuity: Resume information
223
+
224
+ </guidelines>
@@ -0,0 +1,269 @@
1
+ # Summary Template
2
+
3
+ Template for `.planning/phases/XX-name/{phase}-{plan}-SUMMARY.md` - phase completion documentation.
4
+
5
+ ---
6
+
7
+ ## File Template
8
+
9
+ ```markdown
10
+ ---
11
+ phase: XX-name
12
+ plan: YY
13
+ subsystem: [primary category: auth, payments, ui, api, database, infra, testing, etc.]
14
+ tags: [searchable tech: jwt, stripe, react, postgres, prisma]
15
+
16
+ # Dependency graph
17
+ requires:
18
+ - phase: [prior phase this depends on]
19
+ provides: [what that phase built that this uses]
20
+ provides:
21
+ - [bullet list of what this phase built/delivered]
22
+ affects: [list of phase names or keywords that will need this context]
23
+
24
+ # Tech tracking
25
+ tech-stack:
26
+ added: [libraries/tools added in this phase]
27
+ patterns: [architectural/code patterns established]
28
+
29
+ key-files:
30
+ created: [important files created]
31
+ modified: [important files modified]
32
+
33
+ key-decisions:
34
+ - "Decision 1"
35
+ - "Decision 2"
36
+
37
+ patterns-established:
38
+ - "Pattern 1: description"
39
+ - "Pattern 2: description"
40
+
41
+ # Metrics
42
+ duration: Xmin
43
+ completed: YYYY-MM-DD
44
+ ---
45
+
46
+ # Phase [X]: [Name] Summary
47
+
48
+ **[Substantive one-liner describing outcome - NOT "phase complete" or "implementation finished"]**
49
+
50
+ ## Performance
51
+
52
+ - **Duration:** [time] (e.g., 23 min, 1h 15m)
53
+ - **Started:** [ISO timestamp]
54
+ - **Completed:** [ISO timestamp]
55
+ - **Tasks:** [count completed]
56
+ - **Files modified:** [count]
57
+
58
+ ## Accomplishments
59
+ - [Most important outcome]
60
+ - [Second key accomplishment]
61
+ - [Third if applicable]
62
+
63
+ ## Task Commits
64
+
65
+ Each task was committed atomically:
66
+
67
+ 1. **Task 1: [task name]** - `abc123f` (feat/fix/test/refactor)
68
+ 2. **Task 2: [task name]** - `def456g` (feat/fix/test/refactor)
69
+ 3. **Task 3: [task name]** - `hij789k` (feat/fix/test/refactor)
70
+
71
+ **Plan metadata:** `lmn012o` (docs: complete plan)
72
+
73
+ _Note: TDD tasks may have multiple commits (test → feat → refactor)_
74
+
75
+ ## Files Created/Modified
76
+ - `path/to/file.ts` - What it does
77
+ - `path/to/another.ts` - What it does
78
+
79
+ ## Decisions Made
80
+ [Key decisions with brief rationale, or "None - followed plan as specified"]
81
+
82
+ ## Deviations from Plan
83
+
84
+ [If no deviations: "None - plan executed exactly as written"]
85
+
86
+ [If deviations occurred:]
87
+
88
+ ### Auto-fixed Issues
89
+
90
+ **1. [Rule X - Category] Brief description**
91
+ - **Found during:** Task [N] ([task name])
92
+ - **Issue:** [What was wrong]
93
+ - **Fix:** [What was done]
94
+ - **Files modified:** [file paths]
95
+ - **Verification:** [How it was verified]
96
+ - **Committed in:** [hash] (part of task commit)
97
+
98
+ [... repeat for each auto-fix ...]
99
+
100
+ ---
101
+
102
+ **Total deviations:** [N] auto-fixed ([breakdown by rule])
103
+ **Impact on plan:** [Brief assessment - e.g., "All auto-fixes necessary for correctness/security. No scope creep."]
104
+
105
+ ## Issues Encountered
106
+ [Problems and how they were resolved, or "None"]
107
+
108
+ [Note: "Deviations from Plan" documents unplanned work that was handled automatically via deviation rules. "Issues Encountered" documents problems during planned work that required problem-solving.]
109
+
110
+ ## User Setup Required
111
+
112
+ [If USER-SETUP.md was generated:]
113
+ **External services require manual configuration.** See [{phase}-USER-SETUP.md](./{phase}-USER-SETUP.md) for:
114
+ - Environment variables to add
115
+ - Dashboard configuration steps
116
+ - Verification commands
117
+
118
+ [If no USER-SETUP.md:]
119
+ None - no external service configuration required.
120
+
121
+ ## Next Phase Readiness
122
+ [What's ready for next phase]
123
+ [Any blockers or concerns]
124
+
125
+ ---
126
+ *Phase: XX-name*
127
+ *Completed: [date]*
128
+ ```
129
+
130
+ <frontmatter_guidance>
131
+ **Purpose:** Enable automatic context assembly via dependency graph. Frontmatter makes summary metadata machine-readable so plan-phase can scan all summaries quickly and select relevant ones based on dependencies.
132
+
133
+ **Fast scanning:** Frontmatter is first ~25 lines, cheap to scan across all summaries without reading full content.
134
+
135
+ **Dependency graph:** `requires`/`provides`/`affects` create explicit links between phases, enabling transitive closure for context selection.
136
+
137
+ **Subsystem:** Primary categorization (auth, payments, ui, api, database, infra, testing) for detecting related phases.
138
+
139
+ **Tags:** Searchable technical keywords (libraries, frameworks, tools) for tech stack awareness.
140
+
141
+ **Key-files:** Important files for @context references in PLAN.md.
142
+
143
+ **Patterns:** Established conventions future phases should maintain.
144
+
145
+ **Population:** Frontmatter is populated during summary creation in execute-plan.md. See `<step name="create_summary">` for field-by-field guidance.
146
+ </frontmatter_guidance>
147
+
148
+ <one_liner_rules>
149
+ The one-liner MUST be substantive:
150
+
151
+ **Good:**
152
+ - "JWT auth with refresh rotation using jose library"
153
+ - "Prisma schema with User, Session, and Product models"
154
+ - "Dashboard with real-time metrics via Server-Sent Events"
155
+
156
+ **Bad:**
157
+ - "Phase complete"
158
+ - "Authentication implemented"
159
+ - "Foundation finished"
160
+ - "All tasks done"
161
+
162
+ The one-liner should tell someone what actually shipped.
163
+ </one_liner_rules>
164
+
165
+ <example>
166
+ ```markdown
167
+ # Phase 1: Foundation Summary
168
+
169
+ **JWT auth with refresh rotation using jose library, Prisma User model, and protected API middleware**
170
+
171
+ ## Performance
172
+
173
+ - **Duration:** 28 min
174
+ - **Started:** 2025-01-15T14:22:10Z
175
+ - **Completed:** 2025-01-15T14:50:33Z
176
+ - **Tasks:** 5
177
+ - **Files modified:** 8
178
+
179
+ ## Accomplishments
180
+ - User model with email/password auth
181
+ - Login/logout endpoints with httpOnly JWT cookies
182
+ - Protected route middleware checking token validity
183
+ - Refresh token rotation on each request
184
+
185
+ ## Files Created/Modified
186
+ - `prisma/schema.prisma` - User and Session models
187
+ - `src/app/api/auth/login/route.ts` - Login endpoint
188
+ - `src/app/api/auth/logout/route.ts` - Logout endpoint
189
+ - `src/middleware.ts` - Protected route checks
190
+ - `src/lib/auth.ts` - JWT helpers using jose
191
+
192
+ ## Decisions Made
193
+ - Used jose instead of jsonwebtoken (ESM-native, Edge-compatible)
194
+ - 15-min access tokens with 7-day refresh tokens
195
+ - Storing refresh tokens in database for revocation capability
196
+
197
+ ## Deviations from Plan
198
+
199
+ ### Auto-fixed Issues
200
+
201
+ **1. [Rule 2 - Missing Critical] Added password hashing with bcrypt**
202
+ - **Found during:** Task 2 (Login endpoint implementation)
203
+ - **Issue:** Plan didn't specify password hashing - storing plaintext would be critical security flaw
204
+ - **Fix:** Added bcrypt hashing on registration, comparison on login with salt rounds 10
205
+ - **Files modified:** src/app/api/auth/login/route.ts, src/lib/auth.ts
206
+ - **Verification:** Password hash test passes, plaintext never stored
207
+ - **Committed in:** abc123f (Task 2 commit)
208
+
209
+ **2. [Rule 3 - Blocking] Installed missing jose dependency**
210
+ - **Found during:** Task 4 (JWT token generation)
211
+ - **Issue:** jose package not in package.json, import failing
212
+ - **Fix:** Ran `npm install jose`
213
+ - **Files modified:** package.json, package-lock.json
214
+ - **Verification:** Import succeeds, build passes
215
+ - **Committed in:** def456g (Task 4 commit)
216
+
217
+ ---
218
+
219
+ **Total deviations:** 2 auto-fixed (1 missing critical, 1 blocking)
220
+ **Impact on plan:** Both auto-fixes essential for security and functionality. No scope creep.
221
+
222
+ ## Issues Encountered
223
+ - jsonwebtoken CommonJS import failed in Edge runtime - switched to jose (planned library change, worked as expected)
224
+
225
+ ## Next Phase Readiness
226
+ - Auth foundation complete, ready for feature development
227
+ - User registration endpoint needed before public launch
228
+
229
+ ---
230
+ *Phase: 01-foundation*
231
+ *Completed: 2025-01-15*
232
+ ```
233
+ </example>
234
+
235
+ <guidelines>
236
+ **When to create:**
237
+ - After completing each phase plan
238
+ - Required output from execute-plan workflow
239
+ - Documents what actually happened vs what was planned
240
+
241
+ **Frontmatter completion:**
242
+ - MANDATORY: Complete all frontmatter fields during summary creation
243
+ - See <frontmatter_guidance> for field purposes
244
+ - Frontmatter enables automatic context assembly for future planning
245
+
246
+ **One-liner requirements:**
247
+ - Must be substantive (describe what shipped, not "phase complete")
248
+ - Should tell someone what was accomplished
249
+ - Examples: "JWT auth with refresh rotation using jose library" not "Authentication implemented"
250
+
251
+ **Performance tracking:**
252
+ - Include duration, start/end timestamps
253
+ - Used for velocity metrics in STATE.md
254
+
255
+ **Deviations section:**
256
+ - Documents unplanned work handled via deviation rules
257
+ - Separate from "Issues Encountered" (which is planned work problems)
258
+ - Auto-fixed issues: What was wrong, how fixed, verification
259
+
260
+ **Decisions section:**
261
+ - Key decisions made during execution
262
+ - Include rationale (why this choice)
263
+ - Extracted to STATE.md accumulated context
264
+ - Use "None - followed plan as specified" if no deviations
265
+
266
+ **After creation:**
267
+ - STATE.md updated with position, decisions, issues
268
+ - Next plan can reference decisions made
269
+ </guidelines>