gsd-code-first 1.0.0

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 (238) hide show
  1. package/LICENSE +21 -0
  2. package/README.ja-JP.md +834 -0
  3. package/README.ko-KR.md +823 -0
  4. package/README.md +937 -0
  5. package/README.pt-BR.md +452 -0
  6. package/README.zh-CN.md +800 -0
  7. package/agents/gsd-advisor-researcher.md +104 -0
  8. package/agents/gsd-annotator.md +148 -0
  9. package/agents/gsd-arc-executor.md +537 -0
  10. package/agents/gsd-arc-planner.md +374 -0
  11. package/agents/gsd-assumptions-analyzer.md +105 -0
  12. package/agents/gsd-code-planner.md +155 -0
  13. package/agents/gsd-codebase-mapper.md +770 -0
  14. package/agents/gsd-debugger.md +1373 -0
  15. package/agents/gsd-executor.md +509 -0
  16. package/agents/gsd-integration-checker.md +443 -0
  17. package/agents/gsd-nyquist-auditor.md +176 -0
  18. package/agents/gsd-phase-researcher.md +698 -0
  19. package/agents/gsd-plan-checker.md +773 -0
  20. package/agents/gsd-planner.md +1354 -0
  21. package/agents/gsd-project-researcher.md +654 -0
  22. package/agents/gsd-prototyper.md +161 -0
  23. package/agents/gsd-research-synthesizer.md +247 -0
  24. package/agents/gsd-roadmapper.md +679 -0
  25. package/agents/gsd-ui-auditor.md +439 -0
  26. package/agents/gsd-ui-checker.md +300 -0
  27. package/agents/gsd-ui-researcher.md +357 -0
  28. package/agents/gsd-user-profiler.md +171 -0
  29. package/agents/gsd-verifier.md +700 -0
  30. package/bin/install.js +5009 -0
  31. package/commands/gsd/add-backlog.md +76 -0
  32. package/commands/gsd/add-phase.md +43 -0
  33. package/commands/gsd/add-tests.md +41 -0
  34. package/commands/gsd/add-todo.md +47 -0
  35. package/commands/gsd/annotate.md +54 -0
  36. package/commands/gsd/audit-milestone.md +36 -0
  37. package/commands/gsd/audit-uat.md +24 -0
  38. package/commands/gsd/autonomous.md +41 -0
  39. package/commands/gsd/check-todos.md +45 -0
  40. package/commands/gsd/cleanup.md +18 -0
  41. package/commands/gsd/complete-milestone.md +136 -0
  42. package/commands/gsd/debug.md +173 -0
  43. package/commands/gsd/deep-plan.md +52 -0
  44. package/commands/gsd/discuss-phase.md +64 -0
  45. package/commands/gsd/do.md +30 -0
  46. package/commands/gsd/execute-phase.md +59 -0
  47. package/commands/gsd/extract-plan.md +35 -0
  48. package/commands/gsd/fast.md +30 -0
  49. package/commands/gsd/forensics.md +56 -0
  50. package/commands/gsd/health.md +22 -0
  51. package/commands/gsd/help.md +22 -0
  52. package/commands/gsd/insert-phase.md +32 -0
  53. package/commands/gsd/iterate.md +124 -0
  54. package/commands/gsd/join-discord.md +18 -0
  55. package/commands/gsd/list-phase-assumptions.md +46 -0
  56. package/commands/gsd/list-workspaces.md +19 -0
  57. package/commands/gsd/manager.md +39 -0
  58. package/commands/gsd/map-codebase.md +71 -0
  59. package/commands/gsd/milestone-summary.md +51 -0
  60. package/commands/gsd/new-milestone.md +44 -0
  61. package/commands/gsd/new-project.md +42 -0
  62. package/commands/gsd/new-workspace.md +44 -0
  63. package/commands/gsd/next.md +24 -0
  64. package/commands/gsd/note.md +34 -0
  65. package/commands/gsd/pause-work.md +38 -0
  66. package/commands/gsd/plan-milestone-gaps.md +34 -0
  67. package/commands/gsd/plan-phase.md +47 -0
  68. package/commands/gsd/plant-seed.md +28 -0
  69. package/commands/gsd/pr-branch.md +25 -0
  70. package/commands/gsd/profile-user.md +46 -0
  71. package/commands/gsd/progress.md +24 -0
  72. package/commands/gsd/prototype.md +56 -0
  73. package/commands/gsd/quick.md +47 -0
  74. package/commands/gsd/reapply-patches.md +123 -0
  75. package/commands/gsd/remove-phase.md +31 -0
  76. package/commands/gsd/remove-workspace.md +26 -0
  77. package/commands/gsd/research-phase.md +195 -0
  78. package/commands/gsd/resume-work.md +40 -0
  79. package/commands/gsd/review-backlog.md +61 -0
  80. package/commands/gsd/review.md +37 -0
  81. package/commands/gsd/session-report.md +19 -0
  82. package/commands/gsd/set-mode.md +41 -0
  83. package/commands/gsd/set-profile.md +12 -0
  84. package/commands/gsd/settings.md +36 -0
  85. package/commands/gsd/ship.md +23 -0
  86. package/commands/gsd/stats.md +18 -0
  87. package/commands/gsd/thread.md +127 -0
  88. package/commands/gsd/ui-phase.md +34 -0
  89. package/commands/gsd/ui-review.md +32 -0
  90. package/commands/gsd/update.md +37 -0
  91. package/commands/gsd/validate-phase.md +35 -0
  92. package/commands/gsd/verify-work.md +38 -0
  93. package/commands/gsd/workstreams.md +63 -0
  94. package/get-shit-done/bin/gsd-tools.cjs +946 -0
  95. package/get-shit-done/bin/lib/arc-scanner.cjs +341 -0
  96. package/get-shit-done/bin/lib/commands.cjs +959 -0
  97. package/get-shit-done/bin/lib/config.cjs +466 -0
  98. package/get-shit-done/bin/lib/core.cjs +1230 -0
  99. package/get-shit-done/bin/lib/frontmatter.cjs +336 -0
  100. package/get-shit-done/bin/lib/init.cjs +1442 -0
  101. package/get-shit-done/bin/lib/milestone.cjs +252 -0
  102. package/get-shit-done/bin/lib/model-profiles.cjs +68 -0
  103. package/get-shit-done/bin/lib/phase.cjs +888 -0
  104. package/get-shit-done/bin/lib/profile-output.cjs +952 -0
  105. package/get-shit-done/bin/lib/profile-pipeline.cjs +539 -0
  106. package/get-shit-done/bin/lib/roadmap.cjs +329 -0
  107. package/get-shit-done/bin/lib/security.cjs +382 -0
  108. package/get-shit-done/bin/lib/state.cjs +1031 -0
  109. package/get-shit-done/bin/lib/template.cjs +222 -0
  110. package/get-shit-done/bin/lib/uat.cjs +282 -0
  111. package/get-shit-done/bin/lib/verify.cjs +888 -0
  112. package/get-shit-done/bin/lib/workstream.cjs +491 -0
  113. package/get-shit-done/commands/gsd/workstreams.md +63 -0
  114. package/get-shit-done/references/arc-standard.md +315 -0
  115. package/get-shit-done/references/checkpoints.md +778 -0
  116. package/get-shit-done/references/continuation-format.md +249 -0
  117. package/get-shit-done/references/decimal-phase-calculation.md +64 -0
  118. package/get-shit-done/references/git-integration.md +295 -0
  119. package/get-shit-done/references/git-planning-commit.md +38 -0
  120. package/get-shit-done/references/model-profile-resolution.md +36 -0
  121. package/get-shit-done/references/model-profiles.md +139 -0
  122. package/get-shit-done/references/phase-argument-parsing.md +61 -0
  123. package/get-shit-done/references/planning-config.md +202 -0
  124. package/get-shit-done/references/questioning.md +162 -0
  125. package/get-shit-done/references/tdd.md +263 -0
  126. package/get-shit-done/references/ui-brand.md +160 -0
  127. package/get-shit-done/references/user-profiling.md +681 -0
  128. package/get-shit-done/references/verification-patterns.md +612 -0
  129. package/get-shit-done/references/workstream-flag.md +58 -0
  130. package/get-shit-done/templates/DEBUG.md +164 -0
  131. package/get-shit-done/templates/UAT.md +265 -0
  132. package/get-shit-done/templates/UI-SPEC.md +100 -0
  133. package/get-shit-done/templates/VALIDATION.md +76 -0
  134. package/get-shit-done/templates/claude-md.md +122 -0
  135. package/get-shit-done/templates/codebase/architecture.md +255 -0
  136. package/get-shit-done/templates/codebase/concerns.md +310 -0
  137. package/get-shit-done/templates/codebase/conventions.md +307 -0
  138. package/get-shit-done/templates/codebase/integrations.md +280 -0
  139. package/get-shit-done/templates/codebase/stack.md +186 -0
  140. package/get-shit-done/templates/codebase/structure.md +285 -0
  141. package/get-shit-done/templates/codebase/testing.md +480 -0
  142. package/get-shit-done/templates/config.json +44 -0
  143. package/get-shit-done/templates/context.md +352 -0
  144. package/get-shit-done/templates/continue-here.md +78 -0
  145. package/get-shit-done/templates/copilot-instructions.md +7 -0
  146. package/get-shit-done/templates/debug-subagent-prompt.md +91 -0
  147. package/get-shit-done/templates/dev-preferences.md +21 -0
  148. package/get-shit-done/templates/discovery.md +146 -0
  149. package/get-shit-done/templates/discussion-log.md +63 -0
  150. package/get-shit-done/templates/milestone-archive.md +123 -0
  151. package/get-shit-done/templates/milestone.md +115 -0
  152. package/get-shit-done/templates/phase-prompt.md +610 -0
  153. package/get-shit-done/templates/planner-subagent-prompt.md +117 -0
  154. package/get-shit-done/templates/project.md +186 -0
  155. package/get-shit-done/templates/requirements.md +231 -0
  156. package/get-shit-done/templates/research-project/ARCHITECTURE.md +204 -0
  157. package/get-shit-done/templates/research-project/FEATURES.md +147 -0
  158. package/get-shit-done/templates/research-project/PITFALLS.md +200 -0
  159. package/get-shit-done/templates/research-project/STACK.md +120 -0
  160. package/get-shit-done/templates/research-project/SUMMARY.md +170 -0
  161. package/get-shit-done/templates/research.md +552 -0
  162. package/get-shit-done/templates/retrospective.md +54 -0
  163. package/get-shit-done/templates/roadmap.md +202 -0
  164. package/get-shit-done/templates/state.md +176 -0
  165. package/get-shit-done/templates/summary-complex.md +59 -0
  166. package/get-shit-done/templates/summary-minimal.md +41 -0
  167. package/get-shit-done/templates/summary-standard.md +48 -0
  168. package/get-shit-done/templates/summary.md +248 -0
  169. package/get-shit-done/templates/user-profile.md +146 -0
  170. package/get-shit-done/templates/user-setup.md +311 -0
  171. package/get-shit-done/templates/verification-report.md +322 -0
  172. package/get-shit-done/workflows/add-phase.md +112 -0
  173. package/get-shit-done/workflows/add-tests.md +351 -0
  174. package/get-shit-done/workflows/add-todo.md +158 -0
  175. package/get-shit-done/workflows/audit-milestone.md +340 -0
  176. package/get-shit-done/workflows/audit-uat.md +109 -0
  177. package/get-shit-done/workflows/autonomous.md +891 -0
  178. package/get-shit-done/workflows/check-todos.md +177 -0
  179. package/get-shit-done/workflows/cleanup.md +152 -0
  180. package/get-shit-done/workflows/complete-milestone.md +767 -0
  181. package/get-shit-done/workflows/diagnose-issues.md +231 -0
  182. package/get-shit-done/workflows/discovery-phase.md +289 -0
  183. package/get-shit-done/workflows/discuss-phase-assumptions.md +653 -0
  184. package/get-shit-done/workflows/discuss-phase.md +1049 -0
  185. package/get-shit-done/workflows/do.md +104 -0
  186. package/get-shit-done/workflows/execute-phase.md +846 -0
  187. package/get-shit-done/workflows/execute-plan.md +514 -0
  188. package/get-shit-done/workflows/fast.md +105 -0
  189. package/get-shit-done/workflows/forensics.md +265 -0
  190. package/get-shit-done/workflows/health.md +181 -0
  191. package/get-shit-done/workflows/help.md +634 -0
  192. package/get-shit-done/workflows/insert-phase.md +130 -0
  193. package/get-shit-done/workflows/list-phase-assumptions.md +178 -0
  194. package/get-shit-done/workflows/list-workspaces.md +56 -0
  195. package/get-shit-done/workflows/manager.md +362 -0
  196. package/get-shit-done/workflows/map-codebase.md +377 -0
  197. package/get-shit-done/workflows/milestone-summary.md +223 -0
  198. package/get-shit-done/workflows/new-milestone.md +486 -0
  199. package/get-shit-done/workflows/new-project.md +1250 -0
  200. package/get-shit-done/workflows/new-workspace.md +237 -0
  201. package/get-shit-done/workflows/next.md +97 -0
  202. package/get-shit-done/workflows/node-repair.md +92 -0
  203. package/get-shit-done/workflows/note.md +156 -0
  204. package/get-shit-done/workflows/pause-work.md +176 -0
  205. package/get-shit-done/workflows/plan-milestone-gaps.md +273 -0
  206. package/get-shit-done/workflows/plan-phase.md +859 -0
  207. package/get-shit-done/workflows/plant-seed.md +169 -0
  208. package/get-shit-done/workflows/pr-branch.md +129 -0
  209. package/get-shit-done/workflows/profile-user.md +450 -0
  210. package/get-shit-done/workflows/progress.md +507 -0
  211. package/get-shit-done/workflows/quick.md +757 -0
  212. package/get-shit-done/workflows/remove-phase.md +155 -0
  213. package/get-shit-done/workflows/remove-workspace.md +90 -0
  214. package/get-shit-done/workflows/research-phase.md +82 -0
  215. package/get-shit-done/workflows/resume-project.md +326 -0
  216. package/get-shit-done/workflows/review.md +228 -0
  217. package/get-shit-done/workflows/session-report.md +146 -0
  218. package/get-shit-done/workflows/settings.md +283 -0
  219. package/get-shit-done/workflows/ship.md +228 -0
  220. package/get-shit-done/workflows/stats.md +60 -0
  221. package/get-shit-done/workflows/transition.md +671 -0
  222. package/get-shit-done/workflows/ui-phase.md +302 -0
  223. package/get-shit-done/workflows/ui-review.md +165 -0
  224. package/get-shit-done/workflows/update.md +323 -0
  225. package/get-shit-done/workflows/validate-phase.md +174 -0
  226. package/get-shit-done/workflows/verify-phase.md +254 -0
  227. package/get-shit-done/workflows/verify-work.md +637 -0
  228. package/hooks/dist/gsd-check-update.js +114 -0
  229. package/hooks/dist/gsd-context-monitor.js +156 -0
  230. package/hooks/dist/gsd-prompt-guard.js +96 -0
  231. package/hooks/dist/gsd-statusline.js +119 -0
  232. package/hooks/dist/gsd-workflow-guard.js +94 -0
  233. package/package.json +52 -0
  234. package/scripts/base64-scan.sh +262 -0
  235. package/scripts/build-hooks.js +82 -0
  236. package/scripts/prompt-injection-scan.sh +198 -0
  237. package/scripts/run-tests.cjs +29 -0
  238. package/scripts/secret-scan.sh +227 -0
