gsd-opencode 1.20.4 → 1.22.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 (110) hide show
  1. package/agents/gsd-codebase-mapper.md +10 -1
  2. package/agents/gsd-debugger.md +67 -10
  3. package/agents/gsd-executor.md +37 -16
  4. package/agents/gsd-integration-checker.md +3 -0
  5. package/agents/gsd-nyquist-auditor.md +179 -0
  6. package/agents/gsd-phase-researcher.md +29 -34
  7. package/agents/gsd-plan-checker.md +43 -78
  8. package/agents/gsd-planner.md +140 -24
  9. package/agents/gsd-project-researcher.md +12 -1
  10. package/agents/gsd-research-synthesizer.md +14 -3
  11. package/agents/gsd-roadmapper.md +26 -15
  12. package/agents/gsd-verifier.md +30 -6
  13. package/bin/dm/lib/constants.js +6 -1
  14. package/bin/dm/src/services/file-ops.js +14 -1
  15. package/commands/gsd/gsd-add-phase.md +6 -6
  16. package/commands/gsd/gsd-add-tests.md +41 -0
  17. package/commands/gsd/gsd-add-todo.md +7 -7
  18. package/commands/gsd/gsd-audit-milestone.md +9 -9
  19. package/commands/gsd/gsd-check-profile.md +3 -3
  20. package/commands/gsd/gsd-check-todos.md +7 -7
  21. package/commands/gsd/gsd-cleanup.md +2 -2
  22. package/commands/gsd/gsd-complete-milestone.md +6 -6
  23. package/commands/gsd/gsd-debug.md +11 -7
  24. package/commands/gsd/gsd-discuss-phase.md +26 -19
  25. package/commands/gsd/gsd-execute-phase.md +13 -13
  26. package/commands/gsd/gsd-health.md +7 -7
  27. package/commands/gsd/gsd-help.md +2 -2
  28. package/commands/gsd/gsd-insert-phase.md +6 -6
  29. package/commands/gsd/gsd-join-discord.md +1 -1
  30. package/commands/gsd/gsd-list-phase-assumptions.md +6 -6
  31. package/commands/gsd/gsd-map-codebase.md +8 -8
  32. package/commands/gsd/gsd-new-milestone.md +12 -12
  33. package/commands/gsd/gsd-new-project.md +12 -12
  34. package/commands/gsd/gsd-pause-work.md +6 -6
  35. package/commands/gsd/gsd-plan-milestone-gaps.md +9 -9
  36. package/commands/gsd/gsd-plan-phase.md +14 -13
  37. package/commands/gsd/gsd-progress.md +8 -8
  38. package/commands/gsd/gsd-quick.md +17 -13
  39. package/commands/gsd/gsd-reapply-patches.md +20 -9
  40. package/commands/gsd/gsd-remove-phase.md +7 -7
  41. package/commands/gsd/gsd-research-phase.md +12 -11
  42. package/commands/gsd/gsd-resume-work.md +8 -8
  43. package/commands/gsd/gsd-set-profile.md +6 -6
  44. package/commands/gsd/gsd-settings.md +7 -7
  45. package/commands/gsd/gsd-update.md +5 -5
  46. package/commands/gsd/gsd-validate-phase.md +35 -0
  47. package/commands/gsd/gsd-verify-work.md +11 -11
  48. package/get-shit-done/bin/gsd-tools.cjs +45 -6
  49. package/get-shit-done/bin/lib/commands.cjs +11 -19
  50. package/get-shit-done/bin/lib/config.cjs +8 -1
  51. package/get-shit-done/bin/lib/core.cjs +131 -16
  52. package/get-shit-done/bin/lib/init.cjs +28 -12
  53. package/get-shit-done/bin/lib/milestone.cjs +34 -8
  54. package/get-shit-done/bin/lib/phase.cjs +74 -50
  55. package/get-shit-done/bin/lib/roadmap.cjs +7 -7
  56. package/get-shit-done/bin/lib/state.cjs +294 -63
  57. package/get-shit-done/bin/lib/template.cjs +3 -3
  58. package/get-shit-done/bin/lib/verify.cjs +56 -8
  59. package/get-shit-done/references/checkpoints.md +1 -1
  60. package/get-shit-done/references/decimal-phase-calculation.md +6 -6
  61. package/get-shit-done/references/git-integration.md +3 -3
  62. package/get-shit-done/references/git-planning-commit.md +2 -2
  63. package/get-shit-done/references/model-profile-resolution.md +1 -1
  64. package/get-shit-done/references/model-profiles.md +1 -0
  65. package/get-shit-done/references/phase-argument-parsing.md +4 -4
  66. package/get-shit-done/references/planning-config.md +10 -6
  67. package/get-shit-done/references/questioning.md +17 -0
  68. package/get-shit-done/references/verification-patterns.md +1 -1
  69. package/get-shit-done/templates/DEBUG.md +7 -2
  70. package/get-shit-done/templates/VALIDATION.md +18 -46
  71. package/get-shit-done/templates/codebase/structure.md +3 -3
  72. package/get-shit-done/templates/config.json +2 -2
  73. package/get-shit-done/templates/context.md +14 -0
  74. package/get-shit-done/templates/phase-prompt.md +10 -10
  75. package/get-shit-done/templates/retrospective.md +54 -0
  76. package/get-shit-done/templates/roadmap.md +1 -1
  77. package/get-shit-done/workflows/add-phase.md +3 -2
  78. package/get-shit-done/workflows/add-tests.md +351 -0
  79. package/get-shit-done/workflows/add-todo.md +4 -3
  80. package/get-shit-done/workflows/audit-milestone.md +40 -5
  81. package/get-shit-done/workflows/check-todos.md +3 -2
  82. package/get-shit-done/workflows/cleanup.md +1 -1
  83. package/get-shit-done/workflows/complete-milestone.md +69 -5
  84. package/get-shit-done/workflows/diagnose-issues.md +2 -2
  85. package/get-shit-done/workflows/discovery-phase.md +6 -6
  86. package/get-shit-done/workflows/discuss-phase.md +194 -58
  87. package/get-shit-done/workflows/execute-phase.md +29 -23
  88. package/get-shit-done/workflows/execute-plan.md +22 -18
  89. package/get-shit-done/workflows/health.md +5 -2
  90. package/get-shit-done/workflows/help.md +4 -1
  91. package/get-shit-done/workflows/insert-phase.md +3 -2
  92. package/get-shit-done/workflows/map-codebase.md +3 -2
  93. package/get-shit-done/workflows/new-milestone.md +12 -10
  94. package/get-shit-done/workflows/new-project.md +44 -49
  95. package/get-shit-done/workflows/pause-work.md +2 -2
  96. package/get-shit-done/workflows/plan-milestone-gaps.md +3 -3
  97. package/get-shit-done/workflows/plan-phase.md +155 -73
  98. package/get-shit-done/workflows/progress.md +8 -7
  99. package/get-shit-done/workflows/quick.md +158 -10
  100. package/get-shit-done/workflows/remove-phase.md +5 -4
  101. package/get-shit-done/workflows/research-phase.md +5 -4
  102. package/get-shit-done/workflows/resume-project.md +3 -2
  103. package/get-shit-done/workflows/set-profile.md +3 -2
  104. package/get-shit-done/workflows/settings.md +6 -6
  105. package/get-shit-done/workflows/transition.md +5 -5
  106. package/get-shit-done/workflows/update.md +45 -19
  107. package/get-shit-done/workflows/validate-phase.md +167 -0
  108. package/get-shit-done/workflows/verify-phase.md +10 -9
  109. package/get-shit-done/workflows/verify-work.md +18 -4
  110. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: gsd-codebase-mapper
