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,187 @@
1
+ <purpose>
2
+ Generate framework-specific mock code for manual UAT testing. Creates override files with toggle flags and minimal production hooks.
3
+
4
+ Called by verify-work workflow when a test batch requires mock state.
5
+ </purpose>
6
+
7
+ <philosophy>
8
+ **Mocks are temporary scaffolding.**
9
+
10
+ They exist only as uncommitted changes during testing. They enable reaching UI states that require specific backend conditions (premium user, error states, empty lists, loading states).
11
+
12
+ **Principles:**
13
+ - Minimal footprint: One override file + minimal hooks
14
+ - Easy removal: Delete file, remove imports, done
15
+ - Framework-appropriate: Match project conventions
16
+ - User-controlled: Clear toggle instructions
17
+ </philosophy>
18
+
19
+ <framework_detection>
20
+
21
+ **Step 1: Read PROJECT.md**
22
+ ```bash
23
+ cat .planning/PROJECT.md 2>/dev/null | head -50
24
+ ```
25
+
26
+ **Step 2: Verify with config files**
27
+
28
+ | Check | Indicates |
29
+ |-------|-----------|
30
+ | `pubspec.yaml` exists | Flutter |
31
+ | `package.json` has `"react"` or `"next"` | React/Next.js |
32
+ | `package.json` has `"react-native"` | React Native |
33
+ | `package.json` has `"vue"` | Vue |
34
+
35
+ **Step 3: Determine file locations**
36
+
37
+ | Framework | Override File | Import Pattern |
38
+ |-----------|---------------|----------------|
39
+ | Flutter | `lib/test_overrides.dart` | `import 'package:{app}/test_overrides.dart';` |
40
+ | React/Next.js | `src/testOverrides.ts` | `import { testOverrides } from '@/testOverrides';` |
41
+ | React Native | `src/testOverrides.ts` | `import { testOverrides } from '../testOverrides';` |
42
+ | Vue | `src/testOverrides.ts` | `import { testOverrides } from '@/testOverrides';` |
43
+
44
+ </framework_detection>
45
+
46
+ <override_file_pattern>
47
+
48
+ **Structure:**
49
+
50
+ ```
51
+ // Test Overrides - DELETE THIS FILE BEFORE COMMITTING
52
+ // Used for manual UAT testing only
53
+
54
+ // === STATE FLAGS ===
55
+ // Set to true to enable mock state
56
+
57
+ {flag declarations based on mock_type}
58
+
59
+ // === MOCK DATA ===
60
+ // Returned when flags are true
61
+
62
+ {mock data structures}
63
+
64
+ // === RESET ===
65
+ // Call to disable all overrides
66
+
67
+ {reset function}
68
+ ```
69
+
70
+ **Flag naming convention:**
71
+ - `force{State}` for boolean flags (e.g., `forcePremiumUser`, `forceErrorState`)
72
+ - `mock{DataType}` for mock data (e.g., `mockUserData`, `mockErrorMessage`)
73
+
74
+ </override_file_pattern>
75
+
76
+ <production_hook_pattern>
77
+
78
+ **Minimal hooks at service/repository layer:**
79
+
80
+ ```
81
+ // Check override BEFORE real implementation
82
+ if (testOverrides.force{State}) {
83
+ return testOverrides.mock{Data};
84
+ }
85
+
86
+ // Real implementation continues here...
87
+ ```
88
+
89
+ **Placement:**
90
+ - In services/repositories, not UI components
91
+ - At the data fetch point, not the render point
92
+ - Single if-check, no complex branching
93
+
94
+ **Marking:**
95
+ ```
96
+ // TEST OVERRIDE - Remove before commit
97
+ if (testOverrides.forceError) {
98
+ throw testOverrides.mockError;
99
+ }
100
+ ```
101
+
102
+ </production_hook_pattern>
103
+
104
+ <mock_types>
105
+
106
+ Common mock types and what they enable:
107
+
108
+ | Mock Type | Enables Testing | Typical Flags |
109
+ |-----------|-----------------|---------------|
110
+ | `error_state` | Error messages, retry UI, fallback displays | `forceError`, `mockErrorMessage` |
111
+ | `premium_user` | Premium badges, gated features, upgrade prompts | `forcePremium`, `mockPremiumData` |
112
+ | `empty_response` | Empty states, placeholder UI, "no results" | `forceEmpty` |
113
+ | `loading_state` | Loading spinners, skeleton screens | `forceLoading`, `mockLoadingDelay` |
114
+ | `offline` | Offline UI, cached data, sync indicators | `forceOffline` |
115
+
116
+ </mock_types>
117
+
118
+ <toggle_instructions_template>
119
+
120
+ **Format for each mock state:**
121
+
122
+ ```markdown
123
+ **To enable {state_name}:**
124
+ 1. Open `{override_file_path}`
125
+ 2. Set `{flag_name} = true`
126
+ 3. {Hot reload command or restart instruction}
127
+ 4. Verify: {What user should see to confirm mock is active}
128
+
129
+ **To disable:**
130
+ 1. Set `{flag_name} = false`
131
+ 2. {Hot reload / restart}
132
+ ```
133
+
134
+ **Framework-specific apply instructions:**
135
+
136
+ | Framework | Apply Changes |
137
+ |-----------|---------------|
138
+ | Flutter | Hot reload (r in terminal) or hot restart (R) |
139
+ | React/Next.js (dev) | Auto hot reload on save |
140
+ | React Native | Shake device → Reload, or `r` in Metro |
141
+ | Vue (dev) | Auto hot reload on save |
142
+
143
+ </toggle_instructions_template>
144
+
145
+ <spawn_mock_generator>
146
+
147
+ When verify-work needs mocks:
148
+
149
+ ```
150
+ Task(
151
+ prompt="""
152
+ You are generating test mocks for manual UI verification.
153
+
154
+ ## Context
155
+
156
+ Project type: {detected_framework}
157
+ Phase: {phase_name}
158
+ Mock type needed: {mock_type}
159
+
160
+ ## Tests requiring this mock
161
+
162
+ {test_list_with_expected_behavior}
163
+
164
+ ## Requirements
165
+
166
+ 1. Create override file at standard location for this framework
167
+ 2. Add minimal hooks to relevant services (if needed)
168
+ 3. Provide clear toggle instructions
169
+ 4. Write all files to disk
170
+
171
+ Follow the patterns from @~/.claude/mindsystem/workflows/generate-mocks.md
172
+ """,
173
+ subagent_type="ms-mock-generator",
174
+ description="Generate {mock_type} mocks"
175
+ )
176
+ ```
177
+
178
+ </spawn_mock_generator>
179
+
180
+ <success_criteria>
181
+ - [ ] Framework correctly detected
182
+ - [ ] Override file created at standard location
183
+ - [ ] Minimal hooks added (only if needed)
184
+ - [ ] Toggle instructions clear and complete
185
+ - [ ] Files written to disk (uncommitted)
186
+ - [ ] Easy to remove (clear cleanup path)
187
+ </success_criteria>
@@ -0,0 +1,178 @@
1
+ <purpose>
2
+ Surface Claude's assumptions about a phase before planning, enabling users to correct misconceptions early.
3
+
4
+ Key difference from discuss-phase: This is ANALYSIS of what Claude thinks, not INTAKE of what user knows. No file output - purely conversational to prompt discussion.
5
+ </purpose>
6
+
7
+ <process>
8
+
9
+ <step name="validate_phase" priority="first">
10
+ Phase number: $ARGUMENTS (required)
11
+
12
+ **If argument missing:**
13
+
14
+ ```
15
+ Error: Phase number required.
16
+
17
+ Usage: /ms:list-phase-assumptions [phase-number]
18
+ Example: /ms:list-phase-assumptions 3
19
+ ```
20
+
21
+ Exit workflow.
22
+
23
+ **If argument provided:**
24
+ Validate phase exists in roadmap:
25
+
26
+ ```bash
27
+ cat .planning/ROADMAP.md | grep -i "Phase ${PHASE}"
28
+ ```
29
+
30
+ **If phase not found:**
31
+
32
+ ```
33
+ Error: Phase ${PHASE} not found in roadmap.
34
+
35
+ Available phases:
36
+ [list phases from roadmap]
37
+ ```
38
+
39
+ Exit workflow.
40
+
41
+ **If phase found:**
42
+ Parse phase details from roadmap:
43
+
44
+ - Phase number
45
+ - Phase name
46
+ - Phase description/goal
47
+ - Any scope details mentioned
48
+
49
+ Continue to analyze_phase.
50
+ </step>
51
+
52
+ <step name="analyze_phase">
53
+ Based on roadmap description and project context, identify assumptions across five areas:
54
+
55
+ **1. Technical Approach:**
56
+ What libraries, frameworks, patterns, or tools would Claude use?
57
+ - "I'd use X library because..."
58
+ - "I'd follow Y pattern because..."
59
+ - "I'd structure this as Z because..."
60
+
61
+ **2. Implementation Order:**
62
+ What would Claude build first, second, third?
63
+ - "I'd start with X because it's foundational"
64
+ - "Then Y because it depends on X"
65
+ - "Finally Z because..."
66
+
67
+ **3. Scope Boundaries:**
68
+ What's included vs excluded in Claude's interpretation?
69
+ - "This phase includes: A, B, C"
70
+ - "This phase does NOT include: D, E, F"
71
+ - "Boundary ambiguities: G could go either way"
72
+
73
+ **4. Risk Areas:**
74
+ Where does Claude expect complexity or challenges?
75
+ - "The tricky part is X because..."
76
+ - "Potential issues: Y, Z"
77
+ - "I'd watch out for..."
78
+
79
+ **5. Dependencies:**
80
+ What does Claude assume exists or needs to be in place?
81
+ - "This assumes X from previous phases"
82
+ - "External dependencies: Y, Z"
83
+ - "This will be consumed by..."
84
+
85
+ Be honest about uncertainty. Mark assumptions with confidence levels:
86
+ - "Fairly confident: ..." (clear from roadmap)
87
+ - "Assuming: ..." (reasonable inference)
88
+ - "Unclear: ..." (could go multiple ways)
89
+ </step>
90
+
91
+ <step name="present_assumptions">
92
+ Present assumptions in a clear, scannable format:
93
+
94
+ ```
95
+ ## My Assumptions for Phase ${PHASE}: ${PHASE_NAME}
96
+
97
+ ### Technical Approach
98
+ [List assumptions about how to implement]
99
+
100
+ ### Implementation Order
101
+ [List assumptions about sequencing]
102
+
103
+ ### Scope Boundaries
104
+ **In scope:** [what's included]
105
+ **Out of scope:** [what's excluded]
106
+ **Ambiguous:** [what could go either way]
107
+
108
+ ### Risk Areas
109
+ [List anticipated challenges]
110
+
111
+ ### Dependencies
112
+ **From prior phases:** [what's needed]
113
+ **External:** [third-party needs]
114
+ **Feeds into:** [what future phases need from this]
115
+
116
+ ---
117
+
118
+ **What do you think?**
119
+
120
+ Are these assumptions accurate? Let me know:
121
+ - What I got right
122
+ - What I got wrong
123
+ - What I'm missing
124
+ ```
125
+
126
+ Wait for user response.
127
+ </step>
128
+
129
+ <step name="gather_feedback">
130
+ **If user provides corrections:**
131
+
132
+ Acknowledge the corrections:
133
+
134
+ ```
135
+ Got it. Key corrections:
136
+ - [correction 1]
137
+ - [correction 2]
138
+
139
+ This changes my understanding significantly. [Summarize new understanding]
140
+ ```
141
+
142
+ **If user confirms assumptions:**
143
+
144
+ ```
145
+ Great, assumptions validated.
146
+ ```
147
+
148
+ Continue to offer_next.
149
+ </step>
150
+
151
+ <step name="offer_next">
152
+ Present next steps:
153
+
154
+ ```
155
+ What's next?
156
+ 1. Discuss context (/ms:discuss-phase ${PHASE}) - Let me ask you questions to build comprehensive context
157
+ 2. Plan this phase (/ms:plan-phase ${PHASE}) - Create detailed execution plans
158
+ 3. Re-examine assumptions - I'll analyze again with your corrections
159
+ 4. Done for now
160
+ ```
161
+
162
+ Wait for user selection.
163
+
164
+ If "Discuss context": Note that CONTEXT.md will incorporate any corrections discussed here
165
+ If "Plan this phase": Proceed knowing assumptions are understood
166
+ If "Re-examine": Return to analyze_phase with updated understanding
167
+ </step>
168
+
169
+ </process>
170
+
171
+ <success_criteria>
172
+ - Phase number validated against roadmap
173
+ - Assumptions surfaced across five areas: technical approach, implementation order, scope, risks, dependencies
174
+ - Confidence levels marked where appropriate
175
+ - "What do you think?" prompt presented
176
+ - User feedback acknowledged
177
+ - Clear next steps offered
178
+ </success_criteria>
@@ -0,0 +1,289 @@
1
+ <purpose>
2
+ Orchestrate parallel codebase mapper agents to analyze codebase and produce structured documents in .planning/codebase/
3
+
4
+ Each agent has fresh context, explores a specific focus area, and **writes documents directly**. The orchestrator only receives confirmation + line counts, then writes a summary.
5
+
6
+ Output: .planning/codebase/ folder with 7 structured documents about the codebase state.
7
+ </purpose>
8
+
9
+ <philosophy>
10
+ **Why dedicated mapper agents:**
11
+ - Fresh context per domain (no token contamination)
12
+ - Agents write documents directly (no context transfer back to orchestrator)
13
+ - Orchestrator only summarizes what was created (minimal context usage)
14
+ - Faster execution (agents run simultaneously)
15
+
16
+ **Document quality over length:**
17
+ Include enough detail to be useful as reference. Prioritize practical examples (especially code patterns) over arbitrary brevity.
18
+
19
+ **Always include file paths:**
20
+ Documents are reference material for Claude when planning/executing. Always include actual file paths formatted with backticks: `src/services/user.ts`.
21
+ </philosophy>
22
+
23
+ <process>
24
+
25
+ <step name="check_existing" priority="first">
26
+ Check if .planning/codebase/ already exists:
27
+
28
+ ```bash
29
+ ls -la .planning/codebase/ 2>/dev/null
30
+ ```
31
+
32
+ **If exists:**
33
+
34
+ ```
35
+ .planning/codebase/ already exists with these documents:
36
+ [List files found]
37
+
38
+ What's next?
39
+ 1. Refresh - Delete existing and remap codebase
40
+ 2. Update - Keep existing, only update specific documents
41
+ 3. Skip - Use existing codebase map as-is
42
+ ```
43
+
44
+ Wait for user response.
45
+
46
+ If "Refresh": Delete .planning/codebase/, continue to create_structure
47
+ If "Update": Ask which documents to update, continue to spawn_agents (filtered)
48
+ If "Skip": Exit workflow
49
+
50
+ **If doesn't exist:**
51
+ Continue to create_structure.
52
+ </step>
53
+
54
+ <step name="create_structure">
55
+ Create .planning/codebase/ directory:
56
+
57
+ ```bash
58
+ mkdir -p .planning/codebase
59
+ ```
60
+
61
+ **Expected output files:**
62
+ - STACK.md (from tech mapper)
63
+ - INTEGRATIONS.md (from tech mapper)
64
+ - ARCHITECTURE.md (from arch mapper)
65
+ - STRUCTURE.md (from arch mapper)
66
+ - CONVENTIONS.md (from quality mapper)
67
+ - TESTING.md (from quality mapper)
68
+ - CONCERNS.md (from concerns mapper)
69
+
70
+ Continue to spawn_agents.
71
+ </step>
72
+
73
+ <step name="spawn_agents">
74
+ Spawn 4 parallel ms-codebase-mapper agents.
75
+
76
+ Use Task tool with `subagent_type="ms-codebase-mapper"` and `run_in_background=true` for parallel execution.
77
+
78
+ **CRITICAL:** Use the dedicated `ms-codebase-mapper` agent, NOT `Explore`. The mapper agent writes documents directly.
79
+
80
+ **Agent 1: Tech Focus**
81
+
82
+ Task tool parameters:
83
+ ```
84
+ subagent_type: "ms-codebase-mapper"
85
+ run_in_background: true
86
+ description: "Map codebase tech stack"
87
+ ```
88
+
89
+ Prompt:
90
+ ```
91
+ Focus: tech
92
+
93
+ Analyze this codebase for technology stack and external integrations.
94
+
95
+ Write these documents to .planning/codebase/:
96
+ - STACK.md - Languages, runtime, frameworks, dependencies, configuration
97
+ - INTEGRATIONS.md - External APIs, databases, auth providers, webhooks
98
+
99
+ Explore thoroughly. Write documents directly using templates. Return confirmation only.
100
+ ```
101
+
102
+ **Agent 2: Architecture Focus**
103
+
104
+ Task tool parameters:
105
+ ```
106
+ subagent_type: "ms-codebase-mapper"
107
+ run_in_background: true
108
+ description: "Map codebase architecture"
109
+ ```
110
+
111
+ Prompt:
112
+ ```
113
+ Focus: arch
114
+
115
+ Analyze this codebase architecture and directory structure.
116
+
117
+ Write these documents to .planning/codebase/:
118
+ - ARCHITECTURE.md - Pattern, layers, data flow, abstractions, entry points
119
+ - STRUCTURE.md - Directory layout, key locations, naming conventions
120
+
121
+ Explore thoroughly. Write documents directly using templates. Return confirmation only.
122
+ ```
123
+
124
+ **Agent 3: Quality Focus**
125
+
126
+ Task tool parameters:
127
+ ```
128
+ subagent_type: "ms-codebase-mapper"
129
+ run_in_background: true
130
+ description: "Map codebase conventions"
131
+ ```
132
+
133
+ Prompt:
134
+ ```
135
+ Focus: quality
136
+
137
+ Analyze this codebase for coding conventions and testing patterns.
138
+
139
+ Write these documents to .planning/codebase/:
140
+ - CONVENTIONS.md - Code style, naming, patterns, error handling
141
+ - TESTING.md - Framework, structure, mocking, coverage
142
+
143
+ Explore thoroughly. Write documents directly using templates. Return confirmation only.
144
+ ```
145
+
146
+ **Agent 4: Concerns Focus**
147
+
148
+ Task tool parameters:
149
+ ```
150
+ subagent_type: "ms-codebase-mapper"
151
+ run_in_background: true
152
+ description: "Map codebase concerns"
153
+ ```
154
+
155
+ Prompt:
156
+ ```
157
+ Focus: concerns
158
+
159
+ Analyze this codebase for technical debt, known issues, and areas of concern.
160
+
161
+ Write this document to .planning/codebase/:
162
+ - CONCERNS.md - Tech debt, bugs, security, performance, fragile areas
163
+
164
+ Explore thoroughly. Write document directly using template. Return confirmation only.
165
+ ```
166
+
167
+ Continue to collect_confirmations.
168
+ </step>
169
+
170
+ <step name="collect_confirmations">
171
+ Wait for all 4 agents to complete.
172
+
173
+ Use TaskOutput tool to collect confirmations from each agent.
174
+
175
+ **Expected confirmation format from each agent:**
176
+ ```
177
+ ## Mapping Complete
178
+
179
+ **Focus:** {focus}
180
+ **Documents written:**
181
+ - `.planning/codebase/{DOC1}.md` ({N} lines)
182
+ - `.planning/codebase/{DOC2}.md` ({N} lines)
183
+
184
+ Ready for orchestrator summary.
185
+ ```
186
+
187
+ **What you receive:** Just file paths and line counts. NOT document contents.
188
+
189
+ If any agent failed, note the failure and continue with successful documents.
190
+
191
+ Continue to verify_output.
192
+ </step>
193
+
194
+ <step name="verify_output">
195
+ Verify all documents created successfully:
196
+
197
+ ```bash
198
+ ls -la .planning/codebase/
199
+ wc -l .planning/codebase/*.md
200
+ ```
201
+
202
+ **Verification checklist:**
203
+ - All 7 documents exist
204
+ - No empty documents (each should have >20 lines)
205
+
206
+ If any documents missing or empty, note which agents may have failed.
207
+
208
+ Continue to commit_codebase_map.
209
+ </step>
210
+
211
+ <step name="commit_codebase_map">
212
+ Commit the codebase map:
213
+
214
+ ```bash
215
+ git add .planning/codebase/*.md
216
+ git commit -m "$(cat <<'EOF'
217
+ docs: map existing codebase
218
+
219
+ - STACK.md - Technologies and dependencies
220
+ - ARCHITECTURE.md - System design and patterns
221
+ - STRUCTURE.md - Directory layout
222
+ - CONVENTIONS.md - Code style and patterns
223
+ - TESTING.md - Test structure
224
+ - INTEGRATIONS.md - External services
225
+ - CONCERNS.md - Technical debt and issues
226
+ EOF
227
+ )"
228
+ ```
229
+
230
+ Continue to offer_next.
231
+ </step>
232
+
233
+ <step name="offer_next">
234
+ Present completion summary and next steps.
235
+
236
+ **Get line counts:**
237
+ ```bash
238
+ wc -l .planning/codebase/*.md
239
+ ```
240
+
241
+ **Output format:**
242
+
243
+ ```
244
+ Codebase mapping complete.
245
+
246
+ Created .planning/codebase/:
247
+ - STACK.md ([N] lines) - Technologies and dependencies
248
+ - ARCHITECTURE.md ([N] lines) - System design and patterns
249
+ - STRUCTURE.md ([N] lines) - Directory layout and organization
250
+ - CONVENTIONS.md ([N] lines) - Code style and patterns
251
+ - TESTING.md ([N] lines) - Test structure and practices
252
+ - INTEGRATIONS.md ([N] lines) - External services and APIs
253
+ - CONCERNS.md ([N] lines) - Technical debt and issues
254
+
255
+
256
+ ---
257
+
258
+ ## ▶ Next Up
259
+
260
+ **Initialize project** — use codebase context for planning
261
+
262
+ `/ms:new-project`
263
+
264
+ <sub>`/clear` first → fresh context window</sub>
265
+
266
+ ---
267
+
268
+ **Also available:**
269
+ - Re-run mapping: `/ms:map-codebase`
270
+ - Review specific file: `cat .planning/codebase/STACK.md`
271
+ - Edit any document before proceeding
272
+
273
+ ---
274
+ ```
275
+
276
+ End workflow.
277
+ </step>
278
+
279
+ </process>
280
+
281
+ <success_criteria>
282
+ - .planning/codebase/ directory created
283
+ - 4 parallel ms-codebase-mapper agents spawned with run_in_background=true
284
+ - Agents write documents directly (orchestrator doesn't receive document contents)
285
+ - TaskOutput used to collect confirmations only
286
+ - All 7 codebase documents exist
287
+ - Clear completion summary with line counts
288
+ - User offered clear next steps in GSD style
289
+ </success_criteria>