@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,94 @@
1
+ <purpose>
2
+ Autonomous repair operator for failed task verification. Invoked by execute-plan when a task fails its done-criteria. Proposes and attempts structured fixes before escalating to the user.
3
+ </purpose>
4
+
5
+ <context_tier>none</context_tier>
6
+
7
+ <inputs>
8
+ - FAILED_TASK: Task number, name, and done-criteria from the plan
9
+ - ERROR: What verification produced — actual result vs expected
10
+ - PLAN_CONTEXT: Adjacent tasks and phase goal (for constraint awareness)
11
+ - REPAIR_BUDGET: Max repair attempts remaining (default: 2)
12
+ </inputs>
13
+
14
+ <repair_directive>
15
+ Analyze the failure and choose exactly one repair strategy:
16
+
17
+ **RETRY** — The approach was right but execution failed. Try again with a concrete adjustment.
18
+ - Use when: command error, missing dependency, wrong path, env issue, transient failure
19
+ - Output: `RETRY: [specific adjustment to make before retrying]`
20
+
21
+ **DECOMPOSE** — The task is too coarse. Break it into smaller verifiable sub-steps.
22
+ - Use when: done-criteria covers multiple concerns, implementation gaps are structural
23
+ - Output: `DECOMPOSE: [sub-task 1] | [sub-task 2] | ...` (max 3 sub-tasks)
24
+ - Sub-tasks must each have a single verifiable outcome
25
+
26
+ **PRUNE** — The task is infeasible given current constraints. Skip with justification.
27
+ - Use when: prerequisite missing and not fixable here, out of scope, contradicts an earlier decision
28
+ - Output: `PRUNE: [one-sentence justification]`
29
+
30
+ **ESCALATE** — Repair budget exhausted, or this is an architectural decision (Rule 4).
31
+ - Use when: RETRY failed more than once with different approaches, or fix requires structural change
32
+ - Output: `ESCALATE: [what was tried] | [what decision is needed]`
33
+ </repair_directive>
34
+
35
+ <process>
36
+
37
+ <step name="diagnose">
38
+ Read the error and done-criteria carefully. Ask:
39
+ 1. Is this a transient/environmental issue? → RETRY
40
+ 2. Is the task verifiably too broad? → DECOMPOSE
41
+ 3. Is a prerequisite genuinely missing and unfixable in scope? → PRUNE
42
+ 4. Has RETRY already been attempted with this task? Check REPAIR_BUDGET. If 0 → ESCALATE
43
+ </step>
44
+
45
+ <step name="execute_retry">
46
+ If RETRY:
47
+ 1. Apply the specific adjustment stated in the directive
48
+ 2. Re-run the task implementation
49
+ 3. Re-run verification
50
+ 4. If passes → continue normally, log `[Node Repair - RETRY] Task [X]: [adjustment made]`
51
+ 5. If fails again → decrement REPAIR_BUDGET, re-invoke node-repair with updated context
52
+ </step>
53
+
54
+ <step name="execute_decompose">
55
+ If DECOMPOSE:
56
+ 1. Replace the failed task inline with the sub-tasks (do not modify PLAN.md on disk)
57
+ 2. Execute sub-tasks sequentially, each with its own verification
58
+ 3. If all sub-tasks pass → treat original task as succeeded, log `[Node Repair - DECOMPOSE] Task [X] → [N] sub-tasks`
59
+ 4. If a sub-task fails → re-invoke node-repair for that sub-task (REPAIR_BUDGET applies per sub-task)
60
+ </step>
61
+
62
+ <step name="execute_prune">
63
+ If PRUNE:
64
+ 1. Mark task as skipped with justification
65
+ 2. Log to SUMMARY "Issues Encountered": `[Node Repair - PRUNE] Task [X]: [justification]`
66
+ 3. Continue to next task
67
+ </step>
68
+
69
+ <step name="execute_escalate">
70
+ If ESCALATE:
71
+ 1. Surface to user via verification_failure_gate with full repair history
72
+ 2. Present: what was tried (each RETRY/DECOMPOSE attempt), what the blocker is, options available
73
+ 3. Wait for user direction before continuing
74
+ </step>
75
+
76
+ </process>
77
+
78
+ <logging>
79
+ All repair actions must appear in SUMMARY.md under "## Deviations from Plan":
80
+
81
+ | Type | Format |
82
+ |------|--------|
83
+ | RETRY success | `[Node Repair - RETRY] Task X: [adjustment] — resolved` |
84
+ | RETRY fail → ESCALATE | `[Node Repair - RETRY] Task X: [N] attempts exhausted — escalated to user` |
85
+ | DECOMPOSE | `[Node Repair - DECOMPOSE] Task X split into [N] sub-tasks — all passed` |
86
+ | PRUNE | `[Node Repair - PRUNE] Task X skipped: [justification]` |
87
+ </logging>
88
+
89
+ <constraints>
90
+ - REPAIR_BUDGET defaults to 2 per task. Configurable via dgs.config.json `workflow.node_repair_budget`.
91
+ - Never modify PLAN.md on disk — decomposed sub-tasks are in-memory only.
92
+ - DECOMPOSE sub-tasks must be more specific than the original, not synonymous rewrites.
93
+ - If dgs.config.json `workflow.node_repair` is `false`, skip directly to verification_failure_gate (user retains original behavior).
94
+ </constraints>
@@ -0,0 +1,86 @@
1
+ <purpose>
2
+ Show which repos and files are touched by multiple active projects.
3
+ Non-blocking informational output — never prevents work.
4
+ </purpose>
5
+
6
+ <context_tier>lite</context_tier>
7
+
8
+ <process>
9
+
10
+ ## 1. Initialize
11
+
12
+ Check v2 install:
13
+ ```bash
14
+ INIT=$(node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs init phase-op "1" 2>/dev/null)
15
+ TIER_FILES=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" context load-tier lite --raw 2>/dev/null)
16
+ ```
17
+
18
+ Use `TIER_FILES` JSON `files` array for project context (PROJECT.md, STATE.md, config.json).
19
+
20
+ Parse JSON. If not v2 (no PROJECTS.md/REPOS.md — `dgs_mode` is not `v2`):
21
+
22
+ ```
23
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
24
+ DGS ► OVERLAP CHECK
25
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
26
+
27
+ Overlap check requires v2 multi-project setup.
28
+ Run /dgs:init-product first.
29
+ ```
30
+
31
+ Exit.
32
+
33
+ ## 2. Run Overlap Check
34
+
35
+ ```bash
36
+ OVERLAP=$(node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs overlap check --raw)
37
+ ```
38
+
39
+ Parse JSON result. Extract `overlapping_repos` array and `warnings` array.
40
+
41
+ ## 3. Present Results
42
+
43
+ **If no overlaps** (`overlapping_repos` is empty):
44
+
45
+ ```
46
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
47
+ DGS ► OVERLAP CHECK ✓
48
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
49
+
50
+ No cross-project overlaps detected.
51
+
52
+ Each active project touches unique repos.
53
+ ```
54
+
55
+ **If overlaps found:**
56
+
57
+ ```
58
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
59
+ DGS ► OVERLAP CHECK
60
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
61
+
62
+ ⚠ {N} repo(s) touched by multiple active projects
63
+
64
+ | Repo | Projects |
65
+ |------|----------|
66
+ | {repo} | {project1}, {project2} |
67
+
68
+ ### File-Level Conflicts
69
+
70
+ **{repo}:**
71
+ - {file1} — {project1}, {project2}
72
+ - {file2} — {project1}
73
+
74
+ This is informational — overlapping repos don't block work.
75
+ Coordinate merges manually if projects touch the same files.
76
+ ```
77
+
78
+ **If warnings exist** (ghost projects, etc.), append:
79
+
80
+ ```
81
+ ### Warnings
82
+ - {warning1}
83
+ - {warning2}
84
+ ```
85
+
86
+ </process>
@@ -0,0 +1,134 @@
1
+ <purpose>
2
+ Create `.continue-here.md` handoff file to preserve complete work state across sessions. Enables seamless resumption with full context restoration.
3
+ </purpose>
4
+
5
+ <context_tier>lite</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
+ <process>
12
+
13
+ <step name="load_context" priority="first">
14
+ Load project context via tier system:
15
+
16
+ ```bash
17
+ TIER_FILES=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" context load-tier lite --raw 2>/dev/null)
18
+ ```
19
+
20
+ Use `TIER_FILES` JSON `files` array for project context (PROJECT.md, STATE.md, config.json).
21
+ </step>
22
+
23
+ <step name="detect">
24
+ Find current phase directory from most recently modified files:
25
+
26
+ ```bash
27
+ # Find most recent phase directory with work
28
+ ls -lt ${project_root}/phases/*/PLAN.md 2>/dev/null | head -1 | grep -oP 'phases/\K[^/]+'
29
+ ```
30
+
31
+ If no active phase detected, ask user which phase they're pausing work on.
32
+ </step>
33
+
34
+ <step name="gather">
35
+ **Collect complete state for handoff:**
36
+
37
+ 1. **Current position**: Which phase, which plan, which task
38
+ 2. **Work completed**: What got done this session
39
+ 3. **Work remaining**: What's left in current plan/phase
40
+ 4. **Decisions made**: Key decisions and rationale
41
+ 5. **Blockers/issues**: Anything stuck
42
+ 6. **Mental context**: The approach, next steps, "vibe"
43
+ 7. **Files modified**: What's changed but not committed
44
+
45
+ Ask user for clarifications if needed via conversational questions.
46
+ </step>
47
+
48
+ <step name="write">
49
+ **Write handoff to `${phase_dir}/.continue-here.md`:**
50
+
51
+ ```markdown
52
+ ---
53
+ phase: XX-name
54
+ task: 3
55
+ total_tasks: 7
56
+ status: in_progress
57
+ last_updated: [timestamp from current-timestamp]
58
+ ---
59
+
60
+ <current_state>
61
+ [Where exactly are we? Immediate context]
62
+ </current_state>
63
+
64
+ <completed_work>
65
+
66
+ - Task 1: [name] - Done
67
+ - Task 2: [name] - Done
68
+ - Task 3: [name] - In progress, [what's done]
69
+ </completed_work>
70
+
71
+ <remaining_work>
72
+
73
+ - Task 3: [what's left]
74
+ - Task 4: Not started
75
+ - Task 5: Not started
76
+ </remaining_work>
77
+
78
+ <decisions_made>
79
+
80
+ - Decided to use [X] because [reason]
81
+ - Chose [approach] over [alternative] because [reason]
82
+ </decisions_made>
83
+
84
+ <blockers>
85
+ - [Blocker 1]: [status/workaround]
86
+ </blockers>
87
+
88
+ <context>
89
+ [Mental state, what were you thinking, the plan]
90
+ </context>
91
+
92
+ <next_action>
93
+ Start with: [specific first action when resuming]
94
+ </next_action>
95
+ ```
96
+
97
+ Be specific enough for a fresh Claude to understand immediately.
98
+
99
+ Use `current-timestamp` for last_updated field. You can use init todos (which provides timestamps) or call directly:
100
+ ```bash
101
+ timestamp=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" current-timestamp full --raw)
102
+ ```
103
+ </step>
104
+
105
+ <step name="commit">
106
+ ```bash
107
+ node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" commit "wip: [phase-name] paused at task [X]/[Y]" --files ${phase_dir}/.continue-here.md
108
+ ```
109
+ </step>
110
+
111
+ <step name="confirm">
112
+ ```
113
+ ✓ Handoff created: ${phase_dir}/.continue-here.md
114
+
115
+ Current state:
116
+
117
+ - Phase: [XX-name]
118
+ - Task: [X] of [Y]
119
+ - Status: [in_progress/blocked]
120
+ - Committed as WIP
121
+
122
+ To resume: /dgs:resume-work
123
+
124
+ ```
125
+ </step>
126
+
127
+ </process>
128
+
129
+ <success_criteria>
130
+ - [ ] .continue-here.md created in correct phase directory
131
+ - [ ] All sections filled with specific content
132
+ - [ ] Committed as WIP
133
+ - [ ] User knows location and how to resume
134
+ </success_criteria>
@@ -0,0 +1,306 @@
1
+ <purpose>
2
+ Create all phases necessary to close gaps identified by `/dgs:audit-milestone`. Reads MILESTONE-AUDIT.md, groups gaps into logical phases, creates phase entries in ROADMAP.md, and offers to plan each phase. One command creates all fix phases — no manual `/dgs:add-phase` per gap.
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
+ <process>
12
+
13
+ ## 0. Load Context
14
+
15
+ Load planning-tier context files:
16
+
17
+ ```bash
18
+ TIER_FILES=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" context load-tier planning --raw 2>/dev/null)
19
+ ```
20
+
21
+ ## 1. Load Audit Results
22
+
23
+ ```bash
24
+ # Find the most recent audit file
25
+ ls -t ${project_root}/v*-MILESTONE-AUDIT.md 2>/dev/null | head -1
26
+ ```
27
+
28
+ Parse YAML frontmatter to extract structured gaps:
29
+ - `gaps.requirements` — unsatisfied requirements
30
+ - `gaps.integration` — missing cross-phase connections
31
+ - `gaps.flows` — broken E2E flows
32
+
33
+ If no audit file exists or has no gaps, error:
34
+ ```
35
+ No audit gaps found. Run `/dgs:audit-milestone` first.
36
+ ```
37
+
38
+ ## 1b. Parse Arguments
39
+
40
+ Parse `$ARGUMENTS` for:
41
+ - `--auto` flag --> store as `NON_INTERACTIVE` (true/false)
42
+ - Remaining text --> version identifier
43
+
44
+ ```bash
45
+ # Example: "v10.0 --auto" --> NON_INTERACTIVE=true, VERSION="v10.0"
46
+ NON_INTERACTIVE=false
47
+ if echo "$ARGUMENTS" | grep -q "\-\-auto"; then
48
+ NON_INTERACTIVE=true
49
+ fi
50
+ ```
51
+
52
+ ## 2. Prioritize Gaps
53
+
54
+ Group gaps by priority from REQUIREMENTS.md:
55
+
56
+ | Priority | Action |
57
+ |----------|--------|
58
+ | `must` | Create phase, blocks milestone |
59
+ | `should` | Create phase, recommended |
60
+ | `nice` | Ask user: include or defer? |
61
+
62
+ For integration/flow gaps, infer priority from affected requirements.
63
+
64
+ ## 3. Group Gaps into Phases
65
+
66
+ Cluster related gaps into logical phases:
67
+
68
+ **Grouping rules:**
69
+ - Same affected phase → combine into one fix phase
70
+ - Same subsystem (auth, API, UI) → combine
71
+ - Dependency order (fix stubs before wiring)
72
+ - Keep phases focused: 2-4 tasks each
73
+
74
+ **Example grouping:**
75
+ ```
76
+ Gap: DASH-01 unsatisfied (Dashboard doesn't fetch)
77
+ Gap: Integration Phase 1→3 (Auth not passed to API calls)
78
+ Gap: Flow "View dashboard" broken at data fetch
79
+
80
+ → Phase 6: "Wire Dashboard to API"
81
+ - Add fetch to Dashboard.tsx
82
+ - Include auth header in fetch
83
+ - Handle response, update state
84
+ - Render user data
85
+ ```
86
+
87
+ ## 4. Determine Phase Numbers
88
+
89
+ Find highest existing phase:
90
+ ```bash
91
+ # Get sorted phase list, extract last one
92
+ PHASES=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" phases list)
93
+ HIGHEST=$(printf '%s\n' "$PHASES" | jq -r '.directories[-1]')
94
+ ```
95
+
96
+ New phases continue from there:
97
+ - If Phase 5 is highest, gaps become Phase 6, 7, 8...
98
+
99
+ ## 5. Present Gap Closure Plan
100
+
101
+ ```markdown
102
+ ## Gap Closure Plan
103
+
104
+ **Milestone:** {version}
105
+ **Gaps to close:** {N} requirements, {M} integration, {K} flows
106
+
107
+ ### Proposed Phases
108
+
109
+ **Phase {N}: {Name}**
110
+ Closes:
111
+ - {REQ-ID}: {description}
112
+ - Integration: {from} → {to}
113
+ Tasks: {count}
114
+
115
+ **Phase {N+1}: {Name}**
116
+ Closes:
117
+ - {REQ-ID}: {description}
118
+ - Flow: {flow name}
119
+ Tasks: {count}
120
+
121
+ {If nice-to-have gaps exist:}
122
+
123
+ ### Deferred (nice-to-have)
124
+
125
+ These gaps are optional. Include them?
126
+ - {gap description}
127
+ - {gap description}
128
+
129
+ ---
130
+
131
+ Create these {X} phases? (yes / adjust / defer all optional)
132
+ ```
133
+
134
+ **If `NON_INTERACTIVE` is true:**
135
+ - Auto-include all must/should gaps
136
+ - Auto-include nice-to-have gaps (job mode resolves ambiguity by including everything)
137
+ - Display: `[AUTO-RESOLVE] Auto-approving {X} gap closure phases`
138
+ - Skip to step 6 (do not wait for confirmation)
139
+
140
+ **If `NON_INTERACTIVE` is false (default):**
141
+
142
+ Wait for user confirmation.
143
+
144
+ ## 6. Update ROADMAP.md
145
+
146
+ Add new phases to current milestone:
147
+
148
+ ```markdown
149
+ ### Phase {N}: {Name}
150
+ **Goal:** {derived from gaps being closed}
151
+ **Requirements:** {REQ-IDs being satisfied}
152
+ **Gap Closure:** Closes gaps from audit
153
+
154
+ ### Phase {N+1}: {Name}
155
+ ...
156
+ ```
157
+
158
+ ## 7. Update REQUIREMENTS.md Traceability Table (REQUIRED)
159
+
160
+ For each REQ-ID assigned to a gap closure phase:
161
+ - Update the Phase column to reflect the new gap closure phase
162
+ - Reset Status to `Pending`
163
+
164
+ Reset checked-off requirements the audit found unsatisfied:
165
+ - Change `[x]` → `[ ]` for any requirement marked unsatisfied in the audit
166
+ - Update coverage count at top of REQUIREMENTS.md
167
+
168
+ ```bash
169
+ # Verify traceability table reflects gap closure assignments
170
+ grep -c "Pending" ${project_root}/REQUIREMENTS.md
171
+ ```
172
+
173
+ ## 8. Create Phase Directories
174
+
175
+ ```bash
176
+ mkdir -p "${project_root}/phases/{NN}-{name}"
177
+ ```
178
+
179
+ ## 9. Commit Roadmap and Requirements Update
180
+
181
+ ```bash
182
+ node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" commit "docs(roadmap): add gap closure phases {N}-{M}" --files ${roadmap_path} ${project_root}/REQUIREMENTS.md
183
+ ```
184
+
185
+ ## 10. Offer Next Steps
186
+
187
+ ```markdown
188
+ ## ✓ Gap Closure Phases Created
189
+
190
+ **Phases added:** {N} - {M}
191
+ **Gaps addressed:** {count} requirements, {count} integration, {count} flows
192
+
193
+ ---
194
+
195
+ ## ▶ Next Up
196
+
197
+ **Plan first gap closure phase**
198
+
199
+ `/dgs:plan-phase {N}`
200
+
201
+ <sub>`/clear` first → fresh context window</sub>
202
+
203
+ ---
204
+
205
+ **Also available:**
206
+ - `/dgs:execute-phase {N}` — if plans already exist
207
+ - `cat ${roadmap_path}` — see updated roadmap
208
+
209
+ ---
210
+
211
+ **After all gap phases complete:**
212
+
213
+ `/dgs:audit-milestone` — re-audit to verify gaps closed
214
+ `/dgs:complete-milestone {version}` — archive when audit passes
215
+ ```
216
+
217
+ </process>
218
+
219
+ <gap_to_phase_mapping>
220
+
221
+ ## How Gaps Become Tasks
222
+
223
+ **Requirement gap → Tasks:**
224
+ ```yaml
225
+ gap:
226
+ id: DASH-01
227
+ description: "User sees their data"
228
+ reason: "Dashboard exists but doesn't fetch from API"
229
+ missing:
230
+ - "useEffect with fetch to /api/user/data"
231
+ - "State for user data"
232
+ - "Render user data in JSX"
233
+
234
+ becomes:
235
+
236
+ phase: "Wire Dashboard Data"
237
+ tasks:
238
+ - name: "Add data fetching"
239
+ files: [src/components/Dashboard.tsx]
240
+ action: "Add useEffect that fetches /api/user/data on mount"
241
+
242
+ - name: "Add state management"
243
+ files: [src/components/Dashboard.tsx]
244
+ action: "Add useState for userData, loading, error states"
245
+
246
+ - name: "Render user data"
247
+ files: [src/components/Dashboard.tsx]
248
+ action: "Replace placeholder with userData.map rendering"
249
+ ```
250
+
251
+ **Integration gap → Tasks:**
252
+ ```yaml
253
+ gap:
254
+ from_phase: 1
255
+ to_phase: 3
256
+ connection: "Auth token → API calls"
257
+ reason: "Dashboard API calls don't include auth header"
258
+ missing:
259
+ - "Auth header in fetch calls"
260
+ - "Token refresh on 401"
261
+
262
+ becomes:
263
+
264
+ phase: "Add Auth to Dashboard API Calls"
265
+ tasks:
266
+ - name: "Add auth header to fetches"
267
+ files: [src/components/Dashboard.tsx, src/lib/api.ts]
268
+ action: "Include Authorization header with token in all API calls"
269
+
270
+ - name: "Handle 401 responses"
271
+ files: [src/lib/api.ts]
272
+ action: "Add interceptor to refresh token or redirect to login on 401"
273
+ ```
274
+
275
+ **Flow gap → Tasks:**
276
+ ```yaml
277
+ gap:
278
+ name: "User views dashboard after login"
279
+ broken_at: "Dashboard data load"
280
+ reason: "No fetch call"
281
+ missing:
282
+ - "Fetch user data on mount"
283
+ - "Display loading state"
284
+ - "Render user data"
285
+
286
+ becomes:
287
+
288
+ # Usually same phase as requirement/integration gap
289
+ # Flow gaps often overlap with other gap types
290
+ ```
291
+
292
+ </gap_to_phase_mapping>
293
+
294
+ <success_criteria>
295
+ - [ ] MILESTONE-AUDIT.md loaded and gaps parsed
296
+ - [ ] Gaps prioritized (must/should/nice)
297
+ - [ ] Gaps grouped into logical phases
298
+ - [ ] User confirmed phase plan
299
+ - [ ] ROADMAP.md updated with new phases
300
+ - [ ] REQUIREMENTS.md traceability table updated with gap closure phase assignments
301
+ - [ ] Unsatisfied requirement checkboxes reset (`[x]` → `[ ]`)
302
+ - [ ] Coverage count updated in REQUIREMENTS.md
303
+ - [ ] Phase directories created
304
+ - [ ] Changes committed (includes REQUIREMENTS.md)
305
+ - [ ] User knows to run `/dgs:plan-phase` next
306
+ </success_criteria>