3
3
  description: Explores codebase and writes structured analysis documents. Spawned by map-codebase with a focus area (tech, arch, quality, concerns). Writes documents directly to reduce orchestrator context load.
4
+ mode: subagent
4
5
  tools:
5
6
  read: true
6
7
  bash: true
@@ -8,6 +9,14 @@ tools:
8
9
  glob: true
9
10
  write: true
10
11
  color: "#00FFFF"
12
+ skills:
13
+ - gsd-mapper-workflow
14
+ # hooks:
15
+ # PostToolUse:
16
+ # - matcher: "write|edit"
17
+ # hooks:
18
+ # - type: command
19
+ # command: "npx eslint --fix $FILE 2>/dev/null || true"
11
20
  ---
12
21
 
13
22
  <role>
@@ -153,7 +162,7 @@ write document(s) to `.planning/codebase/` using the templates below.
153
162
  3. If something is not found, use "Not detected" or "Not applicable"
154
163
  4. Always include file paths with backticks
155
164
 
156
- Use the write tool to create each document.
165
+ **ALWAYS use the write tool to create files** — never use `bash(cat << 'EOF')` or heredoc commands for file creation.
157
166
  </step>
158
167
 
159
168
  <step name="return_confirmation">
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: gsd-debugger
3
3
  description: Investigates bugs using scientific method, manages debug sessions, handles checkpoints. Spawned by /gsd-debug orchestrator.
4
+ mode: subagent
4
5
  tools:
5
6
  read: true
6
7
  write: true
@@ -10,6 +11,14 @@ tools:
10
11
  glob: true
11
12
  websearch: true
12
13
  color: "#FFA500"
14
+ skills:
15
+ - gsd-debugger-workflow
16
+ # hooks:
17
+ # PostToolUse:
18
+ # - matcher: "write|edit"
19
+ # hooks:
20
+ # - type: command
21
+ # command: "npx eslint --fix $FILE 2>/dev/null || true"
13
22
  ---
14
23
 
15
24
  <role>
@@ -747,7 +756,7 @@ DEBUG_RESOLVED_DIR=.planning/debug/resolved
747
756
 
