@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,119 @@
1
+ # Planner Subagent Prompt Template
2
+
3
+ Template for spawning dgs-planner agent. The agent contains all planning expertise - this template provides planning context only.
4
+
5
+ > **Layout-agnostic:** The `@` paths in this template use ${variable} notation resolved by the orchestrator using init output variables at runtime.
6
+
7
+ ---
8
+
9
+ ## Template
10
+
11
+ ```markdown
12
+ <planning_context>
13
+
14
+ **Phase:** {phase_number}
15
+ **Mode:** {standard | gap_closure}
16
+
17
+ **Project State:**
18
+ @${state_path}
19
+
20
+ **Roadmap:**
21
+ @${roadmap_path}
22
+
23
+ **Requirements (if exists):**
24
+ @${requirements_path}
25
+
26
+ **Phase Context (if exists):**
27
+ @${phase_dir}/{phase_num}-CONTEXT.md
28
+
29
+ **Research (if exists):**
30
+ @${phase_dir}/{phase_num}-RESEARCH.md
31
+
32
+ **Gap Closure (if --gaps mode):**
33
+ @${phase_dir}/{phase_num}-VERIFICATION.md
34
+ @${phase_dir}/{phase_num}-UAT.md
35
+
36
+ </planning_context>
37
+
38
+ <downstream_consumer>
39
+ Output consumed by /dgs:execute-phase
40
+ Plans must be executable prompts with:
41
+ - Frontmatter (wave, depends_on, files_modified, autonomous)
42
+ - Tasks in XML format
43
+ - Verification criteria
44
+ - must_haves for goal-backward verification
45
+ </downstream_consumer>
46
+
47
+ <quality_gate>
48
+ Before returning PLANNING COMPLETE:
49
+ - [ ] PLAN.md files created in phase directory
50
+ - [ ] Each plan has valid frontmatter
51
+ - [ ] Tasks are specific and actionable
52
+ - [ ] Dependencies correctly identified
53
+ - [ ] Waves assigned for parallel execution
54
+ - [ ] must_haves derived from phase goal
55
+ </quality_gate>
56
+ ```
57
+
58
+ ---
59
+
60
+ ## Placeholders
61
+
62
+ | Placeholder | Source | Example |
63
+ |-------------|--------|---------|
64
+ | `{phase_number}` | From roadmap/arguments | `5` or `2.1` |
65
+ | `{phase_dir}` | Phase directory name | `05-user-profiles` |
66
+ | `{phase}` | Phase prefix | `05` |
67
+ | `{standard \| gap_closure}` | Mode flag | `standard` |
68
+
69
+ ---
70
+
71
+ ## Usage
72
+
73
+ **From /dgs:plan-phase (standard mode):**
74
+ ```python
75
+ Task(
76
+ prompt=filled_template,
77
+ subagent_type="dgs-planner",
78
+ description="Plan Phase {phase}"
79
+ )
80
+ ```
81
+
82
+ **From /dgs:plan-phase --gaps (gap closure mode):**
83
+ ```python
84
+ Task(
85
+ prompt=filled_template, # with mode: gap_closure
86
+ subagent_type="dgs-planner",
87
+ description="Plan gaps for Phase {phase}"
88
+ )
89
+ ```
90
+
91
+ ---
92
+
93
+ ## Continuation
94
+
95
+ For checkpoints, spawn fresh agent with:
96
+
97
+ ```markdown
98
+ <objective>
99
+ Continue planning for Phase {phase_number}: {phase_name}
100
+ </objective>
101
+
102
+ <prior_state>
103
+ Phase directory: @${phase_dir}/
104
+ Existing plans: @${phase_dir}/*-PLAN.md
105
+ </prior_state>
106
+
107
+ <checkpoint_response>
108
+ **Type:** {checkpoint_type}
109
+ **Response:** {user_response}
110
+ </checkpoint_response>
111
+
112
+ <mode>
113
+ Continue: {standard | gap_closure}
114
+ </mode>
115
+ ```
116
+
117
+ ---
118
+
119
+ **Note:** Planning methodology, task breakdown, dependency analysis, wave assignment, TDD detection, and goal-backward derivation are baked into the dgs-planner agent. This template only passes context.
@@ -0,0 +1,186 @@
1
+ # PROJECT.md Template
2
+
3
+ Template for `PROJECT.md` (in planning root) — the living project context document.
4
+
5
+ > **Layout-agnostic:** Workflows access PROJECT.md via `${project_path}` from init output. Works in both standard and root layouts.
6
+
7
+ <template>
8
+
9
+ ```markdown
10
+ # [Project Name]
11
+
12
+ ## What This Is
13
+
14
+ [Current accurate description — 2-3 sentences. What does this product do and who is it for?
15
+ Use the user's language and framing. Update whenever reality drifts from this description.]
16
+
17
+ ## Core Value
18
+
19
+ [The ONE thing that matters most. If everything else fails, this must work.
20
+ One sentence that drives prioritization when tradeoffs arise.]
21
+
22
+ ## Requirements
23
+
24
+ ### Validated
25
+
26
+ <!-- Shipped and confirmed valuable. -->
27
+
28
+ (None yet — ship to validate)
29
+
30
+ ### Active
31
+
32
+ <!-- Current scope. Building toward these. -->
33
+
34
+ - [ ] [Requirement 1]
35
+ - [ ] [Requirement 2]
36
+ - [ ] [Requirement 3]
37
+
38
+ ### Out of Scope
39
+
40
+ <!-- Explicit boundaries. Includes reasoning to prevent re-adding. -->
41
+
42
+ - [Exclusion 1] — [why]
43
+ - [Exclusion 2] — [why]
44
+
45
+ ## Context
46
+
47
+ [Background information that informs implementation:
48
+ - Technical environment or ecosystem
49
+ - Relevant prior work or experience
50
+ - User research or feedback themes
51
+ - Known issues to address]
52
+
53
+ ## Constraints
54
+
55
+ - **[Type]**: [What] — [Why]
56
+ - **[Type]**: [What] — [Why]
57
+
58
+ Common types: Tech stack, Timeline, Budget, Dependencies, Compatibility, Performance, Security
59
+
60
+ ## Key Decisions
61
+
62
+ <!-- Decisions that constrain future work. Add throughout project lifecycle. -->
63
+
64
+ | Decision | Rationale | Outcome |
65
+ |----------|-----------|---------|
66
+ | [Choice] | [Why] | [✓ Good / ⚠️ Revisit / — Pending] |
67
+
68
+ ---
69
+ *Last updated: [date] after [trigger]*
70
+ ```
71
+
72
+ </template>
73
+
74
+ <guidelines>
75
+
76
+ **What This Is:**
77
+ - Current accurate description of the product
78
+ - 2-3 sentences capturing what it does and who it's for
79
+ - Use the user's words and framing
80
+ - Update when the product evolves beyond this description
81
+
82
+ **Core Value:**
83
+ - The single most important thing
84
+ - Everything else can fail; this cannot
85
+ - Drives prioritization when tradeoffs arise
86
+ - Rarely changes; if it does, it's a significant pivot
87
+
88
+ **Requirements — Validated:**
89
+ - Requirements that shipped and proved valuable
90
+ - Format: `- ✓ [Requirement] — [version/phase]`
91
+ - These are locked — changing them requires explicit discussion
92
+
93
+ **Requirements — Active:**
94
+ - Current scope being built toward
95
+ - These are hypotheses until shipped and validated
96
+ - Move to Validated when shipped, Out of Scope if invalidated
97
+
98
+ **Requirements — Out of Scope:**
99
+ - Explicit boundaries on what we're not building
100
+ - Always include reasoning (prevents re-adding later)
101
+ - Includes: considered and rejected, deferred to future, explicitly excluded
102
+
103
+ **Context:**
104
+ - Background that informs implementation decisions
105
+ - Technical environment, prior work, user feedback
106
+ - Known issues or technical debt to address
107
+ - Update as new context emerges
108
+
109
+ **Constraints:**
110
+ - Hard limits on implementation choices
111
+ - Tech stack, timeline, budget, compatibility, dependencies
112
+ - Include the "why" — constraints without rationale get questioned
113
+
114
+ **Key Decisions:**
115
+ - Significant choices that affect future work
116
+ - Add decisions as they're made throughout the project
117
+ - Track outcome when known:
118
+ - ✓ Good — decision proved correct
119
+ - ⚠️ Revisit — decision may need reconsideration
120
+ - — Pending — too early to evaluate
121
+
122
+ **Last Updated:**
123
+ - Always note when and why the document was updated
124
+ - Format: `after Phase 2` or `after v1.0 milestone`
125
+ - Triggers review of whether content is still accurate
126
+
127
+ </guidelines>
128
+
129
+ <evolution>
130
+
131
+ PROJECT.md evolves throughout the project lifecycle.
132
+
133
+ **After each phase transition:**
134
+ 1. Requirements invalidated? → Move to Out of Scope with reason
135
+ 2. Requirements validated? → Move to Validated with phase reference
136
+ 3. New requirements emerged? → Add to Active
137
+ 4. Decisions to log? → Add to Key Decisions
138
+ 5. "What This Is" still accurate? → Update if drifted
139
+
140
+ **After each milestone:**
141
+ 1. Full review of all sections
142
+ 2. Core Value check — still the right priority?
143
+ 3. Audit Out of Scope — reasons still valid?
144
+ 4. Update Context with current state (users, feedback, metrics)
145
+
146
+ </evolution>
147
+
148
+ <brownfield>
149
+
150
+ For existing codebases:
151
+
152
+ 1. **Map codebase first** via `/dgs:map-codebase`
153
+
154
+ 2. **Infer Validated requirements** from existing code:
155
+ - What does the codebase actually do?
156
+ - What patterns are established?
157
+ - What's clearly working and relied upon?
158
+
159
+ 3. **Gather Active requirements** from user:
160
+ - Present inferred current state
161
+ - Ask what they want to build next
162
+
163
+ 4. **Initialize:**
164
+ - Validated = inferred from existing code
165
+ - Active = user's goals for this work
166
+ - Out of Scope = boundaries user specifies
167
+ - Context = includes current codebase state
168
+
169
+ </brownfield>
170
+
171
+ <state_reference>
172
+
173
+ STATE.md references PROJECT.md:
174
+
175
+ ```markdown
176
+ ## Project Reference
177
+
178
+ See: PROJECT.md (updated [date])
179
+
180
+ **Core value:** [One-liner from Core Value section]
181
+ **Current focus:** [Current phase name]
182
+ ```
183
+
184
+ This ensures Claude reads current PROJECT.md context.
185
+
186
+ </state_reference>
@@ -0,0 +1,233 @@
1
+ # Requirements Template
2
+
3
+ Template for `REQUIREMENTS.md` (in planning root) — checkable requirements that define "done."
4
+
5
+ > **Layout-agnostic:** Workflows access REQUIREMENTS.md via `${requirements_path}` from init output. Works in both standard and root layouts.
6
+
7
+ <template>
8
+
9
+ ```markdown
10
+ # Requirements: [Project Name]
11
+
12
+ **Defined:** [date]
13
+ **Core Value:** [from PROJECT.md]
14
+
15
+ ## v1 Requirements
16
+
17
+ Requirements for initial release. Each maps to roadmap phases.
18
+
19
+ ### Authentication
20
+
21
+ - [ ] **AUTH-01**: User can sign up with email and password
22
+ - [ ] **AUTH-02**: User receives email verification after signup
23
+ - [ ] **AUTH-03**: User can reset password via email link
24
+ - [ ] **AUTH-04**: User session persists across browser refresh
25
+
26
+ ### [Category 2]
27
+
28
+ - [ ] **[CAT]-01**: [Requirement description]
29
+ - [ ] **[CAT]-02**: [Requirement description]
30
+ - [ ] **[CAT]-03**: [Requirement description]
31
+
32
+ ### [Category 3]
33
+
34
+ - [ ] **[CAT]-01**: [Requirement description]
35
+ - [ ] **[CAT]-02**: [Requirement description]
36
+
37
+ ## v2 Requirements
38
+
39
+ Deferred to future release. Tracked but not in current roadmap.
40
+
41
+ ### [Category]
42
+
43
+ - **[CAT]-01**: [Requirement description]
44
+ - **[CAT]-02**: [Requirement description]
45
+
46
+ ## Out of Scope
47
+
48
+ Explicitly excluded. Documented to prevent scope creep.
49
+
50
+ | Feature | Reason |
51
+ |---------|--------|
52
+ | [Feature] | [Why excluded] |
53
+ | [Feature] | [Why excluded] |
54
+
55
+ ## Traceability
56
+
57
+ Which phases cover which requirements. Updated during roadmap creation.
58
+
59
+ | Requirement | Phase | Status |
60
+ |-------------|-------|--------|
61
+ | AUTH-01 | Phase 1 | Pending |
62
+ | AUTH-02 | Phase 1 | Pending |
63
+ | AUTH-03 | Phase 1 | Pending |
64
+ | AUTH-04 | Phase 1 | Pending |
65
+ | [REQ-ID] | Phase [N] | Pending |
66
+
67
+ **Coverage:**
68
+ - v1 requirements: [X] total
69
+ - Mapped to phases: [Y]
70
+ - Unmapped: [Z] ⚠️
71
+
72
+ ---
73
+ *Requirements defined: [date]*
74
+ *Last updated: [date] after [trigger]*
75
+ ```
76
+
77
+ </template>
78
+
79
+ <guidelines>
80
+
81
+ **Requirement Format:**
82
+ - ID: `[CATEGORY]-[NUMBER]` (AUTH-01, CONTENT-02, SOCIAL-03)
83
+ - Description: User-centric, testable, atomic
84
+ - Checkbox: Only for v1 requirements (v2 are not yet actionable)
85
+
86
+ **Categories:**
87
+ - Derive from research FEATURES.md categories
88
+ - Keep consistent with domain conventions
89
+ - Typical: Authentication, Content, Social, Notifications, Moderation, Payments, Admin
90
+
91
+ **v1 vs v2:**
92
+ - v1: Committed scope, will be in roadmap phases
93
+ - v2: Acknowledged but deferred, not in current roadmap
94
+ - Moving v2 → v1 requires roadmap update
95
+
96
+ **Out of Scope:**
97
+ - Explicit exclusions with reasoning
98
+ - Prevents "why didn't you include X?" later
99
+ - Anti-features from research belong here with warnings
100
+
101
+ **Traceability:**
102
+ - Empty initially, populated during roadmap creation
103
+ - Each requirement maps to exactly one phase
104
+ - Unmapped requirements = roadmap gap
105
+
106
+ **Status Values:**
107
+ - Pending: Not started
108
+ - In Progress: Phase is active
109
+ - Complete: Requirement verified
110
+ - Blocked: Waiting on external factor
111
+
112
+ </guidelines>
113
+
114
+ <evolution>
115
+
116
+ **After each phase completes:**
117
+ 1. Mark covered requirements as Complete
118
+ 2. Update traceability status
119
+ 3. Note any requirements that changed scope
120
+
121
+ **After roadmap updates:**
122
+ 1. Verify all v1 requirements still mapped
123
+ 2. Add new requirements if scope expanded
124
+ 3. Move requirements to v2/out of scope if descoped
125
+
126
+ **Requirement completion criteria:**
127
+ - Requirement is "Complete" when:
128
+ - Feature is implemented
129
+ - Feature is verified (tests pass, manual check done)
130
+ - Feature is committed
131
+
132
+ </evolution>
133
+
134
+ <example>
135
+
136
+ ```markdown
137
+ # Requirements: CommunityApp
138
+
139
+ **Defined:** 2025-01-14
140
+ **Core Value:** Users can share and discuss content with people who share their interests
141
+
142
+ ## v1 Requirements
143
+
144
+ ### Authentication
145
+
146
+ - [ ] **AUTH-01**: User can sign up with email and password
147
+ - [ ] **AUTH-02**: User receives email verification after signup
148
+ - [ ] **AUTH-03**: User can reset password via email link
149
+ - [ ] **AUTH-04**: User session persists across browser refresh
150
+
151
+ ### Profiles
152
+
153
+ - [ ] **PROF-01**: User can create profile with display name
154
+ - [ ] **PROF-02**: User can upload avatar image
155
+ - [ ] **PROF-03**: User can write bio (max 500 chars)
156
+ - [ ] **PROF-04**: User can view other users' profiles
157
+
158
+ ### Content
159
+
160
+ - [ ] **CONT-01**: User can create text post
161
+ - [ ] **CONT-02**: User can upload image with post
162
+ - [ ] **CONT-03**: User can edit own posts
163
+ - [ ] **CONT-04**: User can delete own posts
164
+ - [ ] **CONT-05**: User can view feed of posts
165
+
166
+ ### Social
167
+
168
+ - [ ] **SOCL-01**: User can follow other users
169
+ - [ ] **SOCL-02**: User can unfollow users
170
+ - [ ] **SOCL-03**: User can like posts
171
+ - [ ] **SOCL-04**: User can comment on posts
172
+ - [ ] **SOCL-05**: User can view activity feed (followed users' posts)
173
+
174
+ ## v2 Requirements
175
+
176
+ ### Notifications
177
+
178
+ - **NOTF-01**: User receives in-app notifications
179
+ - **NOTF-02**: User receives email for new followers
180
+ - **NOTF-03**: User receives email for comments on own posts
181
+ - **NOTF-04**: User can configure notification preferences
182
+
183
+ ### Moderation
184
+
185
+ - **MODR-01**: User can report content
186
+ - **MODR-02**: User can block other users
187
+ - **MODR-03**: Admin can view reported content
188
+ - **MODR-04**: Admin can remove content
189
+ - **MODR-05**: Admin can ban users
190
+
191
+ ## Out of Scope
192
+
193
+ | Feature | Reason |
194
+ |---------|--------|
195
+ | Real-time chat | High complexity, not core to community value |
196
+ | Video posts | Storage/bandwidth costs, defer to v2+ |
197
+ | OAuth login | Email/password sufficient for v1 |
198
+ | Mobile app | Web-first, mobile later |
199
+
200
+ ## Traceability
201
+
202
+ | Requirement | Phase | Status |
203
+ |-------------|-------|--------|
204
+ | AUTH-01 | Phase 1 | Pending |
205
+ | AUTH-02 | Phase 1 | Pending |
206
+ | AUTH-03 | Phase 1 | Pending |
207
+ | AUTH-04 | Phase 1 | Pending |
208
+ | PROF-01 | Phase 2 | Pending |
209
+ | PROF-02 | Phase 2 | Pending |
210
+ | PROF-03 | Phase 2 | Pending |
211
+ | PROF-04 | Phase 2 | Pending |
212
+ | CONT-01 | Phase 3 | Pending |
213
+ | CONT-02 | Phase 3 | Pending |
214
+ | CONT-03 | Phase 3 | Pending |
215
+ | CONT-04 | Phase 3 | Pending |
216
+ | CONT-05 | Phase 3 | Pending |
217
+ | SOCL-01 | Phase 4 | Pending |
218
+ | SOCL-02 | Phase 4 | Pending |
219
+ | SOCL-03 | Phase 4 | Pending |
220
+ | SOCL-04 | Phase 4 | Pending |
221
+ | SOCL-05 | Phase 4 | Pending |
222
+
223
+ **Coverage:**
224
+ - v1 requirements: 18 total
225
+ - Mapped to phases: 18
226
+ - Unmapped: 0 ✓
227
+
228
+ ---
229
+ *Requirements defined: 2025-01-14*
230
+ *Last updated: 2025-01-14 after initial definition*
231
+ ```
232
+
233
+ </example>