@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,1113 @@
1
+ <purpose>
2
+ Initialize a new project through unified flow: questioning, research (optional), requirements, roadmap. This is the most leveraged moment in any project — deep questioning here means better plans, better execution, better outcomes. One workflow takes you from idea to ready-for-planning.
3
+ </purpose>
4
+
5
+ <context_tier>planning</context_tier>
6
+
7
+ <required_reading>
8
+ Read all files referenced by the invoking prompt's execution_context before starting.
9
+ </required_reading>
10
+
11
+ <auto_mode>
12
+ ## Auto Mode Detection
13
+
14
+ Check if `--auto` flag is present in $ARGUMENTS.
15
+
16
+ **If auto mode:**
17
+ - Skip brownfield mapping offer (assume greenfield)
18
+ - Skip deep questioning (extract context from provided document)
19
+ - Config: Use existing product config from init-product (Step 2a sets auto_advance only)
20
+ - After config: run Steps 6-9 automatically with smart defaults:
21
+ - Research: Always yes
22
+ - Requirements: Include all table stakes + features from provided document
23
+ - Requirements approval: Auto-approve
24
+ - Roadmap approval: Auto-approve
25
+
26
+ **Document requirement:**
27
+ Auto mode requires an idea document or spec reference — either:
28
+ - File reference: `/dgs:new-project --auto @prd.md`
29
+ - Pasted/written text in the prompt
30
+ - Spec ID: `/dgs:new-project --auto <spec-id>`
31
+ - Spec file path: `/dgs:new-project --auto @${project_root}/specs/X.md`
32
+
33
+ If no document content provided, error:
34
+
35
+ ```
36
+ Error: --auto requires an idea document or spec reference.
37
+
38
+ Usage:
39
+ /dgs:new-project --auto @your-idea.md # From idea document
40
+ /dgs:new-project --auto [paste or write idea] # From freeform text
41
+ /dgs:new-project --auto <spec-id> # From finalized spec
42
+ /dgs:new-project --auto @${project_root}/specs/X.md # From spec file path
43
+
44
+ The argument should be an idea document, freeform text, or a finalized spec.
45
+ ```
46
+
47
+ **Spec-driven mode:**
48
+
49
+ If the `--auto` argument references a spec file path or spec ID:
50
+ 1. Read the spec file (either from the provided path or by looking up via `node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs specs list --status final`)
51
+ 2. Validate the spec has `status: final` — if not, error: "Spec must be finalized before creating a project. Run /dgs:write-spec to complete it."
52
+ 3. Enter spec-driven flow (Steps 2b-2c below) instead of the standard auto flow
53
+
54
+ **Detection:** If the argument after `--auto` contains `spec-` or ends with `.md` and exists in `${project_root}/specs/`, treat it as a spec reference. Otherwise, treat as a freeform document (existing behavior).
55
+ </auto_mode>
56
+
57
+ <process>
58
+
59
+ ## 1. Setup
60
+
61
+ **MANDATORY FIRST STEP — Execute these checks before ANY user interaction:**
62
+
63
+ ```bash
64
+ INIT=$(node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs init new-project)
65
+ ```
66
+
67
+ Parse JSON for: `researcher_model`, `synthesizer_model`, `roadmapper_model`, `commit_docs`, `project_exists`, `has_codebase_map`, `planning_exists`, `has_existing_code`, `has_package_file`, `is_brownfield`, `needs_codebase_map`, `has_git`, `project_path`, `state_path`, `roadmap_path`, `requirements_path`, `research_dir`.
68
+
69
+ Load planning-tier context files:
70
+
71
+ ```bash
72
+ TIER_FILES=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" context load-tier planning --raw 2>/dev/null)
73
+ ```
74
+
75
+ **If `project_exists` is true:** Error — project already initialized. Use `/dgs:progress`.
76
+
77
+ **Config validation:** If `project_exists` is false, check that config has workflow preferences:
78
+
79
+ ```bash
80
+ MODE=$(node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs config-get mode --raw 2>/dev/null)
81
+ ```
82
+
83
+ If `MODE` is empty/unset (no `mode` key in config), display error and exit:
84
+
85
+ ```
86
+ Error: Workflow settings not configured. Run `/dgs:init-product` first to configure workflow settings.
87
+ ```
88
+
89
+ **If `has_git` is false:** Initialize git:
90
+ ```bash
91
+ git init
92
+ ```
93
+
94
+ ## 2. Brownfield Offer
95
+
96
+ **If auto mode:** Skip to Step 4 (assume greenfield, synthesize PROJECT.md from provided document).
97
+
98
+ **If `needs_codebase_map` is true** (from init — existing code detected but no codebase map):
99
+
100
+ Use AskUserQuestion:
101
+ - header: "Codebase"
102
+ - question: "I detected existing code in this directory. Would you like to map the codebase first?"
103
+ - options:
104
+ - "Map codebase first" — Run /dgs:map-codebase to understand existing architecture (Recommended)
105
+ - "Skip mapping" — Proceed with project initialization
106
+
107
+ **If "Map codebase first":**
108
+ ```
109
+ Run `/dgs:map-codebase` first, then return to `/dgs:new-project`
110
+ ```
111
+ Exit command.
112
+
113
+ **If "Skip mapping" OR `needs_codebase_map` is false:** Continue to Step 3.
114
+
115
+ ## 2a. Auto Mode Config (auto mode only)
116
+
117
+ **If auto mode:** Use existing product config (set during `/dgs:init-product`). No config questions needed here.
118
+
119
+ **Persist auto-advance to config (survives context compaction):**
120
+
121
+ ```bash
122
+ node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs config-set workflow.auto_advance true
123
+ ```
124
+
125
+ Proceed to Step 4 (skip Step 3).
126
+
127
+ ## 2b. Spec-Driven Project Creation (spec-driven auto mode only)
128
+
129
+ **Triggered when:** `--auto` argument references a spec file.
130
+
131
+ ### Parse the Spec
132
+
133
+ Read the spec file and extract:
134
+ - **Title** → becomes project name (slugified for folder name)
135
+ - **Problem** section → project description / core value
136
+ - **Goals** section → project goals
137
+ - **Non-Goals** section → out of scope
138
+ - **Requirements** (P0/P1/P2) → v1 requirements (P0 + P1) and future requirements (P2)
139
+ - **User Stories** → inform requirement specificity
140
+ - **Technical Considerations** → inform research/architecture
141
+ - **"Repos likely touched"** or similar section → repos for cross-checking (Step 2c)
142
+
143
+ ### Derive Project Name
144
+
145
+ Extract from spec title. Slugify for the project folder name. Example: "Review Configuration System" → `review-configuration-system`.
146
+
147
+ ### Write PROJECT.md
148
+
149
+ Create `${project_path}` with standard template structure, but derived entirely from the spec:
150
+
151
+ ```markdown
152
+ # [Spec Title]
153
+
154
+ ## Vision
155
+
156
+ [Derived from spec Problem + Goals sections]
157
+
158
+ ## Core Value
159
+
160
+ [Extracted from the spec's Problem section — the ONE thing this solves]
161
+
162
+ ## Source Spec
163
+
164
+ `[relative path to spec file]`
165
+
166
+ ## Requirements
167
+
168
+ ### Validated
169
+
170
+ (None yet — ship to validate)
171
+
172
+ ### Active
173
+
174
+ [Requirements derived from spec P0 + P1 sections, each as a checkbox item]
175
+
176
+ ### Out of Scope
177
+
178
+ [From spec Non-Goals + P2 requirements explicitly deferred]
179
+
180
+ ## Key Decisions
181
+
182
+ | Decision | Rationale | Outcome |
183
+ |----------|-----------|---------|
184
+ | Spec-driven creation | Auto-generated from [spec id] | — |
185
+ ```
186
+
187
+ **Important:** Transform spec requirements into standard DGS format:
188
+ - Each spec requirement becomes a user-centric statement: "User can X"
189
+ - Group by logical category
190
+ - Do NOT copy verbatim — restructure for project planning context
191
+ - Add a `Source spec: [path]` line to PROJECT.md (per user decision — reference, not copy)
192
+
193
+ ### Write REQUIREMENTS.md
194
+
195
+ Generate `${requirements_path}` with:
196
+ - REQ-IDs in `[CATEGORY]-[NUMBER]` format (e.g., AUTH-01, UI-02)
197
+ - P0 requirements → v1 (must have)
198
+ - P1 requirements → v1 (should have)
199
+ - P2 requirements → Future
200
+ - Non-Goals → Out of Scope with reasoning
201
+
202
+ The requirements must be user-centric and atomic (one capability per requirement), following the quality criteria in the existing new-project workflow.
203
+
204
+ ### Commit and Continue
205
+
206
+ Commit PROJECT.md and REQUIREMENTS.md, then continue to Step 5 (Resolve Model Profile) — skip Steps 3 (Deep Questioning) and 4 (Write PROJECT.md) since they're replaced by spec-driven derivation.
207
+
208
+ **Branch name preview:** After the project folder is created, if `branching_strategy` is not `"none"`, show:
209
+ ```
210
+ Branch names will look like: dgs/{project-slug}/phase-03-auth
211
+ ```
212
+
213
+ After model profile resolution, proceed to Step 6, 7 (if research selected, auto-default yes), 8 (Create Roadmap), 8.5 (Overlap Check), 9 (Done).
214
+
215
+ ## 2c. Repo Cross-Check (spec-driven mode, v2 only)
216
+
217
+ **Triggered when:** spec-driven mode AND v2 install (REPOS.md exists).
218
+
219
+ ### Extract Repos from Spec
220
+
221
+ Parse the spec body for a "Repos likely touched" or "Technical Considerations" section. Extract any repo names mentioned.
222
+
223
+ ### Load Registered Repos
224
+
225
+ ```bash
226
+ REPOS_JSON=$(node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs repos list --raw)
227
+ ```
228
+
229
+ Parse the JSON to get the list of registered repo names.
230
+
231
+ ### Compare
232
+
233
+ For each repo name mentioned in the spec:
234
+ - If it exists in REPOS.md registered repos → OK (no action)
235
+ - If NOT registered → add to unregistered list
236
+
237
+ ### Handle Unregistered Repos
238
+
239
+ If any unregistered repos found, display a blocking warning:
240
+
241
+ ```
242
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
243
+ DGS ► REPO CHECK
244
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
245
+
246
+ The spec references repos not registered with this product:
247
+ ```
248
+
249
+ For EACH unregistered repo, use AskUserQuestion:
250
+
251
+ ```
252
+ AskUserQuestion([{
253
+ question: "Repo '{repo_name}' is not registered. How should we handle it?",
254
+ header: "Repo",
255
+ multiSelect: false,
256
+ options: [
257
+ { label: "Continue", description: "Proceed without registering this repo" },
258
+ { label: "Register existing", description: "Register an already-existing repo at this path" },
259
+ { label: "Create + Register", description: "Create folder, git init, and register" },
260
+ { label: "Cancel", description: "Stop project creation" }
261
+ ]
262
+ }])
263
+ ```
264
+
265
+ **Handle each choice:**
266
+
267
+ - **Continue:** Skip this repo, proceed to next
268
+ - **Register existing:** Ask for path (suggest `../{repo_name}`), then run:
269
+ ```bash
270
+ node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs repos add "{path}" --name "{repo_name}"
271
+ ```
272
+ - **Create + Register:**
273
+ ```bash
274
+ mkdir -p ../{repo_name}
275
+ cd ../{repo_name} && git init
276
+ node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs repos add "../{repo_name}" --name "{repo_name}"
277
+ ```
278
+ - **Cancel:** Stop project creation entirely with message: "Project creation cancelled. Resolve repo registration and try again."
279
+
280
+ After all repos handled, continue to Step 2b (or back to the standard flow).
281
+
282
+ If no unregistered repos OR not v2: skip silently.
283
+
284
+ ## 3. Deep Questioning
285
+
286
+ **If auto mode:** Skip (already handled in Step 2a). Extract project context from provided document instead and proceed to Step 4.
287
+
288
+ **Display stage banner:**
289
+
290
+ ```
291
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
292
+ DGS ► QUESTIONING
293
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
294
+ ```
295
+
296
+ **Open the conversation:**
297
+
298
+ Ask inline (freeform, NOT AskUserQuestion):
299
+
300
+ "What do you want to build?"
301
+
302
+ Wait for their response. This gives you the context needed to ask intelligent follow-up questions.
303
+
304
+ **Follow the thread:**
305
+
306
+ Based on what they said, ask follow-up questions that dig into their response. Use AskUserQuestion with options that probe what they mentioned — interpretations, clarifications, concrete examples.
307
+
308
+ Keep following threads. Each answer opens new threads to explore. Ask about:
309
+ - What excited them
310
+ - What problem sparked this
311
+ - What they mean by vague terms
312
+ - What it would actually look like
313
+ - What's already decided
314
+
315
+ Consult `questioning.md` for techniques:
316
+ - Challenge vagueness
317
+ - Make abstract concrete
318
+ - Surface assumptions
319
+ - Find edges
320
+ - Reveal motivation
321
+
322
+ **Check context (background, not out loud):**
323
+
324
+ As you go, mentally check the context checklist from `questioning.md`. If gaps remain, weave questions naturally. Don't suddenly switch to checklist mode.
325
+
326
+ **Decision gate:**
327
+
328
+ When you could write a clear PROJECT.md, use AskUserQuestion:
329
+
330
+ - header: "Ready?"
331
+ - question: "I think I understand what you're after. Ready to create PROJECT.md?"
332
+ - options:
333
+ - "Create PROJECT.md" — Let's move forward
334
+ - "Keep exploring" — I want to share more / ask me more
335
+
336
+ If "Keep exploring" — ask what they want to add, or identify gaps and probe naturally.
337
+
338
+ Loop until "Create PROJECT.md" selected.
339
+
340
+ ## 4. Write PROJECT.md
341
+
342
+ **If auto mode:** Synthesize from provided document. No "Ready?" gate was shown — proceed directly to commit.
343
+
344
+ Synthesize all context into `${project_path}` using the template from `templates/project.md`.
345
+
346
+ **For greenfield projects:**
347
+
348
+ Initialize requirements as hypotheses:
349
+
350
+ ```markdown
351
+ ## Requirements
352
+
353
+ ### Validated
354
+
355
+ (None yet — ship to validate)
356
+
357
+ ### Active
358
+
359
+ - [ ] [Requirement 1]
360
+ - [ ] [Requirement 2]
361
+ - [ ] [Requirement 3]
362
+
363
+ ### Out of Scope
364
+
365
+ - [Exclusion 1] — [why]
366
+ - [Exclusion 2] — [why]
367
+ ```
368
+
369
+ All Active requirements are hypotheses until shipped and validated.
370
+
371
+ **For brownfield projects (codebase map exists):**
372
+
373
+ Infer Validated requirements from existing code:
374
+
375
+ 1. Read `${project_root}/codebase/ARCHITECTURE.md` and `STACK.md`
376
+ 2. Identify what the codebase already does
377
+ 3. These become the initial Validated set
378
+
379
+ ```markdown
380
+ ## Requirements
381
+
382
+ ### Validated
383
+
384
+ - ✓ [Existing capability 1] — existing
385
+ - ✓ [Existing capability 2] — existing
386
+ - ✓ [Existing capability 3] — existing
387
+
388
+ ### Active
389
+
390
+ - [ ] [New requirement 1]
391
+ - [ ] [New requirement 2]
392
+
393
+ ### Out of Scope
394
+
395
+ - [Exclusion 1] — [why]
396
+ ```
397
+
398
+ **Key Decisions:**
399
+
400
+ Initialize with any decisions made during questioning:
401
+
402
+ ```markdown
403
+ ## Key Decisions
404
+
405
+ | Decision | Rationale | Outcome |
406
+ |----------|-----------|---------|
407
+ | [Choice from questioning] | [Why] | — Pending |
408
+ ```
409
+
410
+ **Last updated footer:**
411
+
412
+ ```markdown
413
+ ---
414
+ *Last updated: [date] after initialization*
415
+ ```
416
+
417
+ Do not compress. Capture everything gathered.
418
+
419
+ **Commit PROJECT.md:**
420
+
421
+ ```bash
422
+ mkdir -p .planning
423
+ node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs commit "docs: initialize project" --files ${project_path}
424
+ ```
425
+
426
+ ## 5. Resolve Model Profile
427
+
428
+ Use models from init: `researcher_model`, `synthesizer_model`, `roadmapper_model`.
429
+
430
+ ## 6. Research Decision
431
+
432
+ **If auto mode:** Default to "Research first" without asking.
433
+
434
+ Use AskUserQuestion:
435
+ - header: "Research"
436
+ - question: "Research the domain ecosystem before defining requirements?"
437
+ - options:
438
+ - "Research first (Recommended)" — Discover standard stacks, expected features, architecture patterns
439
+ - "Skip research" — I know this domain well, go straight to requirements
440
+
441
+ **If "Research first":**
442
+
443
+ Display stage banner:
444
+ ```
445
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
446
+ DGS ► RESEARCHING
447
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
448
+
449
+ Researching [domain] ecosystem...
450
+ ```
451
+
452
+ Create research directory:
453
+ ```bash
454
+ mkdir -p ${research_dir}
455
+ ```
456
+
457
+ **Determine milestone context:**
458
+
459
+ Check if this is greenfield or subsequent milestone:
460
+ - If no "Validated" requirements in PROJECT.md → Greenfield (building from scratch)
461
+ - If "Validated" requirements exist → Subsequent milestone (adding to existing app)
462
+
463
+ **Discover product-level documents:**
464
+
465
+ Before spawning researchers, check for product-level documents that should inform research:
466
+
467
+ ```bash
468
+ ls ${project_root}/docs/product/ 2>/dev/null
469
+ ```
470
+
471
+ If the directory exists and contains files, store the list of file paths as `$product_doc_files`. For each file, format as a `<files_to_read>` entry: `- ${project_root}/docs/product/{filename} (Product doc)`. If the directory does not exist or is empty, set `$product_doc_files` to empty string.
472
+
473
+ Display spawning indicator:
474
+ ```
475
+ ◆ Spawning 4 researchers in parallel...
476
+ → Stack research
477
+ → Features research
478
+ → Architecture research
479
+ → Pitfalls research
480
+ ```
481
+
482
+ Spawn 4 parallel dgs-project-researcher agents with path references:
483
+
484
+ ```
485
+ Task(prompt="First, read ~/.claude/agents/dgs-project-researcher.md for your role and instructions.
486
+
487
+ <research_type>
488
+ Project Research — Stack dimension for [domain].
489
+ </research_type>
490
+
491
+ <milestone_context>
492
+ [greenfield OR subsequent]
493
+
494
+ Greenfield: Research the standard stack for building [domain] from scratch.
495
+ Subsequent: Research what's needed to add [target features] to an existing [domain] app. Don't re-research the existing system.
496
+ </milestone_context>
497
+
498
+ <question>
499
+ What's the standard 2025 stack for [domain]?
500
+ </question>
501
+
502
+ <files_to_read>
503
+ - {project_path} (Project context and goals)
504
+ ${product_doc_files}
505
+ </files_to_read>
506
+
507
+ <downstream_consumer>
508
+ Your STACK.md feeds into roadmap creation. Be prescriptive:
509
+ - Specific libraries with versions
510
+ - Clear rationale for each choice
511
+ - What NOT to use and why
512
+ </downstream_consumer>
513
+
514
+ <quality_gate>
515
+ - [ ] Versions are current (verify with Context7/official docs, not training data)
516
+ - [ ] Rationale explains WHY, not just WHAT
517
+ - [ ] Confidence levels assigned to each recommendation
518
+ </quality_gate>
519
+
520
+ <output>
521
+ Write to: ${research_dir}/STACK.md
522
+ Use template: ~/.claude/deliver-great-systems/templates/research-project/STACK.md
523
+ </output>
524
+ ", subagent_type="general-purpose", model="{researcher_model}", description="Stack research")
525
+
526
+ Task(prompt="First, read ~/.claude/agents/dgs-project-researcher.md for your role and instructions.
527
+
528
+ <research_type>
529
+ Project Research — Features dimension for [domain].
530
+ </research_type>
531
+
532
+ <milestone_context>
533
+ [greenfield OR subsequent]
534
+
535
+ Greenfield: What features do [domain] products have? What's table stakes vs differentiating?
536
+ Subsequent: How do [target features] typically work? What's expected behavior?
537
+ </milestone_context>
538
+
539
+ <question>
540
+ What features do [domain] products have? What's table stakes vs differentiating?
541
+ </question>
542
+
543
+ <files_to_read>
544
+ - {project_path} (Project context)
545
+ ${product_doc_files}
546
+ </files_to_read>
547
+
548
+ <downstream_consumer>
549
+ Your FEATURES.md feeds into requirements definition. Categorize clearly:
550
+ - Table stakes (must have or users leave)
551
+ - Differentiators (competitive advantage)
552
+ - Anti-features (things to deliberately NOT build)
553
+ </downstream_consumer>
554
+
555
+ <quality_gate>
556
+ - [ ] Categories are clear (table stakes vs differentiators vs anti-features)
557
+ - [ ] Complexity noted for each feature
558
+ - [ ] Dependencies between features identified
559
+ </quality_gate>
560
+
561
+ <output>
562
+ Write to: ${research_dir}/FEATURES.md
563
+ Use template: ~/.claude/deliver-great-systems/templates/research-project/FEATURES.md
564
+ </output>
565
+ ", subagent_type="general-purpose", model="{researcher_model}", description="Features research")
566
+
567
+ Task(prompt="First, read ~/.claude/agents/dgs-project-researcher.md for your role and instructions.
568
+
569
+ <research_type>
570
+ Project Research — Architecture dimension for [domain].
571
+ </research_type>
572
+
573
+ <milestone_context>
574
+ [greenfield OR subsequent]
575
+
576
+ Greenfield: How are [domain] systems typically structured? What are major components?
577
+ Subsequent: How do [target features] integrate with existing [domain] architecture?
578
+ </milestone_context>
579
+
580
+ <question>
581
+ How are [domain] systems typically structured? What are major components?
582
+ </question>
583
+
584
+ <files_to_read>
585
+ - {project_path} (Project context)
586
+ ${product_doc_files}
587
+ </files_to_read>
588
+
589
+ <downstream_consumer>
590
+ Your ARCHITECTURE.md informs phase structure in roadmap. Include:
591
+ - Component boundaries (what talks to what)
592
+ - Data flow (how information moves)
593
+ - Suggested build order (dependencies between components)
594
+ </downstream_consumer>
595
+
596
+ <quality_gate>
597
+ - [ ] Components clearly defined with boundaries
598
+ - [ ] Data flow direction explicit
599
+ - [ ] Build order implications noted
600
+ </quality_gate>
601
+
602
+ <output>
603
+ Write to: ${research_dir}/ARCHITECTURE.md
604
+ Use template: ~/.claude/deliver-great-systems/templates/research-project/ARCHITECTURE.md
605
+ </output>
606
+ ", subagent_type="general-purpose", model="{researcher_model}", description="Architecture research")
607
+
608
+ Task(prompt="First, read ~/.claude/agents/dgs-project-researcher.md for your role and instructions.
609
+
610
+ <research_type>
611
+ Project Research — Pitfalls dimension for [domain].
612
+ </research_type>
613
+
614
+ <milestone_context>
615
+ [greenfield OR subsequent]
616
+
617
+ Greenfield: What do [domain] projects commonly get wrong? Critical mistakes?
618
+ Subsequent: What are common mistakes when adding [target features] to [domain]?
619
+ </milestone_context>
620
+
621
+ <question>
622
+ What do [domain] projects commonly get wrong? Critical mistakes?
623
+ </question>
624
+
625
+ <files_to_read>
626
+ - {project_path} (Project context)
627
+ ${product_doc_files}
628
+ </files_to_read>
629
+
630
+ <downstream_consumer>
631
+ Your PITFALLS.md prevents mistakes in roadmap/planning. For each pitfall:
632
+ - Warning signs (how to detect early)
633
+ - Prevention strategy (how to avoid)
634
+ - Which phase should address it
635
+ </downstream_consumer>
636
+
637
+ <quality_gate>
638
+ - [ ] Pitfalls are specific to this domain (not generic advice)
639
+ - [ ] Prevention strategies are actionable
640
+ - [ ] Phase mapping included where relevant
641
+ </quality_gate>
642
+
643
+ <output>
644
+ Write to: ${research_dir}/PITFALLS.md
645
+ Use template: ~/.claude/deliver-great-systems/templates/research-project/PITFALLS.md
646
+ </output>
647
+ ", subagent_type="general-purpose", model="{researcher_model}", description="Pitfalls research")
648
+ ```
649
+
650
+ After all 4 agents complete, spawn synthesizer to create SUMMARY.md:
651
+
652
+ ```
653
+ Task(prompt="
654
+ <task>
655
+ Synthesize research outputs into SUMMARY.md.
656
+ </task>
657
+
658
+ <files_to_read>
659
+ - ${research_dir}/STACK.md
660
+ - ${research_dir}/FEATURES.md
661
+ - ${research_dir}/ARCHITECTURE.md
662
+ - ${research_dir}/PITFALLS.md
663
+ </files_to_read>
664
+
665
+ <output>
666
+ Write to: ${research_dir}/SUMMARY.md
667
+ Use template: ~/.claude/deliver-great-systems/templates/research-project/SUMMARY.md
668
+ Commit after writing.
669
+ </output>
670
+ ", subagent_type="dgs-research-synthesizer", model="{synthesizer_model}", description="Synthesize research")
671
+ ```
672
+
673
+ Display research complete banner and key findings:
674
+ ```
675
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
676
+ DGS ► RESEARCH COMPLETE ✓
677
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
678
+
679
+ ## Key Findings
680
+
681
+ **Stack:** [from SUMMARY.md]
682
+ **Table Stakes:** [from SUMMARY.md]
683
+ **Watch Out For:** [from SUMMARY.md]
684
+
685
+ Files: `${research_dir}/`
686
+ ```
687
+
688
+ **If "Skip research":** Continue to Step 7.
689
+
690
+ ## 7. Define Requirements
691
+
692
+ Display stage banner:
693
+ ```
694
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
695
+ DGS ► DEFINING REQUIREMENTS
696
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
697
+ ```
698
+
699
+ **Load context:**
700
+
701
+ Read PROJECT.md and extract:
702
+ - Core value (the ONE thing that must work)
703
+ - Stated constraints (budget, timeline, tech limitations)
704
+ - Any explicit scope boundaries
705
+
706
+ **If research exists:** Read research/FEATURES.md and extract feature categories.
707
+
708
+ **If auto mode:**
709
+ - Auto-include all table stakes features (users expect these)
710
+ - Include features explicitly mentioned in provided document
711
+ - Auto-defer differentiators not mentioned in document
712
+ - Skip per-category AskUserQuestion loops
713
+ - Skip "Any additions?" question
714
+ - Skip requirements approval gate
715
+ - Generate REQUIREMENTS.md and commit directly
716
+
717
+ **Present features by category (interactive mode only):**
718
+
719
+ ```
720
+ Here are the features for [domain]:
721
+
722
+ ## Authentication
723
+ **Table stakes:**
724
+ - Sign up with email/password
725
+ - Email verification
726
+ - Password reset
727
+ - Session management
728
+
729
+ **Differentiators:**
730
+ - Magic link login
731
+ - OAuth (Google, GitHub)
732
+ - 2FA
733
+
734
+ **Research notes:** [any relevant notes]
735
+
736
+ ---
737
+
738
+ ## [Next Category]
739
+ ...
740
+ ```
741
+
742
+ **If no research:** Gather requirements through conversation instead.
743
+
744
+ Ask: "What are the main things users need to be able to do?"
745
+
746
+ For each capability mentioned:
747
+ - Ask clarifying questions to make it specific
748
+ - Probe for related capabilities
749
+ - Group into categories
750
+
751
+ **Scope each category:**
752
+
753
+ For each category, use AskUserQuestion:
754
+
755
+ - header: "[Category]" (max 12 chars)
756
+ - question: "Which [category] features are in v1?"
757
+ - multiSelect: true
758
+ - options:
759
+ - "[Feature 1]" — [brief description]
760
+ - "[Feature 2]" — [brief description]
761
+ - "[Feature 3]" — [brief description]
762
+ - "None for v1" — Defer entire category
763
+
764
+ Track responses:
765
+ - Selected features → v1 requirements
766
+ - Unselected table stakes → v2 (users expect these)
767
+ - Unselected differentiators → out of scope
768
+
769
+ **Identify gaps:**
770
+
771
+ Use AskUserQuestion:
772
+ - header: "Additions"
773
+ - question: "Any requirements research missed? (Features specific to your vision)"
774
+ - options:
775
+ - "No, research covered it" — Proceed
776
+ - "Yes, let me add some" — Capture additions
777
+
778
+ **Validate core value:**
779
+
780
+ Cross-check requirements against Core Value from PROJECT.md. If gaps detected, surface them.
781
+
782
+ **Generate REQUIREMENTS.md:**
783
+
784
+ Create `${requirements_path}` with:
785
+ - v1 Requirements grouped by category (checkboxes, REQ-IDs)
786
+ - v2 Requirements (deferred)
787
+ - Out of Scope (explicit exclusions with reasoning)
788
+ - Traceability section (empty, filled by roadmap)
789
+
790
+ **REQ-ID format:** `[CATEGORY]-[NUMBER]` (AUTH-01, CONTENT-02)
791
+
792
+ **Requirement quality criteria:**
793
+
794
+ Good requirements are:
795
+ - **Specific and testable:** "User can reset password via email link" (not "Handle password reset")
796
+ - **User-centric:** "User can X" (not "System does Y")
797
+ - **Atomic:** One capability per requirement (not "User can login and manage profile")
798
+ - **Independent:** Minimal dependencies on other requirements
799
+
800
+ Reject vague requirements. Push for specificity:
801
+ - "Handle authentication" → "User can log in with email/password and stay logged in across sessions"
802
+ - "Support sharing" → "User can share post via link that opens in recipient's browser"
803
+
804
+ **Present full requirements list (interactive mode only):**
805
+
806
+ Show every requirement (not counts) for user confirmation:
807
+
808
+ ```
809
+ ## v1 Requirements
810
+
811
+ ### Authentication
812
+ - [ ] **AUTH-01**: User can create account with email/password
813
+ - [ ] **AUTH-02**: User can log in and stay logged in across sessions
814
+ - [ ] **AUTH-03**: User can log out from any page
815
+
816
+ ### Content
817
+ - [ ] **CONT-01**: User can create posts with text
818
+ - [ ] **CONT-02**: User can edit their own posts
819
+
820
+ [... full list ...]
821
+
822
+ ---
823
+
824
+ Does this capture what you're building? (yes / adjust)
825
+ ```
826
+
827
+ If "adjust": Return to scoping.
828
+
829
+ **Commit requirements:**
830
+
831
+ ```bash
832
+ node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs commit "docs: define v1 requirements" --files ${requirements_path}
833
+ ```
834
+
835
+ ## 8. Create Roadmap
836
+
837
+ Display stage banner:
838
+ ```
839
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
840
+ DGS ► CREATING ROADMAP
841
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
842
+
843
+ ◆ Spawning roadmapper...
844
+ ```
845
+
846
+ Spawn dgs-roadmapper agent with path references:
847
+
848
+ ```
849
+ Task(prompt="
850
+ <planning_context>
851
+
852
+ <files_to_read>
853
+ - ${project_path} (Project context)
854
+ - ${requirements_path} (v1 Requirements)
855
+ - ${research_dir}/SUMMARY.md (Research findings - if exists)
856
+ - ${config_path} (Depth and mode settings)
857
+ ${product_doc_files}
858
+ </files_to_read>
859
+
860
+ </planning_context>
861
+
862
+ <instructions>
863
+ Create roadmap:
864
+ 1. Derive phases from requirements (don't impose structure)
865
+ 2. Map every v1 requirement to exactly one phase
866
+ 3. Derive 2-5 success criteria per phase (observable user behaviors)
867
+ 4. Validate 100% coverage
868
+ 5. Write files immediately (ROADMAP.md, STATE.md, update REQUIREMENTS.md traceability)
869
+ 6. Return ROADMAP CREATED with summary
870
+
871
+ Write files first, then return. This ensures artifacts persist even if context is lost.
872
+ </instructions>
873
+ ", subagent_type="dgs-roadmapper", model="{roadmapper_model}", description="Create roadmap")
874
+ ```
875
+
876
+ **Handle roadmapper return:**
877
+
878
+ **If `## ROADMAP BLOCKED`:**
879
+ - Present blocker information
880
+ - Work with user to resolve
881
+ - Re-spawn when resolved
882
+
883
+ **If `## ROADMAP CREATED`:**
884
+
885
+ Read the created ROADMAP.md and present it nicely inline:
886
+
887
+ ```
888
+ ---
889
+
890
+ ## Proposed Roadmap
891
+
892
+ **[N] phases** | **[X] requirements mapped** | All v1 requirements covered ✓
893
+
894
+ | # | Phase | Goal | Requirements | Success Criteria |
895
+ |---|-------|------|--------------|------------------|
896
+ | 1 | [Name] | [Goal] | [REQ-IDs] | [count] |
897
+ | 2 | [Name] | [Goal] | [REQ-IDs] | [count] |
898
+ | 3 | [Name] | [Goal] | [REQ-IDs] | [count] |
899
+ ...
900
+
901
+ ### Phase Details
902
+
903
+ **Phase 1: [Name]**
904
+ Goal: [goal]
905
+ Requirements: [REQ-IDs]
906
+ Success criteria:
907
+ 1. [criterion]
908
+ 2. [criterion]
909
+ 3. [criterion]
910
+
911
+ **Phase 2: [Name]**
912
+ Goal: [goal]
913
+ Requirements: [REQ-IDs]
914
+ Success criteria:
915
+ 1. [criterion]
916
+ 2. [criterion]
917
+
918
+ [... continue for all phases ...]
919
+
920
+ ---
921
+ ```
922
+
923
+ **If auto mode:** Skip approval gate — auto-approve and commit directly.
924
+
925
+ **CRITICAL: Ask for approval before committing (interactive mode only):**
926
+
927
+ Use AskUserQuestion:
928
+ - header: "Roadmap"
929
+ - question: "Does this roadmap structure work for you?"
930
+ - options:
931
+ - "Approve" — Commit and continue
932
+ - "Adjust phases" — Tell me what to change
933
+ - "Review full file" — Show raw ROADMAP.md
934
+
935
+ **If "Approve":** Continue to commit.
936
+
937
+ **If "Adjust phases":**
938
+ - Get user's adjustment notes
939
+ - Re-spawn roadmapper with revision context:
940
+ ```
941
+ Task(prompt="
942
+ <revision>
943
+ User feedback on roadmap:
944
+ [user's notes]
945
+
946
+ <files_to_read>
947
+ - ${roadmap_path} (Current roadmap to revise)
948
+ </files_to_read>
949
+
950
+ Update the roadmap based on feedback. Edit files in place.
951
+ Return ROADMAP REVISED with changes made.
952
+ </revision>
953
+ ", subagent_type="dgs-roadmapper", model="{roadmapper_model}", description="Revise roadmap")
954
+ ```
955
+ - Present revised roadmap
956
+ - Loop until user approves
957
+
958
+ **If "Review full file":** Display raw `cat ${roadmap_path}`, then re-ask.
959
+
960
+ **Commit roadmap (after approval or auto mode):**
961
+
962
+ ```bash
963
+ node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs commit "docs: create roadmap ([N] phases)" --files ${roadmap_path} ${state_path} ${requirements_path}
964
+ ```
965
+
966
+ ### Link Spec to Milestone (spec-driven mode only)
967
+
968
+ If this project was created from a spec (spec-driven auto mode), update the spec's milestones frontmatter to record the bidirectional link:
969
+
970
+ ```bash
971
+ node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs specs link-milestone --id "$SPEC_ID" --milestone "v1.0"
972
+ ```
973
+
974
+ Include the updated spec file in a commit:
975
+
976
+ ```bash
977
+ node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs commit "specs: link $SPEC_ID to v1.0" --files $SPEC_PATH
978
+ ```
979
+
980
+ ## 8.5. Overlap Check (v2 only)
981
+
982
+ If v2 install (PROJECTS.md or REPOS.md exists in the planning root):
983
+
984
+ ```bash
985
+ OVERLAP=$(node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs overlap check --raw 2>/dev/null)
986
+ ```
987
+
988
+ Parse JSON. If `overlapping_repos` array is non-empty, display warning:
989
+
990
+ ```
991
+ ⚠ Cross-project overlap detected:
992
+
993
+ | Repo | Also touched by |
994
+ |------|----------------|
995
+ | {repo} | {other-project} |
996
+
997
+ This is informational — work can proceed.
998
+ ```
999
+
1000
+ If no overlaps or not v2: skip silently.
1001
+
1002
+ ## 9. Done
1003
+
1004
+ Present completion summary:
1005
+
1006
+ ```
1007
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1008
+ DGS ► PROJECT INITIALIZED ✓
1009
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1010
+
1011
+ **[Project Name]**
1012
+
1013
+ | Artifact | Location |
1014
+ |----------------|-----------------------------|
1015
+ | Project | `${project_path}` |
1016
+ | Config | `${config_path}` |
1017
+ | Research | `${research_dir}/` |
1018
+ | Requirements | `${requirements_path}` |
1019
+ | Roadmap | `${roadmap_path}` |
1020
+
1021
+ **[N] phases** | **[X] requirements** | Ready to build ✓
1022
+ ```
1023
+
1024
+ **If spec-driven mode**, add to the summary table:
1025
+
1026
+ ```
1027
+ **Source:** `[spec path]`
1028
+ **Created from spec:** {spec_id} — "{spec_title}"
1029
+ ```
1030
+
1031
+ **If auto mode (spec-driven):**
1032
+
1033
+ ```
1034
+ **Created from spec:** {spec_id} — "{spec_title}"
1035
+
1036
+ ╔══════════════════════════════════════════╗
1037
+ ║ AUTO-ADVANCING → DISCUSS PHASE 1 ║
1038
+ ╚══════════════════════════════════════════╝
1039
+ ```
1040
+
1041
+ **If auto mode (idea-driven):**
1042
+
1043
+ ```
1044
+ ╔══════════════════════════════════════════╗
1045
+ ║ AUTO-ADVANCING → DISCUSS PHASE 1 ║
1046
+ ╚══════════════════════════════════════════╝
1047
+ ```
1048
+
1049
+ Exit skill and invoke SlashCommand("/dgs:discuss-phase 1 --auto")
1050
+
1051
+ **If interactive mode:**
1052
+
1053
+ ```
1054
+ ───────────────────────────────────────────────────────────────
1055
+
1056
+ ## ▶ Next Up
1057
+
1058
+ **Phase 1: [Phase Name]** — [Goal from ROADMAP.md]
1059
+
1060
+ /dgs:discuss-phase 1 — gather context and clarify approach
1061
+
1062
+ <sub>/clear first → fresh context window</sub>
1063
+
1064
+ ---
1065
+
1066
+ **Also available:**
1067
+ - /dgs:plan-phase 1 — skip discussion, plan directly
1068
+
1069
+ ───────────────────────────────────────────────────────────────
1070
+ ```
1071
+
1072
+ </process>
1073
+
1074
+ <output>
1075
+
1076
+ - `${project_path}`
1077
+ - `${config_path}`
1078
+ - `${research_dir}/` (if research selected)
1079
+ - `STACK.md`
1080
+ - `FEATURES.md`
1081
+ - `ARCHITECTURE.md`
1082
+ - `PITFALLS.md`
1083
+ - `SUMMARY.md`
1084
+ - `${requirements_path}`
1085
+ - `${roadmap_path}`
1086
+ - `${state_path}`
1087
+
1088
+ </output>
1089
+
1090
+ <success_criteria>
1091
+
1092
+ - [ ] Planning root directory created
1093
+ - [ ] Git repo initialized
1094
+ - [ ] Brownfield detection completed
1095
+ - [ ] Deep questioning completed (threads followed, not rushed)
1096
+ - [ ] PROJECT.md captures full context → **committed**
1097
+ - [ ] Product config validated (mode, depth, workflow settings from init-product)
1098
+ - [ ] Research completed (if selected) — 4 parallel agents spawned → **committed**
1099
+ - [ ] Requirements gathered (from research or conversation)
1100
+ - [ ] User scoped each category (v1/v2/out of scope)
1101
+ - [ ] REQUIREMENTS.md created with REQ-IDs → **committed**
1102
+ - [ ] dgs-roadmapper spawned with context
1103
+ - [ ] Roadmap files written immediately (not draft)
1104
+ - [ ] User feedback incorporated (if any)
1105
+ - [ ] ROADMAP.md created with phases, requirement mappings, success criteria
1106
+ - [ ] STATE.md initialized
1107
+ - [ ] REQUIREMENTS.md traceability updated
1108
+ - [ ] Spec-driven mode: spec milestones field updated with link-milestone call
1109
+ - [ ] User knows next step is `/dgs:discuss-phase 1`
1110
+
1111
+ **Atomic commits:** Each phase commits its artifacts immediately. If context is lost, artifacts persist.
1112
+
1113
+ </success_criteria>