@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,671 @@
1
+ <purpose>
2
+ Validate built features through conversational testing with persistent state. Creates UAT.md that tracks test progress, survives /clear, and feeds gaps into /dgs:plan-phase --gaps.
3
+
4
+ User tests, Claude records. One test at a time. Plain text responses.
5
+ </purpose>
6
+
7
+ <context_tier>verification</context_tier>
8
+
9
+ <philosophy>
10
+ **Show expected, ask if reality matches.**
11
+
12
+ Claude presents what SHOULD happen. User confirms or describes what's different.
13
+ - "yes" / "y" / "next" / empty → pass
14
+ - Anything else → logged as issue, severity inferred
15
+
16
+ No Pass/Fail buttons. No severity questions. Just: "Here's what should happen. Does it?"
17
+ </philosophy>
18
+
19
+ <template>
20
+ @~/.claude/deliver-great-systems/templates/UAT.md
21
+ </template>
22
+
23
+ <process>
24
+
25
+ <step name="initialize" priority="first">
26
+ If $ARGUMENTS contains a phase number, load context:
27
+
28
+ ```bash
29
+ INIT=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" init verify-work "${PHASE_ARG}")
30
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
31
+ ```
32
+
33
+ Parse JSON for: `planner_model`, `checker_model`, `commit_docs`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `has_verification`, `dgs_mode`, `author`.
34
+
35
+ **Load verification tier context:**
36
+
37
+ ```bash
38
+ TIER_FILES=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" context load-tier verification --phase "${PHASE_ARG}" --raw 2>/dev/null)
39
+ ```
40
+
41
+ This provides all execution-tier files plus VERIFICATION.md and UAT*.md files for prior verification context. Keep the operational SUMMARY reads in find_summaries/extract_tests (used for test derivation, not just context).
42
+
43
+ **Flag Detection:**
44
+
45
+ 1. Check if `$ARGUMENTS` contains `--auto`. If yes, set `AUTO_MODE = true` and strip `--auto` from `$ARGUMENTS` before phase resolution.
46
+
47
+ **AUTO_MODE Detection:**
48
+
49
+ If `AUTO_MODE` is true, the workflow is running inside a job orchestrator. All interactive prompts (test presentation, user response collection) must auto-resolve:
50
+ - All tests auto-pass (AI-verified only)
51
+ - No user prompts -- record "[AUTO] AI-verified" as response
52
+ - Add `[AUTO-RESOLVE]` prefix to any auto-resolved decisions in the UAT file
53
+ - Flag the UAT session as `ai_verified: true` in frontmatter
54
+
55
+ If `AUTO_MODE` is false, the workflow runs interactively as normal -- present each test and wait for user response.
56
+
57
+ **v2 Multi-Repo Detection:**
58
+
59
+ If `dgs_mode` is `v2`, also load repo context for holistic verification:
60
+
61
+ ```bash
62
+ REPOS_MD=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" repos list --raw 2>/dev/null)
63
+ ```
64
+
65
+ Parse JSON for the list of registered repos with paths.
66
+ </step>
67
+
68
+ <step name="check_active_session">
69
+ **First: Check for active UAT sessions**
70
+
71
+ ```bash
72
+ find ${project_root}/phases -name "*-UAT.md" -type f 2>/dev/null | head -5
73
+ ```
74
+
75
+ **If active sessions exist AND no $ARGUMENTS provided:**
76
+
77
+ Read each file's frontmatter (status, phase) and Current Test section.
78
+
79
+ Display inline:
80
+
81
+ ```
82
+ ## Active UAT Sessions
83
+
84
+ | # | Phase | Status | Current Test | Progress |
85
+ |---|-------|--------|--------------|----------|
86
+ | 1 | 04-comments | testing | 3. Reply to Comment | 2/6 |
87
+ | 2 | 05-auth | testing | 1. Login Form | 0/4 |
88
+
89
+ Reply with a number to resume, or provide a phase number to start new.
90
+ ```
91
+
92
+ Wait for user response.
93
+
94
+ - If user replies with number (1, 2) → Load that file, go to `resume_from_file`
95
+ - If user replies with phase number → Treat as new session, go to `create_uat_file`
96
+
97
+ **If active sessions exist AND $ARGUMENTS provided:**
98
+
99
+ Check if session exists for that phase. If yes, offer to resume or restart.
100
+ If no, continue to `create_uat_file`.
101
+
102
+ **If no active sessions AND no $ARGUMENTS:**
103
+
104
+ ```
105
+ No active UAT sessions.
106
+
107
+ Provide a phase number to start testing (e.g., /dgs:verify-work 4)
108
+ ```
109
+
110
+ **If no active sessions AND $ARGUMENTS provided:**
111
+
112
+ Continue to `create_uat_file`.
113
+ </step>
114
+
115
+ <step name="find_summaries">
116
+ **Find what to test:**
117
+
118
+ Use `phase_dir` from init (or run init if not already done).
119
+
120
+ ```bash
121
+ ls "$phase_dir"/*-SUMMARY.md 2>/dev/null
122
+ ```
123
+
124
+ Read each SUMMARY.md to extract testable deliverables.
125
+
126
+ **v2 Multi-Repo: Extract repos from plan tasks**
127
+
128
+ If `dgs_mode` is `v2`, also scan plan files for `<repos>` tags to know which repos were touched:
129
+
130
+ ```bash
131
+ REPOS_TAGS=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" repos scan-tags "$phase_dir" --raw 2>/dev/null)
132
+ ```
133
+
134
+ Parse to get the list of unique repos touched by this phase.
135
+
136
+ For each unique repo, detect tech stack by checking for marker files:
137
+
138
+ ```bash
139
+ for each REPO in unique repos touched:
140
+ REPO_PATH=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" repos resolve "${REPO}" --raw 2>/dev/null)
141
+ if REPO_PATH exists:
142
+ check for: package.json (node), go.mod (go), Cargo.toml (rust),
143
+ pyproject.toml or requirements.txt (python), Makefile (make)
144
+ ```
145
+
146
+ Build a repo context table:
147
+
148
+ ```markdown
149
+ | Repo | Path | Stack |
150
+ |------|------|-------|
151
+ | web-app | ./web-app | node |
152
+ | server | ./server | node, make |
153
+ ```
154
+
155
+ This context is passed to the verifier subagent in `present_test` and `diagnose_issues` steps.
156
+ </step>
157
+
158
+ <step name="extract_tests">
159
+ **Extract testable deliverables from SUMMARY.md:**
160
+
161
+ Parse for:
162
+ 1. **Accomplishments** - Features/functionality added
163
+ 2. **User-facing changes** - UI, workflows, interactions
164
+
165
+ Focus on USER-OBSERVABLE outcomes, not implementation details.
166
+
167
+ For each deliverable, create a test:
168
+ - name: Brief test name
169
+ - expected: What the user should see/experience (specific, observable)
170
+
171
+ Examples:
172
+ - Accomplishment: "Added comment threading with infinite nesting"
173
+ → Test: "Reply to a Comment"
174
+ → Expected: "Clicking Reply opens inline composer below comment. Submitting shows reply nested under parent with visual indentation."
175
+
176
+ Skip internal/non-observable items (refactors, type changes, etc.).
177
+
178
+ **Cold-start smoke test injection:**
179
+
180
+ After extracting tests from SUMMARYs, scan the SUMMARY files for modified/created file paths. If ANY path matches these patterns:
181
+
182
+ `server.ts`, `server.js`, `app.ts`, `app.js`, `index.ts`, `index.js`, `main.ts`, `main.js`, `database/*`, `db/*`, `seed/*`, `seeds/*`, `migrations/*`, `startup*`, `docker-compose*`, `Dockerfile*`
183
+
184
+ Then **prepend** this test to the test list:
185
+
186
+ - name: "Cold Start Smoke Test"
187
+ - expected: "Kill any running server/service. Clear ephemeral state (temp DBs, caches, lock files). Start the application from scratch. Server boots without errors, any seed/migration completes, and a primary query (health check, homepage load, or basic API call) returns live data."
188
+
189
+ This catches bugs that only manifest on fresh start — race conditions in startup sequences, silent seed failures, missing environment setup — which pass against warm state but break in production.
190
+ </step>
191
+
192
+ <step name="create_uat_file">
193
+ **Create UAT file with all tests:**
194
+
195
+ ```bash
196
+ mkdir -p "$PHASE_DIR"
197
+ ```
198
+
199
+ Build test list from extracted deliverables.
200
+
201
+ Create file:
202
+
203
+ ```markdown
204
+ ---
205
+ status: testing
206
+ phase: XX-name
207
+ source: [list of SUMMARY.md files]
208
+ started: [ISO timestamp]
209
+ updated: [ISO timestamp]
210
+ tested_by: ${author}
211
+ ---
212
+
213
+ ## Current Test
214
+ <!-- OVERWRITE each test - shows where we are -->
215
+
216
+ number: 1
217
+ name: [first test name]
218
+ expected: |
219
+ [what user should observe]
220
+ awaiting: user response
221
+
222
+ ## Tests
223
+
224
+ ### 1. [Test Name]
225
+ expected: [observable behavior]
226
+ result: [pending]
227
+
228
+ ### 2. [Test Name]
229
+ expected: [observable behavior]
230
+ result: [pending]
231
+
232
+ ...
233
+
234
+ ## Summary
235
+
236
+ total: [N]
237
+ passed: 0
238
+ issues: 0
239
+ pending: [N]
240
+ skipped: 0
241
+
242
+ ## Gaps
243
+
244
+ [none yet]
245
+ ```
246
+
247
+ Write to `${phase_dir}/{phase_num}-UAT.md`
248
+
249
+ Proceed to `present_test`.
250
+ </step>
251
+
252
+ <step name="present_test">
253
+ **Present current test to user:**
254
+
255
+ Read Current Test section from UAT file.
256
+
257
+ Display using checkpoint box format:
258
+
259
+ ```
260
+ ╔══════════════════════════════════════════════════════════════╗
261
+ ║ CHECKPOINT: Verification Required ║
262
+ ╚══════════════════════════════════════════════════════════════╝
263
+
264
+ **Test {number}: {name}**
265
+
266
+ {expected}
267
+
268
+ ──────────────────────────────────────────────────────────────
269
+ → Type "pass" or describe what's wrong
270
+ ──────────────────────────────────────────────────────────────
271
+ ```
272
+
273
+ **If `AUTO_MODE` is true:** Do not wait for user response. Auto-pass the test with response "[AUTO] AI-verified — human verification recommended". Proceed immediately to `process_response`.
274
+
275
+ Wait for user response (plain text, no AskUserQuestion).
276
+ </step>
277
+
278
+ <step name="process_response">
279
+ **Process user response and update file:**
280
+
281
+ **If response indicates pass:**
282
+ - Empty response, "yes", "y", "ok", "pass", "next", "approved", "✓"
283
+
284
+ Update Tests section:
285
+ ```
286
+ ### {N}. {name}
287
+ expected: {expected}
288
+ result: pass
289
+ ```
290
+
291
+ **If response indicates skip:**
292
+ - "skip", "can't test", "n/a"
293
+
294
+ Update Tests section:
295
+ ```
296
+ ### {N}. {name}
297
+ expected: {expected}
298
+ result: skipped
299
+ reason: [user's reason if provided]
300
+ ```
301
+
302
+ **If response is anything else:**
303
+ - Treat as issue description
304
+
305
+ Infer severity from description:
306
+ - Contains: crash, error, exception, fails, broken, unusable → blocker
307
+ - Contains: doesn't work, wrong, missing, can't → major
308
+ - Contains: slow, weird, off, minor, small → minor
309
+ - Contains: color, font, spacing, alignment, visual → cosmetic
310
+ - Default if unclear: major
311
+
312
+ Update Tests section:
313
+ ```
314
+ ### {N}. {name}
315
+ expected: {expected}
316
+ result: issue
317
+ reported: "{verbatim user response}"
318
+ severity: {inferred}
319
+ ```
320
+
321
+ Append to Gaps section (structured YAML for plan-phase --gaps):
322
+ ```yaml
323
+ - truth: "{expected behavior from test}"
324
+ status: failed
325
+ reason: "User reported: {verbatim user response}"
326
+ severity: {inferred}
327
+ test: {N}
328
+ gap_type: uat_test
329
+ artifacts: [] # Filled by diagnosis
330
+ missing: [] # Filled by diagnosis
331
+ ```
332
+
333
+ **After any response:**
334
+
335
+ Update Summary counts.
336
+ Update frontmatter.updated timestamp.
337
+
338
+ If more tests remain → Update Current Test, go to `present_test`
339
+ If no more tests → Go to `complete_session`
340
+ </step>
341
+
342
+ <step name="resume_from_file">
343
+ **Resume testing from UAT file:**
344
+
345
+ Read the full UAT file.
346
+
347
+ Find first test with `result: [pending]`.
348
+
349
+ Announce:
350
+ ```
351
+ Resuming: Phase {phase} UAT
352
+ Progress: {passed + issues + skipped}/{total}
353
+ Issues found so far: {issues count}
354
+
355
+ Continuing from Test {N}...
356
+ ```
357
+
358
+ Update Current Test section with the pending test.
359
+ Proceed to `present_test`.
360
+ </step>
361
+
362
+ <step name="complete_session">
363
+ **Complete testing and commit:**
364
+
365
+ Update frontmatter:
366
+ - status: complete
367
+ - updated: [now]
368
+
369
+ Clear Current Test section:
370
+ ```
371
+ ## Current Test
372
+
373
+ [testing complete]
374
+ ```
375
+
376
+ Commit the UAT file:
377
+ ```bash
378
+ node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" commit "test({phase_num}): complete UAT - {passed} passed, {issues} issues" --files "${phase_dir}/{phase_num}-UAT.md"
379
+ ```
380
+
381
+ If `AUTO_MODE` is true, prefix the commit message with `[AUTO] `:
382
+ ```bash
383
+ node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" commit "[AUTO] test({phase_num}): complete UAT - {passed} passed, {issues} issues" --files "${phase_dir}/{phase_num}-UAT.md"
384
+ ```
385
+
386
+ Present summary:
387
+ ```
388
+ ## UAT Complete: Phase {phase}
389
+
390
+ | Result | Count |
391
+ |--------|-------|
392
+ | Passed | {N} |
393
+ | Issues | {N} |
394
+ | Skipped| {N} |
395
+
396
+ [If issues > 0:]
397
+ ### Issues Found
398
+
399
+ [List from Issues section]
400
+ ```
401
+
402
+ **If issues > 0:** Proceed to `diagnose_issues`
403
+
404
+ **If issues == 0:**
405
+ ```
406
+ All tests passed. Ready to continue.
407
+
408
+ - `/dgs:plan-phase {next}` — Plan next phase
409
+ - `/dgs:execute-phase {next}` — Execute next phase
410
+ ```
411
+ </step>
412
+
413
+ <step name="diagnose_issues">
414
+ **Diagnose root causes before planning fixes:**
415
+
416
+ ```
417
+ ---
418
+
419
+ {N} issues found. Diagnosing root causes...
420
+
421
+ Spawning parallel debug agents to investigate each issue.
422
+ ```
423
+
424
+ - Load diagnose-issues workflow
425
+ - Follow @~/.claude/deliver-great-systems/workflows/diagnose-issues.md
426
+ - Spawn parallel debug agents for each issue
427
+ - Collect root causes
428
+ - Update UAT.md with root causes
429
+ - Proceed to `plan_gap_closure`
430
+
431
+ Diagnosis runs automatically - no user prompt. Parallel agents investigate simultaneously, so overhead is minimal and fixes are more accurate.
432
+ </step>
433
+
434
+ <step name="plan_gap_closure">
435
+ **Auto-plan fixes from diagnosed gaps:**
436
+
437
+ Display:
438
+ ```
439
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
440
+ DGS ► PLANNING FIXES
441
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
442
+
443
+ ◆ Spawning planner for gap closure...
444
+ ```
445
+
446
+ Spawn dgs-planner in --gaps mode:
447
+
448
+ ```
449
+ Task(
450
+ prompt="""
451
+ <planning_context>
452
+
453
+ **Phase:** {phase_number}
454
+ **Mode:** gap_closure
455
+
456
+ <files_to_read>
457
+ - {phase_dir}/{phase_num}-UAT.md (UAT with diagnoses)
458
+ - ${state_path} (Project State)
459
+ - ${roadmap_path} (Roadmap)
460
+ </files_to_read>
461
+
462
+ </planning_context>
463
+
464
+ <repo_context>
465
+ <!-- v2 only: include if dgs_mode is v2 and repos were detected -->
466
+ **Repos touched by this phase:**
467
+ | Repo | Path | Stack |
468
+ |------|------|-------|
469
+ | {repo} | {path} | {detected stack} |
470
+
471
+ For repo-specific verification (tests, build checks), use `cd {path}` before running commands.
472
+ Verification is holistic — check phase goals across ALL repos, not per-repo.
473
+ </repo_context>
474
+
475
+ <downstream_consumer>
476
+ Output consumed by /dgs:execute-phase
477
+ Plans must be executable prompts.
478
+ </downstream_consumer>
479
+ """,
480
+ subagent_type="dgs-planner",
481
+ model="{planner_model}",
482
+ description="Plan gap fixes for Phase {phase}"
483
+ )
484
+ ```
485
+
486
+ On return:
487
+ - **PLANNING COMPLETE:** Proceed to `verify_gap_plans`
488
+ - **PLANNING INCONCLUSIVE:** Report and offer manual intervention
489
+ </step>
490
+
491
+ <step name="verify_gap_plans">
492
+ **Verify fix plans with checker:**
493
+
494
+ Display:
495
+ ```
496
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
497
+ DGS ► VERIFYING FIX PLANS
498
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
499
+
500
+ ◆ Spawning plan checker...
501
+ ```
502
+
503
+ Initialize: `iteration_count = 1`
504
+
505
+ Spawn dgs-plan-checker:
506
+
507
+ ```
508
+ Task(
509
+ prompt="""
510
+ <verification_context>
511
+
512
+ **Phase:** {phase_number}
513
+ **Phase Goal:** Close diagnosed gaps from UAT
514
+
515
+ <files_to_read>
516
+ - {phase_dir}/*-PLAN.md (Plans to verify)
517
+ </files_to_read>
518
+
519
+ </verification_context>
520
+
521
+ <expected_output>
522
+ Return one of:
523
+ - ## VERIFICATION PASSED — all checks pass
524
+ - ## ISSUES FOUND — structured issue list
525
+ </expected_output>
526
+ """,
527
+ subagent_type="dgs-plan-checker",
528
+ model="{checker_model}",
529
+ description="Verify Phase {phase} fix plans"
530
+ )
531
+ ```
532
+
533
+ On return:
534
+ - **VERIFICATION PASSED:** Proceed to `present_ready`
535
+ - **ISSUES FOUND:** Proceed to `revision_loop`
536
+ </step>
537
+
538
+ <step name="revision_loop">
539
+ **Iterate planner ↔ checker until plans pass (max 3):**
540
+
541
+ **If iteration_count < 3:**
542
+
543
+ Display: `Sending back to planner for revision... (iteration {N}/3)`
544
+
545
+ Spawn dgs-planner with revision context:
546
+
547
+ ```
548
+ Task(
549
+ prompt="""
550
+ <revision_context>
551
+
552
+ **Phase:** {phase_number}
553
+ **Mode:** revision
554
+
555
+ <files_to_read>
556
+ - {phase_dir}/*-PLAN.md (Existing plans)
557
+ </files_to_read>
558
+
559
+ **Checker issues:**
560
+ {structured_issues_from_checker}
561
+
562
+ </revision_context>
563
+
564
+ <instructions>
565
+ Read existing PLAN.md files. Make targeted updates to address checker issues.
566
+ Do NOT replan from scratch unless issues are fundamental.
567
+ </instructions>
568
+ """,
569
+ subagent_type="dgs-planner",
570
+ model="{planner_model}",
571
+ description="Revise Phase {phase} plans"
572
+ )
573
+ ```
574
+
575
+ After planner returns → spawn checker again (verify_gap_plans logic)
576
+ Increment iteration_count
577
+
578
+ **If iteration_count >= 3:**
579
+
580
+ Display: `Max iterations reached. {N} issues remain.`
581
+
582
+ Offer options:
583
+ 1. Force proceed (execute despite issues)
584
+ 2. Provide guidance (user gives direction, retry)
585
+ 3. Abandon (exit, user runs /dgs:plan-phase manually)
586
+
587
+ Wait for user response.
588
+ </step>
589
+
590
+ <step name="present_ready">
591
+ **Present completion and next steps:**
592
+
593
+ ```
594
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
595
+ DGS ► FIXES READY ✓
596
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
597
+
598
+ **Phase {X}: {Name}** — {N} gap(s) diagnosed, {M} fix plan(s) created
599
+
600
+ | Gap | Root Cause | Fix Plan |
601
+ |-----|------------|----------|
602
+ | {truth 1} | {root_cause} | {phase}-04 |
603
+ | {truth 2} | {root_cause} | {phase}-04 |
604
+
605
+ Plans verified and ready for execution.
606
+ ```
607
+
608
+ Display:
609
+ ```
610
+ ───────────────────────────────────────────────────────────────
611
+
612
+ ## ▶ Next Up
613
+
614
+ **Execute fixes** — run fix plans
615
+
616
+ `/clear` then `/dgs:execute-phase {phase} --gaps-only`
617
+
618
+ ───────────────────────────────────────────────────────────────
619
+ ```
620
+ </step>
621
+
622
+ </process>
623
+
624
+ <update_rules>
625
+ **Batched writes for efficiency:**
626
+
627
+ Keep results in memory. Write to file only when:
628
+ 1. **Issue found** — Preserve the problem immediately
629
+ 2. **Session complete** — Final write before commit
630
+ 3. **Checkpoint** — Every 5 passed tests (safety net)
631
+
632
+ | Section | Rule | When Written |
633
+ |---------|------|--------------|
634
+ | Frontmatter.status | OVERWRITE | Start, complete |
635
+ | Frontmatter.updated | OVERWRITE | On any file write |
636
+ | Current Test | OVERWRITE | On any file write |
637
+ | Tests.{N}.result | OVERWRITE | On any file write |
638
+ | Summary | OVERWRITE | On any file write |
639
+ | Gaps | APPEND | When issue found |
640
+
641
+ On context reset: File shows last checkpoint. Resume from there.
642
+ </update_rules>
643
+
644
+ <severity_inference>
645
+ **Infer severity from user's natural language:**
646
+
647
+ | User says | Infer |
648
+ |-----------|-------|
649
+ | "crashes", "error", "exception", "fails completely" | blocker |
650
+ | "doesn't work", "nothing happens", "wrong behavior" | major |
651
+ | "works but...", "slow", "weird", "minor issue" | minor |
652
+ | "color", "spacing", "alignment", "looks off" | cosmetic |
653
+
654
+ Default to **major** if unclear. User can correct if needed.
655
+
656
+ **Never ask "how severe is this?"** - just infer and move on.
657
+ </severity_inference>
658
+
659
+ <success_criteria>
660
+ - [ ] UAT file created with all tests from SUMMARY.md
661
+ - [ ] Tests presented one at a time with expected behavior
662
+ - [ ] User responses processed as pass/issue/skip
663
+ - [ ] Severity inferred from description (never asked)
664
+ - [ ] Batched writes: on issue, every 5 passes, or completion
665
+ - [ ] Committed on completion
666
+ - [ ] If issues: parallel debug agents diagnose root causes
667
+ - [ ] If issues: dgs-planner creates fix plans (gap_closure mode)
668
+ - [ ] If issues: dgs-plan-checker verifies fix plans
669
+ - [ ] If issues: revision loop until plans pass (max 3 iterations)
670
+ - [ ] Ready for `/dgs:execute-phase --gaps-only` when complete
671
+ </success_criteria>