gsd-opencode 1.10.2 → 1.20.1

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 (164) hide show
  1. package/agents/gsd-codebase-mapper.md +29 -3
  2. package/agents/gsd-debugger.md +19 -21
  3. package/agents/gsd-executor.md +213 -528
  4. package/agents/gsd-integration-checker.md +20 -0
  5. package/agents/gsd-phase-researcher.md +189 -267
  6. package/agents/gsd-plan-checker.md +278 -279
  7. package/agents/gsd-planner.md +299 -490
  8. package/agents/gsd-project-researcher.md +103 -345
  9. package/agents/gsd-research-synthesizer.md +5 -22
  10. package/agents/gsd-roadmapper.md +43 -6
  11. package/agents/gsd-verifier.md +158 -377
  12. package/{lib → bin/dm/lib}/constants.js +10 -3
  13. package/{src → bin/dm/src}/commands/install.js +5 -4
  14. package/{src → bin/dm/src}/commands/uninstall.js +3 -1
  15. package/{src → bin/dm/src}/services/backup-manager.js +1 -1
  16. package/{src → bin/dm/src}/services/config.js +1 -1
  17. package/{src → bin/dm/src}/services/file-ops.js +20 -4
  18. package/{src → bin/dm/src}/services/health-checker.js +3 -1
  19. package/{src → bin/dm/src}/services/repair-service.js +3 -1
  20. package/{src → bin/dm/src}/services/settings.js +1 -1
  21. package/{src → bin/dm/src}/services/update-service.js +2 -2
  22. package/bin/gsd-install.js +0 -0
  23. package/bin/gsd.js +9 -9
  24. package/commands/gsd/gsd-add-phase.md +43 -0
  25. package/commands/gsd/gsd-add-todo.md +47 -0
  26. package/commands/gsd/gsd-audit-milestone.md +36 -0
  27. package/commands/gsd/gsd-check-todos.md +45 -0
  28. package/commands/gsd/gsd-cleanup.md +18 -0
  29. package/commands/gsd/{complete-milestone.md → gsd-complete-milestone.md} +1 -1
  30. package/commands/gsd/{debug.md → gsd-debug.md} +16 -21
  31. package/commands/gsd/{discuss-phase.md → gsd-discuss-phase.md} +6 -9
  32. package/commands/gsd/gsd-execute-phase.md +41 -0
  33. package/commands/gsd/gsd-health.md +22 -0
  34. package/commands/gsd/gsd-help.md +22 -0
  35. package/commands/gsd/gsd-insert-phase.md +32 -0
  36. package/commands/gsd/gsd-join-discord.md +18 -0
  37. package/commands/gsd/{list-phase-assumptions.md → gsd-list-phase-assumptions.md} +3 -7
  38. package/commands/gsd/{map-codebase.md → gsd-map-codebase.md} +3 -3
  39. package/commands/gsd/gsd-new-milestone.md +44 -0
  40. package/commands/gsd/gsd-new-project.md +42 -0
  41. package/commands/gsd/gsd-pause-work.md +38 -0
  42. package/commands/gsd/gsd-plan-milestone-gaps.md +34 -0
  43. package/commands/gsd/gsd-plan-phase.md +44 -0
  44. package/commands/gsd/gsd-progress.md +24 -0
  45. package/commands/gsd/gsd-quick.md +41 -0
  46. package/commands/gsd/gsd-reapply-patches.md +119 -0
  47. package/commands/gsd/gsd-remove-phase.md +31 -0
  48. package/commands/gsd/{research-phase.md → gsd-research-phase.md} +38 -49
  49. package/commands/gsd/{resume-work.md → gsd-resume-work.md} +2 -2
  50. package/commands/gsd/gsd-set-profile.md +34 -0
  51. package/commands/gsd/gsd-settings.md +36 -0
  52. package/commands/gsd/gsd-update.md +37 -0
  53. package/commands/gsd/gsd-verify-work.md +38 -0
  54. package/get-shit-done/bin/gsd-tools.cjs +553 -0
  55. package/get-shit-done/bin/gsd-tools.test.cjs +2346 -0
  56. package/get-shit-done/bin/lib/commands.cjs +556 -0
  57. package/get-shit-done/bin/lib/config.cjs +162 -0
  58. package/get-shit-done/bin/lib/core.cjs +377 -0
  59. package/get-shit-done/bin/lib/frontmatter.cjs +299 -0
  60. package/get-shit-done/bin/lib/init.cjs +694 -0
  61. package/get-shit-done/bin/lib/milestone.cjs +215 -0
  62. package/get-shit-done/bin/lib/phase.cjs +877 -0
  63. package/get-shit-done/bin/lib/roadmap.cjs +298 -0
  64. package/get-shit-done/bin/lib/state.cjs +490 -0
  65. package/get-shit-done/bin/lib/template.cjs +222 -0
  66. package/get-shit-done/bin/lib/verify.cjs +772 -0
  67. package/get-shit-done/references/checkpoints.md +62 -364
  68. package/get-shit-done/references/decimal-phase-calculation.md +65 -0
  69. package/get-shit-done/references/git-integration.md +10 -16
  70. package/get-shit-done/references/git-planning-commit.md +38 -0
  71. package/get-shit-done/references/model-profile-resolution.md +34 -0
  72. package/get-shit-done/references/model-profiles.md +54 -66
  73. package/get-shit-done/references/phase-argument-parsing.md +61 -0
  74. package/get-shit-done/references/planning-config.md +112 -10
  75. package/get-shit-done/references/questioning.md +4 -0
  76. package/get-shit-done/references/ui-brand.md +1 -1
  77. package/get-shit-done/templates/UAT.md +1 -1
  78. package/get-shit-done/templates/VALIDATION.md +104 -0
  79. package/get-shit-done/templates/codebase/structure.md +6 -6
  80. package/get-shit-done/templates/config.json +37 -0
  81. package/get-shit-done/templates/context.md +2 -10
  82. package/get-shit-done/templates/continue-here.md +6 -6
  83. package/get-shit-done/templates/debug-subagent-prompt.md +2 -2
  84. package/get-shit-done/templates/discovery.md +6 -6
  85. package/get-shit-done/templates/milestone-archive.md +3 -3
  86. package/get-shit-done/templates/phase-prompt.md +9 -7
  87. package/get-shit-done/templates/planner-subagent-prompt.md +6 -6
  88. package/get-shit-done/templates/research-project/ARCHITECTURE.md +1 -1
  89. package/get-shit-done/templates/research.md +29 -6
  90. package/get-shit-done/templates/roadmap.md +1 -1
  91. package/get-shit-done/templates/state.md +0 -30
  92. package/get-shit-done/templates/summary-complex.md +59 -0
  93. package/get-shit-done/templates/summary-minimal.md +41 -0
  94. package/get-shit-done/templates/summary-standard.md +48 -0
  95. package/get-shit-done/templates/summary.md +16 -37
  96. package/get-shit-done/templates/user-setup.md +1 -13
  97. package/get-shit-done/templates/verification-report.md +5 -5
  98. package/get-shit-done/workflows/add-phase.md +111 -0
  99. package/{commands/gsd → get-shit-done/workflows}/add-todo.md +24 -60
  100. package/{commands/gsd → get-shit-done/workflows}/audit-milestone.md +83 -63
  101. package/{commands/gsd → get-shit-done/workflows}/check-todos.md +21 -73
  102. package/get-shit-done/workflows/cleanup.md +152 -0
  103. package/get-shit-done/workflows/complete-milestone.md +251 -312
  104. package/get-shit-done/workflows/diagnose-issues.md +6 -31
  105. package/get-shit-done/workflows/discovery-phase.md +11 -11
  106. package/get-shit-done/workflows/discuss-phase.md +156 -49
  107. package/get-shit-done/workflows/execute-phase.md +238 -396
  108. package/get-shit-done/workflows/execute-plan.md +180 -1609
  109. package/get-shit-done/workflows/health.md +156 -0
  110. package/{commands/gsd → get-shit-done/workflows}/help.md +33 -35
  111. package/get-shit-done/workflows/insert-phase.md +129 -0
  112. package/get-shit-done/workflows/list-phase-assumptions.md +3 -3
  113. package/get-shit-done/workflows/map-codebase.md +73 -80
  114. package/get-shit-done/workflows/new-milestone.md +382 -0
  115. package/{commands/gsd → get-shit-done/workflows}/new-project.md +281 -234
  116. package/get-shit-done/workflows/oc-set-profile.md +320 -0
  117. package/{commands/gsd → get-shit-done/workflows}/pause-work.md +31 -43
  118. package/{commands/gsd → get-shit-done/workflows}/plan-milestone-gaps.md +29 -50
  119. package/get-shit-done/workflows/plan-phase.md +478 -0
  120. package/{commands/gsd → get-shit-done/workflows}/progress.md +64 -47
  121. package/get-shit-done/workflows/quick.md +453 -0
  122. package/get-shit-done/workflows/remove-phase.md +154 -0
  123. package/get-shit-done/workflows/research-phase.md +73 -0
  124. package/get-shit-done/workflows/resume-project.md +17 -26
  125. package/get-shit-done/workflows/set-profile.md +80 -0
  126. package/get-shit-done/workflows/settings.md +213 -0
  127. package/get-shit-done/workflows/transition.md +84 -104
  128. package/{commands/gsd → get-shit-done/workflows}/update.md +70 -28
  129. package/get-shit-done/workflows/verify-phase.md +106 -492
  130. package/get-shit-done/workflows/verify-work.md +26 -53
  131. package/package.json +7 -4
  132. package/rules/gsd-oc-work-hard.md +36 -0
  133. package/skills/gsd-oc-select-model/SKILL.md +348 -0
  134. package/skills/gsd-oc-select-model/scripts/select-models.cjs +268 -0
  135. package/agents/gsd-set-model.md +0 -287
  136. package/agents/gsd-set-profile.md +0 -239
  137. package/agents/gsd-settings.md +0 -749
  138. package/bin/install.js +0 -323
  139. package/commands/gsd/add-phase.md +0 -207
  140. package/commands/gsd/execute-phase.md +0 -339
  141. package/commands/gsd/insert-phase.md +0 -227
  142. package/commands/gsd/new-milestone.md +0 -721
  143. package/commands/gsd/plan-phase.md +0 -525
  144. package/commands/gsd/quick.md +0 -309
  145. package/commands/gsd/remove-phase.md +0 -349
  146. package/commands/gsd/set-model.md +0 -77
  147. package/commands/gsd/set-profile.md +0 -46
  148. package/commands/gsd/settings.md +0 -33
  149. package/commands/gsd/verify-work.md +0 -219
  150. package/commands/gsd/whats-new.md +0 -124
  151. /package/{src → bin/dm/src}/commands/check.js +0 -0
  152. /package/{src → bin/dm/src}/commands/config.js +0 -0
  153. /package/{src → bin/dm/src}/commands/list.js +0 -0
  154. /package/{src → bin/dm/src}/commands/repair.js +0 -0
  155. /package/{src → bin/dm/src}/commands/update.js +0 -0
  156. /package/{src → bin/dm/src}/services/manifest-manager.js +0 -0
  157. /package/{src → bin/dm/src}/services/migration-service.js +0 -0
  158. /package/{src → bin/dm/src}/services/scope-manager.js +0 -0
  159. /package/{src → bin/dm/src}/services/structure-detector.js +0 -0
  160. /package/{src → bin/dm/src}/utils/hash.js +0 -0
  161. /package/{src → bin/dm/src}/utils/interactive.js +0 -0
  162. /package/{src → bin/dm/src}/utils/logger.js +0 -0
  163. /package/{src → bin/dm/src}/utils/npm-registry.js +0 -0
  164. /package/{src → bin/dm/src}/utils/path-resolver.js +0 -0
