planflow-ai 1.3.5 → 1.4.3

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 (123) hide show
  1. package/.claude/commands/brainstorm.md +6 -14
  2. package/.claude/commands/create-contract.md +6 -38
  3. package/.claude/commands/create-plan.md +18 -38
  4. package/.claude/commands/discovery-plan.md +19 -49
  5. package/.claude/commands/execute-plan.md +116 -77
  6. package/.claude/commands/flow.md +27 -2
  7. package/.claude/commands/heartbeat.md +12 -14
  8. package/.claude/commands/learn.md +20 -80
  9. package/.claude/commands/note.md +6 -23
  10. package/.claude/commands/resume-work.md +261 -0
  11. package/.claude/commands/review-code.md +19 -51
  12. package/.claude/commands/review-pr.md +21 -57
  13. package/.claude/commands/setup.md +8 -56
  14. package/.claude/commands/write-tests.md +7 -41
  15. package/.claude/resources/core/atomic-commits.md +380 -0
  16. package/.claude/resources/core/autopilot-mode.md +3 -2
  17. package/.claude/resources/core/compaction-guide.md +15 -1
  18. package/.claude/resources/core/heartbeat.md +129 -1
  19. package/.claude/resources/core/per-task-verification.md +362 -0
  20. package/.claude/resources/core/phase-isolation.md +237 -4
  21. package/.claude/resources/core/session-scratchpad.md +1 -0
  22. package/.claude/resources/core/shared-context.md +110 -0
  23. package/.claude/resources/core/wave-execution.md +407 -0
  24. package/.claude/resources/patterns/plans-patterns.md +56 -0
  25. package/.claude/resources/patterns/plans-templates.md +152 -0
  26. package/.claude/resources/skills/create-plan-skill.md +71 -5
  27. package/.claude/resources/skills/execute-plan-skill.md +420 -14
  28. package/.claude/resources/skills/resume-work-skill.md +159 -0
  29. package/README.md +154 -96
  30. package/dist/cli/commands/brain.d.ts +20 -0
  31. package/dist/cli/commands/brain.d.ts.map +1 -0
  32. package/dist/cli/commands/brain.js +127 -0
  33. package/dist/cli/commands/brain.js.map +1 -0
  34. package/dist/cli/commands/init.d.ts.map +1 -1
  35. package/dist/cli/commands/init.js +10 -1
  36. package/dist/cli/commands/init.js.map +1 -1
  37. package/dist/cli/commands/state-query.d.ts +13 -0
  38. package/dist/cli/commands/state-query.d.ts.map +1 -0
  39. package/dist/cli/commands/state-query.js +32 -0
  40. package/dist/cli/commands/state-query.js.map +1 -0
  41. package/dist/cli/commands/state.d.ts +12 -0
  42. package/dist/cli/commands/state.d.ts.map +1 -0
  43. package/dist/cli/commands/state.js +47 -0
  44. package/dist/cli/commands/state.js.map +1 -0
  45. package/dist/cli/daemon/desktop-notifier.d.ts +16 -0
  46. package/dist/cli/daemon/desktop-notifier.d.ts.map +1 -0
  47. package/dist/cli/daemon/desktop-notifier.js +53 -0
  48. package/dist/cli/daemon/desktop-notifier.js.map +1 -0
  49. package/dist/cli/daemon/event-writer.d.ts +22 -0
  50. package/dist/cli/daemon/event-writer.d.ts.map +1 -0
  51. package/dist/cli/daemon/event-writer.js +76 -0
  52. package/dist/cli/daemon/event-writer.js.map +1 -0
  53. package/dist/cli/daemon/heartbeat-daemon.js +81 -1
  54. package/dist/cli/daemon/heartbeat-daemon.js.map +1 -1
  55. package/dist/cli/daemon/log-writer.d.ts +17 -0
  56. package/dist/cli/daemon/log-writer.d.ts.map +1 -0
  57. package/dist/cli/daemon/log-writer.js +62 -0
  58. package/dist/cli/daemon/log-writer.js.map +1 -0
  59. package/dist/cli/daemon/notification-router.d.ts +17 -0
  60. package/dist/cli/daemon/notification-router.d.ts.map +1 -0
  61. package/dist/cli/daemon/notification-router.js +35 -0
  62. package/dist/cli/daemon/notification-router.js.map +1 -0
  63. package/dist/cli/daemon/prompt-manager.d.ts +27 -0
  64. package/dist/cli/daemon/prompt-manager.d.ts.map +1 -0
  65. package/dist/cli/daemon/prompt-manager.js +107 -0
  66. package/dist/cli/daemon/prompt-manager.js.map +1 -0
  67. package/dist/cli/daemon/shared-context.d.ts +38 -0
  68. package/dist/cli/daemon/shared-context.d.ts.map +1 -0
  69. package/dist/cli/daemon/shared-context.js +129 -0
  70. package/dist/cli/daemon/shared-context.js.map +1 -0
  71. package/dist/cli/handlers/claude.d.ts.map +1 -1
  72. package/dist/cli/handlers/claude.js +18 -0
  73. package/dist/cli/handlers/claude.js.map +1 -1
  74. package/dist/cli/handlers/shared.js +1 -1
  75. package/dist/cli/handlers/shared.js.map +1 -1
  76. package/dist/cli/index.js +30 -0
  77. package/dist/cli/index.js.map +1 -1
  78. package/dist/cli/state/brain-query.d.ts +48 -0
  79. package/dist/cli/state/brain-query.d.ts.map +1 -0
  80. package/dist/cli/state/brain-query.js +113 -0
  81. package/dist/cli/state/brain-query.js.map +1 -0
  82. package/dist/cli/state/flowconfig-parser.d.ts +16 -0
  83. package/dist/cli/state/flowconfig-parser.d.ts.map +1 -0
  84. package/dist/cli/state/flowconfig-parser.js +166 -0
  85. package/dist/cli/state/flowconfig-parser.js.map +1 -0
  86. package/dist/cli/state/heartbeat-state.d.ts +16 -0
  87. package/dist/cli/state/heartbeat-state.d.ts.map +1 -0
  88. package/dist/cli/state/heartbeat-state.js +97 -0
  89. package/dist/cli/state/heartbeat-state.js.map +1 -0
  90. package/dist/cli/state/model-router.d.ts +8 -0
  91. package/dist/cli/state/model-router.d.ts.map +1 -0
  92. package/dist/cli/state/model-router.js +36 -0
  93. package/dist/cli/state/model-router.js.map +1 -0
  94. package/dist/cli/state/plan-parser.d.ts +16 -0
  95. package/dist/cli/state/plan-parser.d.ts.map +1 -0
  96. package/dist/cli/state/plan-parser.js +124 -0
  97. package/dist/cli/state/plan-parser.js.map +1 -0
  98. package/dist/cli/state/session-state.d.ts +21 -0
  99. package/dist/cli/state/session-state.d.ts.map +1 -0
  100. package/dist/cli/state/session-state.js +36 -0
  101. package/dist/cli/state/session-state.js.map +1 -0
  102. package/dist/cli/state/state-md-parser.d.ts +18 -0
  103. package/dist/cli/state/state-md-parser.d.ts.map +1 -0
  104. package/dist/cli/state/state-md-parser.js +222 -0
  105. package/dist/cli/state/state-md-parser.js.map +1 -0
  106. package/dist/cli/state/types.d.ts +137 -0
  107. package/dist/cli/state/types.d.ts.map +1 -0
  108. package/dist/cli/state/types.js +8 -0
  109. package/dist/cli/state/types.js.map +1 -0
  110. package/dist/cli/state/wave-calculator.d.ts +18 -0
  111. package/dist/cli/state/wave-calculator.d.ts.map +1 -0
  112. package/dist/cli/state/wave-calculator.js +134 -0
  113. package/dist/cli/state/wave-calculator.js.map +1 -0
  114. package/dist/cli/types.d.ts +15 -0
  115. package/dist/cli/types.d.ts.map +1 -1
  116. package/package.json +7 -2
  117. package/templates/shared/CLAUDE.md.template +4 -0
  118. package/.claude/resources/core/_index.md +0 -304
  119. package/.claude/resources/languages/_index.md +0 -76
  120. package/.claude/resources/patterns/_index.md +0 -200
  121. package/.claude/resources/skills/_index.md +0 -285
  122. package/.claude/resources/tools/_index.md +0 -110
  123. package/.claude/resources/tools/reference-expansion-tool.md +0 -326
