@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,354 @@
1
+ # Phase Context Template
2
+
3
+ Template for `phases/XX-name/{phase_num}-CONTEXT.md` (in planning root) - captures implementation decisions for a phase.
4
+
5
+ > **Layout-agnostic:** Workflows resolve the phase directory path via `${phase_dir}` from init output. Works in both standard and root layouts.
6
+
7
+ **Purpose:** Document decisions that downstream agents need. Researcher uses this to know WHAT to investigate. Planner uses this to know WHAT choices are locked vs flexible.
8
+
9
+ **Key principle:** Categories are NOT predefined. They emerge from what was actually discussed for THIS phase. A CLI phase has CLI-relevant sections, a UI phase has UI-relevant sections.
10
+
11
+ **Downstream consumers:**
12
+ - `dgs-phase-researcher` — Reads decisions to focus research (e.g., "card layout" → research card component patterns)
13
+ - `dgs-planner` — Reads decisions to create specific tasks (e.g., "infinite scroll" → task includes virtualization)
14
+
15
+ ---
16
+
17
+ ## File Template
18
+
19
+ ```markdown
20
+ # Phase [X]: [Name] - Context
21
+
22
+ **Gathered:** [date]
23
+ **Status:** Ready for planning
24
+
25
+ <domain>
26
+ ## Phase Boundary
27
+
28
+ [Clear statement of what this phase delivers — the scope anchor. This comes from ROADMAP.md and is fixed. Discussion clarifies implementation within this boundary.]
29
+
30
+ </domain>
31
+
32
+ <decisions>
33
+ ## Implementation Decisions
34
+
35
+ ### [Area 1 that was discussed]
36
+ - [Specific decision made]
37
+ - [Another decision if applicable]
38
+
39
+ ### [Area 2 that was discussed]
40
+ - [Specific decision made]
41
+
42
+ ### [Area 3 that was discussed]
43
+ - [Specific decision made]
44
+
45
+ ### Claude's Discretion
46
+ [Areas where user explicitly said "you decide" — Claude has flexibility here during planning/implementation]
47
+
48
+ </decisions>
49
+
50
+ <specifics>
51
+ ## Specific Ideas
52
+
53
+ [Any particular references, examples, or "I want it like X" moments from discussion. Product references, specific behaviors, interaction patterns.]
54
+
55
+ [If none: "No specific requirements — open to standard approaches"]
56
+
57
+ </specifics>
58
+
59
+ <canonical_refs>
60
+ ## Canonical References
61
+
62
+ **Downstream agents MUST read these before planning or implementing.**
63
+
64
+ [List every spec, ADR, feature doc, or design doc that defines requirements or constraints for this phase. Use full relative paths so agents can read them directly. Group by topic area when the phase has multiple concerns.]
65
+
66
+ ### [Topic area 1]
67
+ - `path/to/spec-or-adr.md` — [What this doc decides/defines that's relevant]
68
+ - `path/to/doc.md` §N — [Specific section and what it covers]
69
+
70
+ ### [Topic area 2]
71
+ - `path/to/feature-doc.md` — [What capability this defines]
72
+
73
+ [If the project has no external specs: "No external specs — requirements are fully captured in decisions above"]
74
+
75
+ </canonical_refs>
76
+
77
+ <code_context>
78
+ ## Existing Code Insights
79
+
80
+ ### Reusable Assets
81
+ - [Component/hook/utility]: [How it could be used in this phase]
82
+
83
+ ### Established Patterns
84
+ - [Pattern]: [How it constrains/enables this phase]
85
+
86
+ ### Integration Points
87
+ - [Where new code connects to existing system]
88
+
89
+ </code_context>
90
+
91
+ <deferred>
92
+ ## Deferred Ideas
93
+
94
+ [Ideas that came up during discussion but belong in other phases. Captured here so they're not lost, but explicitly out of scope for this phase.]
95
+
96
+ [If none: "None — discussion stayed within phase scope"]
97
+
98
+ </deferred>
99
+
100
+ ---
101
+
102
+ *Phase: XX-name*
103
+ *Context gathered: [date]*
104
+ ```
105
+
106
+ <good_examples>
107
+
108
+ **Example 1: Visual feature (Post Feed)**
109
+
110
+ ```markdown
111
+ # Phase 3: Post Feed - Context
112
+
113
+ **Gathered:** 2025-01-20
114
+ **Status:** Ready for planning
115
+
116
+ <domain>
117
+ ## Phase Boundary
118
+
119
+ Display posts from followed users in a scrollable feed. Users can view posts and see engagement counts. Creating posts and interactions are separate phases.
120
+
121
+ </domain>
122
+
123
+ <decisions>
124
+ ## Implementation Decisions
125
+
126
+ ### Layout style
127
+ - Card-based layout, not timeline or list
128
+ - Each card shows: author avatar, name, timestamp, full post content, reaction counts
129
+ - Cards have subtle shadows, rounded corners — modern feel
130
+
131
+ ### Loading behavior
132
+ - Infinite scroll, not pagination
133
+ - Pull-to-refresh on mobile
134
+ - New posts indicator at top ("3 new posts") rather than auto-inserting
135
+
136
+ ### Empty state
137
+ - Friendly illustration + "Follow people to see posts here"
138
+ - Suggest 3-5 accounts to follow based on interests
139
+
140
+ ### Claude's Discretion
141
+ - Loading skeleton design
142
+ - Exact spacing and typography
143
+ - Error state handling
144
+
145
+ </decisions>
146
+
147
+ <canonical_refs>
148
+ ## Canonical References
149
+
150
+ ### Feed display
151
+ - `docs/features/social-feed.md` — Feed requirements, post card fields, engagement display rules
152
+ - `docs/decisions/adr-012-infinite-scroll.md` — Scroll strategy decision, virtualization requirements
153
+
154
+ ### Empty states
155
+ - `docs/design/empty-states.md` — Empty state patterns, illustration guidelines
156
+
157
+ </canonical_refs>
158
+
159
+ <specifics>
160
+ ## Specific Ideas
161
+
162
+ - "I like how Twitter shows the new posts indicator without disrupting your scroll position"
163
+ - Cards should feel like Linear's issue cards — clean, not cluttered
164
+
165
+ </specifics>
166
+
167
+ <deferred>
168
+ ## Deferred Ideas
169
+
170
+ - Commenting on posts — Phase 5
171
+ - Bookmarking posts — add to backlog
172
+
173
+ </deferred>
174
+
175
+ ---
176
+
177
+ *Phase: 03-post-feed*
178
+ *Context gathered: 2025-01-20*
179
+ ```
180
+
181
+ **Example 2: CLI tool (Database backup)**
182
+
183
+ ```markdown
184
+ # Phase 2: Backup Command - Context
185
+
186
+ **Gathered:** 2025-01-20
187
+ **Status:** Ready for planning
188
+
189
+ <domain>
190
+ ## Phase Boundary
191
+
192
+ CLI command to backup database to local file or S3. Supports full and incremental backups. Restore command is a separate phase.
193
+
194
+ </domain>
195
+
196
+ <decisions>
197
+ ## Implementation Decisions
198
+
199
+ ### Output format
200
+ - JSON for programmatic use, table format for humans
201
+ - Default to table, --json flag for JSON
202
+ - Verbose mode (-v) shows progress, silent by default
203
+
204
+ ### Flag design
205
+ - Short flags for common options: -o (output), -v (verbose), -f (force)
206
+ - Long flags for clarity: --incremental, --compress, --encrypt
207
+ - Required: database connection string (positional or --db)
208
+
209
+ ### Error recovery
210
+ - Retry 3 times on network failure, then fail with clear message
211
+ - --no-retry flag to fail fast
212
+ - Partial backups are deleted on failure (no corrupt files)
213
+
214
+ ### Claude's Discretion
215
+ - Exact progress bar implementation
216
+ - Compression algorithm choice
217
+ - Temp file handling
218
+
219
+ </decisions>
220
+
221
+ <canonical_refs>
222
+ ## Canonical References
223
+
224
+ ### Backup CLI
225
+ - `docs/features/backup-restore.md` — Backup requirements, supported backends, encryption spec
226
+ - `docs/decisions/adr-007-cli-conventions.md` — Flag naming, exit codes, output format standards
227
+
228
+ </canonical_refs>
229
+
230
+ <specifics>
231
+ ## Specific Ideas
232
+
233
+ - "I want it to feel like pg_dump — familiar to database people"
234
+ - Should work in CI pipelines (exit codes, no interactive prompts)
235
+
236
+ </specifics>
237
+
238
+ <deferred>
239
+ ## Deferred Ideas
240
+
241
+ - Scheduled backups — separate phase
242
+ - Backup rotation/retention — add to backlog
243
+
244
+ </deferred>
245
+
246
+ ---
247
+
248
+ *Phase: 02-backup-command*
249
+ *Context gathered: 2025-01-20*
250
+ ```
251
+
252
+ **Example 3: Organization task (Photo library)**
253
+
254
+ ```markdown
255
+ # Phase 1: Photo Organization - Context
256
+
257
+ **Gathered:** 2025-01-20
258
+ **Status:** Ready for planning
259
+
260
+ <domain>
261
+ ## Phase Boundary
262
+
263
+ Organize existing photo library into structured folders. Handle duplicates and apply consistent naming. Tagging and search are separate phases.
264
+
265
+ </domain>
266
+
267
+ <decisions>
268
+ ## Implementation Decisions
269
+
270
+ ### Grouping criteria
271
+ - Primary grouping by year, then by month
272
+ - Events detected by time clustering (photos within 2 hours = same event)
273
+ - Event folders named by date + location if available
274
+
275
+ ### Duplicate handling
276
+ - Keep highest resolution version
277
+ - Move duplicates to _duplicates folder (don't delete)
278
+ - Log all duplicate decisions for review
279
+
280
+ ### Naming convention
281
+ - Format: YYYY-MM-DD_HH-MM-SS_originalname.ext
282
+ - Preserve original filename as suffix for searchability
283
+ - Handle name collisions with incrementing suffix
284
+
285
+ ### Claude's Discretion
286
+ - Exact clustering algorithm
287
+ - How to handle photos with no EXIF data
288
+ - Folder emoji usage
289
+
290
+ </decisions>
291
+
292
+ <canonical_refs>
293
+ ## Canonical References
294
+
295
+ ### Organization rules
296
+ - `docs/features/photo-organization.md` — Grouping rules, duplicate policy, naming spec
297
+ - `docs/decisions/adr-003-exif-handling.md` — EXIF extraction strategy, fallback for missing metadata
298
+
299
+ </canonical_refs>
300
+
301
+ <specifics>
302
+ ## Specific Ideas
303
+
304
+ - "I want to be able to find photos by roughly when they were taken"
305
+ - Don't delete anything — worst case, move to a review folder
306
+
307
+ </specifics>
308
+
309
+ <deferred>
310
+ ## Deferred Ideas
311
+
312
+ - Face detection grouping — future phase
313
+ - Cloud sync — out of scope for now
314
+
315
+ </deferred>
316
+
317
+ ---
318
+
319
+ *Phase: 01-photo-organization*
320
+ *Context gathered: 2025-01-20*
321
+ ```
322
+
323
+ </good_examples>
324
+
325
+ <guidelines>
326
+ **This template captures DECISIONS for downstream agents.**
327
+
328
+ The output should answer: "What does the researcher need to investigate? What choices are locked for the planner?"
329
+
330
+ **Good content (concrete decisions):**
331
+ - "Card-based layout, not timeline"
332
+ - "Retry 3 times on network failure, then fail"
333
+ - "Group by year, then by month"
334
+ - "JSON for programmatic use, table for humans"
335
+
336
+ **Bad content (too vague):**
337
+ - "Should feel modern and clean"
338
+ - "Good user experience"
339
+ - "Fast and responsive"
340
+ - "Easy to use"
341
+
342
+ **After creation:**
343
+ - File lives in phase directory: `phases/XX-name/{phase_num}-CONTEXT.md` (in planning root)
344
+ - `dgs-phase-researcher` uses decisions to focus investigation AND reads canonical_refs to know WHAT docs to study
345
+ - `dgs-planner` uses decisions + research to create executable tasks AND reads canonical_refs to verify alignment
346
+ - Downstream agents should NOT need to ask the user again about captured decisions
347
+
348
+ **CRITICAL — Canonical references:**
349
+ - The `<canonical_refs>` section is MANDATORY. Every CONTEXT.md must have one.
350
+ - If your project has external specs, ADRs, or design docs, list them with full relative paths grouped by topic
351
+ - If ROADMAP.md lists `Canonical refs:` per phase, extract and expand those
352
+ - Inline mentions like "see ADR-019" scattered in decisions are useless to downstream agents — they need full paths and section references in a dedicated section they can find
353
+ - If no external specs exist, say so explicitly — don't silently omit the section
354
+ </guidelines>
@@ -0,0 +1,80 @@
1
+ # Continue-Here Template
2
+
3
+ Copy and fill this structure for `phases/XX-name/.continue-here.md` (in planning root):
4
+
5
+ > **Layout-agnostic:** Workflows resolve the phase directory path via `${phase_dir}` from init output. Works in both standard and root layouts.
6
+
7
+ ```yaml
8
+ ---
9
+ phase: XX-name
10
+ task: 3
11
+ total_tasks: 7
12
+ status: in_progress
13
+ last_updated: 2025-01-15T14:30:00Z
14
+ ---
15
+ ```
16
+
17
+ ```markdown
18
+ <current_state>
19
+ [Where exactly are we? What's the immediate context?]
20
+ </current_state>
21
+
22
+ <completed_work>
23
+ [What got done this session - be specific]
24
+
25
+ - Task 1: [name] - Done
26
+ - Task 2: [name] - Done
27
+ - Task 3: [name] - In progress, [what's done on it]
28
+ </completed_work>
29
+
30
+ <remaining_work>
31
+ [What's left in this phase]
32
+
33
+ - Task 3: [name] - [what's left to do]
34
+ - Task 4: [name] - Not started
35
+ - Task 5: [name] - Not started
36
+ </remaining_work>
37
+
38
+ <decisions_made>
39
+ [Key decisions and why - so next session doesn't re-debate]
40
+
41
+ - Decided to use [X] because [reason]
42
+ - Chose [approach] over [alternative] because [reason]
43
+ </decisions_made>
44
+
45
+ <blockers>
46
+ [Anything stuck or waiting on external factors]
47
+
48
+ - [Blocker 1]: [status/workaround]
49
+ </blockers>
50
+
51
+ <context>
52
+ [Mental state, "vibe", anything that helps resume smoothly]
53
+
54
+ [What were you thinking about? What was the plan?
55
+ This is the "pick up exactly where you left off" context.]
56
+ </context>
57
+
58
+ <next_action>
59
+ [The very first thing to do when resuming]
60
+
61
+ Start with: [specific action]
62
+ </next_action>
63
+ ```
64
+
65
+ <yaml_fields>
66
+ Required YAML frontmatter:
67
+
68
+ - `phase`: Directory name (e.g., `02-authentication`)
69
+ - `task`: Current task number
70
+ - `total_tasks`: How many tasks in phase
71
+ - `status`: `in_progress`, `blocked`, `almost_done`
72
+ - `last_updated`: ISO timestamp
73
+ </yaml_fields>
74
+
75
+ <guidelines>
76
+ - Be specific enough that a fresh Claude instance understands immediately
77
+ - Include WHY decisions were made, not just what
78
+ - The `<next_action>` should be actionable without reading anything else
79
+ - This file gets DELETED after resume - it's not permanent storage
80
+ </guidelines>
@@ -0,0 +1,93 @@
1
+ # Debug Subagent Prompt Template
2
+
3
+ Template for spawning dgs-debugger agent. The agent contains all debugging expertise - this template provides problem context only.
4
+
5
+ > **Layout-agnostic:** The debug directory lives at `debug/` within the planning root. Workflows resolve the path via `${debug_dir}` from init output.
6
+
7
+ ---
8
+
9
+ ## Template
10
+
11
+ ```markdown
12
+ <objective>
13
+ Investigate issue: {issue_id}
14
+
15
+ **Summary:** {issue_summary}
16
+ </objective>
17
+
18
+ <symptoms>
19
+ expected: {expected}
20
+ actual: {actual}
21
+ errors: {errors}
22
+ reproduction: {reproduction}
23
+ timeline: {timeline}
24
+ </symptoms>
25
+
26
+ <mode>
27
+ symptoms_prefilled: {true_or_false}
28
+ goal: {find_root_cause_only | find_and_fix}
29
+ </mode>
30
+
31
+ <debug_file>
32
+ Create: ${debug_dir}/{slug}.md
33
+ </debug_file>
34
+ ```
35
+
36
+ ---
37
+
38
+ ## Placeholders
39
+
40
+ | Placeholder | Source | Example |
41
+ |-------------|--------|---------|
42
+ | `{issue_id}` | Orchestrator-assigned | `auth-screen-dark` |
43
+ | `{issue_summary}` | User description | `Auth screen is too dark` |
44
+ | `{expected}` | From symptoms | `See logo clearly` |
45
+ | `{actual}` | From symptoms | `Screen is dark` |
46
+ | `{errors}` | From symptoms | `None in console` |
47
+ | `{reproduction}` | From symptoms | `Open /auth page` |
48
+ | `{timeline}` | From symptoms | `After recent deploy` |
49
+ | `{goal}` | Orchestrator sets | `find_and_fix` |
50
+ | `{slug}` | Generated | `auth-screen-dark` |
51
+
52
+ ---
53
+
54
+ ## Usage
55
+
56
+ **From /dgs:debug:**
57
+ ```python
58
+ Task(
59
+ prompt=filled_template,
60
+ subagent_type="dgs-debugger",
61
+ description="Debug {slug}"
62
+ )
63
+ ```
64
+
65
+ **From diagnose-issues (UAT):**
66
+ ```python
67
+ Task(prompt=template, subagent_type="dgs-debugger", description="Debug UAT-001")
68
+ ```
69
+
70
+ ---
71
+
72
+ ## Continuation
73
+
74
+ For checkpoints, spawn fresh agent with:
75
+
76
+ ```markdown
77
+ <objective>
78
+ Continue debugging {slug}. Evidence is in the debug file.
79
+ </objective>
80
+
81
+ <prior_state>
82
+ Debug file: @${debug_dir}/{slug}.md
83
+ </prior_state>
84
+
85
+ <checkpoint_response>
86
+ **Type:** {checkpoint_type}
87
+ **Response:** {user_response}
88
+ </checkpoint_response>
89
+
90
+ <mode>
91
+ goal: {goal}
92
+ </mode>
93
+ ```
@@ -0,0 +1,148 @@
1
+ # Discovery Template
2
+
3
+ Template for `phases/XX-name/DISCOVERY.md` (in planning root) - shallow research for library/option decisions.
4
+
5
+ > **Layout-agnostic:** Workflows resolve the phase directory path via `${phase_dir}` from init output. Works in both standard and root layouts.
6
+
7
+ **Purpose:** Answer "which library/option should we use" questions during mandatory discovery in plan-phase.
8
+
9
+ For deep ecosystem research ("how do experts build this"), use `/dgs:research-phase` which produces RESEARCH.md.
10
+
11
+ ---
12
+
13
+ ## File Template
14
+
15
+ ```markdown
16
+ ---
17
+ phase: XX-name
18
+ type: discovery
19
+ topic: [discovery-topic]
20
+ ---
21
+
22
+ <session_initialization>
23
+ Before beginning discovery, verify today's date:
24
+ !`date +%Y-%m-%d`
25
+
26
+ Use this date when searching for "current" or "latest" information.
27
+ Example: If today is 2025-11-22, search for "2025" not "2024".
28
+ </session_initialization>
29
+
30
+ <discovery_objective>
31
+ Discover [topic] to inform [phase name] implementation.
32
+
33
+ Purpose: [What decision/implementation this enables]
34
+ Scope: [Boundaries]
35
+ Output: DISCOVERY.md with recommendation
36
+ </discovery_objective>
37
+
38
+ <discovery_scope>
39
+ <include>
40
+ - [Question to answer]
41
+ - [Area to investigate]
42
+ - [Specific comparison if needed]
43
+ </include>
44
+
45
+ <exclude>
46
+ - [Out of scope for this discovery]
47
+ - [Defer to implementation phase]
48
+ </exclude>
49
+ </discovery_scope>
50
+
51
+ <discovery_protocol>
52
+
53
+ **Source Priority:**
54
+ 1. **Context7 MCP** - For library/framework documentation (current, authoritative)
55
+ 2. **Official Docs** - For platform-specific or non-indexed libraries
56
+ 3. **WebSearch** - For comparisons, trends, community patterns (verify all findings)
57
+
58
+ **Quality Checklist:**
59
+ Before completing discovery, verify:
60
+ - [ ] All claims have authoritative sources (Context7 or official docs)
61
+ - [ ] Negative claims ("X is not possible") verified with official documentation
62
+ - [ ] API syntax/configuration from Context7 or official docs (never WebSearch alone)
63
+ - [ ] WebSearch findings cross-checked with authoritative sources
64
+ - [ ] Recent updates/changelogs checked for breaking changes
65
+ - [ ] Alternative approaches considered (not just first solution found)
66
+
67
+ **Confidence Levels:**
68
+ - HIGH: Context7 or official docs confirm
69
+ - MEDIUM: WebSearch + Context7/official docs confirm
70
+ - LOW: WebSearch only or training knowledge only (mark for validation)
71
+
72
+ </discovery_protocol>
73
+
74
+
75
+ <output_structure>
76
+ Create `phases/XX-name/DISCOVERY.md` (in planning root):
77
+
78
+ ```markdown
79
+ # [Topic] Discovery
80
+
81
+ ## Summary
82
+ [2-3 paragraph executive summary - what was researched, what was found, what's recommended]
83
+
84
+ ## Primary Recommendation
85
+ [What to do and why - be specific and actionable]
86
+
87
+ ## Alternatives Considered
88
+ [What else was evaluated and why not chosen]
89
+
90
+ ## Key Findings
91
+
92
+ ### [Category 1]
93
+ - [Finding with source URL and relevance to our case]
94
+
95
+ ### [Category 2]
96
+ - [Finding with source URL and relevance]
97
+
98
+ ## Code Examples
99
+ [Relevant implementation patterns, if applicable]
100
+
101
+ ## Metadata
102
+
103
+ <metadata>
104
+ <confidence level="high|medium|low">
105
+ [Why this confidence level - based on source quality and verification]
106
+ </confidence>
107
+
108
+ <sources>
109
+ - [Primary authoritative sources used]
110
+ </sources>
111
+
112
+ <open_questions>
113
+ [What couldn't be determined or needs validation during implementation]
114
+ </open_questions>
115
+
116
+ <validation_checkpoints>
117
+ [If confidence is LOW or MEDIUM, list specific things to verify during implementation]
118
+ </validation_checkpoints>
119
+ </metadata>
120
+ ```
121
+ </output_structure>
122
+
123
+ <success_criteria>
124
+ - All scope questions answered with authoritative sources
125
+ - Quality checklist items completed
126
+ - Clear primary recommendation
127
+ - Low-confidence findings marked with validation checkpoints
128
+ - Ready to inform PLAN.md creation
129
+ </success_criteria>
130
+
131
+ <guidelines>
132
+ **When to use discovery:**
133
+ - Technology choice unclear (library A vs B)
134
+ - Best practices needed for unfamiliar integration
135
+ - API/library investigation required
136
+ - Single decision pending
137
+
138
+ **When NOT to use:**
139
+ - Established patterns (CRUD, auth with known library)
140
+ - Implementation details (defer to execution)
141
+ - Questions answerable from existing project context
142
+
143
+ **When to use RESEARCH.md instead:**
144
+ - Niche/complex domains (3D, games, audio, shaders)
145
+ - Need ecosystem knowledge, not just library choice
146
+ - "How do experts build this" questions
147
+ - Use `/dgs:research-phase` for these
148
+ </guidelines>