mindsystem-cc 3.14.0 → 3.16.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 (48) hide show
  1. package/README.md +1 -0
  2. package/agents/ms-codebase-researcher.md +105 -0
  3. package/agents/ms-consolidator.md +137 -286
  4. package/agents/ms-debugger.md +1 -0
  5. package/agents/ms-designer.md +1 -0
  6. package/agents/ms-executor.md +2 -1
  7. package/agents/ms-flutter-reviewer.md +1 -0
  8. package/agents/ms-integration-checker.md +1 -0
  9. package/agents/ms-plan-checker.md +17 -327
  10. package/agents/ms-researcher.md +25 -343
  11. package/agents/ms-roadmapper.md +10 -75
  12. package/agents/ms-verifier.md +33 -309
  13. package/agents/ms-verify-fixer.md +1 -0
  14. package/commands/ms/check-phase.md +24 -55
  15. package/commands/ms/complete-milestone.md +6 -25
  16. package/commands/ms/create-roadmap.md +3 -15
  17. package/commands/ms/design-phase.md +34 -0
  18. package/commands/ms/discuss-phase.md +1 -9
  19. package/commands/ms/doctor.md +224 -0
  20. package/commands/ms/execute-phase.md +22 -12
  21. package/commands/ms/help.md +11 -0
  22. package/commands/ms/new-milestone.md +3 -3
  23. package/commands/ms/plan-phase.md +1 -1
  24. package/commands/ms/research-phase.md +249 -85
  25. package/commands/ms/verify-work.md +1 -0
  26. package/mindsystem/templates/context.md +1 -11
  27. package/mindsystem/templates/discovery.md +2 -3
  28. package/mindsystem/templates/knowledge.md +99 -0
  29. package/mindsystem/templates/requirements.md +3 -61
  30. package/mindsystem/templates/research-comparison-output.md +50 -0
  31. package/mindsystem/templates/research-feasibility-output.md +43 -0
  32. package/mindsystem/templates/research-project-output.md +81 -0
  33. package/mindsystem/templates/research-subagent-prompt.md +164 -48
  34. package/mindsystem/templates/roadmap-milestone.md +67 -0
  35. package/mindsystem/templates/roadmap.md +2 -66
  36. package/mindsystem/workflows/complete-milestone.md +23 -140
  37. package/mindsystem/workflows/define-requirements.md +4 -8
  38. package/mindsystem/workflows/discuss-phase.md +25 -8
  39. package/mindsystem/workflows/execute-phase.md +34 -0
  40. package/mindsystem/workflows/execute-plan.md +8 -0
  41. package/mindsystem/workflows/plan-phase.md +40 -102
  42. package/mindsystem/workflows/verify-work.md +20 -0
  43. package/package.json +1 -1
  44. package/scripts/cleanup-phase-artifacts.sh +68 -0
  45. package/scripts/scan-artifact-subsystems.sh +55 -0
  46. package/scripts/scan-planning-context.py +689 -0
  47. package/mindsystem/templates/decisions.md +0 -145
  48. package/mindsystem/templates/learnings.md +0 -150
@@ -6,14 +6,14 @@ allowed-tools:
6
6
  - Read
7
7
  - Bash
8
8
  - Task
9
+ - Write
10
+ - AskUserQuestion
9
11
  ---
10
12
 
11
13
  <objective>
12
- Research how to implement a phase. Spawns ms-researcher agent with phase context.
14
+ Research how to implement a phase by spawning 3 parallel specialized agents, then synthesizing their findings into RESEARCH.md.
13
15
 
14
- **Orchestrator role:** Parse phase, validate against roadmap, check existing research, gather context, spawn researcher agent, present results.
15
-
16
- **Why subagent:** Research burns context fast (WebSearch, Context7 queries, source verification). Fresh 200k context for investigation. Main context stays lean for user interaction.
16
+ **Orchestrator role:** Parse phase, validate, pre-scan project context, spawn 3 agents (external docs, codebase patterns, best practices), synthesize findings, resolve conflicts, write RESEARCH.md.
17
17
  </objective>
18
18
 
19
19
  <context>
@@ -51,135 +51,282 @@ ls .planning/phases/${PHASE}-*/RESEARCH.md 2>/dev/null
51
51
 
52
52
  **If doesn't exist:** Continue.
53
53
 
54
- ## 3. Gather Phase Context
54
+ ## 3. Pre-scan Project Context
55
+
56
+ Gather baseline context that all agents need:
55
57
 