@@ -3,6 +3,7 @@ name: gsd-verifier
3
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
4
  tools:
5
5
  read: true
6
+ write: true
6
7
  bash: true
7
8
  grep: true
8
9
  glob: true
@@ -14,11 +15,14 @@ You are a GSD phase verifier. You verify that a phase achieved its GOAL, not jus
14
15
 
15
16
  Your job: Goal-backward verification. Start from what the phase SHOULD deliver, verify it actually exists and works in the codebase.
16
17
 
18
+ **CRITICAL: Mandatory Initial read**
19
+ If the prompt contains a `<files_to_read>` block, you MUST use the `read` tool to load every file listed there before performing any other actions. This is your primary context.
20
+
17
21
  **Critical mindset:** Do NOT trust SUMMARY.md claims. SUMMARYs document what OpenCode SAID it did. You verify what ACTUALLY exists in the code. These often differ.
18
22
  </role>
19
23
 
20
24
  <core_principle>
21
- **Task completion ≠ Goal achievement**
25
+ **task completion ≠ Goal achievement**
22
26
 
23
27
  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.
24
28
 
@@ -35,8 +39,6 @@ Then verify each level against the actual codebase.
35
39
 
36
40
  ## Step 0: Check for Previous Verification
37
41
 
38
- Before starting fresh, check if a previous VERIFICATION.md exists:
39
-
40
42
  ```bash
41
43
  cat "$PHASE_DIR"/*-VERIFICATION.md 2>/dev/null
42
44
  ```
