gsd-opencode 1.10.2 → 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 (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
@@ -1,15 +1,15 @@
1
1
  <purpose>
2
- Verify phase goal achievement through goal-backward analysis. Check that the codebase actually delivers what the phase promised, not just that tasks were completed.
2
+ Verify phase goal achievement through goal-backward analysis. Check that the codebase delivers what the phase promised, not just that tasks completed.
3
3
 
4
- This workflow is executed by a verification subagent spawned from execute-phase.md.
4
+ Executed by a verification subagent spawned from execute-phase.md.
5
5
  </purpose>
6
6
 
7
7
  <core_principle>
8
- **Task completion ≠ Goal achievement**
8
+ **task completion ≠ Goal achievement**
9
9
 
10
- 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.
10
+ A task "create chat component" can be marked complete when the component is a placeholder. The task was done — but the goal "working chat interface" was not achieved.
11
11
 
12
- Goal-backward verification starts from the outcome and works backwards:
12
+ Goal-backward verification:
13
13
  1. What must be TRUE for the goal to be achieved?
14
14
  2. What must EXIST for those truths to hold?
15
15
  3. What must be WIRED for those artifacts to function?
@@ -25,219 +25,99 @@ Then verify each level against the actual codebase.
25
25
  <process>
26
26
 
27
27
  <step name="load_context" priority="first">
28
- **Gather all verification context:**
28
+ Load phase operation context:
29
29
 
30
30
  ```bash
31
- # Phase directory (match both zero-padded and unpadded)
32
- PADDED_PHASE=$(printf "%02d" ${PHASE_ARG} 2>/dev/null || echo "${PHASE_ARG}")
33
- PHASE_DIR=$(ls -d .planning/phases/${PADDED_PHASE}-* .planning/phases/${PHASE_ARG}-* 2>/dev/null | head -1)
34
-
35
- # Phase goal from ROADMAP
36
- grep -A 5 "Phase ${PHASE_NUM}" .planning/ROADMAP.md
37
-
38
- # Requirements mapped to this phase
39
- grep -E "^| ${PHASE_NUM}" .planning/REQUIREMENTS.md 2>/dev/null
31
+ INIT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs init phase-op "${PHASE_ARG}")
32
+ ```
40
33
 
41
- # All SUMMARY files (claims to verify)
42
- ls "$PHASE_DIR"/*-SUMMARY.md 2>/dev/null
34
+ Extract from init JSON: `phase_dir`, `phase_number`, `phase_name`, `has_plans`, `plan_count`.
43
35
 
44
- # All PLAN files (for must_haves in frontmatter)
45
- ls "$PHASE_DIR"/*-PLAN.md 2>/dev/null
36
+ Then load phase details and list plans/summaries:
37
+ ```bash
38
+ node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "${phase_number}"
39
+ grep -E "^| ${phase_number}" .planning/REQUIREMENTS.md 2>/dev/null
40
+ ls "$phase_dir"/*-SUMMARY.md "$phase_dir"/*-PLAN.md 2>/dev/null
46
41
  ```
47
42
 
48
- **Extract phase goal:** Parse ROADMAP.md for this phase's goal/description. This is the outcome to verify, not the tasks.
49
-
50
- **Extract requirements:** If REQUIREMENTS.md exists, find requirements mapped to this phase. These become additional verification targets.
43
+ Extract **phase goal** from ROADMAP.md (the outcome to verify, not tasks) and **requirements** from REQUIREMENTS.md if it exists.
51
44
  </step>
52
45
 
53
46
  <step name="establish_must_haves">
54
- **Determine what must be verified.**
55
-
56
47
  **Option A: Must-haves in PLAN frontmatter**
57
48
 
58
- Check if any PLAN.md has `must_haves` in frontmatter:
49
+ Use gsd-tools to extract must_haves from each PLAN:
59
50
 
60
51
  ```bash
61
- grep -l "must_haves:" "$PHASE_DIR"/*-PLAN.md 2>/dev/null
52
+ for plan in "$PHASE_DIR"/*-PLAN.md; do
53
+ MUST_HAVES=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs frontmatter get "$plan" --field must_haves)
54
+ echo "=== $plan ===" && echo "$MUST_HAVES"
55
+ done
62
56
  ```
63
57
 
64
- If found, extract and use:
65
- ```yaml
66
- must_haves:
67
- truths:
68
- - "User can see existing messages"
69
- - "User can send a message"
70
- artifacts:
71
- - path: "src/components/Chat.tsx"
72
- provides: "Message list rendering"
73
- key_links:
74
- - from: "Chat.tsx"
75
- to: "api/chat"
76
- via: "fetch in useEffect"
77
- ```
58
+ Returns JSON: `{ truths: [...], artifacts: [...], key_links: [...] }`
78
59
 
79
- **Option B: Derive from phase goal**
60
+ Aggregate all must_haves across plans for phase-level verification.
80
61
 
81
- If no must_haves in frontmatter, derive using goal-backward process:
62
+ **Option B: Use Success Criteria from ROADMAP.md**
82
63
 
83
- 1. **State the goal:** Take phase goal from ROADMAP.md
64
+ If no must_haves in frontmatter (MUST_HAVES returns error or empty), check for Success Criteria:
84
65
 
85
- 2. **Derive truths:** Ask "What must be TRUE for this goal to be achieved?"
86
- - List 3-7 observable behaviors from user perspective
87
- - Each truth should be testable by a human using the app
66
+ ```bash
67
+ PHASE_DATA=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "${phase_number}" --raw)
68
+ ```
88
69
 
89
- 3. **Derive artifacts:** For each truth, ask "What must EXIST?"
90
- - Map truths to concrete files (components, routes, schemas)
91
- - Be specific: `src/components/Chat.tsx`, not "chat component"
70
+ Parse the `success_criteria` array from the JSON output. If non-empty:
71
+ 1. Use each Success Criterion directly as a **truth** (they are already written as observable, testable behaviors)
72
+ 2. Derive **artifacts** (concrete file paths for each truth)
73
+ 3. Derive **key links** (critical wiring where stubs hide)
74
+ 4. Document the must-haves before proceeding
92
75
 
93
- 4. **Derive key links:** For each artifact, ask "What must be CONNECTED?"
94
- - Identify critical wiring (component calls API, API queries DB)
95
- - These are where stubs hide
76
+ Success Criteria from ROADMAP.md are the contract they override PLAN-level must_haves when both exist.
96
77
 
97
- 5. **Document derived must-haves** before proceeding to verification.
78
+ **Option C: Derive from phase goal (fallback)**
98
79
 
99
- <!-- Goal-backward derivation expertise is baked into the gsd-verifier agent -->
80
+ If no must_haves in frontmatter AND no Success Criteria in ROADMAP:
81
+ 1. State the goal from ROADMAP.md
82
+ 2. Derive **truths** (3-7 observable behaviors, each testable)
83
+ 3. Derive **artifacts** (concrete file paths for each truth)
84
+ 4. Derive **key links** (critical wiring where stubs hide)
85
+ 5. Document derived must-haves before proceeding
100
86
  </step>
101
87
 
102
88
  <step name="verify_truths">
103
- **For each observable truth, determine if codebase enables it.**
104
-
105
- A truth is achievable if the supporting artifacts exist, are substantive, and are wired correctly.
106
-
107
- **Verification status:**
108
- - ✓ VERIFIED: All supporting artifacts pass all checks
109
- - ✗ FAILED: One or more supporting artifacts missing, stub, or unwired
110
- - ? UNCERTAIN: Can't verify programmatically (needs human)
111
-
112
- **For each truth:**
89
+ For each observable truth, determine if the codebase enables it.
113
90
 
114
- 1. Identify supporting artifacts (which files make this truth possible?)
115
- 2. Check artifact status (see verify_artifacts step)
116
- 3. Check wiring status (see verify_wiring step)
117
- 4. Determine truth status based on supporting infrastructure
91
+ **Status:** VERIFIED (all supporting artifacts pass) | ✗ FAILED (artifact missing/stub/unwired) | ? UNCERTAIN (needs human)
118
92
 
119
- **Example:**
93
+ For each truth: identify supporting artifacts → check artifact status → check wiring → determine truth status.
120
94
 
121
- Truth: "User can see existing messages"
122
-
123
- Supporting artifacts:
124
- - Chat.tsx (renders messages)
125
- - /api/chat GET (provides messages)
126
- - Message model (defines schema)
127
-
128
- If Chat.tsx is a stub → Truth FAILED
129
- If /api/chat GET returns hardcoded [] → Truth FAILED
130
- If Chat.tsx exists, is substantive, calls API, renders response → Truth VERIFIED
95
+ **Example:** Truth "User can see existing messages" depends on Chat.tsx (renders), /api/chat GET (provides), Message model (schema). If Chat.tsx is a stub or API returns hardcoded [] → FAILED. If all exist, are substantive, and connected → VERIFIED.
131
96
  </step>
132
97
 
133
98
  <step name="verify_artifacts">
134
- **For each required artifact, verify three levels:**
135
-
136
- ### Level 1: Existence
137
-
138
- ```bash
139
- check_exists() {
140
- local path="$1"
141
- if [ -f "$path" ]; then
142
- echo "EXISTS"
143
- elif [ -d "$path" ]; then
144
- echo "EXISTS (directory)"
145
- else
146
- echo "MISSING"
147
- fi
148
- }
149
- ```
150
-
151
- If MISSING → artifact fails, record and continue to next artifact.
152
-
153
- ### Level 2: Substantive
154
-
155
- Check that the file has real implementation, not a stub.
156
-
157
- **Line count check:**
158
- ```bash
159
- check_length() {
160
- local path="$1"
161
- local min_lines="$2"
162
- local lines=$(wc -l < "$path" 2>/dev/null || echo 0)
163
- [ "$lines" -ge "$min_lines" ] && echo "SUBSTANTIVE ($lines lines)" || echo "THIN ($lines lines)"
164
- }
165
- ```
166
-
167
- Minimum lines by type:
168
- - Component: 15+ lines
169
- - API route: 10+ lines
170
- - Hook/util: 10+ lines
171
- - Schema model: 5+ lines
172
-
173
- **Stub pattern check:**
174
- ```bash
175
- check_stubs() {
176
- local path="$1"
177
-
178
- # Universal stub patterns
179
- local stubs=$(grep -c -E "TODO|FIXME|placeholder|not implemented|coming soon" "$path" 2>/dev/null || echo 0)
180
-
181
- # Empty returns
182
- local empty=$(grep -c -E "return null|return undefined|return \{\}|return \[\]" "$path" 2>/dev/null || echo 0)
99
+ Use gsd-tools for artifact verification against must_haves in each PLAN:
183
100
 
184
- # Placeholder content
185
- local placeholder=$(grep -c -E "will be here|placeholder|lorem ipsum" "$path" 2>/dev/null || echo 0)
186
-
187
- local total=$((stubs + empty + placeholder))
188
- [ "$total" -gt 0 ] && echo "STUB_PATTERNS ($total found)" || echo "NO_STUBS"
189
- }
190
- ```
191
-
192
- **Export check (for components/hooks):**
193
101
  ```bash
194
- check_exports() {
195
- local path="$1"
196
- grep -E "^export (default )?(function|const|class)" "$path" && echo "HAS_EXPORTS" || echo "NO_EXPORTS"
197
- }
102
+ for plan in "$PHASE_DIR"/*-PLAN.md; do
103
+ ARTIFACT_RESULT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs verify artifacts "$plan")
104
+ echo "=== $plan ===" && echo "$ARTIFACT_RESULT"
105
+ done
198
106
  ```
199
107
 
200
- **Combine level 2 results:**
201
- - SUBSTANTIVE: Adequate length + no stubs + has exports
202
- - STUB: Too short OR has stub patterns OR no exports
203
- - PARTIAL: Mixed signals (length OK but has some stubs)
108
+ Parse JSON result: `{ all_passed, passed, total, artifacts: [{path, exists, issues, passed}] }`
204
109
 
205
- ### Level 3: Wired
110
+ **Artifact status from result:**
111
+ - `exists=false` → MISSING
112
+ - `issues` not empty → STUB (check issues for "Only N lines" or "Missing pattern")
113
+ - `passed=true` → VERIFIED (Levels 1-2 pass)
206
114
 
207
- Check that the artifact is connected to the system.
208
-
209
- **Import check (is it used?):**
115
+ **Level 3 Wired (manual check for artifacts that pass Levels 1-2):**
210
116
  ```bash
211
- check_imported() {
212
- local artifact_name="$1"
213
- local search_path="${2:-src/}"
214
-
215
- # Find imports of this artifact
216
- local imports=$(grep -r "import.*$artifact_name" "$search_path" --include="*.ts" --include="*.tsx" 2>/dev/null | wc -l)
217
-
218
- [ "$imports" -gt 0 ] && echo "IMPORTED ($imports times)" || echo "NOT_IMPORTED"
219
- }
117
+ grep -r "import.*$artifact_name" src/ --include="*.ts" --include="*.tsx" # IMPORTED
118
+ grep -r "$artifact_name" src/ --include="*.ts" --include="*.tsx" | grep -v "import" # USED
220
119
  ```
221
-
222
- **Usage check (is it called?):**
223
- ```bash
224
- check_used() {
225
- local artifact_name="$1"
226
- local search_path="${2:-src/}"
227
-
228
- # Find usages (function calls, component renders, etc.)
229
- local uses=$(grep -r "$artifact_name" "$search_path" --include="*.ts" --include="*.tsx" 2>/dev/null | grep -v "import" | wc -l)
230
-
231
- [ "$uses" -gt 0 ] && echo "USED ($uses times)" || echo "NOT_USED"
232
- }
233
- ```
234
-
235
- **Combine level 3 results:**
236
- - WIRED: Imported AND used
237
- - ORPHANED: Exists but not imported/used
238
- - PARTIAL: Imported but not used (or vice versa)
239
-
240
- ### Final artifact status
120
+ WIRED = imported AND used. ORPHANED = exists but not imported/used.
241
121
 
242
122
  | Exists | Substantive | Wired | Status |
243
123
  |--------|-------------|-------|--------|
@@ -245,370 +125,104 @@ check_used() {
245
125
  | ✓ | ✓ | ✗ | ⚠️ ORPHANED |
246
126
  | ✓ | ✗ | - | ✗ STUB |
247
127
  | ✗ | - | - | ✗ MISSING |
248
-
249
- Record status and evidence for each artifact.
250
128
  </step>
251
129
 
252
130
  <step name="verify_wiring">
253
- **Verify key links between artifacts.**
254
-
255
- Key links are critical connections. If broken, the goal fails even with all artifacts present.
256
-
257
- ### Pattern: Component → API
258
-
259
- Check if component actually calls the API:
131
+ Use gsd-tools for key link verification against must_haves in each PLAN:
260
132
 
261
133
  ```bash
262
- verify_component_api_link() {
263
- local component="$1"
264
- local api_path="$2"
265
-
266
- # Check for fetch/axios call to the API
267
- local has_call=$(grep -E "fetch\(['\"].*$api_path|axios\.(get|post).*$api_path" "$component" 2>/dev/null)
268
-
269
- if [ -n "$has_call" ]; then
270
- # Check if response is used
271
- local uses_response=$(grep -A 5 "fetch\|axios" "$component" | grep -E "await|\.then|setData|setState" 2>/dev/null)
272
-
273
- if [ -n "$uses_response" ]; then
274
- echo "WIRED: $component → $api_path (call + response handling)"
275
- else
276
- echo "PARTIAL: $component → $api_path (call exists but response not used)"
277
- fi
278
- else
279
- echo "NOT_WIRED: $component → $api_path (no call found)"
280
- fi
281
- }
134
+ for plan in "$PHASE_DIR"/*-PLAN.md; do
135
+ LINKS_RESULT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs verify key-links "$plan")
136
+ echo "=== $plan ===" && echo "$LINKS_RESULT"
137
+ done
282
138
  ```
283
139
 
284
- ### Pattern: API Database
140
+ Parse JSON result: `{ all_verified, verified, total, links: [{from, to, via, verified, detail}] }`
285
141
 
286
- Check if API route queries database:
142
+ **Link status from result:**
143
+ - `verified=true` → WIRED
144
+ - `verified=false` with "not found" → NOT_WIRED
145
+ - `verified=false` with "Pattern not found" → PARTIAL
287
146
 
288
- ```bash
289
- verify_api_db_link() {
290
- local route="$1"
291
- local model="$2"
292
-
293
- # Check for Prisma/DB call
294
- local has_query=$(grep -E "prisma\.$model|db\.$model|$model\.(find|create|update|delete)" "$route" 2>/dev/null)
295
-
296
- if [ -n "$has_query" ]; then
297
- # Check if result is returned
298
- local returns_result=$(grep -E "return.*json.*\w+|res\.json\(\w+" "$route" 2>/dev/null)
299
-
300
- if [ -n "$returns_result" ]; then
301
- echo "WIRED: $route → database ($model)"
302
- else
303
- echo "PARTIAL: $route → database (query exists but result not returned)"
304
- fi
305
- else
306
- echo "NOT_WIRED: $route → database (no query for $model)"
307
- fi
308
- }
309
- ```
310
-
311
- ### Pattern: Form → Handler
312
-
313
- Check if form submission does something:
314
-
315
- ```bash
316
- verify_form_handler_link() {
317
- local component="$1"
318
-
319
- # Find onSubmit handler
320
- local has_handler=$(grep -E "onSubmit=\{|handleSubmit" "$component" 2>/dev/null)
321
-
322
- if [ -n "$has_handler" ]; then
323
- # Check if handler has real implementation
324
- local handler_content=$(grep -A 10 "onSubmit.*=" "$component" | grep -E "fetch|axios|mutate|dispatch" 2>/dev/null)
325
-
326
- if [ -n "$handler_content" ]; then
327
- echo "WIRED: form → handler (has API call)"
328
- else
329
- # Check for stub patterns
330
- local is_stub=$(grep -A 5 "onSubmit" "$component" | grep -E "console\.log|preventDefault\(\)$|\{\}" 2>/dev/null)
331
- if [ -n "$is_stub" ]; then
332
- echo "STUB: form → handler (only logs or empty)"
333
- else
334
- echo "PARTIAL: form → handler (exists but unclear implementation)"
335
- fi
336
- fi
337
- else
338
- echo "NOT_WIRED: form → handler (no onSubmit found)"
339
- fi
340
- }
341
- ```
342
-
343
- ### Pattern: State → Render
344
-
345
- Check if state is actually rendered:
346
-
347
- ```bash
348
- verify_state_render_link() {
349
- local component="$1"
350
- local state_var="$2"
351
-
352
- # Check if state variable exists
353
- local has_state=$(grep -E "useState.*$state_var|\[$state_var," "$component" 2>/dev/null)
354
-
355
- if [ -n "$has_state" ]; then
356
- # Check if state is used in JSX
357
- local renders_state=$(grep -E "\{.*$state_var.*\}|\{$state_var\." "$component" 2>/dev/null)
358
-
359
- if [ -n "$renders_state" ]; then
360
- echo "WIRED: state → render ($state_var displayed)"
361
- else
362
- echo "NOT_WIRED: state → render ($state_var exists but not displayed)"
363
- fi
364
- else
365
- echo "N/A: state → render (no state var $state_var)"
366
- fi
367
- }
368
- ```
147
+ **Fallback patterns (if key_links not in must_haves):**
369
148
 
370
- ### Aggregate key link results
149
+ | Pattern | Check | Status |
150
+ |---------|-------|--------|
151
+ | Component → API | fetch/axios call to API path, response used (await/.then/setState) | WIRED / PARTIAL (call but unused response) / NOT_WIRED |
152
+ | API → Database | Prisma/DB query on model, result returned via res.json() | WIRED / PARTIAL (query but not returned) / NOT_WIRED |
153
+ | Form → Handler | onSubmit with real implementation (fetch/axios/mutate/dispatch), not console.log/empty | WIRED / STUB (log-only/empty) / NOT_WIRED |
154
+ | State → Render | useState variable appears in JSX (`{stateVar}` or `{stateVar.property}`) | WIRED / NOT_WIRED |
371
155
 
372
- For each key link in must_haves:
373
- - Run appropriate verification function
374
- - Record status and evidence
375
- - WIRED / PARTIAL / STUB / NOT_WIRED
156
+ Record status and evidence for each key link.
376
157
  </step>
377
158
 
378
159
  <step name="verify_requirements">
379
- **Check requirements coverage if REQUIREMENTS.md exists.**
380
-
160
+ If REQUIREMENTS.md exists:
381
161
  ```bash
382
- # Find requirements mapped to this phase
383
162
  grep -E "Phase ${PHASE_NUM}" .planning/REQUIREMENTS.md 2>/dev/null
384
163
  ```
385
164
 
386
- For each requirement:
387
- 1. Parse requirement description
388
- 2. Identify which truths/artifacts support it
389
- 3. Determine status based on supporting infrastructure
390
-
391
- **Requirement status:**
392
- - ✓ SATISFIED: All supporting truths verified
393
- - ✗ BLOCKED: One or more supporting truths failed
394
- - ? NEEDS HUMAN: Can't verify requirement programmatically
165
+ For each requirement: parse description → identify supporting truths/artifacts → status: ✓ SATISFIED / ✗ BLOCKED / ? NEEDS HUMAN.
395
166
  </step>
396
167
 
397
168
  <step name="scan_antipatterns">
398
- **Scan for anti-patterns across phase files.**
169
+ Extract files modified in this phase from SUMMARY.md, scan each:
399
170
 
400
- Identify files modified in this phase:
401
- ```bash
402
- # Extract files from SUMMARY.md
403
- grep -E "^\- \`" "$PHASE_DIR"/*-SUMMARY.md | sed 's/.*`\([^`]*\)`.*/\1/' | sort -u
404
- ```
171
+ | Pattern | Search | Severity |
172
+ |---------|--------|----------|
173
+ | TODO/FIXME/XXX/HACK | `grep -n -E "TODO\|FIXME\|XXX\|HACK"` | ⚠️ Warning |
174
+ | Placeholder content | `grep -n -iE "placeholder\|coming soon\|will be here"` | 🛑 Blocker |
175
+ | Empty returns | `grep -n -E "return null\|return \{\}\|return \[\]\|=> \{\}"` | ⚠️ Warning |
176
+ | Log-only functions | Functions containing only console.log | ⚠️ Warning |
405
177
 
406
- Run anti-pattern detection:
407
- ```bash
408
- scan_antipatterns() {
409
- local files="$@"
410
-
411
- echo "## Anti-Patterns Found"
412
- echo ""
413
-
414
- for file in $files; do
415
- [ -f "$file" ] || continue
416
-
417
- # TODO/FIXME comments
418
- grep -n -E "TODO|FIXME|XXX|HACK" "$file" 2>/dev/null | while read line; do
419
- echo "| $file | $(echo $line | cut -d: -f1) | TODO/FIXME | ⚠️ Warning |"
420
- done
421
-
422
- # Placeholder content
423
- grep -n -E "placeholder|coming soon|will be here" "$file" -i 2>/dev/null | while read line; do
424
- echo "| $file | $(echo $line | cut -d: -f1) | Placeholder | 🛑 Blocker |"
425
- done
426
-
427
- # Empty implementations
428
- grep -n -E "return null|return \{\}|return \[\]|=> \{\}" "$file" 2>/dev/null | while read line; do
429
- echo "| $file | $(echo $line | cut -d: -f1) | Empty return | ⚠️ Warning |"
430
- done
431
-
432
- # Console.log only implementations
433
- grep -n -B 2 -A 2 "console\.log" "$file" 2>/dev/null | grep -E "^\s*(const|function|=>)" | while read line; do
434
- echo "| $file | - | Log-only function | ⚠️ Warning |"
435
- done
436
- done
437
- }
438
- ```
439
-
440
- Categorize findings:
441
- - 🛑 Blocker: Prevents goal achievement (placeholder renders, empty handlers)
442
- - ⚠️ Warning: Indicates incomplete (TODO comments, console.log)
443
- - ℹ️ Info: Notable but not problematic
178
+ Categorize: 🛑 Blocker (prevents goal) | ⚠️ Warning (incomplete) | ℹ️ Info (notable).
444
179
  </step>
445
180
 
446
181
  <step name="identify_human_verification">
447
- **Flag items that need human verification.**
448
-
449
- Some things can't be verified programmatically:
450
-
451
- **Always needs human:**
452
- - Visual appearance (does it look right?)
453
- - User flow completion (can you do the full task?)
454
- - Real-time behavior (WebSocket, SSE updates)
455
- - External service integration (payments, email)
456
- - Performance feel (does it feel fast?)
457
- - Error message clarity
458
-
459
- **Needs human if uncertain:**
460
- - Complex wiring that grep can't trace
461
- - Dynamic behavior depending on state
462
- - Edge cases and error states
463
-
464
- **Format for human verification:**
465
- ```markdown
466
- ## Human Verification Required
467
-
468
- ### 1. {Test Name}
469
- **Test:** {What to do}
470
- **Expected:** {What should happen}
471
- **Why human:** {Why can't verify programmatically}
472
- ```
473
- </step>
474
-
475
- <step name="determine_status">
476
- **Calculate overall verification status.**
477
-
478
- **Status: passed**
479
- - All truths VERIFIED
480
- - All artifacts pass level 1-3
481
- - All key links WIRED
482
- - No blocker anti-patterns
483
- - (Human verification items are OK — will be prompted)
484
-
485
- **Status: gaps_found**
486
- - One or more truths FAILED
487
- - OR one or more artifacts MISSING/STUB
488
- - OR one or more key links NOT_WIRED
489
- - OR blocker anti-patterns found
490
-
491
- **Status: human_needed**
492
- - All automated checks pass
493
- - BUT items flagged for human verification
494
- - Can't determine goal achievement without human
495
-
496
- **Calculate score:**
497
- ```
498
- score = (verified_truths / total_truths)
499
- ```
500
- </step>
501
-
502
- <step name="generate_fix_plans">
503
- **If gaps_found, recommend fix plans.**
504
-
505
- Group related gaps into fix plans:
182
+ **Always needs human:** Visual appearance, user flow completion, real-time behavior (WebSocket/SSE), external service integration, performance feel, error message clarity.
506
183
 
507
- 1. **Identify gap clusters:**
508
- - API stub + component not wired → "Wire frontend to backend"
509
- - Multiple artifacts missing → "Complete core implementation"
510
- - Wiring issues only → "Connect existing components"
184
+ **Needs human if uncertain:** Complex wiring grep can't trace, dynamic state-dependent behavior, edge cases.
511
185
 
512
- 2. **Generate plan recommendations:**
186
+ Format each as: Test Name → What to do → Expected result → Why can't verify programmatically.
187
+ </step>
513
188
 
514
- ```markdown
515
- ### {phase}-{next}-PLAN.md: {Fix Name}
189
+ <step name="determine_status">
190
+ **passed:** All truths VERIFIED, all artifacts pass levels 1-3, all key links WIRED, no blocker anti-patterns.
516
191
 
517
- **Objective:** {What this fixes}
192
+ **gaps_found:** Any truth FAILED, artifact MISSING/STUB, key link NOT_WIRED, or blocker found.
518
193
 
519
- **Tasks:**
520
- 1. {Task to fix gap 1}
521
- - Files: {files to modify}
522
- - Action: {specific fix}
523
- - Verify: {how to confirm fix}
194
+ **human_needed:** All automated checks pass but human verification items remain.
524
195
 
525
- 2. {Task to fix gap 2}
526
- - Files: {files to modify}
527
- - Action: {specific fix}
528
- - Verify: {how to confirm fix}
196
+ **Score:** `verified_truths / total_truths`
197
+ </step>
529
198
 
530
- 3. Re-verify phase goal
531
- - Run verification again
532
- - Confirm all must-haves pass
199
+ <step name="generate_fix_plans">
200
+ If gaps_found:
533
201
 
534
- **Estimated scope:** {Small / Medium}
535
- ```
202
+ 1. **Cluster related gaps:** API stub + component unwired → "Wire frontend to backend". Multiple missing → "Complete core implementation". Wiring only → "Connect existing components".
536
203
 
537
- 3. **Keep plans focused:**
538
- - 2-3 tasks per plan
539
- - Single concern per plan
540
- - Include verification task
204
+ 2. **Generate plan per cluster:** Objective, 2-3 tasks (files/action/verify each), re-verify step. Keep focused: single concern per plan.
541
205
 
542
- 4. **Order by dependency:**
543
- - Fix missing artifacts before wiring
544
- - Fix stubs before integration
545
- - Verify after all fixes
206
+ 3. **Order by dependency:** Fix missing → fix stubs → fix wiring → verify.
546
207
  </step>
547
208
 
548
209
  <step name="create_report">
549
- **Generate VERIFICATION.md using template.**
550
-
551
210
  ```bash
552
211
  REPORT_PATH="$PHASE_DIR/${PHASE_NUM}-VERIFICATION.md"
553
212
  ```
554
213
 
555
- Fill template sections:
556
- 1. **Frontmatter:** phase, verified timestamp, status, score
557
- 2. **Goal Achievement:** Truth verification table
558
- 3. **Required Artifacts:** Artifact verification table
559
- 4. **Key Link Verification:** Wiring verification table
560
- 5. **Requirements Coverage:** If REQUIREMENTS.md exists
561
- 6. **Anti-Patterns Found:** Scan results table
562
- 7. **Human Verification Required:** Items needing human
563
- 8. **Gaps Summary:** Critical and non-critical gaps
564
- 9. **Recommended Fix Plans:** If gaps_found
565
- 10. **Verification Metadata:** Approach, timing, counts
214
+ Fill template sections: frontmatter (phase/timestamp/status/score), goal achievement, artifact table, wiring table, requirements coverage, anti-patterns, human verification, gaps summary, fix plans (if gaps_found), metadata.
566
215
 
567
216
  See ~/.config/opencode/get-shit-done/templates/verification-report.md for complete template.
568
217
  </step>
569
218
 
570
219
  <step name="return_to_orchestrator">
571
- **Return results to execute-phase orchestrator.**
220
+ Return status (`passed` | `gaps_found` | `human_needed`), score (N/M must-haves), report path.
572
221
 
573
- **Return format:**
574
-
575
- ```markdown
576
- ## Verification Complete
577
-
578
- **Status:** {passed | gaps_found | human_needed}
579
- **Score:** {N}/{M} must-haves verified
580
- **Report:** .planning/phases/{phase_dir}/{phase}-VERIFICATION.md
581
-
582
- {If passed:}
583
- All must-haves verified. Phase goal achieved. Ready to proceed.
584
-
585
- {If gaps_found:}
586
- ### Gaps Found
587
-
588
- {N} critical gaps blocking goal achievement:
589
- 1. {Gap 1 summary}
590
- 2. {Gap 2 summary}
591
-
592
- ### Recommended Fixes
593
-
594
- {N} fix plans recommended:
595
- 1. {phase}-{next}-PLAN.md: {name}
596
- 2. {phase}-{next+1}-PLAN.md: {name}
597
-
598
- {If human_needed:}
599
- ### Human Verification Required
600
-
601
- {N} items need human testing:
602
- 1. {Item 1}
603
- 2. {Item 2}
604
-
605
- Automated checks passed. Awaiting human verification.
606
- ```
222
+ If gaps_found: list gaps + recommended fix plan names.
223
+ If human_needed: list items requiring human testing.
607
224
 
608
- The orchestrator will:
609
- - If `passed`: Continue to update_roadmap
610
- - If `gaps_found`: Create and execute fix plans, then re-verify
611
- - If `human_needed`: Present items to user, collect responses
225
+ Orchestrator routes: `passed` → update_roadmap | `gaps_found` → create/execute fixes, re-verify | `human_needed` → present to user.
612
226
  </step>
613
227
 
614
228
  </process>