@@ -51,8 +51,10 @@ Use this template when creating new implementation plans:
51
51
 
52
52
  **Scope**: [What this phase covers]
53
53
  **Complexity**: X/10
54
+ **Dependencies**: None
54
55
 
55
56
  - [ ] Task 1
57
+ <verify>npx tsc --noEmit src/path/to/file.ts</verify>
56
58
  - [ ] Task 2
57
59
 
58
60
  **Build Verification**: Run `npm run build`
@@ -61,6 +63,7 @@ Use this template when creating new implementation plans:
61
63
 
62
64
  **Scope**: [What this phase covers]
63
65
  **Complexity**: X/10
66
+ **Dependencies**: Phase 1
64
67
 
65
68
  - [ ] Task 1
66
69
  - [ ] Task 2
@@ -71,6 +74,7 @@ Use this template when creating new implementation plans:
71
74
 
72
75
  **Scope**: Write comprehensive tests
73
76
  **Complexity**: X/10
77
+ **Dependencies**: Phase 1, Phase 2, ..., Phase N-1
74
78
 
75
79
  - [ ] Unit tests for logic hooks
76
80
  - [ ] Unit tests for utilities
@@ -87,6 +91,130 @@ Use this template when creating new implementation plans:
87
91
 
88
92
  ---
