@undeemed/get-shit-done-codex 1.6.12 → 1.20.3

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