@ktpartners/dgs-platform 2.6.2

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 (256) hide show
  1. package/LICENSE +38 -0
  2. package/README.md +851 -0
  3. package/agents/dgs-codebase-cross-analyzer.md +183 -0
  4. package/agents/dgs-codebase-mapper.md +782 -0
  5. package/agents/dgs-codebase-synthesizer.md +156 -0
  6. package/agents/dgs-debugger.md +1256 -0
  7. package/agents/dgs-executor.md +550 -0
  8. package/agents/dgs-integration-checker.md +481 -0
  9. package/agents/dgs-nyquist-auditor.md +178 -0
  10. package/agents/dgs-phase-researcher.md +563 -0
  11. package/agents/dgs-phase-verifier.md +450 -0
  12. package/agents/dgs-plan-checker.md +708 -0
  13. package/agents/dgs-planner.md +1324 -0
  14. package/agents/dgs-project-researcher.md +631 -0
  15. package/agents/dgs-research-synthesizer.md +249 -0
  16. package/agents/dgs-roadmapper.md +652 -0
  17. package/agents/dgs-verifier.md +607 -0
  18. package/bin/install.js +2073 -0
  19. package/commands/dgs/add-doc.md +45 -0
  20. package/commands/dgs/add-idea.md +38 -0
  21. package/commands/dgs/add-phase.md +43 -0
  22. package/commands/dgs/add-repo.md +54 -0
  23. package/commands/dgs/add-tests.md +41 -0
  24. package/commands/dgs/add-todo.md +47 -0
  25. package/commands/dgs/approve-spec.md +38 -0
  26. package/commands/dgs/audit-milestone.md +36 -0
  27. package/commands/dgs/audit-phase.md +37 -0
  28. package/commands/dgs/cancel-job.md +23 -0
  29. package/commands/dgs/capture-principle.md +143 -0
  30. package/commands/dgs/check-todos.md +45 -0
  31. package/commands/dgs/cleanup.md +18 -0
  32. package/commands/dgs/complete-milestone.md +136 -0
  33. package/commands/dgs/complete-project.md +70 -0
  34. package/commands/dgs/consolidate-ideas.md +50 -0
  35. package/commands/dgs/create-milestone-job.md +37 -0
  36. package/commands/dgs/debug.md +164 -0
  37. package/commands/dgs/develop-idea.md +53 -0
  38. package/commands/dgs/discuss-idea.md +41 -0
  39. package/commands/dgs/discuss-phase.md +83 -0
  40. package/commands/dgs/execute-phase.md +41 -0
  41. package/commands/dgs/fast.md +38 -0
  42. package/commands/dgs/find-related-ideas.md +43 -0
  43. package/commands/dgs/health.md +28 -0
  44. package/commands/dgs/help.md +22 -0
  45. package/commands/dgs/import-spec.md +36 -0
  46. package/commands/dgs/init-product.md +28 -0
  47. package/commands/dgs/insert-phase.md +32 -0
  48. package/commands/dgs/join-discord.md +18 -0
  49. package/commands/dgs/list-docs.md +40 -0
  50. package/commands/dgs/list-ideas.md +42 -0
  51. package/commands/dgs/list-jobs.md +22 -0
  52. package/commands/dgs/list-phase-assumptions.md +46 -0
  53. package/commands/dgs/list-projects.md +57 -0
  54. package/commands/dgs/list-specs.md +40 -0
  55. package/commands/dgs/map-codebase.md +92 -0
  56. package/commands/dgs/new-milestone.md +44 -0
  57. package/commands/dgs/new-project.md +42 -0
  58. package/commands/dgs/node-repair.md +26 -0
  59. package/commands/dgs/overlap-check.md +20 -0
  60. package/commands/dgs/pause-work.md +38 -0
  61. package/commands/dgs/plan-milestone-gaps.md +34 -0
  62. package/commands/dgs/plan-phase.md +44 -0
  63. package/commands/dgs/progress.md +24 -0
  64. package/commands/dgs/quick.md +41 -0
  65. package/commands/dgs/reactivate-project.md +70 -0
  66. package/commands/dgs/reapply-patches.md +110 -0
  67. package/commands/dgs/refine-spec.md +38 -0
  68. package/commands/dgs/reject-idea.md +43 -0
  69. package/commands/dgs/remove-doc.md +44 -0
  70. package/commands/dgs/remove-phase.md +31 -0
  71. package/commands/dgs/remove-repo.md +69 -0
  72. package/commands/dgs/research-idea.md +43 -0
  73. package/commands/dgs/research-phase.md +189 -0
  74. package/commands/dgs/restore-idea.md +45 -0
  75. package/commands/dgs/resume-work.md +40 -0
  76. package/commands/dgs/rollback-job.md +24 -0
  77. package/commands/dgs/run-job.md +35 -0
  78. package/commands/dgs/search.md +40 -0
  79. package/commands/dgs/set-profile.md +34 -0
  80. package/commands/dgs/settings.md +38 -0
  81. package/commands/dgs/switch-project.md +58 -0
  82. package/commands/dgs/undo-consolidation.md +42 -0
  83. package/commands/dgs/update-idea.md +44 -0
  84. package/commands/dgs/update.md +37 -0
  85. package/commands/dgs/validate-phase.md +35 -0
  86. package/commands/dgs/verify-work.md +39 -0
  87. package/commands/dgs/write-spec.md +49 -0
  88. package/deliver-great-systems/.planning/phases/09-backend-wiring-and-error-handling/09-01-SUMMARY.md +84 -0
  89. package/deliver-great-systems/.planning/phases/09-backend-wiring-and-error-handling/09-02-SUMMARY.md +86 -0
  90. package/deliver-great-systems/.planning/phases/10-v1-to-v2-migration-flow/10-01-SUMMARY.md +85 -0
  91. package/deliver-great-systems/bin/dgs-tools.cjs +1444 -0
  92. package/deliver-great-systems/bin/lib/auto-test.cjs +1365 -0
  93. package/deliver-great-systems/bin/lib/commands.cjs +570 -0
  94. package/deliver-great-systems/bin/lib/config.cjs +417 -0
  95. package/deliver-great-systems/bin/lib/conflict-agent.cjs +1063 -0
  96. package/deliver-great-systems/bin/lib/conflict-agent.test.cjs +554 -0
  97. package/deliver-great-systems/bin/lib/context.cjs +929 -0
  98. package/deliver-great-systems/bin/lib/context.test.cjs +693 -0
  99. package/deliver-great-systems/bin/lib/core.cjs +744 -0
  100. package/deliver-great-systems/bin/lib/core.test.cjs +822 -0
  101. package/deliver-great-systems/bin/lib/docs.cjs +919 -0
  102. package/deliver-great-systems/bin/lib/docs.test.cjs +211 -0
  103. package/deliver-great-systems/bin/lib/execution.cjs +705 -0
  104. package/deliver-great-systems/bin/lib/execution.test.cjs +1472 -0
  105. package/deliver-great-systems/bin/lib/frontmatter.cjs +324 -0
  106. package/deliver-great-systems/bin/lib/ideas.cjs +1406 -0
  107. package/deliver-great-systems/bin/lib/ideas.test.cjs +1417 -0
  108. package/deliver-great-systems/bin/lib/identity.cjs +125 -0
  109. package/deliver-great-systems/bin/lib/init.cjs +1114 -0
  110. package/deliver-great-systems/bin/lib/init.test.cjs +1271 -0
  111. package/deliver-great-systems/bin/lib/jobs.cjs +2015 -0
  112. package/deliver-great-systems/bin/lib/jobs.test.cjs +2619 -0
  113. package/deliver-great-systems/bin/lib/merge-conflicts.cjs +654 -0
  114. package/deliver-great-systems/bin/lib/merge-conflicts.test.cjs +370 -0
  115. package/deliver-great-systems/bin/lib/migration.cjs +352 -0
  116. package/deliver-great-systems/bin/lib/migration.test.cjs +582 -0
  117. package/deliver-great-systems/bin/lib/milestone.cjs +243 -0
  118. package/deliver-great-systems/bin/lib/overlap.cjs +437 -0
  119. package/deliver-great-systems/bin/lib/overlap.test.cjs +747 -0
  120. package/deliver-great-systems/bin/lib/path-audit.test.cjs +384 -0
  121. package/deliver-great-systems/bin/lib/paths.cjs +144 -0
  122. package/deliver-great-systems/bin/lib/paths.test.cjs +486 -0
  123. package/deliver-great-systems/bin/lib/phase.cjs +910 -0
  124. package/deliver-great-systems/bin/lib/projects.cjs +691 -0
  125. package/deliver-great-systems/bin/lib/projects.test.cjs +871 -0
  126. package/deliver-great-systems/bin/lib/repos.cjs +1432 -0
  127. package/deliver-great-systems/bin/lib/repos.test.cjs +1882 -0
  128. package/deliver-great-systems/bin/lib/roadmap.cjs +305 -0
  129. package/deliver-great-systems/bin/lib/search.cjs +570 -0
  130. package/deliver-great-systems/bin/lib/specs.cjs +1303 -0
  131. package/deliver-great-systems/bin/lib/state.cjs +893 -0
  132. package/deliver-great-systems/bin/lib/template.cjs +228 -0
  133. package/deliver-great-systems/bin/lib/test-helpers.cjs +291 -0
  134. package/deliver-great-systems/bin/lib/verify.cjs +796 -0
  135. package/deliver-great-systems/references/checkpoints.md +776 -0
  136. package/deliver-great-systems/references/conflict-resolution.md +66 -0
  137. package/deliver-great-systems/references/context-tiers.md +166 -0
  138. package/deliver-great-systems/references/continuation-format.md +249 -0
  139. package/deliver-great-systems/references/decimal-phase-calculation.md +67 -0
  140. package/deliver-great-systems/references/git-integration.md +250 -0
  141. package/deliver-great-systems/references/git-planning-commit.md +40 -0
  142. package/deliver-great-systems/references/model-profile-resolution.md +36 -0
  143. package/deliver-great-systems/references/model-profiles.md +95 -0
  144. package/deliver-great-systems/references/phase-argument-parsing.md +61 -0
  145. package/deliver-great-systems/references/planning-config.md +224 -0
  146. package/deliver-great-systems/references/questioning.md +162 -0
  147. package/deliver-great-systems/references/spec-review-loop.md +177 -0
  148. package/deliver-great-systems/references/tdd.md +265 -0
  149. package/deliver-great-systems/references/ui-brand.md +160 -0
  150. package/deliver-great-systems/references/verification-patterns.md +612 -0
  151. package/deliver-great-systems/templates/DEBUG.md +166 -0
  152. package/deliver-great-systems/templates/UAT.md +251 -0
  153. package/deliver-great-systems/templates/VALIDATION.md +95 -0
  154. package/deliver-great-systems/templates/claude-md.md +74 -0
  155. package/deliver-great-systems/templates/codebase/architecture.md +257 -0
  156. package/deliver-great-systems/templates/codebase/concerns.md +312 -0
  157. package/deliver-great-systems/templates/codebase/conventions.md +309 -0
  158. package/deliver-great-systems/templates/codebase/integrations.md +282 -0
  159. package/deliver-great-systems/templates/codebase/stack.md +188 -0
  160. package/deliver-great-systems/templates/codebase/structure.md +287 -0
  161. package/deliver-great-systems/templates/codebase/testing.md +482 -0
  162. package/deliver-great-systems/templates/config.json +38 -0
  163. package/deliver-great-systems/templates/context.md +354 -0
  164. package/deliver-great-systems/templates/continue-here.md +80 -0
  165. package/deliver-great-systems/templates/debug-subagent-prompt.md +93 -0
  166. package/deliver-great-systems/templates/discovery.md +148 -0
  167. package/deliver-great-systems/templates/milestone-archive.md +125 -0
  168. package/deliver-great-systems/templates/milestone.md +117 -0
  169. package/deliver-great-systems/templates/phase-prompt.md +615 -0
  170. package/deliver-great-systems/templates/planner-subagent-prompt.md +119 -0
  171. package/deliver-great-systems/templates/project.md +186 -0
  172. package/deliver-great-systems/templates/requirements.md +233 -0
  173. package/deliver-great-systems/templates/research-project/ARCHITECTURE.md +206 -0
  174. package/deliver-great-systems/templates/research-project/FEATURES.md +149 -0
  175. package/deliver-great-systems/templates/research-project/PITFALLS.md +202 -0
  176. package/deliver-great-systems/templates/research-project/STACK.md +122 -0
  177. package/deliver-great-systems/templates/research-project/SUMMARY.md +172 -0
  178. package/deliver-great-systems/templates/research.md +554 -0
  179. package/deliver-great-systems/templates/retrospective.md +54 -0
  180. package/deliver-great-systems/templates/roadmap.md +204 -0
  181. package/deliver-great-systems/templates/state.md +178 -0
  182. package/deliver-great-systems/templates/summary-complex.md +59 -0
  183. package/deliver-great-systems/templates/summary-minimal.md +41 -0
  184. package/deliver-great-systems/templates/summary-standard.md +48 -0
  185. package/deliver-great-systems/templates/summary.md +253 -0
  186. package/deliver-great-systems/templates/user-setup.md +313 -0
  187. package/deliver-great-systems/templates/verification-report.md +324 -0
  188. package/deliver-great-systems/workflows/add-doc.md +151 -0
  189. package/deliver-great-systems/workflows/add-idea.md +96 -0
  190. package/deliver-great-systems/workflows/add-phase.md +120 -0
  191. package/deliver-great-systems/workflows/add-tests.md +359 -0
  192. package/deliver-great-systems/workflows/add-todo.md +162 -0
  193. package/deliver-great-systems/workflows/approve-spec.md +194 -0
  194. package/deliver-great-systems/workflows/audit-milestone.md +364 -0
  195. package/deliver-great-systems/workflows/audit-phase.md +462 -0
  196. package/deliver-great-systems/workflows/cancel-job.md +108 -0
  197. package/deliver-great-systems/workflows/check-todos.md +181 -0
  198. package/deliver-great-systems/workflows/cleanup.md +247 -0
  199. package/deliver-great-systems/workflows/codereview.md +526 -0
  200. package/deliver-great-systems/workflows/complete-milestone.md +1298 -0
  201. package/deliver-great-systems/workflows/consolidate-ideas.md +365 -0
  202. package/deliver-great-systems/workflows/create-milestone-job.md +177 -0
  203. package/deliver-great-systems/workflows/develop-idea.md +544 -0
  204. package/deliver-great-systems/workflows/diagnose-issues.md +231 -0
  205. package/deliver-great-systems/workflows/discovery-phase.md +301 -0
  206. package/deliver-great-systems/workflows/discuss-idea.md +263 -0
  207. package/deliver-great-systems/workflows/discuss-phase.md +733 -0
  208. package/deliver-great-systems/workflows/execute-phase.md +571 -0
  209. package/deliver-great-systems/workflows/execute-plan.md +592 -0
  210. package/deliver-great-systems/workflows/find-related-ideas.md +271 -0
  211. package/deliver-great-systems/workflows/health.md +173 -0
  212. package/deliver-great-systems/workflows/help.md +997 -0
  213. package/deliver-great-systems/workflows/import-spec.md +381 -0
  214. package/deliver-great-systems/workflows/init-product.md +767 -0
  215. package/deliver-great-systems/workflows/insert-phase.md +138 -0
  216. package/deliver-great-systems/workflows/list-docs.md +119 -0
  217. package/deliver-great-systems/workflows/list-ideas.md +154 -0
  218. package/deliver-great-systems/workflows/list-jobs.md +89 -0
  219. package/deliver-great-systems/workflows/list-phase-assumptions.md +192 -0
  220. package/deliver-great-systems/workflows/list-specs.md +101 -0
  221. package/deliver-great-systems/workflows/map-codebase.md +621 -0
  222. package/deliver-great-systems/workflows/new-milestone.md +591 -0
  223. package/deliver-great-systems/workflows/new-project.md +1113 -0
  224. package/deliver-great-systems/workflows/node-repair.md +94 -0
  225. package/deliver-great-systems/workflows/overlap-check.md +86 -0
  226. package/deliver-great-systems/workflows/pause-work.md +134 -0
  227. package/deliver-great-systems/workflows/plan-milestone-gaps.md +306 -0
  228. package/deliver-great-systems/workflows/plan-phase.md +698 -0
  229. package/deliver-great-systems/workflows/progress.md +386 -0
  230. package/deliver-great-systems/workflows/quick.md +845 -0
  231. package/deliver-great-systems/workflows/refine-spec.md +275 -0
  232. package/deliver-great-systems/workflows/reject-idea.md +109 -0
  233. package/deliver-great-systems/workflows/remove-doc.md +117 -0
  234. package/deliver-great-systems/workflows/remove-phase.md +163 -0
  235. package/deliver-great-systems/workflows/research-idea.md +325 -0
  236. package/deliver-great-systems/workflows/research-phase.md +81 -0
  237. package/deliver-great-systems/workflows/restore-idea.md +101 -0
  238. package/deliver-great-systems/workflows/resume-project.md +311 -0
  239. package/deliver-great-systems/workflows/rollback-job.md +130 -0
  240. package/deliver-great-systems/workflows/run-job.md +498 -0
  241. package/deliver-great-systems/workflows/search.md +130 -0
  242. package/deliver-great-systems/workflows/set-profile.md +83 -0
  243. package/deliver-great-systems/workflows/settings.md +470 -0
  244. package/deliver-great-systems/workflows/transition.md +563 -0
  245. package/deliver-great-systems/workflows/undo-consolidation.md +155 -0
  246. package/deliver-great-systems/workflows/update-idea.md +157 -0
  247. package/deliver-great-systems/workflows/update.md +242 -0
  248. package/deliver-great-systems/workflows/validate-phase.md +177 -0
  249. package/deliver-great-systems/workflows/verify-phase.md +253 -0
  250. package/deliver-great-systems/workflows/verify-work.md +671 -0
  251. package/deliver-great-systems/workflows/write-spec.md +450 -0
  252. package/hooks/dist/dgs-check-update.js +62 -0
  253. package/hooks/dist/dgs-context-monitor.js +141 -0
  254. package/hooks/dist/dgs-statusline.js +115 -0
  255. package/package.json +60 -0
  256. package/scripts/build-hooks.js +43 -0