89
93
 
94
+ ## Dependencies Field
95
+
96
+ The optional `**Dependencies**` field declares which phases must complete before a phase can start. This enables wave-based parallel execution.
97
+
98
+ ### Syntax
99
+
100
+ - `**Dependencies**: None` — Phase has no dependencies and can run in the first wave (parallel with other independent phases)
101
+ - `**Dependencies**: Phase 1, Phase 3` — Phase depends on Phases 1 and 3 completing first
102
+ - **Omitting the field entirely** — Backward-compatible default; phase depends on the immediately previous phase (sequential execution)
103
+
104
+ ### Rules
105
+
106
+ 1. The Tests phase (always last) depends on ALL prior phases — it is never parallelized
107
+ 2. Phases with `Dependencies: None` form the first execution wave
108
+ 3. A phase cannot depend on itself or on phases that come after it
109
+ 4. When in doubt, omit the field to default to sequential execution
110
+
111
+ ### Example
112
+
113
+ ```markdown
114
+ ### Phase 1: Types and Schemas
115
+ **Scope**: Define TypeScript types
116
+ **Complexity**: 3/10
117
+ **Dependencies**: None
118
+
119
+ ### Phase 2: Config Parser
120
+ **Scope**: Implement config parsing
121
+ **Complexity**: 4/10
122
+ **Dependencies**: Phase 1
123
+
124
+ ### Phase 3: CLI Commands
125
+ **Scope**: Implement CLI interface
126
+ **Complexity**: 4/10
127
+ **Dependencies**: Phase 1
128
+
129
+ ### Phase 4: Integration
130
+ **Scope**: Connect all pieces
131
+ **Complexity**: 5/10
132
+ **Dependencies**: Phase 2, Phase 3
133
+
134
+ ### Phase 5: Tests (Final)
135
+ **Scope**: Write comprehensive tests
136
+ **Complexity**: 5/10
137
+ **Dependencies**: Phase 1, Phase 2, Phase 3, Phase 4
138
+ ```
139
+
140
+ In this example, Phases 2 and 3 can run in parallel (both only depend on Phase 1). Phase 4 waits for both 2 and 3. Phase 5 (tests) waits for everything.
141
+
142
+ ---
143
+
144
+ ## Verify Tag
145
+
146
+ The optional `<verify>` tag allows tasks to include a verification command that runs immediately after the task completes. This enables early error detection — failures are caught per-task instead of waiting until the final build step.
147
+
148
+ ### Syntax
149
+
150
+ Add a `<verify>` tag indented under a task checkbox:
151
+
152
+ ```markdown
153
+ - [ ] Create type definitions in `/src/types/workflow.ts`
154
+ <verify>npx tsc --noEmit src/types/workflow.ts</verify>
155
+ ```
156
+
157
+ The `<verify>` tag contains a single shell command that validates the task's output. The command should be **targeted** (single file or narrow scope) rather than a full build.
158
+
159
+ ### Rules
160
+
161
+ 1. **Optional**: Tasks without a `<verify>` tag skip verification entirely (backward compatible)
162
+ 2. **One command per tag**: Each `<verify>` tag contains exactly one shell command
163
+ 3. **Targeted checks only**: Use single-file or narrow-scope commands — never full builds
164
+ 4. **Indented under the task**: The `<verify>` tag must be indented under its parent task checkbox
165
+ 5. **No verify for manual-review tasks**: Config files, documentation, and other tasks requiring human judgment should omit `<verify>`
166
+
167
+ ### Examples
168
+
169
+ **Task with verification:**
170
+
171
+ ```markdown
172
+ - [ ] Create `UserProfile` type in `/src/types/user.ts`
173
+ <verify>npx tsc --noEmit src/types/user.ts</verify>
174
+ - [ ] Write unit tests for user validation
175
+ <verify>npx jest src/types/__tests__/user.test.ts --no-coverage</verify>
176
+ ```
177
+
178
+ **Task without verification (backward compatible):**
179
+
180
+ ```markdown
181
+ - [ ] Update `.flowconfig` with new setting
182
+ - [ ] Add documentation for the new feature
183
+ ```
184
+
185
+ **Mixed phase (some tasks verified, some not):**
186
+
187
+ ```markdown
188
+ ### Phase 2: Backend Implementation
189
+
190
+ **Scope**: Implement API routes and data layer.
191
+ **Complexity**: 6/10
192
+ **Dependencies**: Phase 1
193
+
194
+ - [ ] Create API route handler in `/src/routes/workflow.ts`
195
+ <verify>npx tsc --noEmit src/routes/workflow.ts</verify>
196
+ - [ ] Add database migration for `workflow_steps` table
197
+ - [ ] Create service layer in `/src/services/workflow.ts`
198
+ <verify>npx tsc --noEmit src/services/workflow.ts</verify>
199
+
200
+ **Build Verification**: Run `npm run build`
201
+ ```
202
+
203
+ ### Heuristic Reference
204
+
205
+ When writing plans, use these heuristics to decide which tasks get `<verify>` tags:
206
+
207
+ | Task Type | Verify Command | Example |
208
+ |-----------|---------------|---------|
209
+ | File creation (`.ts`) | `npx tsc --noEmit <file>` | `npx tsc --noEmit src/types/user.ts` |
210
+ | Test writing | `npx jest <test-file> --no-coverage` | `npx jest src/__tests__/user.test.ts --no-coverage` |
211
+ | Schema/type definition | `npx tsc --noEmit <type-file>` | `npx tsc --noEmit src/types/schema.ts` |
212
+ | Config file changes | No verify (manual review) | — |
213
+ | Documentation | No verify (manual review) | — |
214
+ | Generic/ambiguous tasks | No verify (default) | — |
215
+
216
+ ---
217
+
90
218
  ## Phase Templates
