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,184 @@
1
+ # PROJECT.md Template
2
+
3
+ Template for `.planning/PROJECT.md` — the living project context document.
4
+
5
+ <template>
6
+
7
+ ```markdown
8
+ # [Project Name]
9
+
10
+ ## What This Is
11
+
12
+ [Current accurate description — 2-3 sentences. What does this product do and who is it for?
13
+ Use the user's language and framing. Update whenever reality drifts from this description.]
14
+
15
+ ## Core Value
16
+
17
+ [The ONE thing that matters most. If everything else fails, this must work.
18
+ One sentence that drives prioritization when tradeoffs arise.]
19
+
20
+ ## Requirements
21
+
22
+ ### Validated
23
+
24
+ <!-- Shipped and confirmed valuable. -->
25
+
26
+ (None yet — ship to validate)
27
+
28
+ ### Active
29
+
30
+ <!-- Current scope. Building toward these. -->
31
+
32
+ - [ ] [Requirement 1]
33
+ - [ ] [Requirement 2]
34
+ - [ ] [Requirement 3]
35
+
36
+ ### Out of Scope
37
+
38
+ <!-- Explicit boundaries. Includes reasoning to prevent re-adding. -->
39
+
40
+ - [Exclusion 1] — [why]
41
+ - [Exclusion 2] — [why]
42
+
43
+ ## Context
44
+
45
+ [Background information that informs implementation:
46
+ - Technical environment or ecosystem
47
+ - Relevant prior work or experience
48
+ - User research or feedback themes
49
+ - Known issues to address]
50
+
51
+ ## Constraints
52
+
53
+ - **[Type]**: [What] — [Why]
54
+ - **[Type]**: [What] — [Why]
55
+
56
+ Common types: Tech stack, Timeline, Budget, Dependencies, Compatibility, Performance, Security
57
+
58
+ ## Key Decisions
59
+
60
+ <!-- Decisions that constrain future work. Add throughout project lifecycle. -->
61
+
62
+ | Decision | Rationale | Outcome |
63
+ |----------|-----------|---------|
64
+ | [Choice] | [Why] | [✓ Good / ⚠️ Revisit / — Pending] |
65
+
66
+ ---
67
+ *Last updated: [date] after [trigger]*
68
+ ```
69
+
70
+ </template>
71
+
72
+ <guidelines>
73
+
74
+ **What This Is:**
75
+ - Current accurate description of the product
76
+ - 2-3 sentences capturing what it does and who it's for
77
+ - Use the user's words and framing
78
+ - Update when the product evolves beyond this description
79
+
80
+ **Core Value:**
81
+ - The single most important thing
82
+ - Everything else can fail; this cannot
83
+ - Drives prioritization when tradeoffs arise
84
+ - Rarely changes; if it does, it's a significant pivot
85
+
86
+ **Requirements — Validated:**
87
+ - Requirements that shipped and proved valuable
88
+ - Format: `- ✓ [Requirement] — [version/phase]`
89
+ - These are locked — changing them requires explicit discussion
90
+
91
+ **Requirements — Active:**
92
+ - Current scope being built toward
93
+ - These are hypotheses until shipped and validated
94
+ - Move to Validated when shipped, Out of Scope if invalidated
95
+
96
+ **Requirements — Out of Scope:**
97
+ - Explicit boundaries on what we're not building
98
+ - Always include reasoning (prevents re-adding later)
99
+ - Includes: considered and rejected, deferred to future, explicitly excluded
100
+
101
+ **Context:**
102
+ - Background that informs implementation decisions
103
+ - Technical environment, prior work, user feedback
104
+ - Known issues or technical debt to address
105
+ - Update as new context emerges
106
+
107
+ **Constraints:**
108
+ - Hard limits on implementation choices
109
+ - Tech stack, timeline, budget, compatibility, dependencies
110
+ - Include the "why" — constraints without rationale get questioned
111
+
112
+ **Key Decisions:**
113
+ - Significant choices that affect future work
114
+ - Add decisions as they're made throughout the project
115
+ - Track outcome when known:
116
+ - ✓ Good — decision proved correct
117
+ - ⚠️ Revisit — decision may need reconsideration
118
+ - — Pending — too early to evaluate
119
+
120
+ **Last Updated:**
121
+ - Always note when and why the document was updated
122
+ - Format: `after Phase 2` or `after v1.0 milestone`
123
+ - Triggers review of whether content is still accurate
124
+
125
+ </guidelines>
126
+
127
+ <evolution>
128
+
129
+ PROJECT.md evolves throughout the project lifecycle.
130
+
131
+ **After each phase transition:**
132
+ 1. Requirements invalidated? → Move to Out of Scope with reason
133
+ 2. Requirements validated? → Move to Validated with phase reference
134
+ 3. New requirements emerged? → Add to Active
135
+ 4. Decisions to log? → Add to Key Decisions
136
+ 5. "What This Is" still accurate? → Update if drifted
137
+
138
+ **After each milestone:**
139
+ 1. Full review of all sections
140
+ 2. Core Value check — still the right priority?
141
+ 3. Audit Out of Scope — reasons still valid?
142
+ 4. Update Context with current state (users, feedback, metrics)
143
+
144
+ </evolution>
145
+
146
+ <brownfield>
147
+
148
+ For existing codebases:
149
+
150
+ 1. **Map codebase first** via `/ms:map-codebase`
151
+
152
+ 2. **Infer Validated requirements** from existing code:
153
+ - What does the codebase actually do?
154
+ - What patterns are established?
155
+ - What's clearly working and relied upon?
156
+
157
+ 3. **Gather Active requirements** from user:
158
+ - Present inferred current state
159
+ - Ask what they want to build next
160
+
161
+ 4. **Initialize:**
162
+ - Validated = inferred from existing code
163
+ - Active = user's goals for this work
164
+ - Out of Scope = boundaries user specifies
165
+ - Context = includes current codebase state
166
+
167
+ </brownfield>
168
+
169
+ <state_reference>
170
+
171
+ STATE.md references PROJECT.md:
172
+
173
+ ```markdown
174
+ ## Project Reference
175
+
176
+ See: .planning/PROJECT.md (updated [date])
177
+
178
+ **Core value:** [One-liner from Core Value section]
179
+ **Current focus:** [Current phase name]
180
+ ```
181
+
182
+ This ensures Claude reads current PROJECT.md context.
183
+
184
+ </state_reference>
@@ -0,0 +1,231 @@
1
+ # Requirements Template
2
+
3
+ Template for `.planning/REQUIREMENTS.md` — checkable requirements that define "done."
4
+
5
+ <template>
6
+
7
+ ```markdown
8
+ # Requirements: [Project Name]
9
+
10
+ **Defined:** [date]
11
+ **Core Value:** [from PROJECT.md]
12
+
13
+ ## v1 Requirements
14
+
15
+ Requirements for initial release. Each maps to roadmap phases.
16
+
17
+ ### Authentication
18
+
19
+ - [ ] **AUTH-01**: User can sign up with email and password
20
+ - [ ] **AUTH-02**: User receives email verification after signup
21
+ - [ ] **AUTH-03**: User can reset password via email link
22
+ - [ ] **AUTH-04**: User session persists across browser refresh
23
+
24
+ ### [Category 2]
25
+
26
+ - [ ] **[CAT]-01**: [Requirement description]
27
+ - [ ] **[CAT]-02**: [Requirement description]
28
+ - [ ] **[CAT]-03**: [Requirement description]
29
+
30
+ ### [Category 3]
31
+
32
+ - [ ] **[CAT]-01**: [Requirement description]
33
+ - [ ] **[CAT]-02**: [Requirement description]
34
+
35
+ ## v2 Requirements
36
+
37
+ Deferred to future release. Tracked but not in current roadmap.
38
+
39
+ ### [Category]
40
+
41
+ - **[CAT]-01**: [Requirement description]
42
+ - **[CAT]-02**: [Requirement description]
43
+
44
+ ## Out of Scope
45
+
46
+ Explicitly excluded. Documented to prevent scope creep.
47
+
48
+ | Feature | Reason |
49
+ |---------|--------|
50
+ | [Feature] | [Why excluded] |
51
+ | [Feature] | [Why excluded] |
52
+
53
+ ## Traceability
54
+
55
+ Which phases cover which requirements. Updated by create-roadmap.
56
+
57
+ | Requirement | Phase | Status |
58
+ |-------------|-------|--------|
59
+ | AUTH-01 | Phase 1 | Pending |
60
+ | AUTH-02 | Phase 1 | Pending |
61
+ | AUTH-03 | Phase 1 | Pending |
62
+ | AUTH-04 | Phase 1 | Pending |
63
+ | [REQ-ID] | Phase [N] | Pending |
64
+
65
+ **Coverage:**
66
+ - v1 requirements: [X] total
67
+ - Mapped to phases: [Y]
68
+ - Unmapped: [Z] ⚠️
69
+
70
+ ---
71
+ *Requirements defined: [date]*
72
+ *Last updated: [date] after [trigger]*
73
+ ```
74
+
75
+ </template>
76
+
77
+ <guidelines>
78
+
79
+ **Requirement Format:**
80
+ - ID: `[CATEGORY]-[NUMBER]` (AUTH-01, CONTENT-02, SOCIAL-03)
81
+ - Description: User-centric, testable, atomic
82
+ - Checkbox: Only for v1 requirements (v2 are not yet actionable)
83
+
84
+ **Categories:**
85
+ - Derive from research FEATURES.md categories
86
+ - Keep consistent with domain conventions
87
+ - Typical: Authentication, Content, Social, Notifications, Moderation, Payments, Admin
88
+
89
+ **v1 vs v2:**
90
+ - v1: Committed scope, will be in roadmap phases
91
+ - v2: Acknowledged but deferred, not in current roadmap
92
+ - Moving v2 → v1 requires roadmap update
93
+
94
+ **Out of Scope:**
95
+ - Explicit exclusions with reasoning
96
+ - Prevents "why didn't you include X?" later
97
+ - Anti-features from research belong here with warnings
98
+
99
+ **Traceability:**
100
+ - Empty initially, populated by create-roadmap
101
+ - Each requirement maps to exactly one phase
102
+ - Unmapped requirements = roadmap gap (error in create-roadmap)
103
+
104
+ **Status Values:**
105
+ - Pending: Not started
106
+ - In Progress: Phase is active
107
+ - Complete: Requirement verified
108
+ - Blocked: Waiting on external factor
109
+
110
+ </guidelines>
111
+
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
+
130
+ </evolution>
131
+
132
+ <example>
133
+
134
+ ```markdown
135
+ # Requirements: CommunityApp
136
+
137
+ **Defined:** 2025-01-14
138
+ **Core Value:** Users can share and discuss content with people who share their interests
139
+
140
+ ## v1 Requirements
141
+
142
+ ### Authentication
143
+
144
+ - [ ] **AUTH-01**: User can sign up with email and password
145
+ - [ ] **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
+
149
+ ### Profiles
150
+
151
+ - [ ] **PROF-01**: User can create profile with display name
152
+ - [ ] **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
+
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)
171
+
172
+ ## v2 Requirements
173
+
174
+ ### Notifications
175
+
176
+ - **NOTF-01**: User receives in-app notifications
177
+ - **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
188
+
189
+ ## Out of Scope
190
+
191
+ | Feature | Reason |
192
+ |---------|--------|
193
+ | Real-time chat | High complexity, not core to community value |
194
+ | Video posts | Storage/bandwidth costs, defer to v2+ |
195
+ | OAuth login | Email/password sufficient for v1 |
196
+ | Mobile app | Web-first, mobile later |
197
+
198
+ ## Traceability
199
+
200
+ | Requirement | Phase | Status |
201
+ |-------------|-------|--------|
202
+ | AUTH-01 | Phase 1 | Pending |
203
+ | AUTH-02 | Phase 1 | Pending |
204
+ | AUTH-03 | Phase 1 | Pending |
205
+ | AUTH-04 | Phase 1 | Pending |
206
+ | PROF-01 | Phase 2 | Pending |
207
+ | 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
+
221
+ **Coverage:**
222
+ - v1 requirements: 18 total
223
+ - Mapped to phases: 18
224
+ - Unmapped: 0 ✓
225
+
226
+ ---
227
+ *Requirements defined: 2025-01-14*
228
+ *Last updated: 2025-01-14 after initial definition*
229
+ ```
230
+
231
+ </example>
@@ -0,0 +1,204 @@
1
+ # Architecture Research Template
2
+
3
+ Template for `.planning/research/ARCHITECTURE.md` — system structure patterns for the project domain.
4
+
5
+ <template>
6
+
7
+ ```markdown
8
+ # Architecture Research
9
+
10
+ **Domain:** [domain type]
11
+ **Researched:** [date]
12
+ **Confidence:** [HIGH/MEDIUM/LOW]
13
+
14
+ ## Standard Architecture
15
+
16
+ ### System Overview
17
+
18
+ ```
19
+ ┌─────────────────────────────────────────────────────────────┐
20
+ │ [Layer Name] │
21
+ ├─────────────────────────────────────────────────────────────┤
22
+ │ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
23
+ │ │ [Comp] │ │ [Comp] │ │ [Comp] │ │ [Comp] │ │
24
+ │ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ │
25
+ │ │ │ │ │ │
26
+ ├───────┴────────────┴────────────┴────────────┴──────────────┤
27
+ │ [Layer Name] │
28
+ ├─────────────────────────────────────────────────────────────┤
29
+ │ ┌─────────────────────────────────────────────────────┐ │
30
+ │ │ [Component] │ │
31
+ │ └─────────────────────────────────────────────────────┘ │
32
+ ├─────────────────────────────────────────────────────────────┤
33
+ │ [Layer Name] │
34
+ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
35
+ │ │ [Store] │ │ [Store] │ │ [Store] │ │
36
+ │ └──────────┘ └──────────┘ └──────────┘ │
37
+ └─────────────────────────────────────────────────────────────┘
38
+ ```
39
+
40
+ ### Component Responsibilities
41
+
42
+ | Component | Responsibility | Typical Implementation |
43
+ |-----------|----------------|------------------------|
44
+ | [name] | [what it owns] | [how it's usually built] |
45
+ | [name] | [what it owns] | [how it's usually built] |
46
+ | [name] | [what it owns] | [how it's usually built] |
47
+
48
+ ## Recommended Project Structure
49
+
50
+ ```
51
+ src/
52
+ ├── [folder]/ # [purpose]
53
+ │ ├── [subfolder]/ # [purpose]
54
+ │ └── [file].ts # [purpose]
55
+ ├── [folder]/ # [purpose]
56
+ │ ├── [subfolder]/ # [purpose]
57
+ │ └── [file].ts # [purpose]
58
+ ├── [folder]/ # [purpose]
59
+ └── [folder]/ # [purpose]
60
+ ```
61
+
62
+ ### Structure Rationale
63
+
64
+ - **[folder]/:** [why organized this way]
65
+ - **[folder]/:** [why organized this way]
66
+
67
+ ## Architectural Patterns
68
+
69
+ ### Pattern 1: [Pattern Name]
70
+
71
+ **What:** [description]
72
+ **When to use:** [conditions]
73
+ **Trade-offs:** [pros and cons]
74
+
75
+ **Example:**
76
+ ```typescript
77
+ // [Brief code example showing the pattern]
78
+ ```
79
+
80
+ ### Pattern 2: [Pattern Name]
81
+
82
+ **What:** [description]
83
+ **When to use:** [conditions]
84
+ **Trade-offs:** [pros and cons]
85
+
86
+ **Example:**
87
+ ```typescript
88
+ // [Brief code example showing the pattern]
89
+ ```
90
+
91
+ ### Pattern 3: [Pattern Name]
92
+
93
+ **What:** [description]
94
+ **When to use:** [conditions]
95
+ **Trade-offs:** [pros and cons]
96
+
97
+ ## Data Flow
98
+
99
+ ### Request Flow
100
+
101
+ ```
102
+ [User Action]
103
+
104
+ [Component] → [Handler] → [Service] → [Data Store]
105
+ ↓ ↓ ↓ ↓
106
+ [Response] ← [Transform] ← [Query] ← [Database]
107
+ ```
108
+
109
+ ### State Management
110
+
111
+ ```
112
+ [State Store]
113
+ ↓ (subscribe)
114
+ [Components] ←→ [Actions] → [Reducers/Mutations] → [State Store]
115
+ ```
116
+
117
+ ### Key Data Flows
118
+
119
+ 1. **[Flow name]:** [description of how data moves]
120
+ 2. **[Flow name]:** [description of how data moves]
121
+
122
+ ## Scaling Considerations
123
+
124
+ | Scale | Architecture Adjustments |
125
+ |-------|--------------------------|
126
+ | 0-1k users | [approach — usually monolith is fine] |
127
+ | 1k-100k users | [approach — what to optimize first] |
128
+ | 100k+ users | [approach — when to consider splitting] |
129
+
130
+ ### Scaling Priorities
131
+
132
+ 1. **First bottleneck:** [what breaks first, how to fix]
133
+ 2. **Second bottleneck:** [what breaks next, how to fix]
134
+
135
+ ## Anti-Patterns
136
+
137
+ ### Anti-Pattern 1: [Name]
138
+
139
+ **What people do:** [the mistake]
140
+ **Why it's wrong:** [the problem it causes]
141
+ **Do this instead:** [the correct approach]
142
+
143
+ ### Anti-Pattern 2: [Name]
144
+
145
+ **What people do:** [the mistake]
146
+ **Why it's wrong:** [the problem it causes]
147
+ **Do this instead:** [the correct approach]
148
+
149
+ ## Integration Points
150
+
151
+ ### External Services
152
+
153
+ | Service | Integration Pattern | Notes |
154
+ |---------|---------------------|-------|
155
+ | [service] | [how to connect] | [gotchas] |
156
+ | [service] | [how to connect] | [gotchas] |
157
+
158
+ ### Internal Boundaries
159
+
160
+ | Boundary | Communication | Notes |
161
+ |----------|---------------|-------|
162
+ | [module A ↔ module B] | [API/events/direct] | [considerations] |
163
+
164
+ ## Sources
165
+
166
+ - [Architecture references]
167
+ - [Official documentation]
168
+ - [Case studies]
169
+
170
+ ---
171
+ *Architecture research for: [domain]*
172
+ *Researched: [date]*
173
+ ```
174
+
175
+ </template>
176
+
177
+ <guidelines>
178
+
179
+ **System Overview:**
180
+ - Use ASCII diagrams for clarity
181
+ - Show major components and their relationships
182
+ - Don't over-detail — this is conceptual, not implementation
183
+
184
+ **Project Structure:**
185
+ - Be specific about folder organization
186
+ - Explain the rationale for grouping
187
+ - Match conventions of the chosen stack
188
+
189
+ **Patterns:**
190
+ - Include code examples where helpful
191
+ - Explain trade-offs honestly
192
+ - Note when patterns are overkill for small projects
193
+
194
+ **Scaling Considerations:**
195
+ - Be realistic — most projects don't need to scale to millions
196
+ - Focus on "what breaks first" not theoretical limits
197
+ - Avoid premature optimization recommendations
198
+
199
+ **Anti-Patterns:**
200
+ - Specific to this domain
201
+ - Include what to do instead
202
+ - Helps prevent common mistakes during implementation
203
+
204
+ </guidelines>