@@ -0,0 +1,615 @@
1
+ # Phase Prompt Template
2
+
3
+ > **Note:** Planning methodology is in `agents/dgs-planner.md`.
4
+ > This template defines the PLAN.md output format that the agent produces.
5
+
6
+ Template for `phases/XX-name/{phase}-{plan}-PLAN.md` (in planning root) - executable phase plans optimized for parallel execution.
7
+
8
+ > **Layout-agnostic:** The `@` references in `<context>` blocks use paths relative to the planning root. The executor resolves these via init output paths at runtime, supporting both standard and root layouts.
9
+
10
+ **Naming:** Use `{phase}-{plan}-PLAN.md` format (e.g., `01-02-PLAN.md` for Phase 1, Plan 2)
11
+
12
+ ---
13
+
14
+ ## File Template
15
+
16
+ ```markdown
17
+ ---
18
+ phase: XX-name
19
+ plan: NN
20
+ type: execute
21
+ wave: N # Execution wave (1, 2, 3...). Pre-computed at plan time.
22
+ depends_on: [] # Plan IDs this plan requires (e.g., ["01-01"]).
23
+ files_modified: [] # Files this plan modifies.
24
+ autonomous: true # false if plan has checkpoints requiring user interaction
25
+ requirements: [] # REQUIRED — Requirement IDs from ROADMAP this plan addresses. MUST NOT be empty.
26
+ created_by: "" # Author who created this plan (set by planner from init author)
27
+ user_setup: [] # Human-required setup Claude cannot automate (see below)
28
+
29
+ # Goal-backward verification (derived during planning, verified after execution)
30
+ must_haves:
31
+ truths: [] # Observable behaviors that must be true for goal achievement
32
+ artifacts: [] # Files that must exist with real implementation
33
+ key_links: [] # Critical connections between artifacts
34
+ ---
35
+
36
+ <objective>
37
+ [What this plan accomplishes]
38
+
39
+ Purpose: [Why this matters for the project]
40
+ Output: [What artifacts will be created]
41
+ </objective>
42
+
43
+ <execution_context>
44
+ @~/.claude/deliver-great-systems/workflows/execute-plan.md
45
+ @~/.claude/deliver-great-systems/templates/summary.md
46
+ [If plan contains checkpoint tasks (type="checkpoint:*"), add:]
47
+ @~/.claude/deliver-great-systems/references/checkpoints.md
48
+ </execution_context>
49
+
50
+ <context>
51
+ @${project_path}
52
+ @${roadmap_path}
53
+ @${state_path}
54
+
55
+ # Only reference prior plan SUMMARYs if genuinely needed:
56
+ # - This plan uses types/exports from prior plan
57
+ # - Prior plan made decision that affects this plan
58
+ # Do NOT reflexively chain: Plan 02 refs 01, Plan 03 refs 02...
59
+
60
+ [Relevant source files:]
61
+ @src/path/to/relevant.ts
62
+ </context>
63
+
64
+ <tasks>
65
+
66
+ <task type="auto">
67
+ <name>Task 1: [Action-oriented name]</name>
68
+ <files>path/to/file.ext, another/file.ext</files>
69
+ <read_first>path/to/reference.ext, path/to/source-of-truth.ext</read_first>
70
+ <action>[Specific implementation - what to do, how to do it, what to avoid and WHY. Include CONCRETE values: exact identifiers, parameters, expected outputs, file paths, command arguments. Never say "align X with Y" without specifying the exact target state.]</action>
71
+ <verify>[Command or check to prove it worked]</verify>
72
+ <acceptance_criteria>
73
+ - [Grep-verifiable condition: "file.ext contains 'exact string'"]
74
+ - [Measurable condition: "output.ext uses 'expected-value', NOT 'wrong-value'"]
75
+ </acceptance_criteria>
76
+ <done>[Measurable acceptance criteria]</done>
77
+ </task>
78
+
79
+ <task type="auto">
80
+ <name>Task 2: [Action-oriented name]</name>
81
+ <files>path/to/file.ext</files>
82
+ <read_first>path/to/reference.ext</read_first>
83
+ <action>[Specific implementation with concrete values]</action>
84
+ <verify>[Command or check]</verify>
85
+ <acceptance_criteria>
86
+ - [Grep-verifiable condition]
87
+ </acceptance_criteria>
88
+ <done>[Acceptance criteria]</done>
89
+ </task>
90
+
91
+ <!-- For checkpoint task examples and patterns, see @~/.claude/deliver-great-systems/references/checkpoints.md -->
92
+ <!-- Key rule: Claude starts dev server BEFORE human-verify checkpoints. User only visits URLs. -->
93
+
94
+ <task type="checkpoint:decision" gate="blocking">
95
+ <decision>[What needs deciding]</decision>
96
+ <context>[Why this decision matters]</context>
97
+ <options>
98
+ <option id="option-a"><name>[Name]</name><pros>[Benefits]</pros><cons>[Tradeoffs]</cons></option>
99
+ <option id="option-b"><name>[Name]</name><pros>[Benefits]</pros><cons>[Tradeoffs]</cons></option>
100
+ </options>
101
+ <resume-signal>Select: option-a or option-b</resume-signal>
102
+ </task>
103
+
104
+ <task type="checkpoint:human-verify" gate="blocking">
105
+ <what-built>[What Claude built] - server running at [URL]</what-built>
106
+ <how-to-verify>Visit [URL] and verify: [visual checks only, NO CLI commands]</how-to-verify>
107
+ <resume-signal>Type "approved" or describe issues</resume-signal>
108
+ </task>
109
+
110
+ </tasks>
111
+
112
+ <verification>
113
+ Before declaring plan complete:
114
+ - [ ] [Specific test command]
115
+ - [ ] [Build/type check passes]
116
+ - [ ] [Behavior verification]
117
+ </verification>
118
+
119
+ <success_criteria>
120
+
121
+ - All tasks completed
122
+ - All verification checks pass
123
+ - No errors or warnings introduced
124
+ - [Plan-specific criteria]
125
+ </success_criteria>
126
+
127
+ <output>
128
+ After completion, create `phases/XX-name/{phase}-{plan}-SUMMARY.md` (in planning root)
129
+ </output>
130
+ ```
131
+
132
+ ---
133
+
134
+ ## Frontmatter Fields
135
+
136
+ | Field | Required | Purpose |
137
+ |-------|----------|---------|
138
+ | `phase` | Yes | Phase identifier (e.g., `01-foundation`) |
139
+ | `plan` | Yes | Plan number within phase (e.g., `01`, `02`) |
140
+ | `type` | Yes | Always `execute` for standard plans, `tdd` for TDD plans |
141
+ | `wave` | Yes | Execution wave number (1, 2, 3...). Pre-computed at plan time. |
142
+ | `depends_on` | Yes | Array of plan IDs this plan requires. |
143
+ | `files_modified` | Yes | Files this plan touches. |
144
+ | `autonomous` | Yes | `true` if no checkpoints, `false` if has checkpoints |
145
+ | `requirements` | Yes | **MUST** list requirement IDs from ROADMAP. Every roadmap requirement MUST appear in at least one plan. |
146
+ | `created_by` | No | Author who created this plan (set by planner from init author) |
147
+ | `user_setup` | No | Array of human-required setup items (external services) |
148
+ | `must_haves` | Yes | Goal-backward verification criteria (see below) |
149
+
150
+ **Wave is pre-computed:** Wave numbers are assigned during `/dgs:plan-phase`. Execute-phase reads `wave` directly from frontmatter and groups plans by wave number. No runtime dependency analysis needed.
151
+
152
+ **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.
153
+
154
+ ---
155
+
156
+ ## Parallel vs Sequential
157
+
158
+ <parallel_examples>
159
+
160
+ **Wave 1 candidates (parallel):**
161
+
162
+ ```yaml
163
+ # Plan 01 - User feature
164
+ wave: 1
165
+ depends_on: []
166
+ files_modified: [src/models/user.ts, src/api/users.ts]
167
+ autonomous: true
168
+
169
+ # Plan 02 - Product feature (no overlap with Plan 01)
170
+ wave: 1
171
+ depends_on: []
172
+ files_modified: [src/models/product.ts, src/api/products.ts]
173
+ autonomous: true
174
+
175
+ # Plan 03 - Order feature (no overlap)
176
+ wave: 1
177
+ depends_on: []
178
+ files_modified: [src/models/order.ts, src/api/orders.ts]
179
+ autonomous: true
180
+ ```
181
+
182
+ All three run in parallel (Wave 1) - no dependencies, no file conflicts.
183
+
184
+ **Sequential (genuine dependency):**
185
+
186
+ ```yaml
187
+ # Plan 01 - Auth foundation
188
+ wave: 1
189
+ depends_on: []
190
+ files_modified: [src/lib/auth.ts, src/middleware/auth.ts]
191
+ autonomous: true
192
+
193
+ # Plan 02 - Protected features (needs auth)
194
+ wave: 2
195
+ depends_on: ["01"]
196
+ files_modified: [src/features/dashboard.ts]
197
+ autonomous: true
198
+ ```
199
+
200
+ Plan 02 in Wave 2 waits for Plan 01 in Wave 1 - genuine dependency on auth types/middleware.
201
+
202
+ **Checkpoint plan:**
203
+
204
+ ```yaml
205
+ # Plan 03 - UI with verification
206
+ wave: 3
207
+ depends_on: ["01", "02"]
208
+ files_modified: [src/components/Dashboard.tsx]
209
+ autonomous: false # Has checkpoint:human-verify
210
+ ```
211
+
212
+ Wave 3 runs after Waves 1 and 2. Pauses at checkpoint, orchestrator presents to user, resumes on approval.
213
+
214
+ </parallel_examples>
215
+
216
+ ---
217
+
218
+ ## Context Section
219
+
220
+ **Parallel-aware context:**
221
+
222
+ ```markdown
223
+ <context>
224
+ @${project_path}
225
+ @${roadmap_path}
226
+ @${state_path}
227
+
228
+ # Only include SUMMARY refs if genuinely needed:
229
+ # - This plan imports types from prior plan
230
+ # - Prior plan made decision affecting this plan
231
+ # - Prior plan's output is input to this plan
232
+ #
233
+ # Independent plans need NO prior SUMMARY references.
234
+ # Do NOT reflexively chain: 02 refs 01, 03 refs 02...
235
+
236
+ @src/relevant/source.ts
237
+ </context>
238
+ ```
239
+
240
+ **Bad pattern (creates false dependencies):**
241
+ ```markdown
242
+ <context>
243
+ @${phase_dir}/03-01-SUMMARY.md # Just because it's earlier
244
+ @${phase_dir}/03-02-SUMMARY.md # Reflexive chaining
245
+ </context>
246
+ ```
247
+
248
+ ---
249
+
250
+ ## Scope Guidance
251
+
252
+ **Plan sizing:**
253
+
254
+ - 2-3 tasks per plan
255
+ - ~50% context usage maximum
256
+ - Complex phases: Multiple focused plans, not one large plan
257
+
258
+ **When to split:**
259
+
260
+ - Different subsystems (auth vs API vs UI)
261
+ - >3 tasks
262
+ - Risk of context overflow
263
+ - TDD candidates - separate plans
264
+
265
+ **Vertical slices preferred:**
266
+
267
+ ```
268
+ PREFER: Plan 01 = User (model + API + UI)
269
+ Plan 02 = Product (model + API + UI)
270
+
271
+ AVOID: Plan 01 = All models
272
+ Plan 02 = All APIs
273
+ Plan 03 = All UIs
274
+ ```
275
+
276
+ ---
277
+
278
+ ## TDD Plans
279
+
280
+ TDD features get dedicated plans with `type: tdd`.
281
+
282
+ **Heuristic:** Can you write `expect(fn(input)).toBe(output)` before writing `fn`?
283
+ → Yes: Create a TDD plan
284
+ → No: Standard task in standard plan
285
+
286
+ See `~/.claude/deliver-great-systems/references/tdd.md` for TDD plan structure.
287
+
288
+ ---
289
+
290
+ ## Task Types
291
+
292
+ | Type | Use For | Autonomy |
293
+ |------|---------|----------|
294
+ | `auto` | Everything Claude can do independently | Fully autonomous |
295
+ | `checkpoint:human-verify` | Visual/functional verification | Pauses, returns to orchestrator |
296
+ | `checkpoint:decision` | Implementation choices | Pauses, returns to orchestrator |
297
+ | `checkpoint:human-action` | Truly unavoidable manual steps (rare) | Pauses, returns to orchestrator |
298
+
299
+ **Checkpoint behavior in parallel execution:**
300
+ - Plan runs until checkpoint
301
+ - Agent returns with checkpoint details + agent_id
302
+ - Orchestrator presents to user
303
+ - User responds
304
+ - Orchestrator resumes agent with `resume: agent_id`
305
+
306
+ ---
307
+
308
+ ## Examples
309
+
310
+ **Autonomous parallel plan:**
311
+
312
+ ```markdown
313
+ ---
314
+ phase: 03-features
315
+ plan: 01
316
+ type: execute
317
+ wave: 1
318
+ depends_on: []
319
+ files_modified: [src/features/user/model.ts, src/features/user/api.ts, src/features/user/UserList.tsx]
320
+ autonomous: true
321
+ ---
322
+
323
+ <objective>
324
+ Implement complete User feature as vertical slice.
325
+
326
+ Purpose: Self-contained user management that can run parallel to other features.
327
+ Output: User model, API endpoints, and UI components.
328
+ </objective>
329
+
330
+ <context>
331
+ @${project_path}
332
+ @${roadmap_path}
333
+ @${state_path}
334
+ </context>
335
+
336
+ <tasks>
337
+ <task type="auto">
338
+ <name>Task 1: Create User model</name>
339
+ <files>src/features/user/model.ts</files>
340
+ <action>Define User type with id, email, name, createdAt. Export TypeScript interface.</action>
341
+ <verify>tsc --noEmit passes</verify>
342
+ <done>User type exported and usable</done>
343
+ </task>
344
+
345
+ <task type="auto">
346
+ <name>Task 2: Create User API endpoints</name>
347
+ <files>src/features/user/api.ts</files>
348
+ <action>GET /users (list), GET /users/:id (single), POST /users (create). Use User type from model.</action>
349
+ <verify>curl tests pass for all endpoints</verify>
350
+ <done>All CRUD operations work</done>
351
+ </task>
352
+ </tasks>
353
+
354
+ <verification>
355
+ - [ ] npm run build succeeds
356
+ - [ ] API endpoints respond correctly
357
+ </verification>
358
+
359
+ <success_criteria>
360
+ - All tasks completed
361
+ - User feature works end-to-end
362
+ </success_criteria>
363
+
364
+ <output>
365
+ After completion, create `phases/03-features/03-01-SUMMARY.md` (in planning root)
366
+ </output>
367
+ ```
368
+
369
+ **Plan with checkpoint (non-autonomous):**
370
+
371
+ ```markdown
372
+ ---
373
+ phase: 03-features
374
+ plan: 03
375
+ type: execute
376
+ wave: 2
377
+ depends_on: ["03-01", "03-02"]
378
+ files_modified: [src/components/Dashboard.tsx]
379
+ autonomous: false
380
+ ---
381
+
382
+ <objective>
383
+ Build dashboard with visual verification.
384
+
385
+ Purpose: Integrate user and product features into unified view.
386
+ Output: Working dashboard component.
387
+ </objective>
388
+
389
+ <execution_context>
390
+ @~/.claude/deliver-great-systems/workflows/execute-plan.md
391
+ @~/.claude/deliver-great-systems/templates/summary.md
392
+ @~/.claude/deliver-great-systems/references/checkpoints.md
393
+ </execution_context>
394
+
395
+ <context>
396
+ @${project_path}
397
+ @${roadmap_path}
398
+ @${phase_dir}/03-01-SUMMARY.md
399
+ @${phase_dir}/03-02-SUMMARY.md
400
+ </context>
401
+
402
+ <tasks>
403
+ <task type="auto">
404
+ <name>Task 1: Build Dashboard layout</name>
405
+ <files>src/components/Dashboard.tsx</files>
406
+ <action>Create responsive grid with UserList and ProductList components. Use Tailwind for styling.</action>
407
+ <verify>npm run build succeeds</verify>
408
+ <done>Dashboard renders without errors</done>
409
+ </task>
410
+
411
+ <!-- Checkpoint pattern: Claude starts server, user visits URL. See checkpoints.md for full patterns. -->
412
+ <task type="auto">
413
+ <name>Start dev server</name>
414
+ <action>Run `npm run dev` in background, wait for ready</action>
415
+ <verify>curl localhost:3000 returns 200</verify>
416
+ </task>
417
+
418
+ <task type="checkpoint:human-verify" gate="blocking">
419
+ <what-built>Dashboard - server at http://localhost:3000</what-built>
420
+ <how-to-verify>Visit localhost:3000/dashboard. Check: desktop grid, mobile stack, no scroll issues.</how-to-verify>
421
+ <resume-signal>Type "approved" or describe issues</resume-signal>
422
+ </task>
423
+ </tasks>
424
+
425
+ <verification>
426
+ - [ ] npm run build succeeds
427
+ - [ ] Visual verification passed
428
+ </verification>
429
+
430
+ <success_criteria>
431
+ - All tasks completed
432
+ - User approved visual layout
433
+ </success_criteria>
434
+
435
+ <output>
436
+ After completion, create `phases/03-features/03-03-SUMMARY.md` (in planning root)
437
+ </output>
438
+ ```
439
+
440
+ ---
441
+
442
+ ## Anti-Patterns
443
+
444
+ **Bad: Reflexive dependency chaining**
445
+ ```yaml
446
+ depends_on: ["03-01"] # Just because 01 comes before 02
447
+ ```
448
+
449
+ **Bad: Horizontal layer grouping**
450
+ ```
451
+ Plan 01: All models
452
+ Plan 02: All APIs (depends on 01)
453
+ Plan 03: All UIs (depends on 02)
454
+ ```
455
+
456
+ **Bad: Missing autonomy flag**
457
+ ```yaml
458
+ # Has checkpoint but no autonomous: false
459
+ depends_on: []
460
+ files_modified: [...]
461
+ # autonomous: ??? <- Missing!
462
+ ```
463
+
464
+ **Bad: Vague tasks**
465
+ ```xml
466
+ <task type="auto">
467
+ <name>Set up authentication</name>
468
+ <action>Add auth to the app</action>
469
+ </task>
470
+ ```
471
+
472
+ **Bad: Missing read_first (executor modifies files it hasn't read)**
473
+ ```xml
474
+ <task type="auto">
475
+ <name>Update database config</name>
476
+ <files>src/config/database.ts</files>
477
+ <!-- No read_first! Executor doesn't know current state or conventions -->
478
+ <action>Update the database config to match production settings</action>
479
+ </task>
480
+ ```
481
+
482
+ **Bad: Vague acceptance criteria (not verifiable)**
483
+ ```xml
484
+ <acceptance_criteria>
485
+ - Config is properly set up
486
+ - Database connection works correctly
487
+ </acceptance_criteria>
488
+ ```
489
+
490
+ **Good: Concrete with read_first + verifiable criteria**
491
+ ```xml
492
+ <task type="auto">
493
+ <name>Update database config for connection pooling</name>
494
+ <files>src/config/database.ts</files>
495
+ <read_first>src/config/database.ts, .env.example, docker-compose.yml</read_first>
496
+ <action>Add pool configuration: min=2, max=20, idleTimeoutMs=30000. Add SSL config: rejectUnauthorized=true when NODE_ENV=production. Add .env.example entry: DATABASE_POOL_MAX=20.</action>
497
+ <acceptance_criteria>
498
+ - database.ts contains "max: 20" and "idleTimeoutMillis: 30000"
499
+ - database.ts contains SSL conditional on NODE_ENV
500
+ - .env.example contains DATABASE_POOL_MAX
501
+ </acceptance_criteria>
502
+ </task>
503
+ ```
504
+
505
+ ---
506
+
507
+ ## Guidelines
508
+
509
+ - Always use XML structure for Claude parsing
510
+ - Include `wave`, `depends_on`, `files_modified`, `autonomous` in every plan
511
+ - Prefer vertical slices over horizontal layers
512
+ - Only reference prior SUMMARYs when genuinely needed
513
+ - Group checkpoints with related auto tasks in same plan
514
+ - 2-3 tasks per plan, ~50% context max
515
+
516
+ ---
517
+
518
+ ## User Setup (External Services)
519
+
520
+ When a plan introduces external services requiring human configuration, declare in frontmatter:
521
+
522
+ ```yaml
523
+ user_setup:
524
+ - service: stripe
525
+ why: "Payment processing requires API keys"
526
+ env_vars:
527
+ - name: STRIPE_SECRET_KEY
528
+ source: "Stripe Dashboard → Developers → API keys → Secret key"
529
+ - name: STRIPE_WEBHOOK_SECRET
530
+ source: "Stripe Dashboard → Developers → Webhooks → Signing secret"
531
+ dashboard_config:
532
+ - task: "Create webhook endpoint"
533
+ location: "Stripe Dashboard → Developers → Webhooks → Add endpoint"
534
+ details: "URL: https://[your-domain]/api/webhooks/stripe"
535
+ local_dev:
536
+ - "stripe listen --forward-to localhost:3000/api/webhooks/stripe"
537
+ ```
538
+
539
+ **The automation-first rule:** `user_setup` contains ONLY what Claude literally cannot do:
540
+ - Account creation (requires human signup)
541
+ - Secret retrieval (requires dashboard access)
542
+ - Dashboard configuration (requires human in browser)
543
+
544
+ **NOT included:** Package installs, code changes, file creation, CLI commands Claude can run.
545
+
546
+ **Result:** Execute-plan generates `{phase}-USER-SETUP.md` with checklist for the user.
547
+
548
+ See `~/.claude/deliver-great-systems/templates/user-setup.md` for full schema and examples
549
+
550
+ ---
551
+
552
+ ## Must-Haves (Goal-Backward Verification)
553
+
554
+ The `must_haves` field defines what must be TRUE for the phase goal to be achieved. Derived during planning, verified after execution.
555
+
556
+ **Structure:**
557
+
558
+ ```yaml
559
+ must_haves:
560
+ truths:
561
+ - "User can see existing messages"
562
+ - "User can send a message"
563
+ - "Messages persist across refresh"
564
+ artifacts:
565
+ - path: "src/components/Chat.tsx"
566
+ provides: "Message list rendering"
567
+ min_lines: 30
568
+ - path: "src/app/api/chat/route.ts"
569
+ provides: "Message CRUD operations"
570
+ exports: ["GET", "POST"]
571
+ - path: "prisma/schema.prisma"
572
+ provides: "Message model"
573
+ contains: "model Message"
574
+ key_links:
575
+ - from: "src/components/Chat.tsx"
576
+ to: "/api/chat"
577
+ via: "fetch in useEffect"
578
+ pattern: "fetch.*api/chat"
579
+ - from: "src/app/api/chat/route.ts"
580
+ to: "prisma.message"
581
+ via: "database query"
582
+ pattern: "prisma\\.message\\.(find|create)"
583
+ ```
584
+
585
+ **Field descriptions:**
586
+
587
+ | Field | Purpose |
588
+ |-------|---------|
589
+ | `truths` | Observable behaviors from user perspective. Each must be testable. |
590
+ | `artifacts` | Files that must exist with real implementation. |
591
+ | `artifacts[].path` | File path relative to project root. |
592
+ | `artifacts[].provides` | What this artifact delivers. |
593
+ | `artifacts[].min_lines` | Optional. Minimum lines to be considered substantive. |
594
+ | `artifacts[].exports` | Optional. Expected exports to verify. |
595
+ | `artifacts[].contains` | Optional. Pattern that must exist in file. |
596
+ | `key_links` | Critical connections between artifacts. |
597
+ | `key_links[].from` | Source artifact. |
598
+ | `key_links[].to` | Target artifact or endpoint. |
599
+ | `key_links[].via` | How they connect (description). |
600
+ | `key_links[].pattern` | Optional. Regex to verify connection exists. |
601
+
602
+ **Why this matters:**
603
+
604
+ 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.
605
+
606
+ **Verification flow:**
607
+
608
+ 1. Plan-phase derives must_haves from phase goal (goal-backward)
609
+ 2. Must_haves written to PLAN.md frontmatter
610
+ 3. Execute-phase runs all plans
611
+ 4. Verification subagent checks must_haves against codebase
612
+ 5. Gaps found → fix plans created → execute → re-verify
613
+ 6. All must_haves pass → phase complete
614
+
615
+ See `~/.claude/deliver-great-systems/workflows/verify-phase.md` for verification logic.