@@ -0,0 +1,637 @@
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 /gsd:plan-phase --gaps.
3
+
4
+ User tests, Claude records. One test at a time. Plain text responses.
5
+ </purpose>
6
+
7
+ <available_agent_types>
8
+ Valid GSD subagent types (use exact names — do not fall back to 'general-purpose'):
9
+ - gsd-planner — Creates detailed plans from phase scope
10
+ - gsd-plan-checker — Reviews plan quality before execution
11
+ </available_agent_types>
12
+
13
+ <philosophy>
14
+ **Show expected, ask if reality matches.**
15
+
16
+ Claude presents what SHOULD happen. User confirms or describes what's different.
17
+ - "yes" / "y" / "next" / empty → pass
18
+ - Anything else → logged as issue, severity inferred
19
+
20
+ No Pass/Fail buttons. No severity questions. Just: "Here's what should happen. Does it?"
21
+ </philosophy>
22
+
23
+ <template>
24
+ @~/.claude/get-shit-done/templates/UAT.md
25
+ </template>
26
+
27
+ <process>
28
+
29
+ <step name="initialize" priority="first">
30
+ If $ARGUMENTS contains a phase number, load context:
31
+
32
+ ```bash
33
+ INIT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" init verify-work "${PHASE_ARG}")
34
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
35
+ AGENT_SKILLS_PLANNER=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" agent-skills gsd-planner 2>/dev/null)
36
+ AGENT_SKILLS_CHECKER=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" agent-skills gsd-checker 2>/dev/null)
37
+ ```
38
+
39
+ Parse JSON for: `planner_model`, `checker_model`, `commit_docs`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `has_verification`, `uat_path`.
40
+ </step>
41
+
42
+ <step name="check_active_session">
43
+ **First: Check for active UAT sessions**
44
+
45
+ ```bash
46
+ (find .planning/phases -name "*-UAT.md" -type f 2>/dev/null || true) | head -5
47
+ ```
48
+
49
+ **If active sessions exist AND no $ARGUMENTS provided:**
50
+
51
+ Read each file's frontmatter (status, phase) and Current Test section.
52
+
53
+ Display inline:
54
+
55
+ ```
56
+ ## Active UAT Sessions
57
+
58
+ | # | Phase | Status | Current Test | Progress |
59
+ |---|-------|--------|--------------|----------|
60
+ | 1 | 04-comments | testing | 3. Reply to Comment | 2/6 |
61
+ | 2 | 05-auth | testing | 1. Login Form | 0/4 |
62
+
63
+ Reply with a number to resume, or provide a phase number to start new.
64
+ ```
65
+
66
+ Wait for user response.
67
+
68
+ - If user replies with number (1, 2) → Load that file, go to `resume_from_file`
69
+ - If user replies with phase number → Treat as new session, go to `create_uat_file`
70
+
71
+ **If active sessions exist AND $ARGUMENTS provided:**
72
+
73
+ Check if session exists for that phase. If yes, offer to resume or restart.
74
+ If no, continue to `create_uat_file`.
75
+
76
+ **If no active sessions AND no $ARGUMENTS:**
77
+
78
+ ```
79
+ No active UAT sessions.
80
+
81
+ Provide a phase number to start testing (e.g., /gsd:verify-work 4)
82
+ ```
83
+
84
+ **If no active sessions AND $ARGUMENTS provided:**
85
+
86
+ Continue to `create_uat_file`.
87
+ </step>
88
+
89
+ <step name="find_summaries">
90
+ **Find what to test:**
91
+
92
+ Use `phase_dir` from init (or run init if not already done).
93
+
94
+ ```bash
95
+ ls "$phase_dir"/*-SUMMARY.md 2>/dev/null || true
96
+ ```
97
+
98
+ Read each SUMMARY.md to extract testable deliverables.
99
+ </step>
100
+
101
+ <step name="extract_tests">
102
+ **Extract testable deliverables from SUMMARY.md:**
103
+
104
+ Parse for:
105
+ 1. **Accomplishments** - Features/functionality added
106
+ 2. **User-facing changes** - UI, workflows, interactions
107
+
108
+ Focus on USER-OBSERVABLE outcomes, not implementation details.
109
+
110
+ For each deliverable, create a test:
111
+ - name: Brief test name
112
+ - expected: What the user should see/experience (specific, observable)
113
+
114
+ Examples:
115
+ - Accomplishment: "Added comment threading with infinite nesting"
116
+ → Test: "Reply to a Comment"
117
+ → Expected: "Clicking Reply opens inline composer below comment. Submitting shows reply nested under parent with visual indentation."
118
+
119
+ Skip internal/non-observable items (refactors, type changes, etc.).
120
+
121
+ **Cold-start smoke test injection:**
122
+
123
+ After extracting tests from SUMMARYs, scan the SUMMARY files for modified/created file paths. If ANY path matches these patterns:
124
+
125
+ `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*`
126
+
127
+ Then **prepend** this test to the test list:
128
+
129
+ - name: "Cold Start Smoke Test"
130
+ - 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."
131
+
132
+ 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.
133
+ </step>
134
+
135
+ <step name="create_uat_file">
136
+ **Create UAT file with all tests:**
137
+
138
+ ```bash
139
+ mkdir -p "$PHASE_DIR"
140
+ ```
141
+
142
+ Build test list from extracted deliverables.
143
+
144
+ Create file:
145
+
146
+ ```markdown
147
+ ---
148
+ status: testing
149
+ phase: XX-name
150
+ source: [list of SUMMARY.md files]
151
+ started: [ISO timestamp]
152
+ updated: [ISO timestamp]
153
+ ---
154
+
155
+ ## Current Test
156
+ <!-- OVERWRITE each test - shows where we are -->
157
+
158
+ number: 1
159
+ name: [first test name]
160
+ expected: |
161
+ [what user should observe]
162
+ awaiting: user response
163
+
164
+ ## Tests
165
+
166
+ ### 1. [Test Name]
167
+ expected: [observable behavior]
168
+ result: [pending]
169
+
170
+ ### 2. [Test Name]
171
+ expected: [observable behavior]
172
+ result: [pending]
173
+
174
+ ...
175
+
176
+ ## Summary
177
+
178
+ total: [N]
179
+ passed: 0
180
+ issues: 0
181
+ pending: [N]
182
+ skipped: 0
183
+
184
+ ## Gaps
185
+
186
+ [none yet]
187
+ ```
188
+
189
+ Write to `.planning/phases/XX-name/{phase_num}-UAT.md`
190
+
191
+ Proceed to `present_test`.
192
+ </step>
193
+
194
+ <step name="present_test">
195
+ **Present current test to user:**
196
+
197
+ Render the checkpoint from the structured UAT file instead of composing it freehand:
198
+
199
+ ```bash
200
+ CHECKPOINT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" uat render-checkpoint --file "$uat_path" --raw)
201
+ if [[ "$CHECKPOINT" == @file:* ]]; then CHECKPOINT=$(cat "${CHECKPOINT#@file:}"); fi
202
+ ```
203
+
204
+ Display the returned checkpoint EXACTLY as-is:
205
+
206
+ ```
207
+ {CHECKPOINT}
208
+ ```
209
+
210
+ **Critical response hygiene:**
211
+ - Your entire response MUST equal `{CHECKPOINT}` byte-for-byte.
212
+ - Do NOT add commentary before or after the block.
213
+ - If you notice protocol/meta markers such as `to=all:`, role-routing text, XML system tags, hidden instruction markers, ad copy, or any unrelated suffix, discard the draft and output `{CHECKPOINT}` only.
214
+
215
+ Wait for user response (plain text, no AskUserQuestion).
216
+ </step>
217
+
218
+ <step name="process_response">
219
+ **Process user response and update file:**
220
+
221
+ **If response indicates pass:**
222
+ - Empty response, "yes", "y", "ok", "pass", "next", "approved", "✓"
223
+
224
+ Update Tests section:
225
+ ```
226
+ ### {N}. {name}
227
+ expected: {expected}
228
+ result: pass
229
+ ```
230
+
231
+ **If response indicates skip:**
232
+ - "skip", "can't test", "n/a"
233
+
234
+ Update Tests section:
235
+ ```
236
+ ### {N}. {name}
237
+ expected: {expected}
238
+ result: skipped
239
+ reason: [user's reason if provided]
240
+ ```
241
+
242
+ **If response indicates blocked:**
243
+ - "blocked", "can't test - server not running", "need physical device", "need release build"
244
+ - Or any response containing: "server", "blocked", "not running", "physical device", "release build"
245
+
246
+ Infer blocked_by tag from response:
247
+ - Contains: server, not running, gateway, API → `server`
248
+ - Contains: physical, device, hardware, real phone → `physical-device`
249
+ - Contains: release, preview, build, EAS → `release-build`
250
+ - Contains: stripe, twilio, third-party, configure → `third-party`
251
+ - Contains: depends on, prior phase, prerequisite → `prior-phase`
252
+ - Default: `other`
253
+
254
+ Update Tests section:
255
+ ```
256
+ ### {N}. {name}
257
+ expected: {expected}
258
+ result: blocked
259
+ blocked_by: {inferred tag}
260
+ reason: "{verbatim user response}"
261
+ ```
262
+
263
+ Note: Blocked tests do NOT go into the Gaps section (they aren't code issues — they're prerequisite gates).
264
+
265
+ **If response is anything else:**
266
+ - Treat as issue description
267
+
268
+ Infer severity from description:
269
+ - Contains: crash, error, exception, fails, broken, unusable → blocker
270
+ - Contains: doesn't work, wrong, missing, can't → major
271
+ - Contains: slow, weird, off, minor, small → minor
272
+ - Contains: color, font, spacing, alignment, visual → cosmetic
273
+ - Default if unclear: major
274
+
275
+ Update Tests section:
276
+ ```
277
+ ### {N}. {name}
278
+ expected: {expected}
279
+ result: issue
280
+ reported: "{verbatim user response}"
281
+ severity: {inferred}
282
+ ```
283
+
284
+ Append to Gaps section (structured YAML for plan-phase --gaps):
285
+ ```yaml
286
+ - truth: "{expected behavior from test}"
287
+ status: failed
288
+ reason: "User reported: {verbatim user response}"
289
+ severity: {inferred}
290
+ test: {N}
291
+ artifacts: [] # Filled by diagnosis
292
+ missing: [] # Filled by diagnosis
293
+ ```
294
+
295
+ **After any response:**
296
+
297
+ Update Summary counts.
298
+ Update frontmatter.updated timestamp.
299
+
300
+ If more tests remain → Update Current Test, go to `present_test`
301
+ If no more tests → Go to `complete_session`
302
+ </step>
303
+
304
+ <step name="resume_from_file">
305
+ **Resume testing from UAT file:**
306
+
307
+ Read the full UAT file.
308
+
309
+ Find first test with `result: [pending]`.
310
+
311
+ Announce:
312
+ ```
313
+ Resuming: Phase {phase} UAT
314
+ Progress: {passed + issues + skipped}/{total}
315
+ Issues found so far: {issues count}
316
+
317
+ Continuing from Test {N}...
318
+ ```
319
+
320
+ Update Current Test section with the pending test.
321
+ Proceed to `present_test`.
322
+ </step>
323
+
324
+ <step name="complete_session">
325
+ **Complete testing and commit:**
326
+
327
+ **Determine final status:**
328
+
329
+ Count results:
330
+ - `pending_count`: tests with `result: [pending]`
331
+ - `blocked_count`: tests with `result: blocked`
332
+ - `skipped_no_reason`: tests with `result: skipped` and no `reason` field
333
+
334
+ ```
335
+ if pending_count > 0 OR blocked_count > 0 OR skipped_no_reason > 0:
336
+ status: partial
337
+ # Session ended but not all tests resolved
338
+ else:
339
+ status: complete
340
+ # All tests have a definitive result (pass, issue, or skipped-with-reason)
341
+ ```
342
+
343
+ Update frontmatter:
344
+ - status: {computed status}
345
+ - updated: [now]
346
+
347
+ Clear Current Test section:
348
+ ```
349
+ ## Current Test
350
+
351
+ [testing complete]
352
+ ```
353
+
354
+ Commit the UAT file:
355
+ ```bash
356
+ node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "test({phase_num}): complete UAT - {passed} passed, {issues} issues" --files ".planning/phases/XX-name/{phase_num}-UAT.md"
357
+ ```
358
+
359
+ Present summary:
360
+ ```
361
+ ## UAT Complete: Phase {phase}
362
+
363
+ | Result | Count |
364
+ |--------|-------|
365
+ | Passed | {N} |
366
+ | Issues | {N} |
367
+ | Skipped| {N} |
368
+
369
+ [If issues > 0:]
370
+ ### Issues Found
371
+
372
+ [List from Issues section]
373
+ ```
374
+
375
+ **If issues > 0:** Proceed to `diagnose_issues`
376
+
377
+ **If issues == 0:**
378
+ ```
379
+ All tests passed. Ready to continue.
380
+
381
+ - `/gsd:plan-phase {next}` — Plan next phase
382
+ - `/gsd:execute-phase {next}` — Execute next phase
383
+ - `/gsd:ui-review {phase}` — visual quality audit (if frontend files were modified)
384
+ ```
385
+ </step>
386
+
387
+ <step name="diagnose_issues">
388
+ **Diagnose root causes before planning fixes:**
389
+
390
+ ```
391
+ ---
392
+
393
+ {N} issues found. Diagnosing root causes...
394
+
395
+ Spawning parallel debug agents to investigate each issue.
396
+ ```
397
+
398
+ - Load diagnose-issues workflow
399
+ - Follow @~/.claude/get-shit-done/workflows/diagnose-issues.md
400
+ - Spawn parallel debug agents for each issue
401
+ - Collect root causes
402
+ - Update UAT.md with root causes
403
+ - Proceed to `plan_gap_closure`
404
+
405
+ Diagnosis runs automatically - no user prompt. Parallel agents investigate simultaneously, so overhead is minimal and fixes are more accurate.
406
+ </step>
407
+
408
+ <step name="plan_gap_closure">
409
+ **Auto-plan fixes from diagnosed gaps:**
410
+
411
+ Display:
412
+ ```
413
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
414
+ GSD ► PLANNING FIXES
415
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
416
+
417
+ ◆ Spawning planner for gap closure...
418
+ ```
419
+
420
+ Spawn gsd-planner in --gaps mode:
421
+
422
+ ```
423
+ Task(
424
+ prompt="""
425
+ <planning_context>
426
+
427
+ **Phase:** {phase_number}
428
+ **Mode:** gap_closure
429
+
430
+ <files_to_read>
431
+ - {phase_dir}/{phase_num}-UAT.md (UAT with diagnoses)
432
+ - .planning/STATE.md (Project State)
433
+ - .planning/ROADMAP.md (Roadmap)
434
+ </files_to_read>
435
+
436
+ ${AGENT_SKILLS_PLANNER}
437
+
438
+ </planning_context>
439
+
440
+ <downstream_consumer>
441
+ Output consumed by /gsd:execute-phase
442
+ Plans must be executable prompts.
443
+ </downstream_consumer>
444
+ """,
445
+ subagent_type="gsd-planner",
446
+ model="{planner_model}",
447
+ description="Plan gap fixes for Phase {phase}"
448
+ )
449
+ ```
450
+
451
+ On return:
452
+ - **PLANNING COMPLETE:** Proceed to `verify_gap_plans`
453
+ - **PLANNING INCONCLUSIVE:** Report and offer manual intervention
454
+ </step>
455
+
456
+ <step name="verify_gap_plans">
457
+ **Verify fix plans with checker:**
458
+
459
+ Display:
460
+ ```
461
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
462
+ GSD ► VERIFYING FIX PLANS
463
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
464
+
465
+ ◆ Spawning plan checker...
466
+ ```
467
+
468
+ Initialize: `iteration_count = 1`
469
+
470
+ Spawn gsd-plan-checker:
471
+
472
+ ```
473
+ Task(
474
+ prompt="""
475
+ <verification_context>
476
+
477
+ **Phase:** {phase_number}
478
+ **Phase Goal:** Close diagnosed gaps from UAT
479
+
480
+ <files_to_read>
481
+ - {phase_dir}/*-PLAN.md (Plans to verify)
482
+ </files_to_read>
483
+
484
+ ${AGENT_SKILLS_CHECKER}
485
+
486
+ </verification_context>
487
+
488
+ <expected_output>
489
+ Return one of:
490
+ - ## VERIFICATION PASSED — all checks pass
491
+ - ## ISSUES FOUND — structured issue list
492
+ </expected_output>
493
+ """,
494
+ subagent_type="gsd-plan-checker",
495
+ model="{checker_model}",
496
+ description="Verify Phase {phase} fix plans"
497
+ )
498
+ ```
499
+
500
+ On return:
501
+ - **VERIFICATION PASSED:** Proceed to `present_ready`
502
+ - **ISSUES FOUND:** Proceed to `revision_loop`
503
+ </step>
504
+
505
+ <step name="revision_loop">
506
+ **Iterate planner ↔ checker until plans pass (max 3):**
507
+
508
+ **If iteration_count < 3:**
509
+
510
+ Display: `Sending back to planner for revision... (iteration {N}/3)`
511
+
512
+ Spawn gsd-planner with revision context:
513
+
514
+ ```
515
+ Task(
516
+ prompt="""
517
+ <revision_context>
518
+
519
+ **Phase:** {phase_number}
520
+ **Mode:** revision
521
+
522
+ <files_to_read>
523
+ - {phase_dir}/*-PLAN.md (Existing plans)
524
+ </files_to_read>
525
+
526
+ ${AGENT_SKILLS_PLANNER}
527
+
528
+ **Checker issues:**
529
+ {structured_issues_from_checker}
530
+
531
+ </revision_context>
532
+
533
+ <instructions>
534
+ Read existing PLAN.md files. Make targeted updates to address checker issues.
535
+ Do NOT replan from scratch unless issues are fundamental.
536
+ </instructions>
537
+ """,
538
+ subagent_type="gsd-planner",
539
+ model="{planner_model}",
540
+ description="Revise Phase {phase} plans"
541
+ )
542
+ ```
543
+
544
+ After planner returns → spawn checker again (verify_gap_plans logic)
545
+ Increment iteration_count
546
+
547
+ **If iteration_count >= 3:**
548
+
549
+ Display: `Max iterations reached. {N} issues remain.`
550
+
551
+ Offer options:
552
+ 1. Force proceed (execute despite issues)
553
+ 2. Provide guidance (user gives direction, retry)
554
+ 3. Abandon (exit, user runs /gsd:plan-phase manually)
555
+
556
+ Wait for user response.
557
+ </step>
558
+
559
+ <step name="present_ready">
560
+ **Present completion and next steps:**
561
+
562
+ ```
563
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
564
+ GSD ► FIXES READY ✓
565
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
566
+
567
+ **Phase {X}: {Name}** — {N} gap(s) diagnosed, {M} fix plan(s) created
568
+
569
+ | Gap | Root Cause | Fix Plan |
570
+ |-----|------------|----------|
571
+ | {truth 1} | {root_cause} | {phase}-04 |
572
+ | {truth 2} | {root_cause} | {phase}-04 |
573
+
574
+ Plans verified and ready for execution.
575
+
576
+ ───────────────────────────────────────────────────────────────
577
+
578
+ ## ▶ Next Up
579
+
580
+ **Execute fixes** — run fix plans
581
+
582
+ `/clear` then `/gsd:execute-phase {phase} --gaps-only`
583
+
584
+ ───────────────────────────────────────────────────────────────
585
+ ```
586
+ </step>
587
+
588
+ </process>
589
+
590
+ <update_rules>
591
+ **Batched writes for efficiency:**
592
+
593
+ Keep results in memory. Write to file only when:
594
+ 1. **Issue found** — Preserve the problem immediately
595
+ 2. **Session complete** — Final write before commit
596
+ 3. **Checkpoint** — Every 5 passed tests (safety net)
597
+
598
+ | Section | Rule | When Written |
599
+ |---------|------|--------------|
600
+ | Frontmatter.status | OVERWRITE | Start, complete |
601
+ | Frontmatter.updated | OVERWRITE | On any file write |
602
+ | Current Test | OVERWRITE | On any file write |
603
+ | Tests.{N}.result | OVERWRITE | On any file write |
604
+ | Summary | OVERWRITE | On any file write |
605
+ | Gaps | APPEND | When issue found |
606
+
607
+ On context reset: File shows last checkpoint. Resume from there.
608
+ </update_rules>
609
+
610
+ <severity_inference>
611
+ **Infer severity from user's natural language:**
612
+
613
+ | User says | Infer |
614
+ |-----------|-------|
615
+ | "crashes", "error", "exception", "fails completely" | blocker |
616
+ | "doesn't work", "nothing happens", "wrong behavior" | major |
617
+ | "works but...", "slow", "weird", "minor issue" | minor |
618
+ | "color", "spacing", "alignment", "looks off" | cosmetic |
619
+
620
+ Default to **major** if unclear. User can correct if needed.
621
+
622
+ **Never ask "how severe is this?"** - just infer and move on.
623
+ </severity_inference>
624
+
625
+ <success_criteria>
626
+ - [ ] UAT file created with all tests from SUMMARY.md
627
+ - [ ] Tests presented one at a time with expected behavior
628
+ - [ ] User responses processed as pass/issue/skip
629
+ - [ ] Severity inferred from description (never asked)
630
+ - [ ] Batched writes: on issue, every 5 passes, or completion
631
+ - [ ] Committed on completion
632
+ - [ ] If issues: parallel debug agents diagnose root causes
633
+ - [ ] If issues: gsd-planner creates fix plans (gap_closure mode)
634
+ - [ ] If issues: gsd-plan-checker verifies fix plans
635
+ - [ ] If issues: revision loop until plans pass (max 3 iterations)
636
+ - [ ] Ready for `/gsd:execute-phase --gaps-only` when complete
637
+ </success_criteria>