91
219
 
92
220
  ### Types and Schemas Phase
@@ -96,9 +224,12 @@ Use this template when creating new implementation plans:
96
224
 
97
225
  **Scope**: Define all TypeScript types and Zod schemas needed for the feature.
98
226
  **Complexity**: 3/10
227
+ **Dependencies**: None
99
228
 
100
229
  - [ ] Create type definitions in `/src/types/`
230
+ <verify>npx tsc --noEmit src/types/feature.ts</verify>
101
231
  - [ ] Create Zod validation schemas in `/src/types/rest-inputs.ts`
232
+ <verify>npx tsc --noEmit src/types/rest-inputs.ts</verify>
102
233
 
103
234
  **Build Verification**: Run `npm run build`
104
235
  ```
@@ -110,9 +241,12 @@ Use this template when creating new implementation plans:
110
241
 
111
242
  **Scope**: Implement API routes and commands.
112
243
  **Complexity**: 7/10
244
+ **Dependencies**: Phase 1
113
245
 
114
246
  - [ ] Create command in `/src/commands/`
247
+ <verify>npx tsc --noEmit src/commands/feature.ts</verify>
115
248
  - [ ] Create API route in `/src/app/api/`
249
+ <verify>npx tsc --noEmit src/app/api/feature/route.ts</verify>
116
250
  - [ ] Add database operations if needed
117
251
 
118
252
  **Build Verification**: Run `npm run build`
@@ -125,8 +259,10 @@ Use this template when creating new implementation plans:
125
259
 
126
260
  **Scope**: Implement Zustand stores for state management.
127
261
  **Complexity**: 5/10
262
+ **Dependencies**: Phase 1
128
263
 
129
264
  - [ ] Create or extend store in `/src/stores/`
265
+ <verify>npx tsc --noEmit src/stores/featureStore.ts</verify>
130
266
  - [ ] Add actions and selectors
131
267
 
132
268
  **Build Verification**: Run `npm run build`
@@ -139,9 +275,12 @@ Use this template when creating new implementation plans:
139
275
 
140
276
  **Scope**: Build the user interface components.
141
277
  **Complexity**: 6/10
278
+ **Dependencies**: Phase 3
142
279
 
143
280
  - [ ] Create logic hook (`useFeatureLogic.internal.ts`)
281
+ <verify>npx tsc --noEmit src/components/feature/useFeatureLogic.internal.ts</verify>
144
282
  - [ ] Create view component (`index.tsx`)
283
+ <verify>npx tsc --noEmit src/components/feature/index.tsx</verify>
145
284
  - [ ] Follow view/logic separation pattern
146
285
 
147
286
  **Build Verification**: Run `npm run build`
@@ -154,6 +293,7 @@ Use this template when creating new implementation plans:
154
293
 
155
294
  **Scope**: Connect all pieces and verify functionality.
156
295
  **Complexity**: 4/10
296
+ **Dependencies**: Phase 2, Phase 4
157
297
 
158
298
  - [ ] Integrate components with pages
159
299
  - [ ] Connect to API endpoints
@@ -169,11 +309,16 @@ Use this template when creating new implementation plans:
169
309
 
170
310
  **Scope**: Write comprehensive tests for all new code.
171
311
  **Complexity**: 5/10
312
+ **Dependencies**: Phase 1, Phase 2, Phase 3, Phase 4, Phase 5
172
313
 
173
314
  - [ ] Unit tests for logic hooks (`*.client.test.ts`)
315
+ <verify>npx jest src/components/feature/__tests__/useFeatureLogic.test.ts --no-coverage</verify>
174
316
  - [ ] Unit tests for utility functions
317
+ <verify>npx jest src/utils/__tests__/feature.test.ts --no-coverage</verify>
175
318
  - [ ] Integration tests for API routes
319
+ <verify>npx jest src/app/api/feature/__tests__/route.test.ts --no-coverage</verify>
176
320
  - [ ] Command tests
321
+ <verify>npx jest src/commands/__tests__/feature.test.ts --no-coverage</verify>
177
322
 
178
323
  **Build Verification**: Run `npm run build && npm run test`
179
324
  ```
