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,574 @@
1
+ # Phase Prompt Template
2
+
3
+ Template for `.planning/phases/XX-name/{phase}-{plan}-PLAN.md` - executable phase plans optimized for parallel execution.
4
+
5
+ **Naming:** Use `{phase}-{plan}-PLAN.md` format (e.g., `01-02-PLAN.md` for Phase 1, Plan 2)
6
+
7
+ ---
8
+
9
+ ## File Template
10
+
11
+ ```markdown
12
+ ---
13
+ phase: XX-name
14
+ plan: NN
15
+ type: execute
16
+ wave: N # Execution wave (1, 2, 3...). Pre-computed at plan time.
17
+ depends_on: [] # Plan IDs this plan requires (e.g., ["01-01"]).
18
+ files_modified: [] # Files this plan modifies.
19
+ autonomous: true # false if plan has checkpoints requiring user interaction
20
+ user_setup: [] # Human-required setup Claude cannot automate (see below)
21
+
22
+ # Goal-backward verification (derived during planning, verified after execution)
23
+ must_haves:
24
+ truths: [] # Observable behaviors that must be true for goal achievement
25
+ artifacts: [] # Files that must exist with real implementation
26
+ key_links: [] # Critical connections between artifacts
27
+ ---
28
+
29
+ <objective>
30
+ [What this plan accomplishes]
31
+
32
+ Purpose: [Why this matters for the project]
33
+ Output: [What artifacts will be created]
34
+ </objective>
35
+
36
+ <execution_context>
37
+ @~/.claude/mindsystem/workflows/execute-plan.md
38
+ @~/.claude/mindsystem/templates/summary.md
39
+ [If plan contains checkpoint tasks (type="checkpoint:*"), add:]
40
+ @~/.claude/mindsystem/references/checkpoints.md
41
+ </execution_context>
42
+
43
+ <context>
44
+ @.planning/PROJECT.md
45
+ @.planning/ROADMAP.md
46
+ @.planning/STATE.md
47
+
48
+ # Only reference prior plan SUMMARYs if genuinely needed:
49
+ # - This plan uses types/exports from prior plan
50
+ # - Prior plan made decision that affects this plan
51
+ # Do NOT reflexively chain: Plan 02 refs 01, Plan 03 refs 02...
52
+
53
+ [Relevant source files:]
54
+ @src/path/to/relevant.ts
55
+ </context>
56
+
57
+ <tasks>
58
+
59
+ <task type="auto">
60
+ <name>Task 1: [Action-oriented name]</name>
61
+ <files>path/to/file.ext, another/file.ext</files>
62
+ <action>[Specific implementation - what to do, how to do it, what to avoid and WHY]</action>
63
+ <verify>[Command or check to prove it worked]</verify>
64
+ <done>[Measurable acceptance criteria]</done>
65
+ </task>
66
+
67
+ <task type="auto">
68
+ <name>Task 2: [Action-oriented name]</name>
69
+ <files>path/to/file.ext</files>
70
+ <action>[Specific implementation]</action>
71
+ <verify>[Command or check]</verify>
72
+ <done>[Acceptance criteria]</done>
73
+ </task>
74
+
75
+ <task type="checkpoint:decision" gate="blocking">
76
+ <decision>[What needs deciding]</decision>
77
+ <context>[Why this decision matters]</context>
78
+ <options>
79
+ <option id="option-a">
80
+ <name>[Option name]</name>
81
+ <pros>[Benefits and advantages]</pros>
82
+ <cons>[Tradeoffs and limitations]</cons>
83
+ </option>
84
+ <option id="option-b">
85
+ <name>[Option name]</name>
86
+ <pros>[Benefits and advantages]</pros>
87
+ <cons>[Tradeoffs and limitations]</cons>
88
+ </option>
89
+ </options>
90
+ <resume-signal>[How to indicate choice - "Select: option-a or option-b"]</resume-signal>
91
+ </task>
92
+
93
+ <task type="checkpoint:human-verify" gate="blocking">
94
+ <what-built>[What Claude just built that needs verification]</what-built>
95
+ <how-to-verify>
96
+ 1. Run: [command to start dev server/app]
97
+ 2. Visit: [URL to check]
98
+ 3. Test: [Specific interactions]
99
+ 4. Confirm: [Expected behaviors]
100
+ </how-to-verify>
101
+ <resume-signal>Type "approved" to continue, or describe issues to fix</resume-signal>
102
+ </task>
103
+
104
+ </tasks>
105
+
106
+ <verification>
107
+ Before declaring plan complete:
108
+ - [ ] [Specific test command]
109
+ - [ ] [Build/type check passes]
110
+ - [ ] [Behavior verification]
111
+ </verification>
112
+
113
+ <success_criteria>
114
+
115
+ - All tasks completed
116
+ - All verification checks pass
117
+ - No errors or warnings introduced
118
+ - [Plan-specific criteria]
119
+ </success_criteria>
120
+
121
+ <output>
122
+ After completion, create `.planning/phases/XX-name/{phase}-{plan}-SUMMARY.md`
123
+ </output>
124
+ ```
125
+
126
+ ---
127
+
128
+ ## Frontmatter Fields
129
+
130
+ | Field | Required | Purpose |
131
+ |-------|----------|---------|
132
+ | `phase` | Yes | Phase identifier (e.g., `01-foundation`) |
133
+ | `plan` | Yes | Plan number within phase (e.g., `01`, `02`) |
134
+ | `type` | Yes | Always `execute` for standard plans, `tdd` for TDD plans |
135
+ | `wave` | Yes | Execution wave number (1, 2, 3...). Pre-computed at plan time. |
136
+ | `depends_on` | Yes | Array of plan IDs this plan requires. |
137
+ | `files_modified` | Yes | Files this plan touches. |
138
+ | `autonomous` | Yes | `true` if no checkpoints, `false` if has checkpoints |
139
+ | `user_setup` | No | Array of human-required setup items (external services) |
140
+ | `must_haves` | Yes | Goal-backward verification criteria (see below) |
141
+
142
+ **Wave is pre-computed:** Wave numbers are assigned during `/ms:plan-phase`. Execute-phase reads `wave` directly from frontmatter and groups plans by wave number. No runtime dependency analysis needed.
143
+
144
+ **Must-haves enable verification:** The `must_haves` field carries goal-backward requirements from planning to execution. After all plans complete, execute-phase spawns a verification subagent that checks these criteria against the actual codebase.
145
+
146
+ ---
147
+
148
+ ## Parallel vs Sequential
149
+
150
+ <parallel_examples>
151
+
152
+ **Wave 1 candidates (parallel):**
153
+
154
+ ```yaml
155
+ # Plan 01 - User feature
156
+ wave: 1
157
+ depends_on: []
158
+ files_modified: [src/models/user.ts, src/api/users.ts]
159
+ autonomous: true
160
+
161
+ # Plan 02 - Product feature (no overlap with Plan 01)
162
+ wave: 1
163
+ depends_on: []
164
+ files_modified: [src/models/product.ts, src/api/products.ts]
165
+ autonomous: true
166
+
167
+ # Plan 03 - Order feature (no overlap)
168
+ wave: 1
169
+ depends_on: []
170
+ files_modified: [src/models/order.ts, src/api/orders.ts]
171
+ autonomous: true
172
+ ```
173
+
174
+ All three run in parallel (Wave 1) - no dependencies, no file conflicts.
175
+
176
+ **Sequential (genuine dependency):**
177
+
178
+ ```yaml
179
+ # Plan 01 - Auth foundation
180
+ wave: 1
181
+ depends_on: []
182
+ files_modified: [src/lib/auth.ts, src/middleware/auth.ts]
183
+ autonomous: true
184
+
185
+ # Plan 02 - Protected features (needs auth)
186
+ wave: 2
187
+ depends_on: ["01"]
188
+ files_modified: [src/features/dashboard.ts]
189
+ autonomous: true
190
+ ```
191
+
192
+ Plan 02 in Wave 2 waits for Plan 01 in Wave 1 - genuine dependency on auth types/middleware.
193
+
194
+ **Checkpoint plan:**
195
+
196
+ ```yaml
197
+ # Plan 03 - UI with verification
198
+ wave: 3
199
+ depends_on: ["01", "02"]
200
+ files_modified: [src/components/Dashboard.tsx]
201
+ autonomous: false # Has checkpoint:human-verify
202
+ ```
203
+
204
+ Wave 3 runs after Waves 1 and 2. Pauses at checkpoint, orchestrator presents to user, resumes on approval.
205
+
206
+ </parallel_examples>
207
+
208
+ ---
209
+
210
+ ## Context Section
211
+
212
+ **Parallel-aware context:**
213
+
214
+ ```markdown
215
+ <context>
216
+ @.planning/PROJECT.md
217
+ @.planning/ROADMAP.md
218
+ @.planning/STATE.md
219
+
220
+ # Only include SUMMARY refs if genuinely needed:
221
+ # - This plan imports types from prior plan
222
+ # - Prior plan made decision affecting this plan
223
+ # - Prior plan's output is input to this plan
224
+ #
225
+ # Independent plans need NO prior SUMMARY references.
226
+ # Do NOT reflexively chain: 02 refs 01, 03 refs 02...
227
+
228
+ @src/relevant/source.ts
229
+ </context>
230
+ ```
231
+
232
+ **Bad pattern (creates false dependencies):**
233
+ ```markdown
234
+ <context>
235
+ @.planning/phases/03-features/03-01-SUMMARY.md # Just because it's earlier
236
+ @.planning/phases/03-features/03-02-SUMMARY.md # Reflexive chaining
237
+ </context>
238
+ ```
239
+
240
+ ---
241
+
242
+ ## Scope Guidance
243
+
244
+ **Plan sizing:**
245
+
246
+ - 2-3 tasks per plan
247
+ - ~50% context usage maximum
248
+ - Complex phases: Multiple focused plans, not one large plan
249
+
250
+ **When to split:**
251
+
252
+ - Different subsystems (auth vs API vs UI)
253
+ - >3 tasks
254
+ - Risk of context overflow
255
+ - TDD candidates - separate plans
256
+
257
+ **Vertical slices preferred:**
258
+
259
+ ```
260
+ PREFER: Plan 01 = User (model + API + UI)
261
+ Plan 02 = Product (model + API + UI)
262
+
263
+ AVOID: Plan 01 = All models
264
+ Plan 02 = All APIs
265
+ Plan 03 = All UIs
266
+ ```
267
+
268
+ ---
269
+
270
+ ## TDD Plans
271
+
272
+ TDD features get dedicated plans with `type: tdd`.
273
+
274
+ **Heuristic:** Can you write `expect(fn(input)).toBe(output)` before writing `fn`?
275
+ → Yes: Create a TDD plan
276
+ → No: Standard task in standard plan
277
+
278
+ See `~/.claude/mindsystem/references/tdd.md` for TDD plan structure.
279
+
280
+ ---
281
+
282
+ ## Task Types
283
+
284
+ | Type | Use For | Autonomy |
285
+ |------|---------|----------|
286
+ | `auto` | Everything Claude can do independently | Fully autonomous |
287
+ | `checkpoint:human-verify` | Visual/functional verification | Pauses, returns to orchestrator |
288
+ | `checkpoint:decision` | Implementation choices | Pauses, returns to orchestrator |
289
+ | `checkpoint:human-action` | Truly unavoidable manual steps (rare) | Pauses, returns to orchestrator |
290
+
291
+ **Checkpoint behavior in parallel execution:**
292
+ - Plan runs until checkpoint
293
+ - Agent returns with checkpoint details + agent_id
294
+ - Orchestrator presents to user
295
+ - User responds
296
+ - Orchestrator resumes agent with `resume: agent_id`
297
+
298
+ ---
299
+
300
+ ## Examples
301
+
302
+ **Autonomous parallel plan:**
303
+
304
+ ```markdown
305
+ ---
306
+ phase: 03-features
307
+ plan: 01
308
+ type: execute
309
+ wave: 1
310
+ depends_on: []
311
+ files_modified: [src/features/user/model.ts, src/features/user/api.ts, src/features/user/UserList.tsx]
312
+ autonomous: true
313
+ ---
314
+
315
+ <objective>
316
+ Implement complete User feature as vertical slice.
317
+
318
+ Purpose: Self-contained user management that can run parallel to other features.
319
+ Output: User model, API endpoints, and UI components.
320
+ </objective>
321
+
322
+ <context>
323
+ @.planning/PROJECT.md
324
+ @.planning/ROADMAP.md
325
+ @.planning/STATE.md
326
+ </context>
327
+
328
+ <tasks>
329
+ <task type="auto">
330
+ <name>Task 1: Create User model</name>
331
+ <files>src/features/user/model.ts</files>
332
+ <action>Define User type with id, email, name, createdAt. Export TypeScript interface.</action>
333
+ <verify>tsc --noEmit passes</verify>
334
+ <done>User type exported and usable</done>
335
+ </task>
336
+
337
+ <task type="auto">
338
+ <name>Task 2: Create User API endpoints</name>
339
+ <files>src/features/user/api.ts</files>
340
+ <action>GET /users (list), GET /users/:id (single), POST /users (create). Use User type from model.</action>
341
+ <verify>curl tests pass for all endpoints</verify>
342
+ <done>All CRUD operations work</done>
343
+ </task>
344
+ </tasks>
345
+
346
+ <verification>
347
+ - [ ] npm run build succeeds
348
+ - [ ] API endpoints respond correctly
349
+ </verification>
350
+
351
+ <success_criteria>
352
+ - All tasks completed
353
+ - User feature works end-to-end
354
+ </success_criteria>
355
+
356
+ <output>
357
+ After completion, create `.planning/phases/03-features/03-01-SUMMARY.md`
358
+ </output>
359
+ ```
360
+
361
+ **Plan with checkpoint (non-autonomous):**
362
+
363
+ ```markdown
364
+ ---
365
+ phase: 03-features
366
+ plan: 03
367
+ type: execute
368
+ wave: 2
369
+ depends_on: ["03-01", "03-02"]
370
+ files_modified: [src/components/Dashboard.tsx]
371
+ autonomous: false
372
+ ---
373
+
374
+ <objective>
375
+ Build dashboard with visual verification.
376
+
377
+ Purpose: Integrate user and product features into unified view.
378
+ Output: Working dashboard component.
379
+ </objective>
380
+
381
+ <execution_context>
382
+ @~/.claude/mindsystem/workflows/execute-plan.md
383
+ @~/.claude/mindsystem/templates/summary.md
384
+ @~/.claude/mindsystem/references/checkpoints.md
385
+ </execution_context>
386
+
387
+ <context>
388
+ @.planning/PROJECT.md
389
+ @.planning/ROADMAP.md
390
+ @.planning/phases/03-features/03-01-SUMMARY.md
391
+ @.planning/phases/03-features/03-02-SUMMARY.md
392
+ </context>
393
+
394
+ <tasks>
395
+ <task type="auto">
396
+ <name>Task 1: Build Dashboard layout</name>
397
+ <files>src/components/Dashboard.tsx</files>
398
+ <action>Create responsive grid with UserList and ProductList components. Use Tailwind for styling.</action>
399
+ <verify>npm run build succeeds</verify>
400
+ <done>Dashboard renders without errors</done>
401
+ </task>
402
+
403
+ <task type="checkpoint:human-verify" gate="blocking">
404
+ <what-built>Responsive dashboard with user and product sections</what-built>
405
+ <how-to-verify>
406
+ 1. Run: npm run dev
407
+ 2. Visit: http://localhost:3000/dashboard
408
+ 3. Desktop: Verify two-column grid
409
+ 4. Mobile: Verify stacked layout
410
+ 5. Check: No layout shift, no scroll issues
411
+ </how-to-verify>
412
+ <resume-signal>Type "approved" or describe issues</resume-signal>
413
+ </task>
414
+ </tasks>
415
+
416
+ <verification>
417
+ - [ ] npm run build succeeds
418
+ - [ ] Visual verification passed
419
+ </verification>
420
+
421
+ <success_criteria>
422
+ - All tasks completed
423
+ - User approved visual layout
424
+ </success_criteria>
425
+
426
+ <output>
427
+ After completion, create `.planning/phases/03-features/03-03-SUMMARY.md`
428
+ </output>
429
+ ```
430
+
431
+ ---
432
+
433
+ ## Anti-Patterns
434
+
435
+ **Bad: Reflexive dependency chaining**
436
+ ```yaml
437
+ depends_on: ["03-01"] # Just because 01 comes before 02
438
+ ```
439
+
440
+ **Bad: Horizontal layer grouping**
441
+ ```
442
+ Plan 01: All models
443
+ Plan 02: All APIs (depends on 01)
444
+ Plan 03: All UIs (depends on 02)
445
+ ```
446
+
447
+ **Bad: Missing autonomy flag**
448
+ ```yaml
449
+ # Has checkpoint but no autonomous: false
450
+ depends_on: []
451
+ files_modified: [...]
452
+ # autonomous: ??? <- Missing!
453
+ ```
454
+
455
+ **Bad: Vague tasks**
456
+ ```xml
457
+ <task type="auto">
458
+ <name>Set up authentication</name>
459
+ <action>Add auth to the app</action>
460
+ </task>
461
+ ```
462
+
463
+ ---
464
+
465
+ ## Guidelines
466
+
467
+ - Always use XML structure for Claude parsing
468
+ - Include `wave`, `depends_on`, `files_modified`, `autonomous` in every plan
469
+ - Prefer vertical slices over horizontal layers
470
+ - Only reference prior SUMMARYs when genuinely needed
471
+ - Group checkpoints with related auto tasks in same plan
472
+ - 2-3 tasks per plan, ~50% context max
473
+
474
+ ---
475
+
476
+ ## User Setup (External Services)
477
+
478
+ When a plan introduces external services requiring human configuration, declare in frontmatter:
479
+
480
+ ```yaml
481
+ user_setup:
482
+ - service: stripe
483
+ why: "Payment processing requires API keys"
484
+ env_vars:
485
+ - name: STRIPE_SECRET_KEY
486
+ source: "Stripe Dashboard → Developers → API keys → Secret key"
487
+ - name: STRIPE_WEBHOOK_SECRET
488
+ source: "Stripe Dashboard → Developers → Webhooks → Signing secret"
489
+ dashboard_config:
490
+ - task: "Create webhook endpoint"
491
+ location: "Stripe Dashboard → Developers → Webhooks → Add endpoint"
492
+ details: "URL: https://[your-domain]/api/webhooks/stripe"
493
+ local_dev:
494
+ - "stripe listen --forward-to localhost:3000/api/webhooks/stripe"
495
+ ```
496
+
497
+ **The automation-first rule:** `user_setup` contains ONLY what Claude literally cannot do:
498
+ - Account creation (requires human signup)
499
+ - Secret retrieval (requires dashboard access)
500
+ - Dashboard configuration (requires human in browser)
501
+
502
+ **NOT included:** Package installs, code changes, file creation, CLI commands Claude can run.
503
+
504
+ **Result:** Execute-plan generates `{phase}-USER-SETUP.md` with checklist for the user.
505
+
506
+ See `~/.claude/mindsystem/templates/user-setup.md` for full schema and examples
507
+
508
+ ---
509
+
510
+ ## Must-Haves (Goal-Backward Verification)
511
+
512
+ The `must_haves` field defines what must be TRUE for the phase goal to be achieved. Derived during planning, verified after execution.
513
+
514
+ **Structure:**
515
+
516
+ ```yaml
517
+ must_haves:
518
+ truths:
519
+ - "User can see existing messages"
520
+ - "User can send a message"
521
+ - "Messages persist across refresh"
522
+ artifacts:
523
+ - path: "src/components/Chat.tsx"
524
+ provides: "Message list rendering"
525
+ min_lines: 30
526
+ - path: "src/app/api/chat/route.ts"
527
+ provides: "Message CRUD operations"
528
+ exports: ["GET", "POST"]
529
+ - path: "prisma/schema.prisma"
530
+ provides: "Message model"
531
+ contains: "model Message"
532
+ key_links:
533
+ - from: "src/components/Chat.tsx"
534
+ to: "/api/chat"
535
+ via: "fetch in useEffect"
536
+ pattern: "fetch.*api/chat"
537
+ - from: "src/app/api/chat/route.ts"
538
+ to: "prisma.message"
539
+ via: "database query"
540
+ pattern: "prisma\\.message\\.(find|create)"
541
+ ```
542
+
543
+ **Field descriptions:**
544
+
545
+ | Field | Purpose |
546
+ |-------|---------|
547
+ | `truths` | Observable behaviors from user perspective. Each must be testable. |
548
+ | `artifacts` | Files that must exist with real implementation. |
549
+ | `artifacts[].path` | File path relative to project root. |
550
+ | `artifacts[].provides` | What this artifact delivers. |
551
+ | `artifacts[].min_lines` | Optional. Minimum lines to be considered substantive. |
552
+ | `artifacts[].exports` | Optional. Expected exports to verify. |
553
+ | `artifacts[].contains` | Optional. Pattern that must exist in file. |
554
+ | `key_links` | Critical connections between artifacts. |
555
+ | `key_links[].from` | Source artifact. |
556
+ | `key_links[].to` | Target artifact or endpoint. |
557
+ | `key_links[].via` | How they connect (description). |
558
+ | `key_links[].pattern` | Optional. Regex to verify connection exists. |
559
+
560
+ **Why this matters:**
561
+
562
+ Task completion ≠ Goal achievement. A task "create chat component" can complete by creating a placeholder. The `must_haves` field captures what must actually work, enabling verification to catch gaps before they compound.
563
+
564
+ **Verification flow:**
565
+
566
+ 1. Plan-phase derives must_haves from phase goal (goal-backward)
567
+ 2. Must_haves written to PLAN.md frontmatter
568
+ 3. Execute-phase runs all plans
569
+ 4. Verification subagent checks must_haves against codebase
570
+ 5. Gaps found → fix plans created → execute → re-verify
571
+ 6. All must_haves pass → phase complete
572
+
573
+ See `~/.claude/mindsystem/references/goal-backward.md` for derivation process.
574
+ See `~/.claude/mindsystem/workflows/verify-phase.md` for verification logic.