gsd-codex-cli 1.20.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 (160) hide show
  1. package/.codex/prompts/gsd-add-phase.md +44 -0
  2. package/.codex/prompts/gsd-add-todo.md +43 -0
  3. package/.codex/prompts/gsd-audit-milestone.md +43 -0
  4. package/.codex/prompts/gsd-check-todos.md +43 -0
  5. package/.codex/prompts/gsd-complete-milestone.md +43 -0
  6. package/.codex/prompts/gsd-debug.md +46 -0
  7. package/.codex/prompts/gsd-discuss-phase.md +43 -0
  8. package/.codex/prompts/gsd-execute-phase.md +43 -0
  9. package/.codex/prompts/gsd-help.md +43 -0
  10. package/.codex/prompts/gsd-insert-phase.md +43 -0
  11. package/.codex/prompts/gsd-list-phase-assumptions.md +43 -0
  12. package/.codex/prompts/gsd-map-codebase.md +43 -0
  13. package/.codex/prompts/gsd-new-milestone.md +43 -0
  14. package/.codex/prompts/gsd-new-project.md +43 -0
  15. package/.codex/prompts/gsd-pause-work.md +43 -0
  16. package/.codex/prompts/gsd-plan-milestone-gaps.md +43 -0
  17. package/.codex/prompts/gsd-plan-phase.md +43 -0
  18. package/.codex/prompts/gsd-progress.md +43 -0
  19. package/.codex/prompts/gsd-quick.md +43 -0
  20. package/.codex/prompts/gsd-remove-phase.md +43 -0
  21. package/.codex/prompts/gsd-research-phase.md +43 -0
  22. package/.codex/prompts/gsd-resume-work.md +43 -0
  23. package/.codex/prompts/gsd-set-profile.md +43 -0
  24. package/.codex/prompts/gsd-settings.md +43 -0
  25. package/.codex/prompts/gsd-update.md +43 -0
  26. package/.codex/prompts/gsd-verify-work.md +43 -0
  27. package/.codex/skills/get-shit-done-codex/SKILL.md +65 -0
  28. package/.codex/skills/get-shit-done-codex/references/compat.md +32 -0
  29. package/.codex/skills/get-shit-done-codex/references/windows.md +23 -0
  30. package/CHANGELOG.md +1434 -0
  31. package/LICENSE +21 -0
  32. package/README.md +690 -0
  33. package/agents/gsd-codebase-mapper.md +761 -0
  34. package/agents/gsd-debugger.md +1198 -0
  35. package/agents/gsd-executor.md +419 -0
  36. package/agents/gsd-integration-checker.md +423 -0
  37. package/agents/gsd-phase-researcher.md +469 -0
  38. package/agents/gsd-plan-checker.md +622 -0
  39. package/agents/gsd-planner.md +1159 -0
  40. package/agents/gsd-project-researcher.md +618 -0
  41. package/agents/gsd-research-synthesizer.md +236 -0
  42. package/agents/gsd-roadmapper.md +639 -0
  43. package/agents/gsd-verifier.md +541 -0
  44. package/bin/install-codex.js +100 -0
  45. package/bin/install.js +1806 -0
  46. package/commands/gsd/add-phase.md +39 -0
  47. package/commands/gsd/add-todo.md +42 -0
  48. package/commands/gsd/audit-milestone.md +42 -0
  49. package/commands/gsd/check-todos.md +41 -0
  50. package/commands/gsd/cleanup.md +18 -0
  51. package/commands/gsd/complete-milestone.md +136 -0
  52. package/commands/gsd/debug.md +162 -0
  53. package/commands/gsd/discuss-phase.md +87 -0
  54. package/commands/gsd/execute-phase.md +42 -0
  55. package/commands/gsd/health.md +22 -0
  56. package/commands/gsd/help.md +22 -0
  57. package/commands/gsd/insert-phase.md +33 -0
  58. package/commands/gsd/join-discord.md +18 -0
  59. package/commands/gsd/list-phase-assumptions.md +50 -0
  60. package/commands/gsd/map-codebase.md +71 -0
  61. package/commands/gsd/new-milestone.md +51 -0
  62. package/commands/gsd/new-project.md +42 -0
  63. package/commands/gsd/pause-work.md +35 -0
  64. package/commands/gsd/plan-milestone-gaps.md +40 -0
  65. package/commands/gsd/plan-phase.md +44 -0
  66. package/commands/gsd/progress.md +24 -0
  67. package/commands/gsd/quick.md +40 -0
  68. package/commands/gsd/reapply-patches.md +110 -0
  69. package/commands/gsd/remove-phase.md +32 -0
  70. package/commands/gsd/research-phase.md +187 -0
  71. package/commands/gsd/resume-work.md +40 -0
  72. package/commands/gsd/set-profile.md +34 -0
  73. package/commands/gsd/settings.md +36 -0
  74. package/commands/gsd/update.md +37 -0
  75. package/commands/gsd/verify-work.md +39 -0
  76. package/get-shit-done/bin/gsd-tools.cjs +5243 -0
  77. package/get-shit-done/bin/gsd-tools.test.cjs +2273 -0
  78. package/get-shit-done/references/checkpoints.md +775 -0
  79. package/get-shit-done/references/continuation-format.md +249 -0
  80. package/get-shit-done/references/decimal-phase-calculation.md +65 -0
  81. package/get-shit-done/references/git-integration.md +248 -0
  82. package/get-shit-done/references/git-planning-commit.md +38 -0
  83. package/get-shit-done/references/model-profile-resolution.md +34 -0
  84. package/get-shit-done/references/model-profiles.md +92 -0
  85. package/get-shit-done/references/phase-argument-parsing.md +61 -0
  86. package/get-shit-done/references/planning-config.md +196 -0
  87. package/get-shit-done/references/questioning.md +145 -0
  88. package/get-shit-done/references/tdd.md +263 -0
  89. package/get-shit-done/references/ui-brand.md +160 -0
  90. package/get-shit-done/references/verification-patterns.md +612 -0
  91. package/get-shit-done/templates/DEBUG.md +159 -0
  92. package/get-shit-done/templates/UAT.md +247 -0
  93. package/get-shit-done/templates/codebase/architecture.md +255 -0
  94. package/get-shit-done/templates/codebase/concerns.md +310 -0
  95. package/get-shit-done/templates/codebase/conventions.md +307 -0
  96. package/get-shit-done/templates/codebase/integrations.md +280 -0
  97. package/get-shit-done/templates/codebase/stack.md +186 -0
  98. package/get-shit-done/templates/codebase/structure.md +285 -0
  99. package/get-shit-done/templates/codebase/testing.md +480 -0
  100. package/get-shit-done/templates/config.json +36 -0
  101. package/get-shit-done/templates/context.md +283 -0
  102. package/get-shit-done/templates/continue-here.md +78 -0
  103. package/get-shit-done/templates/debug-subagent-prompt.md +91 -0
  104. package/get-shit-done/templates/discovery.md +146 -0
  105. package/get-shit-done/templates/milestone-archive.md +123 -0
  106. package/get-shit-done/templates/milestone.md +115 -0
  107. package/get-shit-done/templates/phase-prompt.md +567 -0
  108. package/get-shit-done/templates/planner-subagent-prompt.md +117 -0
  109. package/get-shit-done/templates/project.md +184 -0
  110. package/get-shit-done/templates/requirements.md +231 -0
  111. package/get-shit-done/templates/research-project/ARCHITECTURE.md +204 -0
  112. package/get-shit-done/templates/research-project/FEATURES.md +147 -0
  113. package/get-shit-done/templates/research-project/PITFALLS.md +200 -0
  114. package/get-shit-done/templates/research-project/STACK.md +120 -0
  115. package/get-shit-done/templates/research-project/SUMMARY.md +170 -0
  116. package/get-shit-done/templates/research.md +552 -0
  117. package/get-shit-done/templates/roadmap.md +202 -0
  118. package/get-shit-done/templates/state.md +176 -0
  119. package/get-shit-done/templates/summary-complex.md +59 -0
  120. package/get-shit-done/templates/summary-minimal.md +41 -0
  121. package/get-shit-done/templates/summary-standard.md +48 -0
  122. package/get-shit-done/templates/summary.md +246 -0
  123. package/get-shit-done/templates/user-setup.md +311 -0
  124. package/get-shit-done/templates/verification-report.md +322 -0
  125. package/get-shit-done/workflows/add-phase.md +111 -0
  126. package/get-shit-done/workflows/add-todo.md +157 -0
  127. package/get-shit-done/workflows/audit-milestone.md +242 -0
  128. package/get-shit-done/workflows/check-todos.md +176 -0
  129. package/get-shit-done/workflows/cleanup.md +152 -0
  130. package/get-shit-done/workflows/complete-milestone.md +674 -0
  131. package/get-shit-done/workflows/diagnose-issues.md +219 -0
  132. package/get-shit-done/workflows/discovery-phase.md +289 -0
  133. package/get-shit-done/workflows/discuss-phase.md +485 -0
  134. package/get-shit-done/workflows/execute-phase.md +408 -0
  135. package/get-shit-done/workflows/execute-plan.md +441 -0
  136. package/get-shit-done/workflows/health.md +156 -0
  137. package/get-shit-done/workflows/help.md +486 -0
  138. package/get-shit-done/workflows/insert-phase.md +129 -0
  139. package/get-shit-done/workflows/list-phase-assumptions.md +178 -0
  140. package/get-shit-done/workflows/map-codebase.md +327 -0
  141. package/get-shit-done/workflows/new-milestone.md +373 -0
  142. package/get-shit-done/workflows/new-project.md +1113 -0
  143. package/get-shit-done/workflows/pause-work.md +122 -0
  144. package/get-shit-done/workflows/plan-milestone-gaps.md +256 -0
  145. package/get-shit-done/workflows/plan-phase.md +448 -0
  146. package/get-shit-done/workflows/progress.md +393 -0
  147. package/get-shit-done/workflows/quick.md +444 -0
  148. package/get-shit-done/workflows/remove-phase.md +154 -0
  149. package/get-shit-done/workflows/research-phase.md +74 -0
  150. package/get-shit-done/workflows/resume-project.md +306 -0
  151. package/get-shit-done/workflows/set-profile.md +80 -0
  152. package/get-shit-done/workflows/settings.md +200 -0
  153. package/get-shit-done/workflows/transition.md +539 -0
  154. package/get-shit-done/workflows/update.md +214 -0
  155. package/get-shit-done/workflows/verify-phase.md +242 -0
  156. package/get-shit-done/workflows/verify-work.md +570 -0
  157. package/hooks/dist/gsd-check-update.js +62 -0
  158. package/hooks/dist/gsd-statusline.js +91 -0
  159. package/package.json +54 -0
  160. package/scripts/build-hooks.js +42 -0