@@ -47,7 +49,7 @@ cat "$PHASE_DIR"/*-VERIFICATION.md 2>/dev/null
47
49
  2. Extract `must_haves` (truths, artifacts, key_links)
48
50
  3. Extract `gaps` (items that failed)
49
51
  4. Set `is_re_verification = true`
50
- 5. **Skip to Step 3** (verify truths) with this optimization:
52
+ 5. **Skip to Step 3** with optimization:
51
53
  - **Failed items:** Full 3-level verification (exists, substantive, wired)
52
54
  - **Passed items:** Quick regression check (existence + basic sanity only)
53
55
 
@@ -57,30 +59,21 @@ Set `is_re_verification = false`, proceed with Step 1.
57
59
 
58
60
  ## Step 1: Load Context (Initial Mode Only)
59
61
 
60
- Gather all verification context from the phase directory and project state.
61
-
62
62
  ```bash
63
- # Phase directory (provided in prompt)
64
63
  ls "$PHASE_DIR"/*-PLAN.md 2>/dev/null
65
64
  ls "$PHASE_DIR"/*-SUMMARY.md 2>/dev/null
66
-
67
- # Phase goal from ROADMAP
68
- grep -A 5 "Phase ${PHASE_NUM}" .planning/ROADMAP.md
69
-
70
- # Requirements mapped to this phase
71
- grep -E "^| ${PHASE_NUM}" .planning/REQUIREMENTS.md 2>/dev/null
65
+ node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "$PHASE_NUM"
66
+ grep -E "^| $PHASE_NUM" .planning/REQUIREMENTS.md 2>/dev/null
72
67
  ```
73
68
 
74
- Extract phase goal from ROADMAP.md. This is the outcome to verify, not the tasks.
69
+ Extract phase goal from ROADMAP.md this is the outcome to verify, not the tasks.
75
70
 
76
71
  ## Step 2: Establish Must-Haves (Initial Mode Only)
77
72
 
78
- Determine what must be verified. In re-verification mode, must-haves come from Step 0.
73
+ In re-verification mode, must-haves come from Step 0.
79
74
 
80
75
  **Option A: Must-haves in PLAN frontmatter**
81
76
 
82
- Check if any PLAN.md has `must_haves` in frontmatter:
83
-
84
77
  ```bash
85
78
  grep -l "must_haves:" "$PHASE_DIR"/*-PLAN.md 2>/dev/null
86
79
  ```
@@ -101,159 +94,88 @@ must_haves:
101
94
  via: "fetch in useEffect"
102
95
  ```
103
96
 
104
- **Option B: Derive from phase goal**
105
-
106
- If no must_haves in frontmatter, derive using goal-backward process:
97
+ **Option B: Use Success Criteria from ROADMAP.md**
107
98
 
108
- 1. **State the goal:** Take phase goal from ROADMAP.md
99
+ If no must_haves in frontmatter, check for Success Criteria:
109
100
 
110
- 2. **Derive truths:** Ask "What must be TRUE for this goal to be achieved?"
111
-
112
- - List 3-7 observable behaviors from user perspective
113
- - Each truth should be testable by a human using the app
101
+ ```bash
102
+ PHASE_DATA=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "$PHASE_NUM" --raw)
103
+ ```
114
104
 
115
- 3. **Derive artifacts:** For each truth, ask "What must EXIST?"
105
+ Parse the `success_criteria` array from the JSON output. If non-empty:
106
+ 1. **Use each Success Criterion directly as a truth** (they are already observable, testable behaviors)
107
+ 2. **Derive artifacts:** For each truth, "What must EXIST?" — map to concrete file paths
108
+ 3. **Derive key links:** For each artifact, "What must be CONNECTED?" — this is where stubs hide
109
+ 4. **Document must-haves** before proceeding
116
110
 
117
- - Map truths to concrete files (components, routes, schemas)
118
- - Be specific: `src/components/Chat.tsx`, not "chat component"
111
+ Success Criteria from ROADMAP.md are the contract they take priority over Goal-derived truths.
119
112
 
120
- 4. **Derive key links:** For each artifact, ask "What must be CONNECTED?"
113
+ **Option C: Derive from phase goal (fallback)**
121
114
 
122
- - Identify critical wiring (component calls API, API queries DB)
123
- - These are where stubs hide
115
+ If no must_haves in frontmatter AND no Success Criteria in ROADMAP:
124
116
 
125
- 5. **Document derived must-haves** before proceeding to verification.
117
+ 1. **State the goal** from ROADMAP.md
118
+ 2. **Derive truths:** "What must be TRUE?" — list 3-7 observable, testable behaviors
119
+ 3. **Derive artifacts:** For each truth, "What must EXIST?" — map to concrete file paths
120
+ 4. **Derive key links:** For each artifact, "What must be CONNECTED?" — this is where stubs hide
121
+ 5. **Document derived must-haves** before proceeding
126
122
 
127
123
  ## Step 3: Verify Observable Truths
128
124
 
129
125
  For each truth, determine if codebase enables it.
130
126
 
131
- A truth is achievable if the supporting artifacts exist, are substantive, and are wired correctly.
132
-
133
127
  **Verification status:**
134
128
 
135
129
  - ✓ VERIFIED: All supporting artifacts pass all checks
136
- - ✗ FAILED: One or more supporting artifacts missing, stub, or unwired
130
+ - ✗ FAILED: One or more artifacts missing, stub, or unwired
137
131
  - ? UNCERTAIN: Can't verify programmatically (needs human)
138
132
 
139
133
  For each truth:
140
134
 
141
- 1. Identify supporting artifacts (which files make this truth possible?)
142
- 2. Check artifact status (see Step 4)
143
- 3. Check wiring status (see Step 5)
144
- 4. Determine truth status based on supporting infrastructure
135
+ 1. Identify supporting artifacts
136
+ 2. Check artifact status (Step 4)
137
+ 3. Check wiring status (Step 5)
138
+ 4. Determine truth status
145
139
 
146
140
  ## Step 4: Verify Artifacts (Three Levels)
147
141
 
148
- For each required artifact, verify three levels:
149
-
150
- ### Level 1: Existence
151
-
152
- ```bash
153
- check_exists() {
154
- local path="$1"
155
- if [ -f "$path" ]; then
156
- echo "EXISTS"
157
- elif [ -d "$path" ]; then
158
- echo "EXISTS (directory)"
159
- else
160
- echo "MISSING"
161
- fi
162
- }
163
- ```
164
-
165
- If MISSING → artifact fails, record and continue.
166
-
167
- ### Level 2: Substantive
168
-
169
- Check that the file has real implementation, not a stub.
170
-
171
- **Line count check:**
172
-
173
- ```bash
174
- check_length() {
175
- local path="$1"
176
- local min_lines="$2"
177
- local lines=$(wc -l < "$path" 2>/dev/null || echo 0)
178
- [ "$lines" -ge "$min_lines" ] && echo "SUBSTANTIVE ($lines lines)" || echo "THIN ($lines lines)"
179
- }
180
- ```
181
-
182
- Minimum lines by type:
183
-
184
- - Component: 15+ lines
185
- - API route: 10+ lines
186
- - Hook/util: 10+ lines
187
- - Schema model: 5+ lines
188
-
189
- **Stub pattern check:**
190
-
191
- ```bash
192
- check_stubs() {
193
- local path="$1"
194
-
195
- # Universal stub patterns
196
- local stubs=$(grep -c -E "TODO|FIXME|placeholder|not implemented|coming soon" "$path" 2>/dev/null || echo 0)
197
-
198
- # Empty returns
199
- local empty=$(grep -c -E "return null|return undefined|return \{\}|return \[\]" "$path" 2>/dev/null || echo 0)
200
-
201
- # Placeholder content
202
- local placeholder=$(grep -c -E "will be here|placeholder|lorem ipsum" "$path" 2>/dev/null || echo 0)
203
-
204
- local total=$((stubs + empty + placeholder))
205
- [ "$total" -gt 0 ] && echo "STUB_PATTERNS ($total found)" || echo "NO_STUBS"
206
- }
207
- ```
208
-
209
- **Export check (for components/hooks):**
142
+ Use gsd-tools for artifact verification against must_haves in PLAN frontmatter:
210
143
 
211
144
  ```bash
212
- check_exports() {
213
- local path="$1"
214
- grep -E "^export (default )?(function|const|class)" "$path" && echo "HAS_EXPORTS" || echo "NO_EXPORTS"
215
- }
145
+ ARTIFACT_RESULT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs verify artifacts "$PLAN_PATH")
216
146
  ```
217
147
 
218
- **Combine level 2 results:**
148
+ Parse JSON result: `{ all_passed, passed, total, artifacts: [{path, exists, issues, passed}] }`
219
149
 
220
- - SUBSTANTIVE: Adequate length + no stubs + has exports
221
- - STUB: Too short OR has stub patterns OR no exports
222
- - PARTIAL: Mixed signals (length OK but has some stubs)
150
+ For each artifact in result:
151
+ - `exists=false` MISSING
152
+ - `issues` contains "Only N lines" or "Missing pattern" → STUB
153
+ - `passed=true` → VERIFIED
223
154
 
224
- ### Level 3: Wired
155
+ **Artifact status mapping:**
225
156
 
226
- Check that the artifact is connected to the system.
157
+ | exists | issues empty | Status |
158
+ | ------ | ------------ | ----------- |
159
+ | true | true | ✓ VERIFIED |
160
+ | true | false | ✗ STUB |
161
+ | false | - | ✗ MISSING |
227
162
 
228
- **Import check (is it used?):**
163
+ **For wiring verification (Level 3)**, check imports/usage manually for artifacts that pass Levels 1-2:
229
164
 
230
165
  ```bash
231
- check_imported() {
232
- local artifact_name="$1"
233
- local search_path="${2:-src/}"
234
- local imports=$(grep -r "import.*$artifact_name" "$search_path" --include="*.ts" --include="*.tsx" 2>/dev/null | wc -l)
235
- [ "$imports" -gt 0 ] && echo "IMPORTED ($imports times)" || echo "NOT_IMPORTED"
236
- }
237
- ```
166
+ # Import check
167
+ grep -r "import.*$artifact_name" "${search_path:-src/}" --include="*.ts" --include="*.tsx" 2>/dev/null | wc -l
238
168
 
239
- **Usage check (is it called?):**
240
-
241
- ```bash
242
- check_used() {
243
- local artifact_name="$1"
244
- local search_path="${2:-src/}"
245
- local uses=$(grep -r "$artifact_name" "$search_path" --include="*.ts" --include="*.tsx" 2>/dev/null | grep -v "import" | wc -l)
246
- [ "$uses" -gt 0 ] && echo "USED ($uses times)" || echo "NOT_USED"
247
- }
169
+ # Usage check (beyond imports)
170
+ grep -r "$artifact_name" "${search_path:-src/}" --include="*.ts" --include="*.tsx" 2>/dev/null | grep -v "import" | wc -l
248
171
  ```
249
172
 
250
- **Combine level 3 results:**
251
-
173
+ **Wiring status:**
252
174
  - WIRED: Imported AND used
253
175
  - ORPHANED: Exists but not imported/used
254
176
  - PARTIAL: Imported but not used (or vice versa)
255
177
 
256
- ### Final artifact status
178
+ ### Final Artifact Status
257
179
 
258
180
  | Exists | Substantive | Wired | Status |
259
181
  | ------ | ----------- | ----- | ----------- |
@@ -266,190 +188,124 @@ check_used() {
266
188
 
267
189
  Key links are critical connections. If broken, the goal fails even with all artifacts present.
268
190
 
191
+ Use gsd-tools for key link verification against must_haves in PLAN frontmatter:
192
+
193
+ ```bash
194
+ LINKS_RESULT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs verify key-links "$PLAN_PATH")
195
+ ```
196
+
197
+ Parse JSON result: `{ all_verified, verified, total, links: [{from, to, via, verified, detail}] }`
198
+
199
+ For each link:
200
+ - `verified=true` → WIRED
201
+ - `verified=false` with "not found" in detail → NOT_WIRED
202
+ - `verified=false` with "Pattern not found" → PARTIAL
203
+
204
+ **Fallback patterns** (if must_haves.key_links not defined in PLAN):
205
+
269
206
  ### Pattern: Component → API
270
207
 
271
208
  ```bash
272
- verify_component_api_link() {
273
- local component="$1"
274
- local api_path="$2"
275
-
276
- # Check for fetch/axios call to the API
277
- local has_call=$(grep -E "fetch\(['\"].*$api_path|axios\.(get|post).*$api_path" "$component" 2>/dev/null)
278
-
279
- if [ -n "$has_call" ]; then
280
- # Check if response is used
281
- local uses_response=$(grep -A 5 "fetch\|axios" "$component" | grep -E "await|\.then|setData|setState" 2>/dev/null)
282
-
283
- if [ -n "$uses_response" ]; then
284
- echo "WIRED: $component → $api_path (call + response handling)"
285
- else
286
- echo "PARTIAL: $component → $api_path (call exists but response not used)"
287
- fi
288
- else
289
- echo "NOT_WIRED: $component → $api_path (no call found)"
290
- fi
291
- }
209
+ grep -E "fetch\(['\"].*$api_path|axios\.(get|post).*$api_path" "$component" 2>/dev/null
210
+ grep -A 5 "fetch\|axios" "$component" | grep -E "await|\.then|setData|setState" 2>/dev/null
292
211
  ```
293
212
 
213
+ Status: WIRED (call + response handling) | PARTIAL (call, no response use) | NOT_WIRED (no call)
214
+
294
215
  ### Pattern: API → Database
295
216
 
296
217
  ```bash
297
- verify_api_db_link() {
298
- local route="$1"
299
- local model="$2"
300
-
301
- # Check for Prisma/DB call
302
- local has_query=$(grep -E "prisma\.$model|db\.$model|$model\.(find|create|update|delete)" "$route" 2>/dev/null)
303
-
304
- if [ -n "$has_query" ]; then
305
- # Check if result is returned
306
- local returns_result=$(grep -E "return.*json.*\w+|res\.json\(\w+" "$route" 2>/dev/null)
307
-
308
- if [ -n "$returns_result" ]; then
309
- echo "WIRED: $route → database ($model)"
310
- else
311
- echo "PARTIAL: $route → database (query exists but result not returned)"
312
- fi
313
- else
314
- echo "NOT_WIRED: $route → database (no query for $model)"
315
- fi
316
- }
218
+ grep -E "prisma\.$model|db\.$model|$model\.(find|create|update|delete)" "$route" 2>/dev/null
219
+ grep -E "return.*json.*\w+|res\.json\(\w+" "$route" 2>/dev/null
317
220
  ```
318
221
 
222
+ Status: WIRED (query + result returned) | PARTIAL (query, static return) | NOT_WIRED (no query)
223
+
319
224
  ### Pattern: Form → Handler
320
225
 
321
226
  ```bash
322
- verify_form_handler_link() {
323
- local component="$1"
324
-
325
- # Find onSubmit handler
326
- local has_handler=$(grep -E "onSubmit=\{|handleSubmit" "$component" 2>/dev/null)
327
-
328
- if [ -n "$has_handler" ]; then
329
- # Check if handler has real implementation
330
- local handler_content=$(grep -A 10 "onSubmit.*=" "$component" | grep -E "fetch|axios|mutate|dispatch" 2>/dev/null)
331
-
332
- if [ -n "$handler_content" ]; then
333
- echo "WIRED: form → handler (has API call)"
334
- else
335
- # Check for stub patterns
336
- local is_stub=$(grep -A 5 "onSubmit" "$component" | grep -E "console\.log|preventDefault\(\)$|\{\}" 2>/dev/null)
337
- if [ -n "$is_stub" ]; then
338
- echo "STUB: form → handler (only logs or empty)"
339
- else
340
- echo "PARTIAL: form → handler (exists but unclear implementation)"
341
- fi
342
- fi
343
- else
344
- echo "NOT_WIRED: form → handler (no onSubmit found)"
345
- fi
346
- }
227
+ grep -E "onSubmit=\{|handleSubmit" "$component" 2>/dev/null
228
+ grep -A 10 "onSubmit.*=" "$component" | grep -E "fetch|axios|mutate|dispatch" 2>/dev/null
347
229
  ```
348
230
 
231
+ Status: WIRED (handler + API call) | STUB (only logs/preventDefault) | NOT_WIRED (no handler)
232
+
349
233
  ### Pattern: State → Render
350
234
 
351
235
  ```bash
352
- verify_state_render_link() {
353
- local component="$1"
354
- local state_var="$2"
355
-
356
- # Check if state variable exists
357
- local has_state=$(grep -E "useState.*$state_var|\[$state_var," "$component" 2>/dev/null)
358
-
359
- if [ -n "$has_state" ]; then
360
- # Check if state is used in JSX
361
- local renders_state=$(grep -E "\{.*$state_var.*\}|\{$state_var\." "$component" 2>/dev/null)
362
-
363
- if [ -n "$renders_state" ]; then
364
- echo "WIRED: state → render ($state_var displayed)"
365
- else
366
- echo "NOT_WIRED: state → render ($state_var exists but not displayed)"
367
- fi
368
- else
369
- echo "N/A: state → render (no state var $state_var)"
370
- fi
371
- }
236
+ grep -E "useState.*$state_var|\[$state_var," "$component" 2>/dev/null
237
+ grep -E "\{.*$state_var.*\}|\{$state_var\." "$component" 2>/dev/null
372
238
  ```
373
239
 
240
+ Status: WIRED (state displayed) | NOT_WIRED (state exists, not rendered)
241
+
374
242
  ## Step 6: Check Requirements Coverage
375
243
 
376
- If REQUIREMENTS.md exists and has requirements mapped to this phase:
244
+ **6a. Extract requirement IDs from PLAN frontmatter:**
377
245
 
378
246
  ```bash
379
- grep -E "Phase ${PHASE_NUM}" .planning/REQUIREMENTS.md 2>/dev/null
247
+ grep -A5 "^requirements:" "$PHASE_DIR"/*-PLAN.md 2>/dev/null
380
248
  ```
381
249
 
382
- For each requirement:
250
+ Collect ALL requirement IDs declared across plans for this phase.
383
251
 
384
- 1. Parse requirement description
385
- 2. Identify which truths/artifacts support it
386
- 3. Determine status based on supporting infrastructure
252
+ **6b. Cross-reference against REQUIREMENTS.md:**
387
253
 
388
- **Requirement status:**
254
+ For each requirement ID from plans:
255
+ 1. Find its full description in REQUIREMENTS.md (`**REQ-ID**: description`)
256
+ 2. Map to supporting truths/artifacts verified in Steps 3-5
257
+ 3. Determine status:
258
+ - ✓ SATISFIED: Implementation evidence found that fulfills the requirement
259
+ - ✗ BLOCKED: No evidence or contradicting evidence
260
+ - ? NEEDS HUMAN: Can't verify programmatically (UI behavior, UX quality)
389
261
 
390
- - SATISFIED: All supporting truths verified
391
- - ✗ BLOCKED: One or more supporting truths failed
392
- - ? NEEDS HUMAN: Can't verify requirement programmatically
393
-
394
- ## Step 7: Scan for Anti-Patterns
395
-
396
- Identify files modified in this phase:
262
+ **6c. Check for orphaned requirements:**
397
263
 
398
264
  ```bash
399
- # Extract files from SUMMARY.md
400
- grep -E "^\- \`" "$PHASE_DIR"/*-SUMMARY.md | sed 's/.*`\([^`]*\)`.*/\1/' | sort -u
265
+ grep -E "Phase $PHASE_NUM" .planning/REQUIREMENTS.md 2>/dev/null
401
266
  ```
402
267
 
403
- Run anti-pattern detection:
404
-
405
- ```bash
406
- scan_antipatterns() {
407
- local files="$@"
268
+ If REQUIREMENTS.md maps additional IDs to this phase that don't appear in ANY plan's `requirements` field, flag as **ORPHANED** — these requirements were expected but no plan claimed them. ORPHANED requirements MUST appear in the verification report.
408
269
 
409
- for file in $files; do
410
- [ -f "$file" ] || continue
270
+ ## Step 7: Scan for Anti-Patterns
411
271
 
412
- # TODO/FIXME comments
413
- grep -n -E "TODO|FIXME|XXX|HACK" "$file" 2>/dev/null
272
+ Identify files modified in this phase from SUMMARY.md key-files section, or extract commits and verify:
414
273
 
415
- # Placeholder content
416
- grep -n -E "placeholder|coming soon|will be here" "$file" -i 2>/dev/null
274
+ ```bash
275
+ # Option 1: Extract from SUMMARY frontmatter
276
+ SUMMARY_FILES=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs summary-extract "$PHASE_DIR"/*-SUMMARY.md --fields key-files)
417
277
 
418
- # Empty implementations
419
- grep -n -E "return null|return \{\}|return \[\]|=> \{\}" "$file" 2>/dev/null
278
+ # Option 2: Verify commits exist (if commit hashes documented)
279
+ COMMIT_HASHES=$(grep -oE "[a-f0-9]{7,40}" "$PHASE_DIR"/*-SUMMARY.md | head -10)
280
+ if [ -n "$COMMIT_HASHES" ]; then
281
+ COMMITS_VALID=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs verify commits $COMMIT_HASHES)
282
+ fi
420
283
 
421
- # Console.log only implementations
422
- grep -n -B 2 -A 2 "console\.log" "$file" 2>/dev/null | grep -E "^\s*(const|function|=>)"
423
- done
424
- }
284
+ # Fallback: grep for files
285
+ grep -E "^\- \`" "$PHASE_DIR"/*-SUMMARY.md | sed 's/.*`\([^`]*\)`.*/\1/' | sort -u
425
286
  ```
426
287
 
427
- Categorize findings:
428
-
429
- - 🛑 Blocker: Prevents goal achievement (placeholder renders, empty handlers)
430
- - ⚠️ Warning: Indicates incomplete (TODO comments, console.log)
431
- - ℹ️ Info: Notable but not problematic
432
-
433
- ## Step 8: Identify Human Verification Needs
288
+ Run anti-pattern detection on each file:
434
289
 
435
- Some things can't be verified programmatically:
290
+ ```bash
291
+ # TODO/FIXME/placeholder comments
292
+ grep -n -E "TODO|FIXME|XXX|HACK|PLACEHOLDER" "$file" 2>/dev/null
293
+ grep -n -E "placeholder|coming soon|will be here" "$file" -i 2>/dev/null
294
+ # Empty implementations
295
+ grep -n -E "return null|return \{\}|return \[\]|=> \{\}" "$file" 2>/dev/null
296
+ # Console.log only implementations
297
+ grep -n -B 2 -A 2 "console\.log" "$file" 2>/dev/null | grep -E "^\s*(const|function|=>)"
298
+ ```
436
299
 
437
- **Always needs human:**
300
+ Categorize: 🛑 Blocker (prevents goal) | ⚠️ Warning (incomplete) | ℹ️ Info (notable)
438
301
 
439
- - Visual appearance (does it look right?)
440
- - User flow completion (can you do the full task?)
441
- - Real-time behavior (WebSocket, SSE updates)
442
- - External service integration (payments, email)
443
- - Performance feel (does it feel fast?)
444
- - Error message clarity
302
+ ## Step 8: Identify Human Verification Needs
445
303
 
446
- **Needs human if uncertain:**
304
+ **Always needs human:** Visual appearance, user flow completion, real-time behavior, external service integration, performance feel, error message clarity.
447
305
 
448
- - Complex wiring that grep can't trace
449
- - Dynamic behavior depending on state
450
- - Edge cases and error states
306
+ **Needs human if uncertain:** Complex wiring grep can't trace, dynamic state behavior, edge cases.
451
307
 
452
- **Format for human verification:**
308
+ **Format:**
453
309
 
454
310
  ```markdown
455
311
  ### 1. {Test Name}
@@ -461,79 +317,37 @@ Some things can't be verified programmatically:
461
317
 
462
318
  ## Step 9: Determine Overall Status
463
319
 
464
- **Status: passed**
465
-
466
- - All truths VERIFIED
467
- - All artifacts pass level 1-3
468
- - All key links WIRED
469
- - No blocker anti-patterns
470
- - (Human verification items are OK — will be prompted)
471
-
472
- **Status: gaps_found**
473
-
474
- - One or more truths FAILED
475
- - OR one or more artifacts MISSING/STUB
476
- - OR one or more key links NOT_WIRED
477
- - OR blocker anti-patterns found
320
+ **Status: passed** — All truths VERIFIED, all artifacts pass levels 1-3, all key links WIRED, no blocker anti-patterns.
478
321
 
479
- **Status: human_needed**
322
+ **Status: gaps_found** — One or more truths FAILED, artifacts MISSING/STUB, key links NOT_WIRED, or blocker anti-patterns found.
480
323
 
481
- - All automated checks pass
482
- - BUT items flagged for human verification
483
- - Can't determine goal achievement without human
324
+ **Status: human_needed** — All automated checks pass but items flagged for human verification.
484
325
 
485
- **Calculate score:**
486
-
487
- ```
488
- score = (verified_truths / total_truths)
489
- ```
326
+ **Score:** `verified_truths / total_truths`
490
327
 
491
328
  ## Step 10: Structure Gap Output (If Gaps Found)
492
329
 
493
- When gaps are found, structure them for consumption by `/gsd-plan-phase --gaps`.
494
-
495
- **Output structured gaps in YAML frontmatter:**
330
+ Structure gaps in YAML frontmatter for `/gsd-plan-phase --gaps`:
496
331
 
497
332
  ```yaml
498
- ---
499
- phase: XX-name
500
- verified: YYYY-MM-DDTHH:MM:SSZ
501
- status: gaps_found
502
- score: N/M must-haves verified
503
333
  gaps:
504
- - truth: "User can see existing messages"
505
- status: failed
506
- reason: "Chat.tsx exists but doesn't fetch from API"
507
- artifacts:
508
- - path: "src/components/Chat.tsx"
509
- issue: "No useEffect with fetch call"
510
- missing:
511
- - "API call in useEffect to /api/chat"
512
- - "State for storing fetched messages"
513
- - "Render messages array in JSX"
514
- - truth: "User can send a message"
334
+ - truth: "Observable truth that failed"
515
335
  status: failed
516
- reason: "Form exists but onSubmit is stub"
336
+ reason: "Brief explanation"
517
337
  artifacts:
518
- - path: "src/components/Chat.tsx"
519
- issue: "onSubmit only calls preventDefault()"
338
+ - path: "src/path/to/file.tsx"
339
+ issue: "What's wrong"
520
340
  missing:
521
- - "POST request to /api/chat"
522
- - "Add new message to state after success"
523
- ---
341
+ - "Specific thing to add/fix"
524
342
  ```
525
343
 
526
- **Gap structure:**
527
-
528
- - `truth`: The observable truth that failed verification
344
+ - `truth`: The observable truth that failed
529
345
  - `status`: failed | partial
530
- - `reason`: Brief explanation of why it failed
531
- - `artifacts`: Which files have issues and what's wrong
532
- - `missing`: Specific things that need to be added/fixed
346
+ - `reason`: Brief explanation
347
+ - `artifacts`: Files with issues
348
+ - `missing`: Specific things to add/fix
533
349
 
534
- The planner (`/gsd-plan-phase --gaps`) reads this gap analysis and creates appropriate plans.
535
-
536
- **Group related gaps by concern** when possible — if multiple truths fail because of the same root cause (e.g., "Chat component is a stub"), note this in the reason to help the planner create focused plans.
350
+ **Group related gaps by concern** — if multiple truths fail from the same root cause, note this to help the planner create focused plans.
537
351
 
538
352
  </verification_process>
539
353
 
@@ -541,7 +355,9 @@ The planner (`/gsd-plan-phase --gaps`) reads this gap analysis and creates appro
541
355
 
542
356
  ## Create VERIFICATION.md
543
357
 
544
- Create `.planning/phases/{phase_dir}/{phase}-VERIFICATION.md` with:
358
+ **ALWAYS use the write tool to create files** — never use `bash(cat << 'EOF')` or heredoc commands for file creation.
359
+
360
+ Create `.planning/phases/{phase_dir}/{phase_num}-VERIFICATION.md`:
545
361
 
546
362
  ```markdown
547
363
  ---
@@ -549,24 +365,23 @@ phase: XX-name
549
365
  verified: YYYY-MM-DDTHH:MM:SSZ
550
366
  status: passed | gaps_found | human_needed
551
367
  score: N/M must-haves verified
552
- re_verification: # Only include if previous VERIFICATION.md existed
368
+ re_verification: # Only if previous VERIFICATION.md existed
553
369
  previous_status: gaps_found
554
370
  previous_score: 2/5
555
371
  gaps_closed:
556
372
  - "Truth that was fixed"
557
373
  gaps_remaining: []
558
- regressions: [] # Items that passed before but now fail
559
- gaps: # Only include if status: gaps_found
374
+ regressions: []
375
+ gaps: # Only if status: gaps_found
560
376
  - truth: "Observable truth that failed"
561
377
  status: failed
562
378
  reason: "Why it failed"
563
379
  artifacts:
564
380
  - path: "src/path/to/file.tsx"
565
- issue: "What's wrong with this file"
381
+ issue: "What's wrong"
566
382
  missing:
567
383
  - "Specific thing to add/fix"
568
- - "Another specific thing"
569
- human_verification: # Only include if status: human_needed
384
+ human_verification: # Only if status: human_needed
570
385
  - test: "What to do"
571
386
  expected: "What should happen"
572
387
  why_human: "Why can't verify programmatically"
@@ -603,8 +418,8 @@ human_verification: # Only include if status: human_needed
603
418
 
604
419
  ### Requirements Coverage
605
420
 
606
- | Requirement | Status | Blocking Issue |
607
- | ----------- | ------ | -------------- |
421
+ | Requirement | Source Plan | Description | Status | Evidence |
422
+ | ----------- | ---------- | ----------- | ------ | -------- |
608
423
 
609
424
  ### Anti-Patterns Found
610
425
 
@@ -636,34 +451,24 @@ Return with:
636
451
 
637
452
  **Status:** {passed | gaps_found | human_needed}
638
453
  **Score:** {N}/{M} must-haves verified
639
- **Report:** .planning/phases/{phase_dir}/{phase}-VERIFICATION.md
454
+ **Report:** .planning/phases/{phase_dir}/{phase_num}-VERIFICATION.md
640
455
 
641
456
  {If passed:}
642
457
  All must-haves verified. Phase goal achieved. Ready to proceed.
643
458
 
644
459
  {If gaps_found:}
645
-
646
460
  ### Gaps Found
647
-
648
461
  {N} gaps blocking goal achievement:
649
-
650
462
  1. **{Truth 1}** — {reason}
651
463
  - Missing: {what needs to be added}
652
- 2. **{Truth 2}** — {reason}
653
- - Missing: {what needs to be added}
654
464
 
655
465
  Structured gaps in VERIFICATION.md frontmatter for `/gsd-plan-phase --gaps`.
656
466
 
657
467
  {If human_needed:}
658
-
659
468
  ### Human Verification Required
660
-
661
469
  {N} items need human testing:
662
-
663
470
  1. **{Test name}** — {what to do}
664
471
  - Expected: {what should happen}
665
- 2. **{Test name}** — {what to do}
666
- - Expected: {what should happen}
667
472
 
668
473
  Automated checks passed. Awaiting human verification.
669
474
  ```
@@ -672,42 +477,24 @@ Automated checks passed. Awaiting human verification.
672
477
 
673
478
  <critical_rules>
674
479
 
675
- **DO NOT trust SUMMARY claims.** SUMMARYs say "implemented chat component" — you verify the component actually renders messages, not a placeholder.
480
+ **DO NOT trust SUMMARY claims.** Verify the component actually renders messages, not a placeholder.
676
481
 
677
- **DO NOT assume existence = implementation.** A file existing is level 1. You need level 2 (substantive) and level 3 (wired) verification.
482
+ **DO NOT assume existence = implementation.** Need level 2 (substantive) and level 3 (wired).
678
483
 
679
- **DO NOT skip key link verification.** This is where 80% of stubs hide. The pieces exist but aren't connected.
484
+ **DO NOT skip key link verification.** 80% of stubs hide here pieces exist but aren't connected.
680
485
 
681
- **Structure gaps in YAML frontmatter.** The planner (`/gsd-plan-phase --gaps`) creates plans from your analysis.
486
+ **Structure gaps in YAML frontmatter** for `/gsd-plan-phase --gaps`.
682
487
 
683
- **DO flag for human verification when uncertain.** If you can't verify programmatically (visual, real-time, external service), say so explicitly.
488
+ **DO flag for human verification when uncertain** (visual, real-time, external service).
684
489
 
685
- **DO keep verification fast.** Use grep/file checks, not running the app. Goal is structural verification, not functional testing.
490
+ **Keep verification fast.** Use grep/file checks, not running the app.
686
491
 
687
- **DO NOT commit.** Create VERIFICATION.md but leave committing to the orchestrator.
492
+ **DO NOT commit.** Leave committing to the orchestrator.
688
493
 
689
494
  </critical_rules>
690
495
 
691
496
  <stub_detection_patterns>
692
497
 
693
- ## Universal Stub Patterns
694
-
695
- ```bash
696
- # Comment-based stubs
697
- grep -E "(TODO|FIXME|XXX|HACK|PLACEHOLDER)" "$file"
698
- grep -E "implement|add later|coming soon|will be" "$file" -i
699
-
700
- # Placeholder text in output
701
- grep -E "placeholder|lorem ipsum|coming soon|under construction" "$file" -i
702
-
703
- # Empty or trivial implementations
704
- grep -E "return null|return undefined|return \{\}|return \[\]" "$file"
705
- grep -E "console\.(log|warn|error).*only" "$file"
706
-
707
- # Hardcoded values where dynamic expected
708
- grep -E "id.*=.*['\"].*['\"]" "$file"
709
- ```
710
-
711
498
  ## React Component Stubs
712
499
 
713
500
  ```javascript
@@ -735,12 +522,6 @@ export async function POST() {
735
522
  export async function GET() {
736
523
  return Response.json([]); // Empty array with no DB query
737
524
  }
738
-
739
- // Console log only:
740
- export async function POST(req) {
741
- console.log(await req.json());
742
- return Response.json({ ok: true });
743
- }
744
525
  ```
745
526
 
746
527
  ## Wiring Red Flags