@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,250 @@
1
+ <overview>
2
+ Git integration for DGS framework.
3
+
4
+ > **v2 Multi-Project:** Always use init output variables (`${state_path}`, `${roadmap_path}`, `${phase_dir}`) instead of hardcoded paths in workflows. In v2 setups, these resolve to `<project-slug>/` within the planning root.
5
+ </overview>
6
+
7
+ <core_principle>
8
+
9
+ **Commit outcomes, not process.**
10
+
11
+ The git log should read like a changelog of what shipped, not a diary of planning activity.
12
+ </core_principle>
13
+
14
+ <commit_points>
15
+
16
+ | Event | Commit? | Why |
17
+ | ----------------------- | ------- | ------------------------------------------------ |
18
+ | BRIEF + ROADMAP created | YES | Project initialization |
19
+ | PLAN.md created | NO | Intermediate - commit with plan completion |
20
+ | RESEARCH.md created | NO | Intermediate |
21
+ | DISCOVERY.md created | NO | Intermediate |
22
+ | **Task completed** | YES | Atomic unit of work (1 commit per task) |
23
+ | **Plan completed** | YES | Metadata commit (SUMMARY + STATE + ROADMAP) |
24
+ | Handoff created | YES | WIP state preserved |
25
+
26
+ </commit_points>
27
+
28
+ <git_check>
29
+
30
+ ```bash
31
+ [ -d .git ] && echo "GIT_EXISTS" || echo "NO_GIT"
32
+ ```
33
+
34
+ If NO_GIT: Run `git init` silently. DGS projects always get their own repo.
35
+ </git_check>
36
+
37
+ <commit_formats>
38
+
39
+ <format name="initialization">
40
+ ## Project Initialization (brief + roadmap together)
41
+
42
+ ```
43
+ docs: initialize [project-name] ([N] phases)
44
+
45
+ [One-liner from PROJECT.md]
46
+
47
+ Phases:
48
+ 1. [phase-name]: [goal]
49
+ 2. [phase-name]: [goal]
50
+ 3. [phase-name]: [goal]
51
+ ```
52
+
53
+ What to commit:
54
+
55
+ ```bash
56
+ node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" commit "docs: initialize [project-name] ([N] phases)" --files ${project_root}/
57
+ ```
58
+
59
+ </format>
60
+
61
+ <format name="task-completion">
62
+ ## Task Completion (During Plan Execution)
63
+
64
+ Each task gets its own commit immediately after completion.
65
+
66
+ ```
67
+ {type}({phase}-{plan}): {task-name}
68
+
69
+ - [Key change 1]
70
+ - [Key change 2]
71
+ - [Key change 3]
72
+ ```
73
+
74
+ **Commit types:**
75
+ - `feat` - New feature/functionality
76
+ - `fix` - Bug fix
77
+ - `test` - Test-only (TDD RED phase)
78
+ - `refactor` - Code cleanup (TDD REFACTOR phase)
79
+ - `perf` - Performance improvement
80
+ - `chore` - Dependencies, config, tooling
81
+
82
+ **Examples:**
83
+
84
+ ```bash
85
+ # Standard task
86
+ git add src/api/auth.ts src/types/user.ts
87
+ git commit -m "feat(08-02): create user registration endpoint
88
+
89
+ - POST /auth/register validates email and password
90
+ - Checks for duplicate users
91
+ - Returns JWT token on success
92
+ "
93
+
94
+ # TDD task - RED phase
95
+ git add src/__tests__/jwt.test.ts
96
+ git commit -m "test(07-02): add failing test for JWT generation
97
+
98
+ - Tests token contains user ID claim
99
+ - Tests token expires in 1 hour
100
+ - Tests signature verification
101
+ "
102
+
103
+ # TDD task - GREEN phase
104
+ git add src/utils/jwt.ts
105
+ git commit -m "feat(07-02): implement JWT generation
106
+
107
+ - Uses jose library for signing
108
+ - Includes user ID and expiry claims
109
+ - Signs with HS256 algorithm
110
+ "
111
+ ```
112
+
113
+ </format>
114
+
115
+ <format name="plan-completion">
116
+ ## Plan Completion (After All Tasks Done)
117
+
118
+ After all tasks committed, one final metadata commit captures plan completion.
119
+
120
+ ```
121
+ docs({phase}-{plan}): complete [plan-name] plan
122
+
123
+ Tasks completed: [N]/[N]
124
+ - [Task 1 name]
125
+ - [Task 2 name]
126
+ - [Task 3 name]
127
+
128
+ SUMMARY: ${phase_dir}/{phase}-{plan}-SUMMARY.md
129
+ ```
130
+
131
+ What to commit:
132
+
133
+ ```bash
134
+ node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" commit "docs({phase}-{plan}): complete [plan-name] plan" --files ${phase_dir}/{phase}-{plan}-PLAN.md ${phase_dir}/{phase}-{plan}-SUMMARY.md ${state_path} ${roadmap_path}
135
+ ```
136
+
137
+ **Note:** Code files NOT included - already committed per-task.
138
+
139
+ </format>
140
+
141
+ <format name="handoff">
142
+ ## Handoff (WIP)
143
+
144
+ ```
145
+ wip: [phase-name] paused at task [X]/[Y]
146
+
147
+ Current: [task name]
148
+ [If blocked:] Blocked: [reason]
149
+ ```
150
+
151
+ What to commit:
152
+
153
+ ```bash
154
+ node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" commit "wip: [phase-name] paused at task [X]/[Y]" --files ${project_root}/
155
+ ```
156
+
157
+ </format>
158
+ </commit_formats>
159
+
160
+ <example_log>
161
+
162
+ **Old approach (per-plan commits):**
163
+ ```
164
+ a7f2d1 feat(checkout): Stripe payments with webhook verification
165
+ 3e9c4b feat(products): catalog with search, filters, and pagination
166
+ 8a1b2c feat(auth): JWT with refresh rotation using jose
167
+ 5c3d7e feat(foundation): Next.js 15 + Prisma + Tailwind scaffold
168
+ 2f4a8d docs: initialize ecommerce-app (5 phases)
169
+ ```
170
+
171
+ **New approach (per-task commits):**
172
+ ```
173
+ # Phase 04 - Checkout
174
+ 1a2b3c docs(04-01): complete checkout flow plan
175
+ 4d5e6f feat(04-01): add webhook signature verification
176
+ 7g8h9i feat(04-01): implement payment session creation
177
+ 0j1k2l feat(04-01): create checkout page component
178
+
179
+ # Phase 03 - Products
180
+ 3m4n5o docs(03-02): complete product listing plan
181
+ 6p7q8r feat(03-02): add pagination controls
182
+ 9s0t1u feat(03-02): implement search and filters
183
+ 2v3w4x feat(03-01): create product catalog schema
184
+
185
+ # Phase 02 - Auth
186
+ 5y6z7a docs(02-02): complete token refresh plan
187
+ 8b9c0d feat(02-02): implement refresh token rotation
188
+ 1e2f3g test(02-02): add failing test for token refresh
189
+ 4h5i6j docs(02-01): complete JWT setup plan
190
+ 7k8l9m feat(02-01): add JWT generation and validation
191
+ 0n1o2p chore(02-01): install jose library
192
+
193
+ # Phase 01 - Foundation
194
+ 3q4r5s docs(01-01): complete scaffold plan
195
+ 6t7u8v feat(01-01): configure Tailwind and globals
196
+ 9w0x1y feat(01-01): set up Prisma with database
197
+ 2z3a4b feat(01-01): create Next.js 15 project
198
+
199
+ # Initialization
200
+ 5c6d7e docs: initialize ecommerce-app (5 phases)
201
+ ```
202
+
203
+ Each plan produces 2-4 commits (tasks + metadata). Clear, granular, bisectable.
204
+
205
+ </example_log>
206
+
207
+ <anti_patterns>
208
+
209
+ **Still don't commit (intermediate artifacts):**
210
+ - PLAN.md creation (commit with plan completion)
211
+ - RESEARCH.md (intermediate)
212
+ - DISCOVERY.md (intermediate)
213
+ - Minor planning tweaks
214
+ - "Fixed typo in roadmap"
215
+
216
+ **Do commit (outcomes):**
217
+ - Each task completion (feat/fix/test/refactor)
218
+ - Plan completion metadata (docs)
219
+ - Project initialization (docs)
220
+
221
+ **Key principle:** Commit working code and shipped outcomes, not planning process.
222
+
223
+ </anti_patterns>
224
+
225
+ <commit_strategy_rationale>
226
+
227
+ ## Why Per-Task Commits?
228
+
229
+ **Context engineering for AI:**
230
+ - Git history becomes primary context source for future Claude sessions
231
+ - `git log --grep="{phase}-{plan}"` shows all work for a plan
232
+ - `git diff <hash>^..<hash>` shows exact changes per task
233
+ - Less reliance on parsing SUMMARY.md = more context for actual work
234
+
235
+ **Failure recovery:**
236
+ - Task 1 committed ✅, Task 2 failed ❌
237
+ - Claude in next session: sees task 1 complete, can retry task 2
238
+ - Can `git reset --hard` to last successful task
239
+
240
+ **Debugging:**
241
+ - `git bisect` finds exact failing task, not just failing plan
242
+ - `git blame` traces line to specific task context
243
+ - Each commit is independently revertable
244
+
245
+ **Observability:**
246
+ - Solo developer + Claude workflow benefits from granular attribution
247
+ - Atomic commits are git best practice
248
+ - "Commit noise" irrelevant when consumer is Claude, not humans
249
+
250
+ </commit_strategy_rationale>
@@ -0,0 +1,40 @@
1
+ # Git Planning Commit
2
+
3
+ Commit planning artifacts using the dgs-tools CLI, which automatically checks `commit_docs` config and gitignore status.
4
+
5
+ ## Commit via CLI
6
+
7
+ Always use `dgs-tools.cjs commit` for planning files — it handles `commit_docs` and gitignore checks automatically:
8
+
9
+ ```bash
10
+ node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" commit "docs({scope}): {description}" --files ${state_path} ${roadmap_path}
11
+ ```
12
+
13
+ > **v2 Note:** Use init output variables (`${state_path}`, `${roadmap_path}`, etc.) instead of hardcoded paths. In v2 multi-project setups, these resolve to `<project-slug>/` within the planning root.
14
+
15
+ The CLI will return `skipped` (with reason) if `commit_docs` is `false` or the planning directory is gitignored. No manual conditional checks needed.
16
+
17
+ ## Amend previous commit
18
+
19
+ To fold planning file changes into the previous commit:
20
+
21
+ ```bash
22
+ node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" commit "" --files ${codebase_dir}/*.md --amend
23
+ ```
24
+
25
+ ## Commit Message Patterns
26
+
27
+ | Command | Scope | Example |
28
+ |---------|-------|---------|
29
+ | plan-phase | phase | `docs(phase-03): create authentication plans` |
30
+ | execute-phase | phase | `docs(phase-03): complete authentication phase` |
31
+ | new-milestone | milestone | `docs: start milestone v1.1` |
32
+ | remove-phase | chore | `chore: remove phase 17 (dashboard)` |
33
+ | insert-phase | phase | `docs: insert phase 16.1 (critical fix)` |
34
+ | add-phase | phase | `docs: add phase 07 (settings page)` |
35
+
36
+ ## When to Skip
37
+
38
+ - `commit_docs: false` in config
39
+ - Planning directory is gitignored
40
+ - No changes to commit (check with `git status --porcelain ${project_root}/`)
@@ -0,0 +1,36 @@
1
+ # Model Profile Resolution
2
+
3
+ > **v2 Multi-Project:** Config file (`dgs.config.json`) is product-level and always at the product root regardless of v1/v2 setup.
4
+
5
+ Resolve model profile once at the start of orchestration, then use it for all Task spawns.
6
+
7
+ ## Resolution Pattern
8
+
9
+ ```bash
10
+ MODEL_PROFILE=$(cat ${config_path} 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
11
+ ```
12
+
13
+ Default: `balanced` if not set or config missing.
14
+
15
+ ## Lookup Table
16
+
17
+ @~/.claude/deliver-great-systems/references/model-profiles.md
18
+
19
+ Look up the agent in the table for the resolved profile. Pass the model parameter to Task calls:
20
+
21
+ ```
22
+ Task(
23
+ prompt="...",
24
+ subagent_type="dgs-planner",
25
+ model="{resolved_model}" # "inherit", "sonnet", or "haiku"
26
+ )
27
+ ```
28
+
29
+ **Note:** Opus-tier agents resolve to `"inherit"` (not `"opus"`). This causes the agent to use the parent session's model, avoiding conflicts with organization policies that may block specific opus versions.
30
+
31
+ ## Usage
32
+
33
+ 1. Resolve once at orchestration start
34
+ 2. Store the profile value
35
+ 3. Look up each agent's model from the table when spawning
36
+ 4. Pass model parameter to each Task call (values: `"inherit"`, `"sonnet"`, `"haiku"`)
@@ -0,0 +1,95 @@
1
+ # Model Profiles
2
+
3
+ > **v2 Multi-Project:** Config file (`dgs.config.json`) is product-level and always at the product root regardless of v1/v2 setup.
4
+
5
+ Model profiles control which Claude model each DGS agent uses. This allows balancing quality vs token spend.
6
+
7
+ ## Profile Definitions
8
+
9
+ | Agent | `quality` | `balanced` | `budget` |
10
+ |-------|-----------|------------|----------|
11
+ | dgs-planner | opus | opus | sonnet |
12
+ | dgs-roadmapper | opus | sonnet | sonnet |
13
+ | dgs-executor | opus | sonnet | sonnet |
14
+ | dgs-phase-researcher | opus | sonnet | haiku |
15
+ | dgs-project-researcher | opus | sonnet | haiku |
16
+ | dgs-research-synthesizer | sonnet | sonnet | haiku |
17
+ | dgs-debugger | opus | sonnet | sonnet |
18
+ | dgs-codebase-mapper | sonnet | haiku | haiku |
19
+ | dgs-verifier | sonnet | sonnet | haiku |
20
+ | dgs-plan-checker | sonnet | sonnet | haiku |
21
+ | dgs-integration-checker | sonnet | sonnet | haiku |
22
+ | dgs-nyquist-auditor | sonnet | sonnet | haiku |
23
+
24
+ ## Profile Philosophy
25
+
26
+ **quality** - Maximum reasoning power
27
+ - Opus for all decision-making agents
28
+ - Sonnet for read-only verification
29
+ - Use when: quota available, critical architecture work
30
+
31
+ **balanced** (default) - Smart allocation
32
+ - Opus only for planning (where architecture decisions happen)
33
+ - Sonnet for execution and research (follows explicit instructions)
34
+ - Sonnet for verification (needs reasoning, not just pattern matching)
35
+ - Use when: normal development, good balance of quality and cost
36
+
37
+ **budget** - Minimal Opus usage
38
+ - Sonnet for anything that writes code
39
+ - Haiku for research and verification
40
+ - Use when: conserving quota, high-volume work, less critical phases
41
+
42
+ ## Resolution Logic
43
+
44
+ Orchestrators resolve model before spawning:
45
+
46
+ ```
47
+ 1. Read ${config_path}
48
+ 2. Check model_overrides for agent-specific override
49
+ 3. If no override, look up agent in profile table
50
+ 4. Pass model parameter to Task call
51
+ ```
52
+
53
+ ## Per-Agent Overrides
54
+
55
+ Override specific agents without changing the entire profile:
56
+
57
+ ```json
58
+ {
59
+ "model_profile": "balanced",
60
+ "model_overrides": {
61
+ "dgs-executor": "opus",
62
+ "dgs-planner": "haiku"
63
+ }
64
+ }
65
+ ```
66
+
67
+ Overrides take precedence over the profile. Valid values: `opus`, `sonnet`, `haiku`.
68
+
69
+ ## Switching Profiles
70
+
71
+ Runtime: `/dgs:set-profile <profile>`
72
+
73
+ Per-project default: Set in `dgs.config.json`:
74
+ ```json
75
+ {
76
+ "model_profile": "balanced"
77
+ }
78
+ ```
79
+
80
+ ## Design Rationale
81
+
82
+ **Why Opus for dgs-planner?**
83
+ Planning involves architecture decisions, goal decomposition, and task design. This is where model quality has the highest impact.
84
+
85
+ **Why Sonnet for dgs-executor?**
86
+ Executors follow explicit PLAN.md instructions. The plan already contains the reasoning; execution is implementation.
87
+
88
+ **Why Sonnet (not Haiku) for verifiers in balanced?**
89
+ Verification requires goal-backward reasoning - checking if code *delivers* what the phase promised, not just pattern matching. Sonnet handles this well; Haiku may miss subtle gaps.
90
+
91
+ **Why Haiku for dgs-codebase-mapper?**
92
+ Read-only exploration and pattern extraction. No reasoning required, just structured output from file contents.
93
+
94
+ **Why `inherit` instead of passing `opus` directly?**
95
+ Claude Code's `"opus"` alias maps to a specific model version. Organizations may block older opus versions while allowing newer ones. DGS returns `"inherit"` for opus-tier agents, causing them to use whatever opus version the user has configured in their session. This avoids version conflicts and silent fallbacks to Sonnet.
@@ -0,0 +1,61 @@
1
+ # Phase Argument Parsing
2
+
3
+ Parse and normalize phase arguments for commands that operate on phases.
4
+
5
+ ## Extraction
6
+
7
+ From `$ARGUMENTS`:
8
+ - Extract phase number (first numeric argument)
9
+ - Extract flags (prefixed with `--`)
10
+ - Remaining text is description (for insert/add commands)
11
+
12
+ ## Using dgs-tools
13
+
14
+ The `find-phase` command handles normalization and validation in one step:
15
+
16
+ ```bash
17
+ PHASE_INFO=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" find-phase "${PHASE}")
18
+ ```
19
+
20
+ Returns JSON with:
21
+ - `found`: true/false
22
+ - `directory`: Full path to phase directory
23
+ - `phase_number`: Normalized number (e.g., "06", "06.1")
24
+ - `phase_name`: Name portion (e.g., "foundation")
25
+ - `plans`: Array of PLAN.md files
26
+ - `summaries`: Array of SUMMARY.md files
27
+
28
+ ## Manual Normalization (Legacy)
29
+
30
+ Zero-pad integer phases to 2 digits. Preserve decimal suffixes.
31
+
32
+ ```bash
33
+ # Normalize phase number
34
+ if [[ "$PHASE" =~ ^[0-9]+$ ]]; then
35
+ # Integer: 8 → 08
36
+ PHASE=$(printf "%02d" "$PHASE")
37
+ elif [[ "$PHASE" =~ ^([0-9]+)\.([0-9]+)$ ]]; then
38
+ # Decimal: 2.1 → 02.1
39
+ PHASE=$(printf "%02d.%s" "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}")
40
+ fi
41
+ ```
42
+
43
+ ## Validation
44
+
45
+ Use `roadmap get-phase` to validate phase exists:
46
+
47
+ ```bash
48
+ PHASE_CHECK=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" roadmap get-phase "${PHASE}")
49
+ if [ "$(printf '%s\n' "$PHASE_CHECK" | jq -r '.found')" = "false" ]; then
50
+ echo "ERROR: Phase ${PHASE} not found in roadmap"
51
+ exit 1
52
+ fi
53
+ ```
54
+
55
+ ## Directory Lookup
56
+
57
+ Use `find-phase` for directory lookup:
58
+
59
+ ```bash
60
+ PHASE_DIR=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" find-phase "${PHASE}" --raw)
61
+ ```