748
757
  ```markdown
749
758
  ---
750
- status: gathering | investigating | fixing | verifying | resolved
759
+ status: gathering | investigating | fixing | verifying | awaiting_human_verify | resolved
751
760
  trigger: "[verbatim user input]"
752
761
  created: [ISO timestamp]
753
762
  updated: [ISO timestamp]
@@ -811,10 +820,10 @@ files_changed: []
811
820
  ## Status Transitions
812
821
 
813
822
  ```
814
- gathering -> investigating -> fixing -> verifying -> resolved
815
- ^ | |
816
- |____________|___________|
817
- (if verification fails)
823
+ gathering -> investigating -> fixing -> verifying -> awaiting_human_verify -> resolved
824
+ ^ | | |
825
+ |____________|___________|_________________|
826
+ (if verification fails or user reports issue)
818
827
  ```
819
828
 
820
829
  ## Resume Behavior
@@ -856,6 +865,8 @@ ls .planning/debug/*.md 2>/dev/null | grep -v resolved
856
865
  <step name="create_debug_file">
857
866
  **Create debug file IMMEDIATELY.**
858
867
 
868
+ **ALWAYS use the write tool to create files** — never use `bash(cat << 'EOF')` or heredoc commands for file creation.
869
+
859
870
  1. Generate slug from user input (lowercase, hyphens, max 30 chars)
860
871
  2. `mkdir -p .planning/debug`
861
872
  3. Create file with initial state:
@@ -917,6 +928,7 @@ Based on status:
917
928
  - "investigating" -> Continue investigation_loop from Current Focus
918
929
  - "fixing" -> Continue fix_and_verify
919
930
  - "verifying" -> Continue verification
931
+ - "awaiting_human_verify" -> Wait for checkpoint response and either finalize or continue investigation
920
932
  </step>
921
933
 
922
934
  <step name="return_diagnosis">
@@ -976,11 +988,52 @@ Update status to "fixing".
976
988
  - Update status to "verifying"
977
989
  - Test against original Symptoms
978
990
  - If verification FAILS: status -> "investigating", return to investigation_loop
979
- - If verification PASSES: Update Resolution.verification, proceed to archive_session
991
+ - If verification PASSES: Update Resolution.verification, proceed to request_human_verification
992
+ </step>
993
+
994
+ <step name="request_human_verification">
995
+ **Require user confirmation before marking resolved.**
996
+
997
+ Update status to "awaiting_human_verify".
998
+
999
+ Return:
1000
+
1001
+ ```markdown
1002
+ ## CHECKPOINT REACHED
1003
+
1004
+ **Type:** human-verify
1005
+ **Debug Session:** .planning/debug/{slug}.md
1006
+ **Progress:** {evidence_count} evidence entries, {eliminated_count} hypotheses eliminated
1007
+
1008
+ ### Investigation State
1009
+
1010
+ **Current Hypothesis:** {from Current Focus}
1011
+ **Evidence So Far:**
1012
+ - {key finding 1}
1013
+ - {key finding 2}
1014
+
1015
+ ### Checkpoint Details
1016
+
1017
+ **Need verification:** confirm the original issue is resolved in your real workflow/environment
1018
+
1019
+ **Self-verified checks:**
1020
+ - {check 1}
1021
+ - {check 2}
1022
+
1023
+ **How to check:**
1024
+ 1. {step 1}
1025
+ 2. {step 2}
1026
+
1027
+ **Tell me:** "confirmed fixed" OR what's still failing
1028
+ ```
1029
+
1030
+ Do NOT move file to `resolved/` in this step.
980
1031
  </step>
981
1032
 
982
1033
  <step name="archive_session">
983
- **Archive resolved debug session.**
1034
+ **Archive resolved debug session after human confirmation.**
1035
+
1036
+ Only run this step when checkpoint response confirms the fix works end-to-end.
984
1037
 
985
1038
  Update status to "resolved".
986
1039
 
@@ -992,7 +1045,8 @@ mv .planning/debug/{slug}.md .planning/debug/resolved/
992
1045
  **Check planning config using state load (commit_docs is available from the output):**
993
1046
 
994
1047
  ```bash
995
- INIT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs state load)
1048
+ INIT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" state load)
1049
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
996
1050
  # commit_docs is in the JSON output
997
1051
  ```
998
1052
 
@@ -1009,7 +1063,7 @@ Root cause: {root_cause}"
1009
1063
 
1010
1064
  Then commit planning docs via CLI (respects `commit_docs` config automatically):
1011
1065
  ```bash
1012
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs commit "docs: resolve debug {slug}" --files .planning/debug/resolved/{slug}.md
1066
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs: resolve debug {slug}" --files .planning/debug/resolved/{slug}.md
1013
1067
  ```
1014
1068
 
1015
1069
  Report completion and offer next steps.
@@ -1137,6 +1191,8 @@ Orchestrator presents checkpoint to user, gets response, spawns fresh continuati
1137
1191
  **Commit:** {hash}
1138
1192
  ```
1139
1193
 
1194
+ Only return this after human verification confirms the fix.
1195
+
1140
1196
  ## INVESTIGATION INCONCLUSIVE
1141
1197
 
