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,323 @@
1
+ <purpose>
2
+ Check for GSD updates via npm, display changelog for versions between installed and latest, obtain user confirmation, and execute clean installation with cache clearing.
3
+ </purpose>
4
+
5
+ <required_reading>
6
+ Read all files referenced by the invoking prompt's execution_context before starting.
7
+ </required_reading>
8
+
9
+ <process>
10
+
11
+ <step name="get_installed_version">
12
+ Detect whether GSD is installed locally or globally by checking both locations and validating install integrity.
13
+
14
+ First, derive `PREFERRED_RUNTIME` from the invoking prompt's `execution_context` path:
15
+ - Path contains `/.codex/` -> `codex`
16
+ - Path contains `/.gemini/` -> `gemini`
17
+ - Path contains `/.config/opencode/` or `/.opencode/` -> `opencode`
18
+ - Otherwise -> `claude`
19
+
20
+ Use `PREFERRED_RUNTIME` as the first runtime checked so `/gsd:update` targets the runtime that invoked it.
21
+
22
+ ```bash
23
+ # Runtime candidates: "<runtime>:<config-dir>" stored as an array.
24
+ # Using an array instead of a space-separated string ensures correct
25
+ # iteration in both bash and zsh (zsh does not word-split unquoted
26
+ # variables by default). Fixes #1173.
27
+ RUNTIME_DIRS=( "claude:.claude" "opencode:.config/opencode" "opencode:.opencode" "gemini:.gemini" "codex:.codex" )
28
+
29
+ # PREFERRED_RUNTIME should be set from execution_context before running this block.
30
+ # If not set, infer from runtime env vars; fallback to claude.
31
+ if [ -z "$PREFERRED_RUNTIME" ]; then
32
+ if [ -n "$CODEX_HOME" ]; then
33
+ PREFERRED_RUNTIME="codex"
34
+ elif [ -n "$GEMINI_CONFIG_DIR" ]; then
35
+ PREFERRED_RUNTIME="gemini"
36
+ elif [ -n "$OPENCODE_CONFIG_DIR" ] || [ -n "$OPENCODE_CONFIG" ]; then
37
+ PREFERRED_RUNTIME="opencode"
38
+ elif [ -n "$CLAUDE_CONFIG_DIR" ]; then
39
+ PREFERRED_RUNTIME="claude"
40
+ else
41
+ PREFERRED_RUNTIME="claude"
42
+ fi
43
+ fi
44
+
45
+ # Reorder entries so preferred runtime is checked first.
46
+ ORDERED_RUNTIME_DIRS=()
47
+ for entry in "${RUNTIME_DIRS[@]}"; do
48
+ runtime="${entry%%:*}"
49
+ if [ "$runtime" = "$PREFERRED_RUNTIME" ]; then
50
+ ORDERED_RUNTIME_DIRS+=( "$entry" )
51
+ fi
52
+ done
53
+ for entry in "${RUNTIME_DIRS[@]}"; do
54
+ runtime="${entry%%:*}"
55
+ if [ "$runtime" != "$PREFERRED_RUNTIME" ]; then
56
+ ORDERED_RUNTIME_DIRS+=( "$entry" )
57
+ fi
58
+ done
59
+
60
+ # Check local first (takes priority only if valid and distinct from global)
61
+ LOCAL_VERSION_FILE="" LOCAL_MARKER_FILE="" LOCAL_DIR="" LOCAL_RUNTIME=""
62
+ for entry in "${ORDERED_RUNTIME_DIRS[@]}"; do
63
+ runtime="${entry%%:*}"
64
+ dir="${entry#*:}"
65
+ if [ -f "./$dir/get-shit-done/VERSION" ] || [ -f "./$dir/get-shit-done/workflows/update.md" ]; then
66
+ LOCAL_RUNTIME="$runtime"
67
+ LOCAL_VERSION_FILE="./$dir/get-shit-done/VERSION"
68
+ LOCAL_MARKER_FILE="./$dir/get-shit-done/workflows/update.md"
69
+ LOCAL_DIR="$(cd "./$dir" 2>/dev/null && pwd)"
70
+ break
71
+ fi
72
+ done
73
+
74
+ GLOBAL_VERSION_FILE="" GLOBAL_MARKER_FILE="" GLOBAL_DIR="" GLOBAL_RUNTIME=""
75
+ for entry in "${ORDERED_RUNTIME_DIRS[@]}"; do
76
+ runtime="${entry%%:*}"
77
+ dir="${entry#*:}"
78
+ if [ -f "$HOME/$dir/get-shit-done/VERSION" ] || [ -f "$HOME/$dir/get-shit-done/workflows/update.md" ]; then
79
+ GLOBAL_RUNTIME="$runtime"
80
+ GLOBAL_VERSION_FILE="$HOME/$dir/get-shit-done/VERSION"
81
+ GLOBAL_MARKER_FILE="$HOME/$dir/get-shit-done/workflows/update.md"
82
+ GLOBAL_DIR="$(cd "$HOME/$dir" 2>/dev/null && pwd)"
83
+ break
84
+ fi
85
+ done
86
+
87
+ # Only treat as LOCAL if the resolved paths differ (prevents misdetection when CWD=$HOME)
88
+ IS_LOCAL=false
89
+ if [ -n "$LOCAL_VERSION_FILE" ] && [ -f "$LOCAL_VERSION_FILE" ] && [ -f "$LOCAL_MARKER_FILE" ] && grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+' "$LOCAL_VERSION_FILE"; then
90
+ if [ -z "$GLOBAL_DIR" ] || [ "$LOCAL_DIR" != "$GLOBAL_DIR" ]; then
91
+ IS_LOCAL=true
92
+ fi
93
+ fi
94
+
95
+ if [ "$IS_LOCAL" = true ]; then
96
+ INSTALLED_VERSION="$(cat "$LOCAL_VERSION_FILE")"
97
+ INSTALL_SCOPE="LOCAL"
98
+ TARGET_RUNTIME="$LOCAL_RUNTIME"
99
+ elif [ -n "$GLOBAL_VERSION_FILE" ] && [ -f "$GLOBAL_VERSION_FILE" ] && [ -f "$GLOBAL_MARKER_FILE" ] && grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+' "$GLOBAL_VERSION_FILE"; then
100
+ INSTALLED_VERSION="$(cat "$GLOBAL_VERSION_FILE")"
101
+ INSTALL_SCOPE="GLOBAL"
102
+ TARGET_RUNTIME="$GLOBAL_RUNTIME"
103
+ elif [ -n "$LOCAL_RUNTIME" ] && [ -f "$LOCAL_MARKER_FILE" ]; then
104
+ # Runtime detected but VERSION missing/corrupt: treat as unknown version, keep runtime target
105
+ INSTALLED_VERSION="0.0.0"
106
+ INSTALL_SCOPE="LOCAL"
107
+ TARGET_RUNTIME="$LOCAL_RUNTIME"
108
+ elif [ -n "$GLOBAL_RUNTIME" ] && [ -f "$GLOBAL_MARKER_FILE" ]; then
109
+ INSTALLED_VERSION="0.0.0"
110
+ INSTALL_SCOPE="GLOBAL"
111
+ TARGET_RUNTIME="$GLOBAL_RUNTIME"
112
+ else
113
+ INSTALLED_VERSION="0.0.0"
114
+ INSTALL_SCOPE="UNKNOWN"
115
+ TARGET_RUNTIME="claude"
116
+ fi
117
+
118
+ echo "$INSTALLED_VERSION"
119
+ echo "$INSTALL_SCOPE"
120
+ echo "$TARGET_RUNTIME"
121
+ ```
122
+
123
+ Parse output:
124
+ - Line 1 = installed version (`0.0.0` means unknown version)
125
+ - Line 2 = install scope (`LOCAL`, `GLOBAL`, or `UNKNOWN`)
126
+ - Line 3 = target runtime (`claude`, `opencode`, `gemini`, or `codex`)
127
+ - If scope is `UNKNOWN`, proceed to install step using `--claude --global` fallback.
128
+
129
+ If multiple runtime installs are detected and the invoking runtime cannot be determined from execution_context, ask the user which runtime to update before running install.
130
+
131
+ **If VERSION file missing:**
132
+ ```
133
+ ## GSD Update
134
+
135
+ **Installed version:** Unknown
136
+
137
+ Your installation doesn't include version tracking.
138
+
139
+ Running fresh install...
140
+ ```
141
+
142
+ Proceed to install step (treat as version 0.0.0 for comparison).
143
+ </step>
144
+
145
+ <step name="check_latest_version">
146
+ Check npm for latest version:
147
+
148
+ ```bash
149
+ npm view get-shit-done-cc version 2>/dev/null
150
+ ```
151
+
152
+ **If npm check fails:**
153
+ ```
154
+ Couldn't check for updates (offline or npm unavailable).
155
+
156
+ To update manually: `npx get-shit-done-cc --global`
157
+ ```
158
+
159
+ Exit.
160
+ </step>
161
+
162
+ <step name="compare_versions">
163
+ Compare installed vs latest:
164
+
165
+ **If installed == latest:**
166
+ ```
167
+ ## GSD Update
168
+
169
+ **Installed:** X.Y.Z
170
+ **Latest:** X.Y.Z
171
+
172
+ You're already on the latest version.
173
+ ```
174
+
175
+ Exit.
176
+
177
+ **If installed > latest:**
178
+ ```
179
+ ## GSD Update
180
+
181
+ **Installed:** X.Y.Z
182
+ **Latest:** A.B.C
183
+
184
+ You're ahead of the latest release (development version?).
185
+ ```
186
+
187
+ Exit.
188
+ </step>
189
+
190
+ <step name="show_changes_and_confirm">
191
+ **If update available**, fetch and show what's new BEFORE updating:
192
+
193
+ 1. Fetch changelog from GitHub raw URL
194
+ 2. Extract entries between installed and latest versions
195
+ 3. Display preview and ask for confirmation:
196
+
197
+ ```
198
+ ## GSD Update Available
199
+
200
+ **Installed:** 1.5.10
201
+ **Latest:** 1.5.15
202
+
203
+ ### What's New
204
+ ────────────────────────────────────────────────────────────
205
+
206
+ ## [1.5.15] - 2026-01-20
207
+
208
+ ### Added
209
+ - Feature X
210
+
211
+ ## [1.5.14] - 2026-01-18
212
+
213
+ ### Fixed
214
+ - Bug fix Y
215
+
216
+ ────────────────────────────────────────────────────────────
217
+
218
+ ⚠️ **Note:** The installer performs a clean install of GSD folders:
219
+ - `commands/gsd/` will be wiped and replaced
220
+ - `get-shit-done/` will be wiped and replaced
221
+ - `agents/gsd-*` files will be replaced
222
+
223
+ (Paths are relative to detected runtime install location:
224
+ global: `~/.claude/`, `~/.config/opencode/`, `~/.opencode/`, `~/.gemini/`, or `~/.codex/`
225
+ local: `./.claude/`, `./.config/opencode/`, `./.opencode/`, `./.gemini/`, or `./.codex/`)
226
+
227
+ Your custom files in other locations are preserved:
228
+ - Custom commands not in `commands/gsd/` ✓
229
+ - Custom agents not prefixed with `gsd-` ✓
230
+ - Custom hooks ✓
231
+ - Your CLAUDE.md files ✓
232
+
233
+ If you've modified any GSD files directly, they'll be automatically backed up to `gsd-local-patches/` and can be reapplied with `/gsd:reapply-patches` after the update.
234
+ ```
235
+
236
+ Use AskUserQuestion:
237
+ - Question: "Proceed with update?"
238
+ - Options:
239
+ - "Yes, update now"
240
+ - "No, cancel"
241
+
242
+ **If user cancels:** Exit.
243
+ </step>
244
+
245
+ <step name="run_update">
246
+ Run the update using the install type detected in step 1:
247
+
248
+ Build runtime flag from step 1:
249
+ ```bash
250
+ RUNTIME_FLAG="--$TARGET_RUNTIME"
251
+ ```
252
+
253
+ **If LOCAL install:**
254
+ ```bash
255
+ npx -y get-shit-done-cc@latest "$RUNTIME_FLAG" --local
256
+ ```
257
+
258
+ **If GLOBAL install:**
259
+ ```bash
260
+ npx -y get-shit-done-cc@latest "$RUNTIME_FLAG" --global
261
+ ```
262
+
263
+ **If UNKNOWN install:**
264
+ ```bash
265
+ npx -y get-shit-done-cc@latest --claude --global
266
+ ```
267
+
268
+ Capture output. If install fails, show error and exit.
269
+
270
+ Clear the update cache so statusline indicator disappears:
271
+
272
+ ```bash
273
+ # Clear update cache across all runtime directories
274
+ for dir in .claude .config/opencode .opencode .gemini .codex; do
275
+ rm -f "./$dir/cache/gsd-update-check.json"
276
+ rm -f "$HOME/$dir/cache/gsd-update-check.json"
277
+ done
278
+ ```
279
+
280
+ The SessionStart hook (`gsd-check-update.js`) writes to the detected runtime's cache directory, so all paths must be cleared to prevent stale update indicators.
281
+ </step>
282
+
283
+ <step name="display_result">
284
+ Format completion message (changelog was already shown in confirmation step):
285
+
286
+ ```
287
+ ╔═══════════════════════════════════════════════════════════╗
288
+ ║ GSD Updated: v1.5.10 → v1.5.15 ║
289
+ ╚═══════════════════════════════════════════════════════════╝
290
+
291
+ ⚠️ Restart your runtime to pick up the new commands.
292
+
293
+ [View full changelog](https://github.com/gsd-build/get-shit-done/blob/main/CHANGELOG.md)
294
+ ```
295
+ </step>
296
+
297
+
298
+ <step name="check_local_patches">
299
+ After update completes, check if the installer detected and backed up any locally modified files:
300
+
301
+ Check for gsd-local-patches/backup-meta.json in the config directory.
302
+
303
+ **If patches found:**
304
+
305
+ ```
306
+ Local patches were backed up before the update.
307
+ Run /gsd:reapply-patches to merge your modifications into the new version.
308
+ ```
309
+
310
+ **If no patches:** Continue normally.
311
+ </step>
312
+ </process>
313
+
314
+ <success_criteria>
315
+ - [ ] Installed version read correctly
316
+ - [ ] Latest version checked via npm
317
+ - [ ] Update skipped if already current
318
+ - [ ] Changelog fetched and displayed BEFORE update
319
+ - [ ] Clean install warning shown
320
+ - [ ] User confirmation obtained
321
+ - [ ] Update executed successfully
322
+ - [ ] Restart reminder shown
323
+ </success_criteria>
@@ -0,0 +1,174 @@
1
+ <purpose>
2
+ Audit Nyquist validation gaps for a completed phase. Generate missing tests. Update VALIDATION.md.
3
+ </purpose>
4
+
5
+ <required_reading>
6
+ @~/.claude/get-shit-done/references/ui-brand.md
7
+ </required_reading>
8
+
9
+ <available_agent_types>
10
+ Valid GSD subagent types (use exact names — do not fall back to 'general-purpose'):
11
+ - gsd-nyquist-auditor — Validates verification coverage
12
+ </available_agent_types>
13
+
14
+ <process>
15
+
16
+ ## 0. Initialize
17
+
18
+ ```bash
19
+ INIT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" init phase-op "${PHASE_ARG}")
20
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
21
+ AGENT_SKILLS_AUDITOR=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" agent-skills gsd-nyquist-auditor 2>/dev/null)
22
+ ```
23
+
24
+ Parse: `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`.
25
+
26
+ ```bash
27
+ AUDITOR_MODEL=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" resolve-model gsd-nyquist-auditor --raw)
28
+ NYQUIST_CFG=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-get workflow.nyquist_validation --raw)
29
+ ```
30
+
31
+ If `NYQUIST_CFG` is `false`: exit with "Nyquist validation is disabled. Enable via /gsd:settings."
32
+
33
+ Display banner: `GSD > VALIDATE PHASE {N}: {name}`
34
+
35
+ ## 1. Detect Input State
36
+
37
+ ```bash
38
+ VALIDATION_FILE=$(ls "${PHASE_DIR}"/*-VALIDATION.md 2>/dev/null | head -1)
39
+ SUMMARY_FILES=$(ls "${PHASE_DIR}"/*-SUMMARY.md 2>/dev/null)
40
+ ```
41
+
42
+ - **State A** (`VALIDATION_FILE` non-empty): Audit existing
43
+ - **State B** (`VALIDATION_FILE` empty, `SUMMARY_FILES` non-empty): Reconstruct from artifacts
44
+ - **State C** (`SUMMARY_FILES` empty): Exit — "Phase {N} not executed. Run /gsd:execute-phase {N} ${GSD_WS} first."
45
+
46
+ ## 2. Discovery
47
+
48
+ ### 2a. Read Phase Artifacts
49
+
50
+ Read all PLAN and SUMMARY files. Extract: task lists, requirement IDs, key-files changed, verify blocks.
51
+
52
+ ### 2b. Build Requirement-to-Task Map
53
+
54
+ Per task: `{ task_id, plan_id, wave, requirement_ids, has_automated_command }`
55
+
56
+ ### 2c. Detect Test Infrastructure
57
+
58
+ State A: Parse from existing VALIDATION.md Test Infrastructure table.
59
+ State B: Filesystem scan:
60
+
61
+ ```bash
62
+ find . -name "pytest.ini" -o -name "jest.config.*" -o -name "vitest.config.*" -o -name "pyproject.toml" 2>/dev/null | head -10
63
+ find . \( -name "*.test.*" -o -name "*.spec.*" -o -name "test_*" \) -not -path "*/node_modules/*" 2>/dev/null | head -40
64
+ ```
65
+
66
+ ### 2d. Cross-Reference
67
+
68
+ Match each requirement to existing tests by filename, imports, test descriptions. Record: requirement → test_file → status.
69
+
70
+ ## 3. Gap Analysis
71
+
72
+ Classify each requirement:
73
+
74
+ | Status | Criteria |
75
+ |--------|----------|
76
+ | COVERED | Test exists, targets behavior, runs green |
77
+ | PARTIAL | Test exists, failing or incomplete |
78
+ | MISSING | No test found |
79
+
80
+ Build: `{ task_id, requirement, gap_type, suggested_test_path, suggested_command }`
81
+
82
+ No gaps → skip to Step 6, set `nyquist_compliant: true`.
83
+
84
+ ## 4. Present Gap Plan
85
+
86
+ Call AskUserQuestion with gap table and options:
87
+ 1. "Fix all gaps" → Step 5
88
+ 2. "Skip — mark manual-only" → add to Manual-Only, Step 6
89
+ 3. "Cancel" → exit
90
+
91
+ ## 5. Spawn gsd-nyquist-auditor
92
+
93
+ ```
94
+ Task(
95
+ prompt="Read ~/.claude/agents/gsd-nyquist-auditor.md for instructions.\n\n" +
96
+ "<files_to_read>{PLAN, SUMMARY, impl files, VALIDATION.md}</files_to_read>" +
97
+ "<gaps>{gap list}</gaps>" +
98
+ "<test_infrastructure>{framework, config, commands}</test_infrastructure>" +
99
+ "<constraints>Never modify impl files. Max 3 debug iterations. Escalate impl bugs.</constraints>" +
100
+ "${AGENT_SKILLS_AUDITOR}",
101
+ subagent_type="gsd-nyquist-auditor",
102
+ model="{AUDITOR_MODEL}",
103
+ description="Fill validation gaps for Phase {N}"
104
+ )
105
+ ```
106
+
107
+ Handle return:
108
+ - `## GAPS FILLED` → record tests + map updates, Step 6
109
+ - `## PARTIAL` → record resolved, move escalated to manual-only, Step 6
110
+ - `## ESCALATE` → move all to manual-only, Step 6
111
+
112
+ ## 6. Generate/Update VALIDATION.md
113
+
114
+ **State B (create):**
115
+ 1. Read template from `~/.claude/get-shit-done/templates/VALIDATION.md`
116
+ 2. Fill: frontmatter, Test Infrastructure, Per-Task Map, Manual-Only, Sign-Off
117
+ 3. Write to `${PHASE_DIR}/${PADDED_PHASE}-VALIDATION.md`
118
+
119
+ **State A (update):**
120
+ 1. Update Per-Task Map statuses, add escalated to Manual-Only, update frontmatter
121
+ 2. Append audit trail:
122
+
123
+ ```markdown
124
+ ## Validation Audit {date}
125
+ | Metric | Count |
126
+ |--------|-------|
127
+ | Gaps found | {N} |
128
+ | Resolved | {M} |
129
+ | Escalated | {K} |
130
+ ```
131
+
132
+ ## 7. Commit
133
+
134
+ ```bash
135
+ git add {test_files}
136
+ git commit -m "test(phase-${PHASE}): add Nyquist validation tests"
137
+
138
+ node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs(phase-${PHASE}): add/update validation strategy"
139
+ ```
140
+
141
+ ## 8. Results + Routing
142
+
143
+ **Compliant:**
144
+ ```
145
+ GSD > PHASE {N} IS NYQUIST-COMPLIANT
146
+ All requirements have automated verification.
147
+ ▶ Next: /gsd:audit-milestone ${GSD_WS}
148
+ ```
149
+
150
+ **Partial:**
151
+ ```
152
+ GSD > PHASE {N} VALIDATED (PARTIAL)
153
+ {M} automated, {K} manual-only.
154
+ ▶ Retry: /gsd:validate-phase {N} ${GSD_WS}
155
+ ```
156
+
157
+ Display `/clear` reminder.
158
+
159
+ </process>
160
+
161
+ <success_criteria>
162
+ - [ ] Nyquist config checked (exit if disabled)
163
+ - [ ] Input state detected (A/B/C)
164
+ - [ ] State C exits cleanly
165
+ - [ ] PLAN/SUMMARY files read, requirement map built
166
+ - [ ] Test infrastructure detected
167
+ - [ ] Gaps classified (COVERED/PARTIAL/MISSING)
168
+ - [ ] User gate with gap table
169
+ - [ ] Auditor spawned with complete context
170
+ - [ ] All three return formats handled
171
+ - [ ] VALIDATION.md created or updated
172
+ - [ ] Test files committed separately
173
+ - [ ] Results with routing presented
174
+ </success_criteria>