@@ -226,4 +371,11 @@ Based on complexity scores (per `.claude/resources/core/complexity-scoring.md`):
226
371
  - **Phases 3-4**: Can be aggregated (combined complexity: 11, but cautious)
227
372
  - **Phase 5**: Can aggregate with Phase 6 if simple
228
373
  - **Phase 6**: Tests - always execute separately
374
+
375
+ Based on dependency graph (when Dependencies fields are present):
376
+
377
+ - **Wave 1**: Phase 1 (no dependencies)
378
+ - **Wave 2**: Phases 2, 3 (both depend only on Phase 1 — run in parallel)
379
+ - **Wave 3**: Phases 4, 5 (depend on earlier waves)
380
+ - **Wave 4**: Phase 6 (Tests — always sequential, always last)
229
381
  ```
@@ -21,7 +21,9 @@ This skill is **strictly for creating plan documents**. The process:
21
21
  1. **Reads** the discovery document or gathers requirements
22
22
  2. **Analyzes** complexity and scope
23
23
  3. **Structures** phases with complexity scores
24
- 4. **Generates** a plan markdown file
24
+ 4. **Analyzes** phase independence for parallel execution
25
+ 5. **Generates** verify sections for applicable tasks
26
+ 6. **Generates** a plan markdown file
25
27
 
26
28
  **No code, no implementation, no source file modifications.**
27
29
 
@@ -96,8 +98,10 @@ Create phases following these guidelines:
96
98
 
97
99
  **Scope**: [What this phase covers]
98
100
  **Complexity**: X/10
101
+ **Dependencies**: [None | Phase N, Phase M | omit for sequential default]
99
102
 
100
103
  - [ ] Task 1
104
+ <verify>npx tsc --noEmit src/path/to/file.ts</verify>
101
105
  - [ ] Task 2
102
106
 
103
107
  **Build Verification**: Run `npm run build`
@@ -122,9 +126,64 @@ Create phases following these guidelines:
122
126
  | 7-8 | High | Complex, multiple considerations |
123
127
  | 9-10 | Very High | Significant complexity/risk |
124
128
 
129
+ #### Auto-Generating Verify Sections
130
+
131
+ When creating tasks within phases, auto-generate `<verify>` tags based on the task type using these heuristics:
132
+
133
+ | Task Type | Verify Command | When to Apply |
134
+ |-----------|---------------|---------------|
135
+ | File creation (`.ts`, `.tsx`) | `npx tsc --noEmit <file>` | Task creates or modifies a TypeScript source file |
136
+ | Test writing | `npx jest <test-file> --no-coverage` | Task creates or modifies a test file |
137
+ | Schema/type definition | `npx tsc --noEmit <type-file>` | Task creates or modifies type definitions or schemas |
138
+ | Config file changes | No verify | Task modifies `.flowconfig`, `tsconfig.json`, or similar config files |
139
+ | Documentation/markdown | No verify | Task creates or updates `.md` files |
140
+ | Generic/ambiguous tasks | No verify | Task description does not clearly indicate a verifiable output file |
141
+
142
+ **Rules for auto-generation:**
143
+
144
+ 1. Only generate `<verify>` when the task clearly references a specific file path
145
+ 2. Use the file path from the task description in the verify command
146
+ 3. Prefer `npx tsc --noEmit` for source files and `npx jest --no-coverage` for test files
147
+ 4. When in doubt, omit the `<verify>` tag — false verification commands are worse than no verification
148
+ 5. Never generate full-build commands (`npm run build`) as verify tags — those belong in Build Verification
149
+
150
+ ---
151
+
152
+ ### Step 4: Analyze Phase Dependencies
153
+
154
+ After structuring phases, analyze which phases are independent and can run in parallel:
155
+
156
+ 1. **For each phase**, determine its data and code dependencies on other phases:
157
+ - Does this phase use types/interfaces defined in another phase?
158
+ - Does this phase call functions or APIs created in another phase?
159
+ - Does this phase modify files that another phase also modifies?
160
+
161
+ 2. **Mark independent phases** with `**Dependencies**: None` when they:
162
+ - Only depend on pre-existing code (not created in this plan)
163
+ - Have no shared file modifications with other phases in the same wave
164
+ - Can be implemented and verified independently
165
+
166
+ 3. **Mark dependent phases** with explicit dependency lists:
167
+ - `**Dependencies**: Phase 1` — depends on one phase
168
+ - `**Dependencies**: Phase 1, Phase 3` — depends on multiple phases
169
+ - List only **direct** dependencies (not transitive ones)
170
+
171
+ 4. **Default to sequential** (omit the field) when:
172
+ - Unsure whether phases are truly independent
173
+ - Phases touch overlapping files
174
+ - The dependency relationship is ambiguous
175
+
176
+ 5. **Tests phase**: Always list ALL prior phases as dependencies. The Tests phase is never parallelized.
177
+
178
+ **Common independence patterns**:
179
+ - Types/schemas phase is often `Dependencies: None` (foundational, no prior phases needed)
180
+ - Backend API and CLI commands may be independent if they don't share code
181
+ - Store and UI phases often depend on types but may be independent of each other
182
+ - Integration phases typically depend on multiple prior phases
183
+
125
184
  ---
126
185
 
127
- ### Step 4: Add Key Changes Summary
186
+ ### Step 5: Add Key Changes Summary
128
187
 
129
188
  Document the most important modifications:
130
189
 
@@ -137,7 +196,7 @@ Document the most important modifications:
137
196
 
138
197
  ---
139
198
 
140
- ### Step 5: Generate Plan Document
199
+ ### Step 6: Generate Plan Document
141
200
 
142
201
  Create the plan markdown file:
143
202
 
@@ -152,7 +211,7 @@ Create the plan markdown file:
152
211
  3. Non-Goals
153
212
  4. Requirements Summary (FR, NFR, Constraints)
154
213
  5. Risks
155
- 6. Phases (with complexity scores)
214
+ 6. Phases (with complexity scores and optional dependency declarations)
156
215
  7. Key Changes
157
216
 
158
217
  ---
@@ -217,8 +276,10 @@ The plan document should follow the template in `.claude/resources/patterns/plan
217
276
 