56
58
  ```bash
59
+ # Dependency file (first 100 lines)
60
+ cat pubspec.yaml package.json Gemfile requirements.txt go.mod pyproject.toml 2>/dev/null | head -100
61
+
62
+ # Phase context from roadmap
57
63
  grep -A20 "Phase ${PHASE}:" .planning/ROADMAP.md
64
+
65
+ # Requirements
58
66
  cat .planning/REQUIREMENTS.md 2>/dev/null
67
+
68
+ # Phase-specific context and design
59
69
  cat .planning/phases/${PHASE}-*/${PHASE}-CONTEXT.md 2>/dev/null
60
70
  cat .planning/phases/${PHASE}-*/${PHASE}-DESIGN.md 2>/dev/null
71
+
72
+ # Locked decisions
61
73
  grep -A30 "### Decisions Made" .planning/STATE.md 2>/dev/null
74
+
75
+ # Prior knowledge — match subsystem(s) by comparing phase description against config.json names
76
+ jq -r '.subsystems[]' .planning/config.json 2>/dev/null
77
+ cat .planning/knowledge/{matched_subsystem}.md 2>/dev/null
78
+ ```
79
+
80
+ Extract from pre-scan:
81
+ - `existing_tech`: Libraries already in the project (from dependency file)
82
+ - `phase_description`: What this phase aims to build
83
+ - `phase_requirements`: Specific requirements
84
+ - `locked_decisions`: From CONTEXT.md and STATE.md
85
+ - `design_specs`: From DESIGN.md if exists
86
+ - `prior_knowledge`: From `.planning/knowledge/{subsystem}.md` — prior decisions, known pitfalls, architecture patterns (so agents don't re-research settled decisions)
87
+
88
+ ## 4. Determine Research Scope
89
+
90
+ Research modes:
91
+ - **ecosystem** (default): Survey available tools, libraries, and integration options
92
+ - **feasibility**: Assess whether current stack can support the requirements
93
+ - **implementation**: Concrete how-to patterns and step-by-step approaches
94
+ - **comparison**: Evaluate alternatives side-by-side with tradeoffs
95
+
96
+ Frame the research question based on mode + phase description. Present to user:
97
+
62
98
  ```
99
+ Research scope for Phase {N}: {name}
63
100
 
64
- Present summary with phase description, requirements, prior decisions.
101
+ Mode: {mode}
102
+ Question: {framed_question}
103
+ Existing tech: {existing_tech_summary}
65
104
 
66
- **If DESIGN.md exists:** Research should address:
67
- - Libraries needed for specified interactions (animations, gestures, charts)
68
- - Technical feasibility of design requirements
69
- - Platform-specific implementation approaches
70
- - Component libraries that match the design system
105
+ Spawning 3 parallel agents:
106
+ 1. External Docs library documentation, APIs, code examples
107
+ 2. Codebase Patterns existing patterns, learnings, established conventions
108
+ 3. Best Practices — community consensus, pitfalls, SOTA
71
109
 
72
- ## 4. Spawn ms-researcher Agent
110
+ Proceed? (yes / adjust scope / change mode)
111
+ ```
73
112
 
74
- Research modes: ecosystem (default), feasibility, implementation, comparison.
113
+ ## 5. Spawn 3 Agents in Parallel
75
114
 
76
- ```markdown
115
+ Announce: "Spawning 3 research agents in parallel..."
116
+
117
+ All 3 receive pre-scan context (existing tech, phase description, requirements, locked decisions, design specs if any). Spawn all 3 in a single message using the Task tool.
118
+
119
+ ### Agent 1: External Docs (ms-researcher)
120
+
121
+ ```
122
+ Task(
123
+ prompt="
77
124
  <research_type>
78
- Phase Research — investigating HOW to implement a specific phase well.
125
+ Phase Research — External Documentation focus.
79
126
  </research_type>
80
127
 
81
- <key_insight>
82
- The question is NOT "which library should I use?"
128
+ <focus>
129
+ Library documentation, APIs, version-specific behavior, verified code examples.
130
+ Use the ms-lookup CLI for library docs and deep research:
131
+ ~/.claude/mindsystem/scripts/ms-lookup-wrapper.sh docs <library> '<query>'
132
+ ~/.claude/mindsystem/scripts/ms-lookup-wrapper.sh deep '<query>'
133
+ Use WebSearch for ecosystem discovery.
134
+ Focus on finding authoritative, current documentation for the libraries and tools
135
+ needed to implement this phase.
136
+ </focus>
83
137
 
84
- The question is: "What do I not know that I don't know?"
138
+ <existing_tech>
139
+ {existing_tech from pre-scan — so agent knows what's already in the project}
140
+ </existing_tech>
85
141
 
86
- For this phase, discover:
87
- - What's the established architecture pattern?
88
- - What libraries form the standard stack?
89
- - What problems do people commonly hit?
90
- - What's SOTA vs what Claude's training thinks is SOTA?
91
- - What should NOT be hand-rolled?
92
- </key_insight>
142
+ <prior_knowledge>
143
+ {prior_decisions, known_pitfalls, architecture_patterns from knowledge files — so agents don't re-research settled decisions}
144
+ </prior_knowledge>
93
145
 
94
146
  <objective>
95
- Research implementation approach for Phase {phase_number}: {phase_name}
96
- Mode: ecosystem
147
+ Research external documentation for Phase {N}: {name}
148
+ Mode: {mode}
97
149
  </objective>
98
150
 
99
151
  <context>
100
- **Phase description:** {phase_description}
101
- **Requirements:** {requirements_list}
102
- **Prior decisions:** {decisions_if_any}
103
- **Phase context:** {context_md_content}
104
- **Design specs:** {design_md_content_if_exists}
152
+ {phase_description, requirements, locked_decisions, design_specs}
105
153
  </context>
106
154
 
107
155
  <downstream_consumer>
108
- Your RESEARCH.md will be loaded by `/ms:plan-phase` which uses specific sections:
109
- - `## Standard Stack` Plans use these libraries
110
- - `## Architecture Patterns` Task structure follows these
111
- - `## Don't Hand-Roll` Tasks NEVER build custom solutions for listed problems
112
- - `## Common Pitfalls` Verification steps check for these
113
- - `## Code Examples` Task actions reference these patterns
114
-
115
- Be prescriptive, not exploratory. "Use X" not "Consider X or Y."
156
+ Your findings feed into orchestrator synthesis -> RESEARCH.md sections:
157
+ - Standard Stack (libraries, versions, install commands)
158
+ - Architecture Patterns (library-recommended patterns)
159
+ - Don't Hand-Roll (library solutions for common problems)
160
+ - Code Examples (verified from official docs)
161
+ - State of the Art (latest approaches, deprecated patterns)
162
+ Be prescriptive. Specific versions. Verified code.
116
163
  </downstream_consumer>
117
164
 
118
- <quality_gate>
119
- Before declaring complete, verify:
120
- - [ ] All domains investigated (not just some)
121
- - [ ] Negative claims verified with official docs
122
- - [ ] Multiple sources for critical claims
123
- - [ ] Confidence levels assigned honestly
124
- - [ ] Section names match what plan-phase expects
125
- </quality_gate>
126
-
127
165
  <output>
128
- Write to: .planning/phases/{phase}-{slug}/{phase}-RESEARCH.md
166
+ Return findings as structured text. Do NOT write to filesystem.
167
+ Format:
168
+ ## EXTERNAL DOCS FINDINGS
169
+ ### Recommended Libraries (name, version, purpose, install)
170
+ ### API Patterns & Code Examples (verified from docs)
171
+ ### Architecture Recommendations (from library docs)
172
+ ### Don't Hand-Roll (library solutions exist for these)
173
+ ### Version Constraints & Compatibility
174
+ ### Confidence (HIGH/MEDIUM/LOW per section with sources)
175
+ Complete your built-in verification protocol and quality checklist before returning findings.
129
176
  </output>
177
+ ",
178
+ subagent_type="ms-researcher",
179
+ description="External docs: Phase {N}"
180
+ )
130
181
  ```
131
182
 
183
+ ### Agent 2: Codebase Patterns (ms-codebase-researcher)
184
+
132
185
  ```
133
186
  Task(
134
- prompt=filled_prompt,
135
- subagent_type="ms-researcher",
136
- description="Research Phase {phase}"
137
- )
138
- ```
187
+ prompt="
188
+ <objective>
189
+ Analyze project codebase for patterns relevant to Phase {N}: {name}
190
+ </objective>
139
191
 
140
- ## 5. Handle Agent Return
192
+ <research_question>
193
+ {framed_question}
194
+ </research_question>
141
195
 
142
- **`## RESEARCH COMPLETE`:**
196
+ <phase_context>
197
+ {phase_description, requirements, locked_decisions}
198
+ </phase_context>
143
199
 
144
- Commit the research file:
200
+ <existing_tech>
201
+ {existing_tech from pre-scan}
202
+ </existing_tech>
145
203
 
146
- ```bash
147
- git add .planning/phases/${PHASE}-*/*-RESEARCH.md
148
- git commit -m "docs: complete research for phase ${PHASE}"
204
+ <prior_knowledge>
205
+ {prior_decisions, known_pitfalls, architecture_patterns from knowledge files — so agents don't re-research settled decisions}
206
+ </prior_knowledge>
207
+
208
+ <scan_hints>
209
+ {keywords extracted from phase description for targeted scanning}
210
+ </scan_hints>
211
+
212
+ <quality>
213
+ Complete your built-in success criteria checklist before returning findings.
214
+ </quality>
215
+ ",
216
+ subagent_type="ms-codebase-researcher",
217
+ description="Codebase patterns: Phase {N}"
218
+ )
149
219
  ```
150
220
 
151
- Display summary, then read `~/.claude/mindsystem/references/prework-status.md` to show what's done vs still needed. Also offer: Dig deeper, Review full.
221
+ ### Agent 3: Best Practices (ms-researcher)
222
+
223
+ ```
224
+ Task(
225
+ prompt="
226
+ <research_type>
227
+ Phase Research — Best Practices & Community Consensus focus.
228
+ </research_type>
152
229
 
153
- **`## CHECKPOINT REACHED`:** Present to user, get response, spawn continuation.
230
+ <focus>
231
+ Community consensus, common pitfalls, proven approaches, state of the art.
232
+ Use the ms-lookup CLI for deep research on high-value questions:
233
+ ~/.claude/mindsystem/scripts/ms-lookup-wrapper.sh deep '<query>'
234
+ Use WebSearch for community articles, blog posts, Stack Overflow patterns.
235
+ Focus on what practitioners recommend and what mistakes to avoid.
236
+ </focus>
154
237
 
155
- **`## RESEARCH INCONCLUSIVE`:** Show what was attempted, offer: Add context, Try different mode, Manual.
238
+ <existing_tech>
239
+ {existing_tech from pre-scan}
240
+ </existing_tech>
156
241
 
157
- ## 6. Spawn Continuation Agent
242
+ <prior_knowledge>
243
+ {prior_decisions, known_pitfalls, architecture_patterns from knowledge files — so agents don't re-research settled decisions}
244
+ </prior_knowledge>
158
245
 
159
- ```markdown
160
246
  <objective>
161
- Continue research for Phase {phase_number}: {phase_name}
247
+ Research best practices for Phase {N}: {name}
248
+ Mode: {mode}
162
249
  </objective>
163
250
 
164
- <prior_state>
165
- Research file: @.planning/phases/{phase}-{slug}/{phase}-RESEARCH.md
166
- </prior_state>
251
+ <context>
252
+ {phase_description, requirements, locked_decisions, design_specs}
253
+ </context>
167
254
 
168
- <checkpoint_response>
169
- **Type:** {checkpoint_type}
170
- **Response:** {user_response}
171
- </checkpoint_response>
172
- ```
255
+ <downstream_consumer>
256
+ Your findings feed into orchestrator synthesis -> RESEARCH.md sections:
257
+ - Common Pitfalls (community war stories, warning signs)
258
+ - State of the Art (current vs deprecated approaches)
259
+ - Architecture Patterns (industry patterns, not library-specific)
260
+ - Don't Hand-Roll (community-known solved problems)
261
+ - Alternatives Considered (why X over Y)
262
+ Be prescriptive. Cite sources. Flag confidence levels.
263
+ </downstream_consumer>
173
264
 
174
- ```
175
- Task(
176
- prompt=continuation_prompt,
265
+ <output>
266
+ Return findings as structured text. Do NOT write to filesystem.
267
+ Format:
268
+ ## BEST PRACTICES FINDINGS
269
+ ### Recommended Approaches (community consensus)
270
+ ### Common Pitfalls (what goes wrong, warning signs, prevention)
271
+ ### State of the Art (current vs deprecated, when things changed)
272
+ ### Alternative Approaches (what else exists, why not chosen)
273
+ ### Industry Patterns (architecture, testing, deployment)
274
+ ### Confidence (HIGH/MEDIUM/LOW per section with sources)
275
+ Complete your built-in verification protocol and quality checklist before returning findings.
276
+ </output>
277
+ ",
177
278
  subagent_type="ms-researcher",
178
- description="Continue research Phase {phase}"
279
+ description="Best practices: Phase {N}"
179
280
  )
180
281
  ```
181
282
 
182
- ## 7. Update Last Command
283
+ ## 6. Synthesize Findings
284
+
285
+ After all 3 agents return, read their structured outputs. Map findings to RESEARCH.md sections:
286
+
287
+ | RESEARCH.md Section | External Docs | Codebase | Best Practices | Synthesis Rule |
288
+ |---------------------|--------------|----------|----------------|----------------|
289
+ | Summary | Key libraries found | What exists already | Community direction | 2-3 paragraph synthesis |
290
+ | Standard Stack | Recommended + versions | Already in project | Community recommended | Merge: keep existing when sufficient, add new when needed |
291
+ | Architecture Patterns | Library-recommended | Established project patterns | Industry patterns | Follow existing; adopt recommended for new capabilities |
292
+ | Don't Hand-Roll | Library solutions | Internal solutions | Solved problems | Union of all three |
293
+ | Common Pitfalls | Library-specific gotchas | Past failures/learnings | Community war stories | Union, deduplicate |
294
+ | Code Examples | From official docs | From project | From community | Prefer official docs; show project examples for "how we do it here" |
295
+ | State of the Art | Latest versions/APIs | — | Current vs deprecated | Combine external + community |
296
+
297
+ **Conflict resolution:** If external recommends library X but project already uses library Y for the same purpose, present conflict to user via AskUserQuestion:
298
+ - Options: "Keep existing [Y]" / "Switch to recommended [X]" / "Use both (different purposes)" / "Something else"
299
+ - Record decision in RESEARCH.md
300
+
301
+ **Source attribution:** In `<sources>` section, prefix findings with their agent origin: "From external docs:", "From codebase analysis:", "From best practices:"
302
+
303
+ Write RESEARCH.md to `.planning/phases/{phase}-{slug}/{phase}-RESEARCH.md` using the standard template structure (semantic XML tags: `<research_summary>`, `<standard_stack>`, `<architecture_patterns>`, `<dont_hand_roll>`, `<common_pitfalls>`, `<code_examples>`, `<sota_updates>`, `<open_questions>`, `<sources>`, `<metadata>`).
304
+
305
+ ## 7. Commit and Present
306
+
307
+ ```bash
308
+ git add .planning/phases/${PHASE}-*/*-RESEARCH.md
309
+ git commit -m "docs: complete research for phase ${PHASE}"
310
+ ```
311
+
312
+ Display research summary. Read `~/.claude/mindsystem/references/prework-status.md` to show what's done vs still needed for this phase.
313
+
314
+ **Post-synthesis routing:**
315
+
316
+ Scan the synthesized RESEARCH.md for LOW confidence sections and significant open questions.
317
+
318
+ If all sections HIGH/MEDIUM confidence with no major gaps, use AskUserQuestion:
319
+ 1. Proceed to planning
320
+ 2. Dig deeper into specific area
321
+ 3. Review full research
322
+
323
+ If any section has LOW confidence or significant open questions, flag the weak areas explicitly, then use AskUserQuestion:
324
+ 1. Dig deeper into [specific LOW area] — re-run targeted agent
325
+ 2. Try different research mode (e.g., ecosystem -> implementation)
326
+ 3. Proceed to planning with caveats noted
327
+ 4. Review full research
328
+
329
+ ## 8. Update Last Command
183
330
 
184
331
  Update `.planning/STATE.md` Last Command field:
185
332
  - Find line starting with `Last Command:` in Current Position section
@@ -188,11 +335,28 @@ Update `.planning/STATE.md` Last Command field:
188
335
 
189
336
  </process>
190
337
 
338
+ <checkpoint_handling>
339
+
340
+ **With parallel agents:**
341
+ - Wait for ALL 3 agents to complete before synthesizing
342
+ - If any agent returns CHECKPOINT: present all checkpoints after other agents finish, handle sequentially
343
+ - If any agent returns BLOCKED: report which failed, offer to retry that agent or proceed with 2/3 findings
344
+
345
+ **Continuation mechanics:**
346
+ When an agent returns CHECKPOINT, its text response contains partial findings. To continue:
347
+ 1. Capture the checkpointed agent's full text response
348
+ 2. Present the checkpoint reason to the user, get their input
349
+ 3. Spawn a fresh agent of the same type, injecting the captured text as inline content in `<prior_state>`
350
+
351
+ The `{partial_findings}` placeholder in the continuation template is the agent's raw text response, not a file reference. Read `mindsystem/templates/research-subagent-prompt.md` Continuation section for the prompt template.
352
+
353
+ </checkpoint_handling>
354
+
191
355
  <success_criteria>
192
- - [ ] Phase validated against roadmap
193
- - [ ] Existing research checked
194
- - [ ] ms-researcher spawned with context
195
- - [ ] Checkpoints handled correctly
196
- - [ ] RESEARCH.md committed on completion
356
+ - [ ] Conflicts reconciled (with user input if needed)
357
+ - [ ] RESEARCH.md synthesized and written
358
+ - [ ] 3 agents spawned in parallel (external-docs, codebase-patterns, best-practices)
359
+ - [ ] All 3 agent results received
360
+ - [ ] RESEARCH.md committed
197
361
  - [ ] User knows next steps
198
362
  </success_criteria>
@@ -61,6 +61,7 @@ Phase: $ARGUMENTS (optional)
61
61
  - Generate UAT fixes patch
62
62
  - Restore user's pre-existing work (if stashed)
63
63
  - Commit UAT.md, present summary
64
+ - **Update knowledge pitfalls** — if significant UAT issues (blocker/major) were fixed, append pitfall entries to relevant knowledge files
64
65
 
65
66
  10. **Update last command**
66
67
  - Update `.planning/STATE.md` Last Command field
@@ -161,17 +161,7 @@ Priority is clarity over features. Better to show less and make it obvious than
161
161
  1. **Vision sections** (`<vision>`, `<essential>`, `<specifics>`, `<notes>`) — for human understanding
162
162
  2. **Decision sections** (`<decisions>`, `<deferred>`) — for downstream agent parsing
163
163
 
164
- The user is the visionary. They know:
165
- - How they imagine it working
166
- - What it should feel like
167
- - What's essential vs nice-to-have
168
- - References to things they like
169
-
170
- The user does NOT know (and shouldn't be asked):
171
- - Codebase patterns (Claude reads the code)
172
- - Technical risks (Claude identifies during research)
173
- - Implementation constraints (Claude figures out)
174
- - Success metrics (Claude infers from the work)
164
+ Vision sections capture the user's own words — how they imagine it, what they reference, what excites them. Do not inject technical analysis, risk assessment, or implementation constraints into vision sections.
175
165
 
176
166
  **Vision content should read like:**
177
167
  - A founder describing their product vision
@@ -119,11 +119,10 @@ Create `.planning/phases/XX-name/DISCOVERY.md`:
119
119
  </output_structure>
120
120
 
121
121
  <success_criteria>
122
- - All scope questions answered with authoritative sources
122
+ - Low-confidence findings marked with validation checkpoints
123
123
  - Quality checklist items completed
124
+ - All scope questions answered with authoritative sources
124
125
  - Clear primary recommendation
125
- - Low-confidence findings marked with validation checkpoints
126
- - Ready to inform PLAN.md creation
127
126
  </success_criteria>
128
127
 
129
128
  <guidelines>
@@ -0,0 +1,99 @@
1
+ # Knowledge Template
2
+
3
+ Template for `.planning/knowledge/{subsystem}.md` — per-subsystem knowledge files that persist across phases and milestones.
4
+
5
+ **Purpose:** Curated reference per domain area. Bridges phase-scoped execution artifacts to topic-scoped knowledge. Each file contains decisions, architecture, design, pitfalls, and key files for one subsystem.
6
+
7
+ **Created by:** `ms-consolidator` agent during `execute-phase`
8
+
9
+ **Referenced by:** All pre-planning phases (discuss-phase, design-phase, research-phase, plan-phase)
10
+
11
+ ---
12
+
13
+ <template>
14
+
15
+ ```markdown
16
+ # {subsystem}
17
+
18
+ > {One-line summary of what this subsystem does and the current approach.}
19
+
20
+ ## Decisions
21
+
22
+ | Decision | Rationale | Source |
23
+ |----------|-----------|--------|
24
+ | {choice in 5-10 words} | {reason in 5-10 words} | {vX.Y phase N} |
25
+
26
+ ## Architecture
27
+
28
+ - {Structural pattern or flow description}
29
+ - {How components connect and interact}
30
+
31
+ ## Design
32
+
33
+ - {Visual/UX spec, interaction pattern, or design token}
34
+ - {Component state, layout choice, or color value}
35
+
36
+ ## Pitfalls
37
+
38
+ - **{Brief title}**: {What to watch out for and why}
39
+ - **{Brief title}**: {Operational pattern or known trap}
40
+
41
+ ## Key Files
42
+
43
+ - `{path/to/file}` — {What it does}
44
+ - `{path/to/file}` — {What it does}
45
+ ```
46
+
47
+ </template>
48
+
49
+ <guidelines>
50
+
51
+ ## Section Purposes
52
+
53
+ | Section | Captures | Source Artifacts |
54
+ |---------|----------|-----------------|
55
+ | **Decisions** | Choices with rationale (the "because" part) | CONTEXT.md locked decisions, RESEARCH.md recommendations, PLAN.md approach rationale, SUMMARY.md key-decisions |
56
+ | **Architecture** | How the subsystem works, structural patterns | RESEARCH.md architecture patterns, PLAN.md implementation details, SUMMARY.md accomplishments |
57
+ | **Design** | Visual/UX specs, interaction patterns, design tokens | DESIGN.md component specs, UX flows, color/spacing values |
58
+ | **Pitfalls** | What to watch out for, operational patterns | RESEARCH.md common pitfalls, SUMMARY.md issues/deviations, debug resolutions, adhoc learnings |
59
+ | **Key Files** | Important file paths for this subsystem | SUMMARY.md key-files, PLAN.md file targets |
60
+
61
+ ## Format Rules
62
+
63
+ - **Omit empty sections.** A subsystem with no design work has no Design section.
64
+ - **No frontmatter.** Filename is the address (`knowledge/auth.md` = auth subsystem). The one-line summary under the heading provides orientation.
65
+ - **Decisions table is concise.** 5-10 words per cell. Extract the "because" — not a description of what was done.
66
+ - **Architecture and Design use prose bullets.** Describe how things work, not tables.
67
+ - **Pitfalls use bold titles** for scannability.
68
+ - **Key Files is a flat list.** No nesting, no grouping.
69
+ - **Rewrite semantics, not append.** Each consolidation produces the current state. Superseded decisions get updated. Outdated patterns get removed. The file is always current.
70
+
71
+ ## Cross-Reference Pattern
72
+
73
+ When a subsystem's knowledge references another subsystem, add a parenthetical cross-reference:
74
+
75
+ ```markdown
76
+ - JWT tokens validated by API middleware on all protected routes (see api subsystem)
77
+ ```
78
+
79
+ The cross-reference is navigational, not essential. Each file is self-contained for its consumer.
80
+
81
+ ## Good vs Bad Entries
82
+
83
+ **Good decision entries:**
84
+ - `jose over jsonwebtoken | Better TypeScript support, actively maintained | v1.0 phase 2`
85
+ - `httpOnly cookies over localStorage | XSS prevention | v1.0 phase 2`
86
+
87
+ **Bad decision entries:**
88
+ - `Use React | — | 1` (no rationale)
89
+ - `Implemented authentication | Users can log in | 2` (not a decision, just work done)
90
+
91
+ **Good pitfall entries:**
92
+ - **bcrypt cost factor**: Use 12, not 10. Cost factor 10 is brute-forceable on modern GPUs
93
+ - **JWT payload size**: Keep under 4KB — cookie size limits vary by browser
94
+
95
+ **Bad pitfall entries:**
96
+ - Fixed a bug in auth (description, not a reusable pattern)
97
+ - Missing import in login.ts (trivial, not worth persisting)
98
+
99
+ </guidelines>
@@ -110,23 +110,7 @@ Which phases cover which requirements. Updated by create-roadmap.
110
110
  </guidelines>
111
111
 
112
112
  <evolution>
113
-
114
- **After each phase completes:**
115
- 1. Mark covered requirements as Complete
116
- 2. Update traceability status
117
- 3. Note any requirements that changed scope
118
-
119
- **After roadmap updates:**
120
- 1. Verify all v1 requirements still mapped
121
- 2. Add new requirements if scope expanded
122
- 3. Move requirements to v2/out of scope if descoped
123
-
124
- **Requirement completion criteria:**
125
- - Requirement is "Complete" when:
126
- - Feature is implemented
127
- - Feature is verified (tests pass, manual check done)
128
- - Feature is committed
129
-
113
+ Update requirements after phase completion: mark requirements Complete, update traceability status. After roadmap changes: verify all v1 requirements still mapped, add/move requirements as scope changes. A requirement is "Complete" when implemented, verified, and committed.
130
114
  </evolution>
131
115
 
132
116
  <example>
@@ -143,31 +127,13 @@ Which phases cover which requirements. Updated by create-roadmap.
143
127
 
144
128
  - [ ] **AUTH-01**: User can sign up with email and password
145
129
  - [ ] **AUTH-02**: User receives email verification after signup
146
- - [ ] **AUTH-03**: User can reset password via email link
147
- - [ ] **AUTH-04**: User session persists across browser refresh
148
130
 
149
131
  ### Profiles
150
132
 
151
133
  - [ ] **PROF-01**: User can create profile with display name
152
134
  - [ ] **PROF-02**: User can upload avatar image
153
- - [ ] **PROF-03**: User can write bio (max 500 chars)
154
- - [ ] **PROF-04**: User can view other users' profiles
155
-
156
- ### Content
157
135
 
158
- - [ ] **CONT-01**: User can create text post
159
- - [ ] **CONT-02**: User can upload image with post
160
- - [ ] **CONT-03**: User can edit own posts
161
- - [ ] **CONT-04**: User can delete own posts
162
- - [ ] **CONT-05**: User can view feed of posts
163
-
164
- ### Social
165
-
166
- - [ ] **SOCL-01**: User can follow other users
167
- - [ ] **SOCL-02**: User can unfollow users
168
- - [ ] **SOCL-03**: User can like posts
169
- - [ ] **SOCL-04**: User can comment on posts
170
- - [ ] **SOCL-05**: User can view activity feed (followed users' posts)
136
+ [... additional categories ...]
171
137
 
172
138
  ## v2 Requirements
173
139
 
@@ -175,16 +141,7 @@ Which phases cover which requirements. Updated by create-roadmap.
175
141
 
176
142
  - **NOTF-01**: User receives in-app notifications
177
143
  - **NOTF-02**: User receives email for new followers
178
- - **NOTF-03**: User receives email for comments on own posts
179
- - **NOTF-04**: User can configure notification preferences
180
-
181
- ### Moderation
182
-
183
- - **MODR-01**: User can report content
184
- - **MODR-02**: User can block other users
185
- - **MODR-03**: Admin can view reported content
186
- - **MODR-04**: Admin can remove content
187
- - **MODR-05**: Admin can ban users
144
+ - **NOTF-03**: User can configure notification preferences
188
145
 
189
146
  ## Out of Scope
190
147
 
@@ -193,7 +150,6 @@ Which phases cover which requirements. Updated by create-roadmap.
193
150
  | Real-time chat | High complexity, not core to community value |
194
151
  | Video posts | Storage/bandwidth costs, defer to v2+ |
195
152
  | OAuth login | Email/password sufficient for v1 |
196
- | Mobile app | Web-first, mobile later |
197
153
 
198
154
  ## Traceability
199
155
 
@@ -201,22 +157,8 @@ Which phases cover which requirements. Updated by create-roadmap.
201
157
  |-------------|-------|--------|
202
158
  | AUTH-01 | Phase 1 | Pending |
203
159
  | AUTH-02 | Phase 1 | Pending |
204
- | AUTH-03 | Phase 1 | Pending |
205
- | AUTH-04 | Phase 1 | Pending |
206
160
  | PROF-01 | Phase 2 | Pending |
207
161
  | PROF-02 | Phase 2 | Pending |
208
- | PROF-03 | Phase 2 | Pending |
209
- | PROF-04 | Phase 2 | Pending |
210
- | CONT-01 | Phase 3 | Pending |
211
- | CONT-02 | Phase 3 | Pending |
212
- | CONT-03 | Phase 3 | Pending |
213
- | CONT-04 | Phase 3 | Pending |
214
- | CONT-05 | Phase 3 | Pending |
215
- | SOCL-01 | Phase 4 | Pending |
216
- | SOCL-02 | Phase 4 | Pending |
217
- | SOCL-03 | Phase 4 | Pending |
218
- | SOCL-04 | Phase 4 | Pending |
219
- | SOCL-05 | Phase 4 | Pending |
220
162
 
221
163
  **Coverage:**
222
164
  - v1 requirements: 18 total