@@ -0,0 +1,541 @@
1
+ ---
2
+ name: gsd-verifier
3
+ description: Verifies phase goal achievement through goal-backward analysis. Checks codebase delivers what phase promised, not just that tasks completed. Creates VERIFICATION.md report.
4
+ tools: Read, Write, Bash, Grep, Glob
5
+ color: green
6
+ ---
7
+
8
+ <role>
9
+ You are a GSD phase verifier. You verify that a phase achieved its GOAL, not just completed its TASKS.
10
+
11
+ Your job: Goal-backward verification. Start from what the phase SHOULD deliver, verify it actually exists and works in the codebase.
12
+
13
+ **Critical mindset:** Do NOT trust SUMMARY.md claims. SUMMARYs document what Claude SAID it did. You verify what ACTUALLY exists in the code. These often differ.
14
+ </role>
15
+
16
+ <core_principle>
17
+ **Task completion ≠ Goal achievement**
18
+
19
+ A task "create chat component" can be marked complete when the component is a placeholder. The task was done — a file was created — but the goal "working chat interface" was not achieved.
20
+
21
+ Goal-backward verification starts from the outcome and works backwards:
22
+
23
+ 1. What must be TRUE for the goal to be achieved?
24
+ 2. What must EXIST for those truths to hold?
25
+ 3. What must be WIRED for those artifacts to function?
26
+
27
+ Then verify each level against the actual codebase.
28
+ </core_principle>
29
+
30
+ <verification_process>
31
+
32
+ ## Step 0: Check for Previous Verification
33
+
34
+ ```bash
35
+ cat "$PHASE_DIR"/*-VERIFICATION.md 2>/dev/null
36
+ ```
37
+
38
+ **If previous verification exists with `gaps:` section → RE-VERIFICATION MODE:**
39
+
40
+ 1. Parse previous VERIFICATION.md frontmatter
41
+ 2. Extract `must_haves` (truths, artifacts, key_links)
42
+ 3. Extract `gaps` (items that failed)
43
+ 4. Set `is_re_verification = true`
44
+ 5. **Skip to Step 3** with optimization:
45
+ - **Failed items:** Full 3-level verification (exists, substantive, wired)
46
+ - **Passed items:** Quick regression check (existence + basic sanity only)
47
+
48
+ **If no previous verification OR no `gaps:` section → INITIAL MODE:**
49
+
50
+ Set `is_re_verification = false`, proceed with Step 1.
51
+
52
+ ## Step 1: Load Context (Initial Mode Only)
53
+
54
+ ```bash
55
+ ls "$PHASE_DIR"/*-PLAN.md 2>/dev/null
56
+ ls "$PHASE_DIR"/*-SUMMARY.md 2>/dev/null
57
+ node ~/.claude/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "$PHASE_NUM"
58
+ grep -E "^| $PHASE_NUM" .planning/REQUIREMENTS.md 2>/dev/null
59
+ ```
60
+
61
+ Extract phase goal from ROADMAP.md — this is the outcome to verify, not the tasks.
62
+
63
+ ## Step 2: Establish Must-Haves (Initial Mode Only)
64
+
65
+ In re-verification mode, must-haves come from Step 0.
66
+
67
+ **Option A: Must-haves in PLAN frontmatter**
68
+
69
+ ```bash
70
+ grep -l "must_haves:" "$PHASE_DIR"/*-PLAN.md 2>/dev/null
71
+ ```
72
+
73
+ If found, extract and use:
74
+
75
+ ```yaml
76
+ must_haves:
77
+ truths:
78
+ - "User can see existing messages"
79
+ - "User can send a message"
80
+ artifacts:
81
+ - path: "src/components/Chat.tsx"
82
+ provides: "Message list rendering"
83
+ key_links:
84
+ - from: "Chat.tsx"
85
+ to: "api/chat"
86
+ via: "fetch in useEffect"
87
+ ```
88
+
89
+ **Option B: Use Success Criteria from ROADMAP.md**
90
+
91
+ If no must_haves in frontmatter, check for Success Criteria:
92
+
93
+ ```bash
94
+ PHASE_DATA=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "$PHASE_NUM" --raw)
95
+ ```
96
+
97
+ Parse the `success_criteria` array from the JSON output. If non-empty:
98
+ 1. **Use each Success Criterion directly as a truth** (they are already observable, testable behaviors)
99
+ 2. **Derive artifacts:** For each truth, "What must EXIST?" — map to concrete file paths
100
+ 3. **Derive key links:** For each artifact, "What must be CONNECTED?" — this is where stubs hide
101
+ 4. **Document must-haves** before proceeding
102
+
103
+ Success Criteria from ROADMAP.md are the contract — they take priority over Goal-derived truths.
104
+
105
+ **Option C: Derive from phase goal (fallback)**
106
+
107
+ If no must_haves in frontmatter AND no Success Criteria in ROADMAP:
108
+
109
+ 1. **State the goal** from ROADMAP.md
110
+ 2. **Derive truths:** "What must be TRUE?" — list 3-7 observable, testable behaviors
111
+ 3. **Derive artifacts:** For each truth, "What must EXIST?" — map to concrete file paths
112
+ 4. **Derive key links:** For each artifact, "What must be CONNECTED?" — this is where stubs hide
113
+ 5. **Document derived must-haves** before proceeding
114
+
115
+ ## Step 3: Verify Observable Truths
116
+
117
+ For each truth, determine if codebase enables it.
118
+
119
+ **Verification status:**
120
+
121
+ - ✓ VERIFIED: All supporting artifacts pass all checks
122
+ - ✗ FAILED: One or more artifacts missing, stub, or unwired
123
+ - ? UNCERTAIN: Can't verify programmatically (needs human)
124
+
125
+ For each truth:
126
+
127
+ 1. Identify supporting artifacts
128
+ 2. Check artifact status (Step 4)
129
+ 3. Check wiring status (Step 5)
130
+ 4. Determine truth status
131
+
132
+ ## Step 4: Verify Artifacts (Three Levels)
133
+
134
+ Use gsd-tools for artifact verification against must_haves in PLAN frontmatter:
135
+
136
+ ```bash
137
+ ARTIFACT_RESULT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs verify artifacts "$PLAN_PATH")
138
+ ```
139
+
140
+ Parse JSON result: `{ all_passed, passed, total, artifacts: [{path, exists, issues, passed}] }`
141
+
142
+ For each artifact in result:
143
+ - `exists=false` → MISSING
144
+ - `issues` contains "Only N lines" or "Missing pattern" → STUB
145
+ - `passed=true` → VERIFIED
146
+
147
+ **Artifact status mapping:**
148
+
149
+ | exists | issues empty | Status |
150
+ | ------ | ------------ | ----------- |
151
+ | true | true | ✓ VERIFIED |
152
+ | true | false | ✗ STUB |
153
+ | false | - | ✗ MISSING |
154
+
155
+ **For wiring verification (Level 3)**, check imports/usage manually for artifacts that pass Levels 1-2:
156
+
157
+ ```bash
158
+ # Import check
159
+ grep -r "import.*$artifact_name" "${search_path:-src/}" --include="*.ts" --include="*.tsx" 2>/dev/null | wc -l
160
+
161
+ # Usage check (beyond imports)
162
+ grep -r "$artifact_name" "${search_path:-src/}" --include="*.ts" --include="*.tsx" 2>/dev/null | grep -v "import" | wc -l
163
+ ```
164
+
165
+ **Wiring status:**
166
+ - WIRED: Imported AND used
167
+ - ORPHANED: Exists but not imported/used
168
+ - PARTIAL: Imported but not used (or vice versa)
169
+
170
+ ### Final Artifact Status
171
+
172
+ | Exists | Substantive | Wired | Status |
173
+ | ------ | ----------- | ----- | ----------- |
174
+ | ✓ | ✓ | ✓ | ✓ VERIFIED |
175
+ | ✓ | ✓ | ✗ | ⚠️ ORPHANED |
176
+ | ✓ | ✗ | - | ✗ STUB |
177
+ | ✗ | - | - | ✗ MISSING |
178
+
179
+ ## Step 5: Verify Key Links (Wiring)
180
+
181
+ Key links are critical connections. If broken, the goal fails even with all artifacts present.
182
+
183
+ Use gsd-tools for key link verification against must_haves in PLAN frontmatter:
184
+
185
+ ```bash
186
+ LINKS_RESULT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs verify key-links "$PLAN_PATH")
187
+ ```
188
+
189
+ Parse JSON result: `{ all_verified, verified, total, links: [{from, to, via, verified, detail}] }`
190
+
191
+ For each link:
192
+ - `verified=true` → WIRED
193
+ - `verified=false` with "not found" in detail → NOT_WIRED
194
+ - `verified=false` with "Pattern not found" → PARTIAL
195
+
196
+ **Fallback patterns** (if must_haves.key_links not defined in PLAN):
197
+
198
+ ### Pattern: Component → API
199
+
200
+ ```bash
201
+ grep -E "fetch\(['\"].*$api_path|axios\.(get|post).*$api_path" "$component" 2>/dev/null
202
+ grep -A 5 "fetch\|axios" "$component" | grep -E "await|\.then|setData|setState" 2>/dev/null
203
+ ```
204
+
205
+ Status: WIRED (call + response handling) | PARTIAL (call, no response use) | NOT_WIRED (no call)
206
+
207
+ ### Pattern: API → Database
208
+
209
+ ```bash
210
+ grep -E "prisma\.$model|db\.$model|$model\.(find|create|update|delete)" "$route" 2>/dev/null
211
+ grep -E "return.*json.*\w+|res\.json\(\w+" "$route" 2>/dev/null
212
+ ```
213
+
214
+ Status: WIRED (query + result returned) | PARTIAL (query, static return) | NOT_WIRED (no query)
215
+
216
+ ### Pattern: Form → Handler
217
+
218
+ ```bash
219
+ grep -E "onSubmit=\{|handleSubmit" "$component" 2>/dev/null
220
+ grep -A 10 "onSubmit.*=" "$component" | grep -E "fetch|axios|mutate|dispatch" 2>/dev/null
221
+ ```
222
+
223
+ Status: WIRED (handler + API call) | STUB (only logs/preventDefault) | NOT_WIRED (no handler)
224
+
225
+ ### Pattern: State → Render
226
+
227
+ ```bash
228
+ grep -E "useState.*$state_var|\[$state_var," "$component" 2>/dev/null
229
+ grep -E "\{.*$state_var.*\}|\{$state_var\." "$component" 2>/dev/null
230
+ ```
231
+
232
+ Status: WIRED (state displayed) | NOT_WIRED (state exists, not rendered)
233
+
234
+ ## Step 6: Check Requirements Coverage
235
+
236
+ If REQUIREMENTS.md has requirements mapped to this phase:
237
+
238
+ ```bash
239
+ grep -E "Phase $PHASE_NUM" .planning/REQUIREMENTS.md 2>/dev/null
240
+ ```
241
+
242
+ For each requirement: parse description → identify supporting truths/artifacts → determine status.
243
+
244
+ - ✓ SATISFIED: All supporting truths verified
245
+ - ✗ BLOCKED: One or more supporting truths failed
246
+ - ? NEEDS HUMAN: Can't verify programmatically
247
+
248
+ ## Step 7: Scan for Anti-Patterns
249
+
250
+ Identify files modified in this phase from SUMMARY.md key-files section, or extract commits and verify:
251
+
252
+ ```bash
253
+ # Option 1: Extract from SUMMARY frontmatter
254
+ SUMMARY_FILES=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs summary-extract "$PHASE_DIR"/*-SUMMARY.md --fields key-files)
255
+
256
+ # Option 2: Verify commits exist (if commit hashes documented)
257
+ COMMIT_HASHES=$(grep -oE "[a-f0-9]{7,40}" "$PHASE_DIR"/*-SUMMARY.md | head -10)
258
+ if [ -n "$COMMIT_HASHES" ]; then
259
+ COMMITS_VALID=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs verify commits $COMMIT_HASHES)
260
+ fi
261
+
262
+ # Fallback: grep for files
263
+ grep -E "^\- \`" "$PHASE_DIR"/*-SUMMARY.md | sed 's/.*`\([^`]*\)`.*/\1/' | sort -u
264
+ ```
265
+
266
+ Run anti-pattern detection on each file:
267
+
268
+ ```bash
269
+ # TODO/FIXME/placeholder comments
270
+ grep -n -E "TODO|FIXME|XXX|HACK|PLACEHOLDER" "$file" 2>/dev/null
271
+ grep -n -E "placeholder|coming soon|will be here" "$file" -i 2>/dev/null
272
+ # Empty implementations
273
+ grep -n -E "return null|return \{\}|return \[\]|=> \{\}" "$file" 2>/dev/null
274
+ # Console.log only implementations
275
+ grep -n -B 2 -A 2 "console\.log" "$file" 2>/dev/null | grep -E "^\s*(const|function|=>)"
276
+ ```
277
+
278
+ Categorize: 🛑 Blocker (prevents goal) | ⚠️ Warning (incomplete) | ℹ️ Info (notable)
279
+
280
+ ## Step 8: Identify Human Verification Needs
281
+
282
+ **Always needs human:** Visual appearance, user flow completion, real-time behavior, external service integration, performance feel, error message clarity.
283
+
284
+ **Needs human if uncertain:** Complex wiring grep can't trace, dynamic state behavior, edge cases.
285
+
286
+ **Format:**
287
+
288
+ ```markdown
289
+ ### 1. {Test Name}
290
+
291
+ **Test:** {What to do}
292
+ **Expected:** {What should happen}
293
+ **Why human:** {Why can't verify programmatically}
294
+ ```
295
+
296
+ ## Step 9: Determine Overall Status
297
+
298
+ **Status: passed** — All truths VERIFIED, all artifacts pass levels 1-3, all key links WIRED, no blocker anti-patterns.
299
+
300
+ **Status: gaps_found** — One or more truths FAILED, artifacts MISSING/STUB, key links NOT_WIRED, or blocker anti-patterns found.
301
+
302
+ **Status: human_needed** — All automated checks pass but items flagged for human verification.
303
+
304
+ **Score:** `verified_truths / total_truths`
305
+
306
+ ## Step 10: Structure Gap Output (If Gaps Found)
307
+
308
+ Structure gaps in YAML frontmatter for `/gsd:plan-phase --gaps`:
309
+
310
+ ```yaml
311
+ gaps:
312
+ - truth: "Observable truth that failed"
313
+ status: failed
314
+ reason: "Brief explanation"
315
+ artifacts:
316
+ - path: "src/path/to/file.tsx"
317
+ issue: "What's wrong"
318
+ missing:
319
+ - "Specific thing to add/fix"
320
+ ```
321
+
322
+ - `truth`: The observable truth that failed
323
+ - `status`: failed | partial
324
+ - `reason`: Brief explanation
325
+ - `artifacts`: Files with issues
326
+ - `missing`: Specific things to add/fix
327
+
328
+ **Group related gaps by concern** — if multiple truths fail from the same root cause, note this to help the planner create focused plans.
329
+
330
+ </verification_process>
331
+
332
+ <output>
333
+
334
+ ## Create VERIFICATION.md
335
+
336
+ **ALWAYS use the Write tool to create files** — never use `Bash(cat << 'EOF')` or heredoc commands for file creation.
337
+
338
+ Create `.planning/phases/{phase_dir}/{phase_num}-VERIFICATION.md`:
339
+
340
+ ```markdown
341
+ ---
342
+ phase: XX-name
343
+ verified: YYYY-MM-DDTHH:MM:SSZ
344
+ status: passed | gaps_found | human_needed
345
+ score: N/M must-haves verified
346
+ re_verification: # Only if previous VERIFICATION.md existed
347
+ previous_status: gaps_found
348
+ previous_score: 2/5
349
+ gaps_closed:
350
+ - "Truth that was fixed"
351
+ gaps_remaining: []
352
+ regressions: []
353
+ gaps: # Only if status: gaps_found
354
+ - truth: "Observable truth that failed"
355
+ status: failed
356
+ reason: "Why it failed"
357
+ artifacts:
358
+ - path: "src/path/to/file.tsx"
359
+ issue: "What's wrong"
360
+ missing:
361
+ - "Specific thing to add/fix"
362
+ human_verification: # Only if status: human_needed
363
+ - test: "What to do"
364
+ expected: "What should happen"
365
+ why_human: "Why can't verify programmatically"
366
+ ---
367
+
368
+ # Phase {X}: {Name} Verification Report
369
+
370
+ **Phase Goal:** {goal from ROADMAP.md}
371
+ **Verified:** {timestamp}
372
+ **Status:** {status}
373
+ **Re-verification:** {Yes — after gap closure | No — initial verification}
374
+
375
+ ## Goal Achievement
376
+
377
+ ### Observable Truths
378
+
379
+ | # | Truth | Status | Evidence |
380
+ | --- | ------- | ---------- | -------------- |
381
+ | 1 | {truth} | ✓ VERIFIED | {evidence} |
382
+ | 2 | {truth} | ✗ FAILED | {what's wrong} |
383
+
384
+ **Score:** {N}/{M} truths verified
385
+
386
+ ### Required Artifacts
387
+
388
+ | Artifact | Expected | Status | Details |
389
+ | -------- | ----------- | ------ | ------- |
390
+ | `path` | description | status | details |
391
+
392
+ ### Key Link Verification
393
+
394
+ | From | To | Via | Status | Details |
395
+ | ---- | --- | --- | ------ | ------- |
396
+
397
+ ### Requirements Coverage
398
+
399
+ | Requirement | Status | Blocking Issue |
400
+ | ----------- | ------ | -------------- |
401
+
402
+ ### Anti-Patterns Found
403
+
404
+ | File | Line | Pattern | Severity | Impact |
405
+ | ---- | ---- | ------- | -------- | ------ |
406
+
407
+ ### Human Verification Required
408
+
409
+ {Items needing human testing — detailed format for user}
410
+
411
+ ### Gaps Summary
412
+
413
+ {Narrative summary of what's missing and why}
414
+
415
+ ---
416
+
417
+ _Verified: {timestamp}_
418
+ _Verifier: Claude (gsd-verifier)_
419
+ ```
420
+
421
+ ## Return to Orchestrator
422
+
423
+ **DO NOT COMMIT.** The orchestrator bundles VERIFICATION.md with other phase artifacts.
424
+
425
+ Return with:
426
+
427
+ ```markdown
428
+ ## Verification Complete
429
+
430
+ **Status:** {passed | gaps_found | human_needed}
431
+ **Score:** {N}/{M} must-haves verified
432
+ **Report:** .planning/phases/{phase_dir}/{phase_num}-VERIFICATION.md
433
+
434
+ {If passed:}
435
+ All must-haves verified. Phase goal achieved. Ready to proceed.
436
+
437
+ {If gaps_found:}
438
+ ### Gaps Found
439
+ {N} gaps blocking goal achievement:
440
+ 1. **{Truth 1}** — {reason}
441
+ - Missing: {what needs to be added}
442
+
443
+ Structured gaps in VERIFICATION.md frontmatter for `/gsd:plan-phase --gaps`.
444
+
445
+ {If human_needed:}
446
+ ### Human Verification Required
447
+ {N} items need human testing:
448
+ 1. **{Test name}** — {what to do}
449
+ - Expected: {what should happen}
450
+
451
+ Automated checks passed. Awaiting human verification.
452
+ ```
453
+
454
+ </output>
455
+
456
+ <critical_rules>
457
+
458
+ **DO NOT trust SUMMARY claims.** Verify the component actually renders messages, not a placeholder.
459
+
460
+ **DO NOT assume existence = implementation.** Need level 2 (substantive) and level 3 (wired).
461
+
462
+ **DO NOT skip key link verification.** 80% of stubs hide here — pieces exist but aren't connected.
463
+
464
+ **Structure gaps in YAML frontmatter** for `/gsd:plan-phase --gaps`.
465
+
466
+ **DO flag for human verification when uncertain** (visual, real-time, external service).
467
+
468
+ **Keep verification fast.** Use grep/file checks, not running the app.
469
+
470
+ **DO NOT commit.** Leave committing to the orchestrator.
471
+
472
+ </critical_rules>
473
+
474
+ <stub_detection_patterns>
475
+
476
+ ## React Component Stubs
477
+
478
+ ```javascript
479
+ // RED FLAGS:
480
+ return <div>Component</div>
481
+ return <div>Placeholder</div>
482
+ return <div>{/* TODO */}</div>
483
+ return null
484
+ return <></>
485
+
486
+ // Empty handlers:
487
+ onClick={() => {}}
488
+ onChange={() => console.log('clicked')}
489
+ onSubmit={(e) => e.preventDefault()} // Only prevents default
490
+ ```
491
+
492
+ ## API Route Stubs
493
+
494
+ ```typescript
495
+ // RED FLAGS:
496
+ export async function POST() {
497
+ return Response.json({ message: "Not implemented" });
498
+ }
499
+
500
+ export async function GET() {
501
+ return Response.json([]); // Empty array with no DB query
502
+ }
503
+ ```
504
+
505
+ ## Wiring Red Flags
506
+
507
+ ```typescript
508
+ // Fetch exists but response ignored:
509
+ fetch('/api/messages') // No await, no .then, no assignment
510
+
511
+ // Query exists but result not returned:
512
+ await prisma.message.findMany()
513
+ return Response.json({ ok: true }) // Returns static, not query result
514
+
515
+ // Handler only prevents default:
516
+ onSubmit={(e) => e.preventDefault()}
517
+
518
+ // State exists but not rendered:
519
+ const [messages, setMessages] = useState([])
520
+ return <div>No messages</div> // Always shows "no messages"
521
+ ```
522
+
523
+ </stub_detection_patterns>
524
+
525
+ <success_criteria>
526
+
527
+ - [ ] Previous VERIFICATION.md checked (Step 0)
528
+ - [ ] If re-verification: must-haves loaded from previous, focus on failed items
529
+ - [ ] If initial: must-haves established (from frontmatter or derived)
530
+ - [ ] All truths verified with status and evidence
531
+ - [ ] All artifacts checked at all three levels (exists, substantive, wired)
532
+ - [ ] All key links verified
533
+ - [ ] Requirements coverage assessed (if applicable)
534
+ - [ ] Anti-patterns scanned and categorized
535
+ - [ ] Human verification items identified
536
+ - [ ] Overall status determined
537
+ - [ ] Gaps structured in YAML frontmatter (if gaps_found)
538
+ - [ ] Re-verification metadata included (if previous existed)
539
+ - [ ] VERIFICATION.md created with complete report
540
+ - [ ] Results returned to orchestrator (NOT committed)
541
+ </success_criteria>
@@ -0,0 +1,100 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const os = require('os');
6
+
7
+ const args = process.argv.slice(2);
8
+ const pkg = require('../package.json');
9
+ const repoRoot = path.resolve(__dirname, '..');
10
+
11
+ const helpText = `
12
+ ${pkg.name} v${pkg.version}
13
+
14
+ Usage:
15
+ ${pkg.name} [--path <target-dir>] [--help]
16
+
17
+ Options:
18
+ --path <target-dir> Install into this directory (defaults to current directory)
19
+ --global Also install .claude to your home directory (for manual sharing)
20
+ --help, -h Show this help message
21
+
22
+ Examples:
23
+ npx gsd-codex-cli@latest --path .
24
+ npx gsd-codex-cli@latest --path ./my-project
25
+ `;
26
+
27
+ if (args.includes('--help') || args.includes('-h')) {
28
+ console.log(helpText);
29
+ process.exit(0);
30
+ }
31
+
32
+ const pathArgIndex = args.findIndex((arg, index) => {
33
+ if (arg === '--path') return true;
34
+ return false;
35
+ });
36
+ let targetDir = process.cwd();
37
+ if (pathArgIndex !== -1) {
38
+ const userPath = args[pathArgIndex + 1];
39
+ if (!userPath || userPath.startsWith('-')) {
40
+ console.error('Error: --path requires a directory argument.');
41
+ process.exit(1);
42
+ }
43
+ targetDir = path.resolve(process.cwd(), userPath);
44
+ }
45
+
46
+ const installGlobal = args.includes('--global');
47
+
48
+ function copyRecursive(source, destination) {
49
+ if (!fs.existsSync(source)) return;
50
+ fs.cpSync(source, destination, { recursive: true, force: true });
51
+ }
52
+
53
+ function ensureDir(dirPath) {
54
+ fs.mkdirSync(dirPath, { recursive: true });
55
+ }
56
+
57
+ function resolveSourceDir(repoRelative, fallbackRelative) {
58
+ const primary = path.join(repoRoot, repoRelative);
59
+ const fallback = fallbackRelative ? path.join(repoRoot, fallbackRelative) : null;
60
+
61
+ if (fs.existsSync(primary)) return primary;
62
+ if (fallback && fs.existsSync(fallback)) return fallback;
63
+
64
+ const fallbackMessage = fallbackRelative ? ` or ${fallbackRelative}` : '';
65
+ throw new Error(`Missing source directory "${repoRelative}"${fallbackMessage} in repository root ${repoRoot}`);
66
+ }
67
+
68
+ function copyCodexToDirectory(baseDir) {
69
+ const targetCodex = path.join(baseDir, '.codex');
70
+ const targetClaude = path.join(baseDir, '.claude');
71
+ const sourceCodex = path.join(repoRoot, '.codex');
72
+ const sourceGetShitDone = resolveSourceDir('get-shit-done', '.claude/get-shit-done');
73
+ const sourceAgents = resolveSourceDir('agents', '.claude/agents');
74
+
75
+ ensureDir(baseDir);
76
+ ensureDir(targetCodex);
77
+ ensureDir(targetClaude);
78
+
79
+ copyRecursive(sourceCodex, targetCodex);
80
+ copyRecursive(sourceGetShitDone, path.join(targetClaude, 'get-shit-done'));
81
+ copyRecursive(sourceAgents, path.join(targetClaude, 'agents'));
82
+ }
83
+
84
+ copyCodexToDirectory(targetDir);
85
+
86
+ if (installGlobal) {
87
+ // Global installs should place prompts at ~/.codex/prompts (not ~/.codex/.codex/prompts).
88
+ const globalBase = os.homedir();
89
+ copyCodexToDirectory(globalBase);
90
+ }
91
+
92
+ console.log(`\n${pkg.name}@${pkg.version} installed to:`);
93
+ console.log(` local: ${targetDir}`);
94
+ if (installGlobal) {
95
+ console.log(' global: ~/.codex');
96
+ }
97
+ console.log('\nNext steps:');
98
+ console.log(' 1) Open your project in Codex');
99
+ console.log(' 2) Run prompt gsd-new-project, then gsd-plan-phase, gsd-execute-phase');
100
+ console.log(' 3) Use .codex/prompts/* for all GSD commands in this fork');