@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,591 @@
1
+ <purpose>
2
+
3
+ Start a new milestone cycle for an existing project. Loads project context, gathers milestone goals (from MILESTONE-CONTEXT.md, conversation, or a finalized spec via --auto), updates PROJECT.md and STATE.md, optionally runs parallel research, defines scoped requirements with REQ-IDs, spawns the roadmapper to create phased execution plan, and commits all artifacts. Brownfield equivalent of new-project. In --auto mode, derives everything from a finalized spec without interactive questioning.
4
+
5
+ </purpose>
6
+
7
+ <context_tier>planning</context_tier>
8
+
9
+ <required_reading>
10
+
11
+ Read all files referenced by the invoking prompt's execution_context before starting.
12
+
13
+ </required_reading>
14
+
15
+ <auto_mode>
16
+ ## Auto Mode Detection
17
+
18
+ Check if `--auto` flag is present in $ARGUMENTS.
19
+
20
+ **If auto mode with spec reference:**
21
+
22
+ The `--auto` argument must reference a spec file path or spec ID (starting with `spec-` or ending in `.md` within `${project_root}/specs/`).
23
+
24
+ 1. Read the spec file
25
+ 2. Validate the spec has `status: final` — if not, error:
26
+ ```
27
+ Error: Spec must be finalized before creating a milestone. Run /dgs:write-spec to complete it.
28
+ ```
29
+ 3. Enter spec-driven flow (replaces Steps 2-5, feeds into Steps 7-10)
30
+
31
+ **If --auto without spec reference:** Error:
32
+ ```
33
+ Error: --auto requires a finalized spec reference.
34
+
35
+ Usage:
36
+ /dgs:new-milestone --auto <spec-id> # From spec ID
37
+ /dgs:new-milestone --auto @${project_root}/specs/X.md # From spec file path
38
+
39
+ The spec must have status: final.
40
+ ```
41
+
42
+ **Scope rule:** Each spec creates exactly ONE milestone. If the user wants multiple milestones, they should write separate specs for each scope.
43
+ </auto_mode>
44
+
45
+ <process>
46
+
47
+ ## 1. Load Context
48
+
49
+ - Read PROJECT.md (existing project, validated requirements, decisions)
50
+ - Read MILESTONES.md (what shipped previously)
51
+ - Read STATE.md (pending todos, blockers)
52
+ - Check for MILESTONE-CONTEXT.md (from /dgs:discuss-milestone)
53
+
54
+ ## 1b. Spec-Driven Milestone (auto mode only)
55
+
56
+ **Triggered when:** `--auto` argument references a spec file.
57
+
58
+ ### Parse the Spec
59
+
60
+ Read the spec file and extract:
61
+ - **Title** → milestone name
62
+ - **Problem** section → milestone goal description
63
+ - **Goals** section → target features
64
+ - **Non-Goals** section → out of scope
65
+ - **Requirements** (P0/P1/P2) → milestone requirements (P0 + P1 for this milestone, P2 deferred)
66
+ - **"Repos likely touched"** or Technical Considerations → repos for cross-checking
67
+
68
+ ### Determine Milestone Version
69
+
70
+ Parse MILESTONES.md for last version. Suggest next version automatically (e.g., v1.0 → v1.1, or v2.0 for major). In auto mode, use the minor bump without asking.
71
+
72
+ ### Repo Cross-Check (v2 only)
73
+
74
+ If v2 install (REPOS.md exists):
75
+
76
+ ```bash
77
+ REPOS_JSON=$(node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs repos list --raw)
78
+ ```
79
+
80
+ Compare spec-mentioned repos against registered repos. For each unregistered repo, use AskUserQuestion with 4 options:
81
+
82
+ ```
83
+ AskUserQuestion([{
84
+ question: "Repo '{repo_name}' mentioned in spec is not registered. How should we handle it?",
85
+ header: "Repo",
86
+ multiSelect: false,
87
+ options: [
88
+ { label: "Continue", description: "Proceed without registering this repo" },
89
+ { label: "Register existing", description: "Register an already-existing repo at this path" },
90
+ { label: "Create + Register", description: "Create folder, git init, and register" },
91
+ { label: "Cancel", description: "Stop milestone creation" }
92
+ ]
93
+ }])
94
+ ```
95
+
96
+ Handle each choice identically to new-project's repo cross-check:
97
+ - **Continue:** Skip, proceed
98
+ - **Register existing:** Ask path, run `repos add`
99
+ - **Create + Register:** `mkdir -p`, `git init`, `repos add`
100
+ - **Cancel:** Stop with message: "Milestone creation cancelled. Resolve repo registration and try again."
101
+
102
+ If no unregistered repos OR not v2: skip silently.
103
+
104
+ ### Update PROJECT.md
105
+
106
+ Add/update the Current Milestone section:
107
+
108
+ ```markdown
109
+ ## Current Milestone: v[X.Y] [Spec Title]
110
+
111
+ **Goal:** [Derived from spec Problem section — one sentence]
112
+ **Source Spec:** `[relative path to spec file]`
113
+
114
+ **Target features:**
115
+ [From spec Goals section, as bullet list]
116
+ ```
117
+
118
+ ### Update STATE.md
119
+
120
+ ```markdown
121
+ ## Current Position
122
+
123
+ Phase: Not started (defining requirements)
124
+ Plan: —
125
+ Status: Defining requirements
126
+ Last activity: [today] — Milestone v[X.Y] started (from spec [spec-id])
127
+ ```
128
+
129
+ ### Commit
130
+
131
+ ```bash
132
+ node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs commit "docs: start milestone v[X.Y] [Name] (from spec)" --files ${project_path} ${state_path}
133
+ ```
134
+
135
+ ### Link Spec to Milestone
136
+
137
+ Update the spec's milestones frontmatter to record the bidirectional link:
138
+
139
+ ```bash
140
+ node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs specs link-milestone --id "$SPEC_ID" --milestone "v$VERSION"
141
+ ```
142
+
143
+ Include the updated spec file in a commit:
144
+
145
+ ```bash
146
+ node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs commit "specs: link $SPEC_ID to v$VERSION" --files ${project_root}/specs/$SPEC_FILENAME
147
+ ```
148
+
149
+ ### Continue to Step 7
150
+
151
+ Skip Steps 2-6 (questioning, version determination, update, cleanup, context loading) — they're replaced by spec-driven derivation. Proceed to Step 7 (Load Context and Resolve Models), then:
152
+
153
+ - Step 8 (Research Decision): Default to "Research first" in auto mode
154
+ - Step 9 (Define Requirements): Generate from spec instead of interactive scoping:
155
+ - P0 requirements → this milestone (must have)
156
+ - P1 requirements → this milestone (should have)
157
+ - P2 requirements → Future
158
+ - Non-Goals → Out of Scope
159
+ - Requirements use standard [CATEGORY]-[NUMBER] REQ-ID format
160
+ - Requirements are user-centric and atomic (not verbatim spec text)
161
+ - Auto-approve (no user confirmation gate)
162
+ - Step 10 (Create Roadmap): Spawn roadmapper as usual
163
+ - In auto mode: auto-approve roadmap without user confirmation
164
+ - Step 10.5 (Overlap Check): Run as usual
165
+ - Step 11 (Done): Show source spec in completion output
166
+
167
+ ## 2. Gather Milestone Goals
168
+
169
+ **If MILESTONE-CONTEXT.md exists:**
170
+ - Use features and scope from discuss-milestone
171
+ - Present summary for confirmation
172
+
173
+ **If no context file:**
174
+ - Present what shipped in last milestone
175
+ - Ask: "What do you want to build next?"
176
+ - Use AskUserQuestion to explore features, priorities, constraints, scope
177
+
178
+ ## 3. Determine Milestone Version
179
+
180
+ - Parse last version from MILESTONES.md
181
+ - Suggest next version (v1.0 → v1.1, or v2.0 for major)
182
+ - Confirm with user
183
+
184
+ ## 4. Update PROJECT.md
185
+
186
+ Add/update:
187
+
188
+ ```markdown
189
+ ## Current Milestone: v[X.Y] [Name]
190
+
191
+ **Goal:** [One sentence describing milestone focus]
192
+
193
+ **Target features:**
194
+ - [Feature 1]
195
+ - [Feature 2]
196
+ - [Feature 3]
197
+ ```
198
+
199
+ Update Active requirements section and "Last updated" footer.
200
+
201
+ ## 5. Update STATE.md
202
+
203
+ ```markdown
204
+ ## Current Position
205
+
206
+ Phase: Not started (defining requirements)
207
+ Plan: —
208
+ Status: Defining requirements
209
+ Last activity: [today] — Milestone v[X.Y] started
210
+ ```
211
+
212
+ Keep Accumulated Context section from previous milestone.
213
+
214
+ ## 6. Cleanup and Commit
215
+
216
+ Delete MILESTONE-CONTEXT.md if exists (consumed).
217
+
218
+ ```bash
219
+ node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs commit "docs: start milestone v[X.Y] [Name]" --files ${project_path} ${state_path}
220
+ ```
221
+
222
+ ## 7. Load Context and Resolve Models
223
+
224
+ ```bash
225
+ INIT=$(node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs init new-milestone)
226
+ ```
227
+
228
+ Extract from init JSON: `researcher_model`, `synthesizer_model`, `roadmapper_model`, `commit_docs`, `research_enabled`, `current_milestone`, `project_exists`, `roadmap_exists`.
229
+
230
+ Load planning-tier context files:
231
+
232
+ ```bash
233
+ TIER_FILES=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" context load-tier planning --raw 2>/dev/null)
234
+ ```
235
+
236
+ ## 8. Research Decision
237
+
238
+ AskUserQuestion: "Research the domain ecosystem for new features before defining requirements?"
239
+ - "Research first (Recommended)" — Discover patterns, features, architecture for NEW capabilities
240
+ - "Skip research" — Go straight to requirements
241
+
242
+ **Persist choice to config** (so future `/dgs:plan-phase` honors it):
243
+
244
+ ```bash
245
+ # If "Research first": persist true
246
+ node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs config-set workflow.research true
247
+
248
+ # If "Skip research": persist false
249
+ node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs config-set workflow.research false
250
+ ```
251
+
252
+ **If "Research first":**
253
+
254
+ ```
255
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
256
+ DGS ► RESEARCHING
257
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
258
+
259
+ ◆ Spawning 4 researchers in parallel...
260
+ → Stack, Features, Architecture, Pitfalls
261
+ ```
262
+
263
+ ```bash
264
+ mkdir -p ${project_root}/research
265
+ ```
266
+
267
+ Spawn 4 parallel dgs-project-researcher agents. Each uses this template with dimension-specific fields:
268
+
269
+ **Common structure for all 4 researchers:**
270
+ ```
271
+ Task(prompt="
272
+ <research_type>Project Research — {DIMENSION} for [new features].</research_type>
273
+
274
+ <milestone_context>
275
+ SUBSEQUENT MILESTONE — Adding [target features] to existing app.
276
+ {EXISTING_CONTEXT}
277
+ Focus ONLY on what's needed for the NEW features.
278
+ </milestone_context>
279
+
280
+ <question>{QUESTION}</question>
281
+
282
+ <files_to_read>
283
+ - ${project_path} (Project context)
284
+ - ${project_root}/docs/product/ARCHITECTURE.md (Target architecture, if exists)
285
+ - ${project_root}/docs/product/PRODUCT-SUMMARY.md (Product summary, if exists)
286
+ </files_to_read>
287
+
288
+ <downstream_consumer>{CONSUMER}</downstream_consumer>
289
+
290
+ <quality_gate>{GATES}</quality_gate>
291
+
292
+ <output>
293
+ Write to: ${project_root}/research/{FILE}
294
+ Use template: ~/.claude/deliver-great-systems/templates/research-project/{FILE}
295
+ </output>
296
+ ", subagent_type="dgs-project-researcher", model="{researcher_model}", description="{DIMENSION} research")
297
+ ```
298
+
299
+ **Dimension-specific fields:**
300
+
301
+ | Field | Stack | Features | Architecture | Pitfalls |
302
+ |-------|-------|----------|-------------|----------|
303
+ | EXISTING_CONTEXT | Existing validated capabilities (DO NOT re-research): [from PROJECT.md] | Existing features (already built): [from PROJECT.md] | Existing architecture: [from PROJECT.md or codebase map] | Focus on common mistakes when ADDING these features to existing system |
304
+ | QUESTION | What stack additions/changes are needed for [new features]? | How do [target features] typically work? Expected behavior? | How do [target features] integrate with existing architecture? | Common mistakes when adding [target features] to [domain]? |
305
+ | CONSUMER | Specific libraries with versions for NEW capabilities, integration points, what NOT to add | Table stakes vs differentiators vs anti-features, complexity noted, dependencies on existing | Integration points, new components, data flow changes, suggested build order | Warning signs, prevention strategy, which phase should address it |
306
+ | GATES | Versions current (verify with Context7), rationale explains WHY, integration considered | Categories clear, complexity noted, dependencies identified | Integration points identified, new vs modified explicit, build order considers deps | Pitfalls specific to adding these features, integration pitfalls covered, prevention actionable |
307
+ | FILE | STACK.md | FEATURES.md | ARCHITECTURE.md | PITFALLS.md |
308
+
309
+ After all 4 complete, spawn synthesizer:
310
+
311
+ ```
312
+ Task(prompt="
313
+ Synthesize research outputs into SUMMARY.md.
314
+
315
+ <files_to_read>
316
+ - ${project_root}/research/STACK.md
317
+ - ${project_root}/research/FEATURES.md
318
+ - ${project_root}/research/ARCHITECTURE.md
319
+ - ${project_root}/research/PITFALLS.md
320
+ </files_to_read>
321
+
322
+ Write to: ${project_root}/research/SUMMARY.md
323
+ Use template: ~/.claude/deliver-great-systems/templates/research-project/SUMMARY.md
324
+ Commit after writing.
325
+ ", subagent_type="dgs-research-synthesizer", model="{synthesizer_model}", description="Synthesize research")
326
+ ```
327
+
328
+ Display key findings from SUMMARY.md:
329
+ ```
330
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
331
+ DGS ► RESEARCH COMPLETE ✓
332
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
333
+
334
+ **Stack additions:** [from SUMMARY.md]
335
+ **Feature table stakes:** [from SUMMARY.md]
336
+ **Watch Out For:** [from SUMMARY.md]
337
+ ```
338
+
339
+ **If "Skip research":** Continue to Step 9.
340
+
341
+ ## 9. Define Requirements
342
+
343
+ ```
344
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
345
+ DGS ► DEFINING REQUIREMENTS
346
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
347
+ ```
348
+
349
+ Read PROJECT.md: core value, current milestone goals, validated requirements (what exists).
350
+
351
+ **If research exists:** Read FEATURES.md, extract feature categories.
352
+
353
+ Present features by category:
354
+ ```
355
+ ## [Category 1]
356
+ **Table stakes:** Feature A, Feature B
357
+ **Differentiators:** Feature C, Feature D
358
+ **Research notes:** [any relevant notes]
359
+ ```
360
+
361
+ **If no research:** Gather requirements through conversation. Ask: "What are the main things users need to do with [new features]?" Clarify, probe for related capabilities, group into categories.
362
+
363
+ **Scope each category** via AskUserQuestion (multiSelect: true, header max 12 chars):
364
+ - "[Feature 1]" — [brief description]
365
+ - "[Feature 2]" — [brief description]
366
+ - "None for this milestone" — Defer entire category
367
+
368
+ Track: Selected → this milestone. Unselected table stakes → future. Unselected differentiators → out of scope.
369
+
370
+ **Identify gaps** via AskUserQuestion:
371
+ - "No, research covered it" — Proceed
372
+ - "Yes, let me add some" — Capture additions
373
+
374
+ **Generate REQUIREMENTS.md:**
375
+ - v1 Requirements grouped by category (checkboxes, REQ-IDs)
376
+ - Future Requirements (deferred)
377
+ - Out of Scope (explicit exclusions with reasoning)
378
+ - Traceability section (empty, filled by roadmap)
379
+
380
+ **REQ-ID format:** `[CATEGORY]-[NUMBER]` (AUTH-01, NOTIF-02). Continue numbering from existing.
381
+
382
+ **Requirement quality criteria:**
383
+
384
+ Good requirements are:
385
+ - **Specific and testable:** "User can reset password via email link" (not "Handle password reset")
386
+ - **User-centric:** "User can X" (not "System does Y")
387
+ - **Atomic:** One capability per requirement (not "User can login and manage profile")
388
+ - **Independent:** Minimal dependencies on other requirements
389
+
390
+ Present FULL requirements list for confirmation:
391
+
392
+ ```
393
+ ## Milestone v[X.Y] Requirements
394
+
395
+ ### [Category 1]
396
+ - [ ] **CAT1-01**: User can do X
397
+ - [ ] **CAT1-02**: User can do Y
398
+
399
+ ### [Category 2]
400
+ - [ ] **CAT2-01**: User can do Z
401
+
402
+ Does this capture what you're building? (yes / adjust)
403
+ ```
404
+
405
+ If "adjust": Return to scoping.
406
+
407
+ **Commit requirements:**
408
+ ```bash
409
+ node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs commit "docs: define milestone v[X.Y] requirements" --files ${project_root}/REQUIREMENTS.md
410
+ ```
411
+
412
+ ## 10. Create Roadmap
413
+
414
+ ```
415
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
416
+ DGS ► CREATING ROADMAP
417
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
418
+
419
+ ◆ Spawning roadmapper...
420
+ ```
421
+
422
+ **Starting phase number:** Read MILESTONES.md for last phase number. Continue from there (v1.0 ended at phase 5 → v1.1 starts at phase 6).
423
+
424
+ ```
425
+ Task(prompt="
426
+ <planning_context>
427
+ <files_to_read>
428
+ - ${project_path}
429
+ - ${project_root}/REQUIREMENTS.md
430
+ - ${project_root}/research/SUMMARY.md (if exists)
431
+ - ${config_path}
432
+ - ${project_root}/MILESTONES.md
433
+ - ${project_root}/docs/product/ARCHITECTURE.md (Target architecture, if exists)
434
+ - ${project_root}/docs/product/PRODUCT-SUMMARY.md (Product summary, if exists)
435
+ </files_to_read>
436
+ </planning_context>
437
+
438
+ <instructions>
439
+ Create roadmap for milestone v[X.Y]:
440
+ 1. Start phase numbering from [N]
441
+ 2. Derive phases from THIS MILESTONE's requirements only
442
+ 3. Map every requirement to exactly one phase
443
+ 4. Derive 2-5 success criteria per phase (observable user behaviors)
444
+ 5. Validate 100% coverage
445
+ 6. Write files immediately (ROADMAP.md, STATE.md, update REQUIREMENTS.md traceability)
446
+ 7. Return ROADMAP CREATED with summary
447
+
448
+ Write files first, then return.
449
+ </instructions>
450
+ ", subagent_type="dgs-roadmapper", model="{roadmapper_model}", description="Create roadmap")
451
+ ```
452
+
453
+ **Handle return:**
454
+
455
+ **If `## ROADMAP BLOCKED`:** Present blocker, work with user, re-spawn.
456
+
457
+ **If `## ROADMAP CREATED`:** Read ROADMAP.md, present inline:
458
+
459
+ ```
460
+ ## Proposed Roadmap
461
+
462
+ **[N] phases** | **[X] requirements mapped** | All covered ✓
463
+
464
+ | # | Phase | Goal | Requirements | Success Criteria |
465
+ |---|-------|------|--------------|------------------|
466
+ | [N] | [Name] | [Goal] | [REQ-IDs] | [count] |
467
+
468
+ ### Phase Details
469
+
470
+ **Phase [N]: [Name]**
471
+ Goal: [goal]
472
+ Requirements: [REQ-IDs]
473
+ Success criteria:
474
+ 1. [criterion]
475
+ 2. [criterion]
476
+ ```
477
+
478
+ **Ask for approval** via AskUserQuestion:
479
+ - "Approve" — Commit and continue
480
+ - "Adjust phases" — Tell me what to change
481
+ - "Review full file" — Show raw ROADMAP.md
482
+
483
+ **If "Adjust":** Get notes, re-spawn roadmapper with revision context, loop until approved.
484
+ **If "Review":** Display raw ROADMAP.md, re-ask.
485
+
486
+ **Commit roadmap** (after approval):
487
+ ```bash
488
+ node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs commit "docs: create milestone v[X.Y] roadmap ([N] phases)" --files ${roadmap_path} ${state_path} ${project_root}/REQUIREMENTS.md
489
+ ```
490
+
491
+ ## 10.5. Overlap Check (v2 only)
492
+
493
+ If v2 install (PROJECTS.md or REPOS.md exists in the planning root):
494
+
495
+ ```bash
496
+ OVERLAP=$(node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs overlap check --raw 2>/dev/null)
497
+ ```
498
+
499
+ Parse JSON. If `overlapping_repos` array is non-empty, display warning:
500
+
501
+ ```
502
+ ⚠ Cross-project overlap detected:
503
+
504
+ | Repo | Also touched by |
505
+ |------|----------------|
506
+ | {repo} | {other-project} |
507
+
508
+ This is informational — work can proceed.
509
+ ```
510
+
511
+ If no overlaps or not v2: skip silently.
512
+
513
+ ## 11. Done
514
+
515
+ ```
516
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
517
+ DGS ► MILESTONE INITIALIZED ✓
518
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
519
+
520
+ **Milestone v[X.Y]: [Name]**
521
+
522
+ | Artifact | Location |
523
+ |----------------|-----------------------------|
524
+ | Project | `${project_path}` |
525
+ | Research | `${project_root}/research/` |
526
+ | Requirements | `${project_root}/REQUIREMENTS.md` |
527
+ | Roadmap | `${roadmap_path}` |
528
+
529
+ **[N] phases** | **[X] requirements** | Ready to build ✓
530
+ ```
531
+
532
+ **If spec-driven mode (auto):** Also display:
533
+
534
+ ```
535
+ **Source:** `[spec path]` — [spec title]
536
+ **Mode:** One milestone from one spec (auto-derived)
537
+ ```
538
+
539
+ ```
540
+ ## ▶ Next Up
541
+
542
+ **Phase [N]: [Phase Name]** — [Goal]
543
+
544
+ `/dgs:discuss-phase [N]` — gather context and clarify approach
545
+
546
+ <sub>`/clear` first → fresh context window</sub>
547
+
548
+ Also: `/dgs:plan-phase [N]` — skip discussion, plan directly
549
+ ```
550
+
551
+ </process>
552
+
553
+ <success_criteria>
554
+ - [ ] PROJECT.md updated with Current Milestone section
555
+ - [ ] STATE.md reset for new milestone
556
+ - [ ] MILESTONE-CONTEXT.md consumed and deleted (if existed)
557
+ - [ ] Research completed (if selected) — 4 parallel agents, milestone-aware
558
+ - [ ] Requirements gathered and scoped per category
559
+ - [ ] REQUIREMENTS.md created with REQ-IDs
560
+ - [ ] dgs-roadmapper spawned with phase numbering context
561
+ - [ ] Roadmap files written immediately (not draft)
562
+ - [ ] User feedback incorporated (if any)
563
+ - [ ] ROADMAP.md phases continue from previous milestone
564
+ - [ ] All commits made (if planning docs committed)
565
+ - [ ] User knows next step: `/dgs:discuss-phase [N]`
566
+ - [ ] Auto mode: spec parsed and validated (status: final)
567
+ - [ ] Auto mode: PROJECT.md includes Source Spec reference
568
+ - [ ] Auto mode: requirements derived (not verbatim) from spec P0/P1/P2
569
+ - [ ] Auto mode: repo cross-check completed (if v2)
570
+ - [ ] Auto mode: one milestone per spec enforced
571
+ - [ ] Auto mode: spec milestones field updated with link-milestone call
572
+
573
+ **Atomic commits:** Each phase commits its artifacts immediately.
574
+ </success_criteria>
575
+
576
+ <output>
577
+
578
+ **Standard mode artifacts:**
579
+ - `${project_path}` — Updated Current Milestone section
580
+ - `${state_path}` — Reset for new milestone
581
+ - `${project_root}/REQUIREMENTS.md` — Scoped requirements with REQ-IDs
582
+ - `${roadmap_path}` — Phased execution plan
583
+ - `${project_root}/research/` — Research files (if research selected)
584
+
585
+ **Auto mode (--auto <spec>) artifacts:**
586
+ Same as standard mode, plus:
587
+ - PROJECT.md includes `Source Spec` reference linking to the originating spec
588
+ - Requirements derived from spec P0/P1/P2 priorities (not verbatim)
589
+ - All interactive gates (research decision, requirements approval, roadmap approval) are auto-approved
590
+
591
+ </output>