218
277
  **Scope**: [What this phase covers]
219
278
  **Complexity**: X/10
279
+ **Dependencies**: None
220
280
 
221
281
  - [ ] Task 1
282
+ <verify>npx tsc --noEmit src/path/to/file.ts</verify>
222
283
  - [ ] Task 2
223
284
 
224
285
  **Build Verification**: Run `npm run build`
@@ -227,8 +288,10 @@ The plan document should follow the template in `.claude/resources/patterns/plan
227
288
 
228
289
  **Scope**: Write comprehensive tests
229
290
  **Complexity**: X/10
291
+ **Dependencies**: Phase 1, Phase 2, ..., Phase N-1
230
292
 
231
293
  - [ ] Unit tests
294
+ <verify>npx jest src/path/to/test.ts --no-coverage</verify>
232
295
  - [ ] Integration tests
233
296
 
234
297
  **Build Verification**: Run `npm run build && npm run test`
@@ -247,9 +310,12 @@ Before completing the plan, verify:
247
310
  - [ ] Plan is saved in `flow/plans/` folder
248
311
  - [ ] File uses snake_case naming: `plan_<feature>_v<version>.md`
249
312
  - [ ] All phases have complexity scores (X/10)
250
- - [ ] Tests are the LAST phase
313
+ - [ ] Phase dependencies are analyzed and declared where appropriate
314
+ - [ ] Tests are the LAST phase with dependencies on ALL prior phases
251
315
  - [ ] Key Changes section is populated
252
316
  - [ ] Discovery document is referenced (discovery is required, never skipped)
317
+ - [ ] Verify sections are generated for applicable tasks (file creation, test writing, schema/type tasks)
318
+ - [ ] Verify sections are omitted for config, documentation, and generic tasks
253
319
  - [ ] **NO implementation code is included**
254
320
  - [ ] **NO source files were created or modified**
255
321