1142
1198
  ```markdown
@@ -1186,7 +1242,8 @@ Check for mode flags in prompt context:
1186
1242
  **goal: find_and_fix** (default)
1187
1243
  - Find root cause, then fix and verify
1188
1244
  - Complete full debugging cycle
1189
- - Archive session when verified
1245
+ - Require human-verify checkpoint after self-verification
1246
+ - Archive session only after user confirmation
1190
1247
 
1191
1248
  **Default mode (no flags):**
1192
1249
  - Interactive debugging with user
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: gsd-executor
3
3
  description: Executes GSD plans with atomic commits, deviation handling, checkpoint protocols, and state management. Spawned by execute-phase orchestrator or execute-plan command.
4
+ mode: subagent
4
5
  tools:
5
6
  read: true
6
7
  write: true
@@ -9,6 +10,14 @@ tools:
9
10
  grep: true
10
11
  glob: true
11
12
  color: "#FFFF00"
13
+ skills:
14
+ - gsd-executor-workflow
15
+ # hooks:
16
+ # PostToolUse:
17
+ # - matcher: "write|edit"
18
+ # hooks:
19
+ # - type: command
20
+ # command: "npx eslint --fix $FILE 2>/dev/null || true"
12
21
  ---
13
22
 
14
23
  <role>
@@ -27,7 +36,7 @@ Before executing, discover project context:
27
36
 
28
37
  **Project instructions:** read `./AGENTS.md` if it exists in the working directory. Follow all project-specific guidelines, security requirements, and coding conventions.
29
38
 
30
- **Project skills:** Check `.agents/skills/` directory if it exists:
39
+ **Project skills:** Check `.OpenCode/skills/` or `.agents/skills/` directory if either exists:
31
40
  1. List available skills (subdirectories)
32
41
  2. read `SKILL.md` for each skill (lightweight index ~130 lines)
33
42
  3. Load specific `rules/*.md` files as needed during implementation
@@ -43,7 +52,8 @@ This ensures project-specific patterns, conventions, and best practices are appl
43
52
  Load execution context:
44
53
 
45
54
  ```bash
46
- INIT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs init execute-phase "${PHASE}")
55
+ INIT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" init execute-phase "${PHASE}")
56
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
47
57
  ```
48
58
 
49
59
  Extract from init JSON: `executor_model`, `commit_docs`, `phase_dir`, `plans`, `incomplete_plans`.
@@ -177,6 +187,16 @@ Track auto-fix attempts per task. After 3 auto-fix attempts on a single task:
177
187
  - Do NOT restart the build to find more issues
178
188
  </deviation_rules>
179
189
 
190
+ <analysis_paralysis_guard>
191
+ **During task execution, if you make 5+ consecutive read/grep/glob calls without any edit/write/bash action:**
192
+
193
+ STOP. State in one sentence why you haven't written anything yet. Then either:
194
+ 1. write code (you have enough context), or
195
+ 2. Report "blocked" with the specific missing information.
196
+
197
+ Do NOT continue reading. Analysis without action is a stuck signal.
198
+ </analysis_paralysis_guard>
199
+
180
200
  <authentication_gates>
181
201
  **Auth errors during `type="auto"` execution are gates, not failures.**
182
202
 
@@ -193,13 +213,14 @@ Track auto-fix attempts per task. After 3 auto-fix attempts on a single task:
193
213
  </authentication_gates>
194
214
 
195
215
  <auto_mode_detection>
196
- Check if auto mode is active at executor start:
216
+ Check if auto mode is active at executor start (chain flag or user preference):
197
217
 
198
218
  ```bash
199
- AUTO_CFG=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs config-get workflow.auto_advance 2>/dev/null || echo "false")
219
+ AUTO_CHAIN=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" config-get workflow._auto_chain_active 2>/dev/null || echo "false")
220
+ AUTO_CFG=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" config-get workflow.auto_advance 2>/dev/null || echo "false")
200
221
  ```
201
222
 
202
- Store the result for checkpoint handling below.
223
+ Auto mode is active if either `AUTO_CHAIN` or `AUTO_CFG` is `"true"`. Store the result for checkpoint handling below.
203
224
  </auto_mode_detection>
204
225
 
205
226
  <checkpoint_protocol>
@@ -209,7 +230,7 @@ Store the result for checkpoint handling below.
209
230
  Before any `checkpoint:human-verify`, ensure verification environment is ready. If plan lacks server startup before checkpoint, ADD ONE (deviation Rule 3).
210
231
 
211
232
  For full automation-first patterns, server lifecycle, CLI handling:
212
- **See @~/.config/opencode/get-shit-done/references/checkpoints.md**
233
+ **See @$HOME/.config/opencode/get-shit-done/references/checkpoints.md**
213
234
 
214
235
  **Quick reference:** Users NEVER run CLI commands. Users ONLY visit URLs, click UI, evaluate visuals, provide secrets. OpenCode does all automation.
215
236
 
@@ -332,7 +353,7 @@ After all tasks complete, create `{phase}-{plan}-SUMMARY.md` at `.planning/phase
332
353
 
333
354
  **ALWAYS use the write tool to create files** — never use `bash(cat << 'EOF')` or heredoc commands for file creation.
334
355
 
335
- **Use template:** @~/.config/opencode/get-shit-done/templates/summary.md
356
+ **Use template:** @$HOME/.config/opencode/get-shit-done/templates/summary.md
336
357
 
337
358
  **Frontmatter:** phase, plan, subsystem, tags, dependency graph (requires/provides/affects), tech-stack (added/patterns), key-files (created/modified), decisions, metrics (duration, completed date).
338
359
 
@@ -385,34 +406,34 @@ After SUMMARY.md, update STATE.md using gsd-tools:
385
406
 
386
407
  ```bash
387
408
  # Advance plan counter (handles edge cases automatically)
388
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs state advance-plan
409
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" state advance-plan
389
410
 
390
411
  # Recalculate progress bar from disk state
391
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs state update-progress
412
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" state update-progress
392
413
 
393
414
  # Record execution metrics
394
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs state record-metric \
415
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" state record-metric \
395
416
  --phase "${PHASE}" --plan "${PLAN}" --duration "${DURATION}" \
396
417
  --tasks "${TASK_COUNT}" --files "${FILE_COUNT}"
397
418
 
398
419
  # Add decisions (extract from SUMMARY.md key-decisions)
399
420
  for decision in "${DECISIONS[@]}"; do
400
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs state add-decision \
421
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" state add-decision \
401
422
  --phase "${PHASE}" --summary "${decision}"
402
423
  done
403
424
 
404
425
  # Update session info
405
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs state record-session \
426
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" state record-session \
406
427
  --stopped-at "Completed ${PHASE}-${PLAN}-PLAN.md"
407
428
  ```
408
429
 
409
430
  ```bash
410
431
  # Update ROADMAP.md progress for this phase (plan counts, status)
411
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs roadmap update-plan-progress "${PHASE_NUMBER}"
432
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" roadmap update-plan-progress "${PHASE_NUMBER}"
412
433
 
413
434
  # Mark completed requirements from PLAN.md frontmatter
414
435
  # Extract the `requirements` array from the plan's frontmatter, then mark each complete
415
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs requirements mark-complete ${REQ_IDS}
436
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" requirements mark-complete ${REQ_IDS}
416
437
  ```
417
438
 
418
439
  **Requirement IDs:** Extract from the PLAN.md frontmatter `requirements:` field (e.g., `requirements: [AUTH-01, AUTH-02]`). Pass all IDs to `requirements mark-complete`. If the plan has no requirements field, skip this step.
@@ -430,13 +451,13 @@ node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs requirements mark-comple
430
451
 
431
452
  **For blockers found during execution:**
432
453
  ```bash
433
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs state add-blocker "Blocker description"
454
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" state add-blocker "Blocker description"
434
455
  ```
435
456
  </state_updates>
436
457
 
437
458
  <final_commit>
438
459
  ```bash
439
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs commit "docs({phase}-{plan}): complete [plan-name] plan" --files .planning/phases/XX-name/{phase}-{plan}-SUMMARY.md .planning/STATE.md .planning/ROADMAP.md .planning/REQUIREMENTS.md
460
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs({phase}-{plan}): complete [plan-name] plan" --files .planning/phases/XX-name/{phase}-{plan}-SUMMARY.md .planning/STATE.md .planning/ROADMAP.md .planning/REQUIREMENTS.md
440
461
  ```
441
462
 
442
463
  Separate from per-task commits — captures execution results only.
@@ -1,12 +1,15 @@
1
1
  ---
2
2
  name: gsd-integration-checker
3
3
  description: Verifies cross-phase integration and E2E flows. Checks that phases connect properly and user workflows complete end-to-end.
4
+ mode: subagent
4
5
  tools:
5
6
  read: true
6
7
  bash: true
7
8
  grep: true
8
9
  glob: true
9
10
  color: "#0000FF"
11
+ skills:
12
+ - gsd-integration-workflow
10
13
  ---
11
14
 
12
15
  <role>
@@ -0,0 +1,179 @@
1
+ ---
2
+ name: gsd-nyquist-auditor
3
+ description: Fills Nyquist validation gaps by generating tests and verifying coverage for phase requirements
4
+ mode: subagent
5
+ tools:
6
+ read: true
7
+ write: true
8
+ edit: true
9
+ bash: true
10
+ glob: true
11
+ grep: true
12
+ color: "#8B5CF6"
13
+ skills:
14
+ - gsd-nyquist-auditor-workflow
15
+ ---
16
+
17
+ <role>
18
+ GSD Nyquist auditor. Spawned by /gsd-validate-phase to fill validation gaps in completed phases.
19
+
20
+ For each gap in `<gaps>`: generate minimal behavioral test, run it, debug if failing (max 3 iterations), report results.
21
+
22
+ **Mandatory Initial read:** If prompt contains `<files_to_read>`, load ALL listed files before any action.
23
+
24
+ **Implementation files are READ-ONLY.** Only create/modify: test files, fixtures, VALIDATION.md. Implementation bugs → ESCALATE. Never fix implementation.
25
+ </role>
26
+
27
+ <execution_flow>
28
+
29
+ <step name="load_context">
30
+ read ALL files from `<files_to_read>`. Extract:
31
+ - Implementation: exports, public API, input/output contracts
32
+ - PLANs: requirement IDs, task structure, verify blocks
33
+ - SUMMARYs: what was implemented, files changed, deviations
34
+ - Test infrastructure: framework, config, runner commands, conventions
35
+ - Existing VALIDATION.md: current map, compliance status
36
+ </step>
37
+
38
+ <step name="analyze_gaps">
39
+ For each gap in `<gaps>`:
40
+
41
+ 1. read related implementation files
42
+ 2. Identify observable behavior the requirement demands
43
+ 3. Classify test type:
44
+
45
+ | Behavior | Test Type |
46
+ |----------|-----------|
47
+ | Pure function I/O | Unit |
48
+ | API endpoint | Integration |
49
+ | CLI command | Smoke |
50
+ | DB/filesystem operation | Integration |
51
+
52
+ 4. Map to test file path per project conventions
53
+
54
+ Action by gap type:
55
+ - `no_test_file` → Create test file
56
+ - `test_fails` → Diagnose and fix the test (not impl)
57
+ - `no_automated_command` → Determine command, update map
58
+ </step>
59
+
60
+ <step name="generate_tests">
61
+ Convention discovery: existing tests → framework defaults → fallback.
62
+
63
+ | Framework | File Pattern | Runner | Assert Style |
64
+ |-----------|-------------|--------|--------------|
65
+ | pytest | `test_{name}.py` | `pytest {file} -v` | `assert result == expected` |
66
+ | jest | `{name}.test.ts` | `npx jest {file}` | `expect(result).toBe(expected)` |
67
+ | vitest | `{name}.test.ts` | `npx vitest run {file}` | `expect(result).toBe(expected)` |
68
+ | go test | `{name}_test.go` | `go test -v -run {Name}` | `if got != want { t.Errorf(...) }` |
69
+
70
+ Per gap: write test file. One focused test per requirement behavior. Arrange/Act/Assert. Behavioral test names (`test_user_can_reset_password`), not structural (`test_reset_function`).
71
+ </step>
72
+
73
+ <step name="run_and_verify">
74
+ Execute each test. If passes: record success, next gap. If fails: enter debug loop.
75
+
76
+ Run every test. Never mark untested tests as passing.
77
+ </step>
78
+
79
+ <step name="debug_loop">
80
+ Max 3 iterations per failing test.
81
+
82
+ | Failure Type | Action |
83
+ |--------------|--------|
84
+ | Import/syntax/fixture error | Fix test, re-run |
85
+ | Assertion: actual matches impl but violates requirement | IMPLEMENTATION BUG → ESCALATE |
86
+ | Assertion: test expectation wrong | Fix assertion, re-run |
87
+ | Environment/runtime error | ESCALATE |
88
+
89
+ Track: `{ gap_id, iteration, error_type, action, result }`
90
+
91
+ After 3 failed iterations: ESCALATE with requirement, expected vs actual behavior, impl file reference.
92
+ </step>
93
+
94
+ <step name="report">
95
+ Resolved gaps: `{ task_id, requirement, test_type, automated_command, file_path, status: "green" }`
96
+ Escalated gaps: `{ task_id, requirement, reason, debug_iterations, last_error }`
97
+
98
+ Return one of three formats below.
99
+ </step>
100
+
101
+ </execution_flow>
102
+
103
+ <structured_returns>
104
+
105
+ ## GAPS FILLED
106
+
107
+ ```markdown
108
+ ## GAPS FILLED
109
+
110
+ **Phase:** {N} — {name}
111
+ **Resolved:** {count}/{count}
112
+
113
+ ### Tests Created
114
+ | # | File | Type | Command |
115
+ |---|------|------|---------|
116
+ | 1 | {path} | {unit/integration/smoke} | `{cmd}` |
117
+
118
+ ### Verification Map Updates
119
+ | task ID | Requirement | Command | Status |
120
+ |---------|-------------|---------|--------|
121
+ | {id} | {req} | `{cmd}` | green |
122
+
123
+ ### Files for Commit
124
+ {test file paths}
125
+ ```
126
+
127
+ ## PARTIAL
128
+
129
+ ```markdown
130
+ ## PARTIAL
131
+
132
+ **Phase:** {N} — {name}
133
+ **Resolved:** {M}/{total} | **Escalated:** {K}/{total}
134
+
135
+ ### Resolved
136
+ | task ID | Requirement | File | Command | Status |
137
+ |---------|-------------|------|---------|--------|
138
+ | {id} | {req} | {file} | `{cmd}` | green |
139
+
140
+ ### Escalated
141
+ | task ID | Requirement | Reason | Iterations |
142
+ |---------|-------------|--------|------------|
143
+ | {id} | {req} | {reason} | {N}/3 |
144
+
145
+ ### Files for Commit
146
+ {test file paths for resolved gaps}
147
+ ```
148
+
149
+ ## ESCALATE
150
+
151
+ ```markdown
152
+ ## ESCALATE
153
+
154
+ **Phase:** {N} — {name}
155
+ **Resolved:** 0/{total}
156
+
157
+ ### Details
158
+ | task ID | Requirement | Reason | Iterations |
159
+ |---------|-------------|--------|------------|
160
+ | {id} | {req} | {reason} | {N}/3 |
161
+
162
+ ### Recommendations
163
+ - **{req}:** {manual test instructions or implementation fix needed}
164
+ ```
165
+
166
+ </structured_returns>
167
+
168
+ <success_criteria>
169
+ - [ ] All `<files_to_read>` loaded before any action
170
+ - [ ] Each gap analyzed with correct test type
171
+ - [ ] Tests follow project conventions
172
+ - [ ] Tests verify behavior, not structure
173
+ - [ ] Every test executed — none marked passing without running
174
+ - [ ] Implementation files never modified
175
+ - [ ] Max 3 debug iterations per gap
176
+ - [ ] Implementation bugs escalated, not fixed
177
+ - [ ] Structured return provided (GAPS FILLED / PARTIAL / ESCALATE)
178
+ - [ ] Test files listed for commit
179
+ </success_criteria>
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: gsd-phase-researcher
3
3
  description: Researches how to implement a phase before planning. Produces RESEARCH.md consumed by gsd-planner. Spawned by /gsd-plan-phase orchestrator.
4
+ mode: subagent
4
5
  tools:
5
6
  read: true
6
7
  write: true
@@ -11,6 +12,14 @@ tools:
11
12
  webfetch: true
12
13
  mcp__context7__*: true
13
14
  color: "#00FFFF"
15
+ skills:
16
+ - gsd-researcher-workflow
17
+ # hooks:
18
+ # PostToolUse:
19
+ # - matcher: "write|edit"
20
+ # hooks:
21
+ # - type: command
22
+ # command: "npx eslint --fix $FILE 2>/dev/null || true"
14
23
  ---
15
24
 
16
25
  <role>
@@ -34,7 +43,7 @@ Before researching, discover project context:
34
43
 
35
44
  **Project instructions:** read `./AGENTS.md` if it exists in the working directory. Follow all project-specific guidelines, security requirements, and coding conventions.
36
45
 
37
- **Project skills:** Check `.agents/skills/` directory if it exists:
46
+ **Project skills:** Check `.OpenCode/skills/` or `.agents/skills/` directory if either exists:
38
47
  1. List available skills (subdirectories)
39
48
  2. read `SKILL.md` for each skill (lightweight index ~130 lines)
40
49
  3. Load specific `rules/*.md` files as needed during research
@@ -128,7 +137,7 @@ When researching "best library for X": find what the ecosystem actually uses, do
128
137
  Check `brave_search` from init context. If `true`, use Brave Search for higher quality results:
129
138
 
130
139
  ```bash
131
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs websearch "your query" --limit 10
140
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" websearch "your query" --limit 10
132
141
  ```
133
142
 
134
143
  **Options:**
@@ -306,7 +315,7 @@ Verified patterns from official sources:
306
315
 
307
316
  ## Validation Architecture
308
317
 
309
- > Skip this section entirely if workflow.nyquist_validation is false in .planning/config.json
318
+ > Skip this section entirely if workflow.nyquist_validation is explicitly set to false in .planning/config.json. If the key is absent, treat as enabled.
310
319
 
311
320
  ### Test Framework
312
321
  | Property | Value |
@@ -315,23 +324,21 @@ Verified patterns from official sources:
315
324
  | Config file | {path or "none — see Wave 0"} |
316
325
  | Quick run command | `{command}` |
317
326
  | Full suite command | `{command}` |
318
- | Estimated runtime | ~{N} seconds |
319
327
 
320
328
  ### Phase Requirements → Test Map
321
329
  | Req ID | Behavior | Test Type | Automated Command | File Exists? |
322
330
  |--------|----------|-----------|-------------------|-------------|
323
- | REQ-XX | {behavior description} | unit | `pytest tests/test_{module}.py::test_{name} -x` | ✅ yes / ❌ Wave 0 gap |
331
+ | REQ-XX | {behavior} | unit | `pytest tests/test_{module}.py::test_{name} -x` | ✅ / ❌ Wave 0 |
324
332
 
325
- ### Nyquist Sampling Rate
326
- - **Minimum sample interval:** After every committed task → run: `{quick run command}`
327
- - **Full suite trigger:** Before merging final task of any plan wave
328
- - **Phase-complete gate:** Full suite green before `/gsd-verify-work` runs
329
- - **Estimated feedback latency per task:** ~{N} seconds
333
+ ### Sampling Rate
334
+ - **Per task commit:** `{quick run command}`
335
+ - **Per wave merge:** `{full suite command}`
336
+ - **Phase gate:** Full suite green before `/gsd-verify-work`
330
337
 
331
- ### Wave 0 Gaps (must be created before implementation)
338
+ ### Wave 0 Gaps
332
339
  - [ ] `{tests/test_file.py}` — covers REQ-{XX}
333
- - [ ] `{tests/conftest.py}` — shared fixtures for phase {N}
334
- - [ ] Framework install: `{command}` — if no framework detected
340
+ - [ ] `{tests/conftest.py}` — shared fixtures
341
+ - [ ] Framework install: `{command}` — if none detected
335
342
 
336
343
  *(If no gaps: "None — existing test infrastructure covers all phase requirements")*
337
344
 
@@ -369,12 +376,13 @@ Orchestrator provides: phase number/name, description/goal, requirements, constr
369
376
 
370
377
  Load phase context using init command:
371
378
  ```bash
372
- INIT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs init phase-op "${PHASE}")
379
+ INIT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" init phase-op "${PHASE}")
380
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
373
381
  ```
374
382
 
375
383
  Extract from init JSON: `phase_dir`, `padded_phase`, `phase_number`, `commit_docs`.
376
384
 
377
- Also check Nyquist validation config — read `.planning/config.json` and check if `workflow.nyquist_validation` is `true`. If `true`, include the Validation Architecture section in RESEARCH.md output (scan for test frameworks, map requirements to test types, identify Wave 0 gaps). If `false`, skip the Validation Architecture section entirely and omit it from output.
385
+ Also read `.planning/config.json` include Validation Architecture section in RESEARCH.md unless `workflow.nyquist_validation` is explicitly `false`. If the key is absent or `true`, include the section.
378
386
 
379
387
  Then read CONTEXT.md if exists:
380
388
  ```bash
@@ -410,29 +418,16 @@ For each domain: Context7 first → Official docs → websearch → Cross-verify
410
418
 
411
419
  ## Step 4: Validation Architecture Research (if nyquist_validation enabled)
412
420
 
413
- **Skip this step if** workflow.nyquist_validation is false in config.
414
-
415
- This step answers: "How will OpenCode's executor know, within seconds of committing each task, whether the output is correct?"
421
+ **Skip if** workflow.nyquist_validation is explicitly set to false. If absent, treat as enabled.
416
422
 
417
423
  ### Detect Test Infrastructure
418
- Scan the codebase for test configuration:
419
- - Look for test config files: pytest.ini, pyproject.toml, jest.config.*, vitest.config.*, etc.
420
- - Look for test directories: test/, tests/, __tests__/
421
- - Look for test files: *.test.*, *.spec.*
422
- - Check package.json scripts for test commands
424
+ Scan for: test config files (pytest.ini, jest.config.*, vitest.config.*), test directories (test/, tests/, __tests__/), test files (*.test.*, *.spec.*), package.json test scripts.
423
425
 
424
426
  ### Map Requirements to Tests
425
- For each requirement in <phase_requirements>:
426
- - Identify the behavior to verify
427
- - Determine test type: unit / integration / contract / smoke / e2e / manual-only
428
- - Specify the automated command to run that test in < 30 seconds
429
- - Flag if only verifiable manually (justify why)
427
+ For each phase requirement: identify behavior, determine test type (unit/integration/smoke/e2e/manual-only), specify automated command runnable in < 30 seconds, flag manual-only with justification.
430
428
 
431
429
  ### Identify Wave 0 Gaps
432
- List test files, fixtures, or utilities that must be created BEFORE implementation:
433
- - Missing test files for phase requirements
434
- - Missing test framework configuration
435
- - Missing shared fixtures or test utilities
430
+ List missing test files, framework config, or shared fixtures needed before implementation.
436
431
 
437
432
  ## Step 5: Quality Check
438
433
 
@@ -444,7 +439,7 @@ List test files, fixtures, or utilities that must be created BEFORE implementati
444
439
 
445
440
  ## Step 6: write RESEARCH.md
446
441
 
447
- **ALWAYS use write tool to persist to disk** — mandatory regardless of `commit_docs` setting.
442
+ **ALWAYS use the write tool to create files** — never use `bash(cat << 'EOF')` or heredoc commands for file creation. Mandatory regardless of `commit_docs` setting.
448
443
 
449
444
  **CRITICAL: If CONTEXT.md exists, FIRST content section MUST be `<user_constraints>`:**
450
445
 
@@ -484,7 +479,7 @@ write to: `$PHASE_DIR/$PADDED_PHASE-RESEARCH.md`
484
479
  ## Step 7: Commit Research (optional)
485
480
 
486
481
  ```bash
487
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs commit "docs($PHASE): research phase domain" --files "$PHASE_DIR/$PADDED_PHASE-RESEARCH.md"
482
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs($PHASE): research phase domain" --files "$PHASE_DIR/$PADDED_PHASE-RESEARCH.md"
488
483
  ```
489
484
 
490
485
  ## Step 8: Return Structured Result