gsd-opencode 1.20.4 → 1.22.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 (110) hide show
  1. package/agents/gsd-codebase-mapper.md +9 -1
  2. package/agents/gsd-debugger.md +66 -10
  3. package/agents/gsd-executor.md +36 -16
  4. package/agents/gsd-integration-checker.md +2 -0
  5. package/agents/gsd-nyquist-auditor.md +178 -0
  6. package/agents/gsd-phase-researcher.md +28 -34
  7. package/agents/gsd-plan-checker.md +42 -78
  8. package/agents/gsd-planner.md +139 -24
  9. package/agents/gsd-project-researcher.md +11 -1
  10. package/agents/gsd-research-synthesizer.md +13 -3
  11. package/agents/gsd-roadmapper.md +25 -15
  12. package/agents/gsd-verifier.md +29 -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 +19 -11
  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
@@ -14,7 +14,7 @@ Check if `--auto` flag is present in $ARGUMENTS.
14
14
  **If auto mode:**
15
15
  - Skip brownfield mapping offer (assume greenfield)
16
16
  - Skip deep questioning (extract context from provided document)
17
- - Config: YOLO mode is implicit (skip that question), but ask depth/git/agents FIRST (Step 2a)
17
+ - Config: YOLO mode is implicit (skip that question), but ask granularity/git/agents FIRST (Step 2a)
18
18
  - After config: run Steps 6-9 automatically with smart defaults:
19
19
  - Research: Always yes
20
20
  - Requirements: Include all table stakes + features from provided document
@@ -46,7 +46,8 @@ The document should describe what you want to build.
46
46
  **MANDATORY FIRST STEP — Execute these checks before ANY user interaction:**
47
47
 
48
48
  ```bash
49
- INIT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs init new-project)
49
+ INIT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" init new-project)
50
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
50
51
  ```
51
52
 
52
53
  Parse JSON for: `researcher_model`, `synthesizer_model`, `roadmapper_model`, `commit_docs`, `project_exists`, `has_codebase_map`, `planning_exists`, `has_existing_code`, `has_package_file`, `is_brownfield`, `needs_codebase_map`, `has_git`, `project_path`.
@@ -90,13 +91,13 @@ YOLO mode is implicit (auto = YOLO). Ask remaining config questions:
90
91
  ```
91
92
  question([
92
93
  {
93
- header: "Depth",
94
- question: "How thorough should planning be?",
94
+ header: "Granularity",
95
+ question: "How finely should scope be sliced into phases?",
95
96
  multiSelect: false,
96
97
  options: [
97
- { label: "Quick (Recommended)", description: "Ship fast (3-5 phases, 1-3 plans each)" },
98
- { label: "Standard", description: "Balanced scope and speed (5-8 phases, 3-5 plans each)" },
99
- { label: "Comprehensive", description: "Thorough coverage (8-12 phases, 5-10 plans each)" }
98
+ { label: "Coarse (Recommended)", description: "Fewer, broader phases (3-5 phases, 1-3 plans each)" },
99
+ { label: "Standard", description: "Balanced phase size (5-8 phases, 3-5 plans each)" },
100
+ { label: "Fine", description: "Many focused phases (8-12 phases, 5-10 plans each)" }
100
101
  ]
101
102
  },
102
103
  {
@@ -158,7 +159,7 @@ question([
158
159
  options: [
159
160
  { label: "Smart (Recommended)", description: "Two models: one for reseach and planing, other for execution and verification" },
160
161
  { label: "Simple", description: Description: "One model for all agents (not flexible)" },
161
- { label: "Custom (most flexible)", description: "Three models: different for every stage" }
162
+ { label: "Genius (most flexible)", description: "Three models: different for every stage" }
162
163
  ]
163
164
  }
164
165
  ])
@@ -169,14 +170,15 @@ Create `.planning/config.json` with mode set to "yolo":
169
170
  ```json
170
171
  {
171
172
  "mode": "yolo",
172
- "depth": "[selected]",
173
+ "granularity": "[selected]",
173
174
  "parallelization": true|false,
174
175
  "commit_docs": true|false,
175
- "model_profile": "simple|smart|custom",
176
+ "model_profile": "simple|smart|genius",
176
177
  "workflow": {
177
178
  "research": true|false,
178
179
  "plan_check": true|false,
179
180
  "verifier": true|false,
181
+ "nyquist_validation": depth !== "quick",
180
182
  "auto_advance": true
181
183
  }
182
184
  }
@@ -188,13 +190,13 @@ Create `.planning/config.json` with mode set to "yolo":
188
190
 
189
191
  ```bash
190
192
  mkdir -p .planning
191
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs commit "chore: add project config" --files .planning/config.json
193
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "chore: add project config" --files .planning/config.json
192
194
  ```
193
195
 
194
- **Persist auto-advance to config (survives context compaction):**
196
+ **Persist auto-advance chain flag to config (survives context compaction):**
195
197
 
196
198
  ```bash
197
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs config-set workflow.auto_advance true
199
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" config-set workflow._auto_chain_active true
198
200
  ```
199
201
 
200
202
  Proceed to Step 4 (skip Steps 3 and 5).
@@ -338,7 +340,7 @@ Do not compress. Capture everything gathered.
338
340
 
339
341
  ```bash
340
342
  mkdir -p .planning
341
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs commit "docs: initialize project" --files .planning/PROJECT.md
343
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs: initialize project" --files .planning/PROJECT.md
342
344
  ```
343
345
 
344
346
  ## 5. Workflow Preferences
@@ -379,13 +381,13 @@ questions: [
379
381
  ]
380
382
  },
381
383
  {
382
- header: "Depth",
383
- question: "How thorough should planning be?",
384
+ header: "Granularity",
385
+ question: "How finely should scope be sliced into phases?",
384
386
  multiSelect: false,
385
387
  options: [
386
- { label: "Quick", description: "Ship fast (3-5 phases, 1-3 plans each)" },
387
- { label: "Standard", description: "Balanced scope and speed (5-8 phases, 3-5 plans each)" },
388
- { label: "Comprehensive", description: "Thorough coverage (8-12 phases, 5-10 plans each)" }
388
+ { label: "Coarse", description: "Fewer, broader phases (3-5 phases, 1-3 plans each)" },
389
+ { label: "Standard", description: "Balanced phase size (5-8 phases, 3-5 plans each)" },
390
+ { label: "Fine", description: "Many focused phases (8-12 phases, 5-10 plans each)" }
389
391
  ]
390
392
  },
391
393
  {
@@ -457,7 +459,7 @@ questions: [
457
459
  options: [
458
460
  { label: "Smart (Recommended)", description: "Two models: one for reseach and planing, other for execution and verification" },
459
461
  { label: "Simple", description: Description: "One model for all agents (not flexible)" },
460
- { label: "Custom (most flexible)", description: "Three models: different for every stage" }
462
+ { label: "Genius (most flexible)", description: "Three models: different for every stage" }
461
463
  ]
462
464
  }
463
465
  ]
@@ -468,14 +470,15 @@ Create `.planning/config.json` with all settings:
468
470
  ```json
469
471
  {
470
472
  "mode": "yolo|interactive",
471
- "depth": "quick|standard|comprehensive",
473
+ "granularity": "coarse|standard|fine",
472
474
  "parallelization": true|false,
473
475
  "commit_docs": true|false,
474
- "model_profile": "simple|smart|custom",
476
+ "model_profile": "simple|smart|genius",
475
477
  "workflow": {
476
478
  "research": true|false,
477
479
  "plan_check": true|false,
478
- "verifier": true|false
480
+ "verifier": true|false,
481
+ "nyquist_validation": depth !== "quick"
479
482
  }
480
483
  }
481
484
  ```
@@ -490,7 +493,7 @@ Create `.planning/config.json` with all settings:
490
493
  **Commit config.json:**
491
494
 
492
495
  ```bash
493
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs commit "chore: add project config" --files .planning/config.json
496
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "chore: add project config" --files .planning/config.json
494
497
  ```
495
498
 
496
499
  **Note:** Run `/gsd-settings` anytime to update these preferences.
@@ -544,9 +547,7 @@ Display spawning indicator:
544
547
  Spawn 4 parallel gsd-project-researcher agents with path references:
545
548
 
546
549
  ```
547
- task(prompt="First, read ~/.config/opencode/agents/gsd-project-researcher.md for your role and instructions.
548
-
549
- <research_type>
550
+ task(prompt="<research_type>
550
551
  Project Research — Stack dimension for [domain].
551
552
  </research_type>
552
553
 
@@ -580,13 +581,11 @@ Your STACK.md feeds into roadmap creation. Be prescriptive:
580
581
 
581
582
  <output>
582
583
  write to: .planning/research/STACK.md
583
- Use template: ~/.config/opencode/get-shit-done/templates/research-project/STACK.md
584
+ Use template: $HOME/.config/opencode/get-shit-done/templates/research-project/STACK.md
584
585
  </output>
585
- ", subagent_type="general", model="{researcher_model}", description="Stack research")
586
-
587
- task(prompt="First, read ~/.config/opencode/agents/gsd-project-researcher.md for your role and instructions.
586
+ ", subagent_type="gsd-project-researcher", model="{researcher_model}", description="Stack research")
588
587
 
589
- <research_type>
588
+ task(prompt="<research_type>
590
589
  Project Research — Features dimension for [domain].
591
590
  </research_type>
592
591
 
@@ -620,13 +619,11 @@ Your FEATURES.md feeds into requirements definition. Categorize clearly:
620
619
 
621
620
  <output>
622
621
  write to: .planning/research/FEATURES.md
623
- Use template: ~/.config/opencode/get-shit-done/templates/research-project/FEATURES.md
622
+ Use template: $HOME/.config/opencode/get-shit-done/templates/research-project/FEATURES.md
624
623
  </output>
625
- ", subagent_type="general", model="{researcher_model}", description="Features research")
624
+ ", subagent_type="gsd-project-researcher", model="{researcher_model}", description="Features research")
626
625
 
627
- task(prompt="First, read ~/.config/opencode/agents/gsd-project-researcher.md for your role and instructions.
628
-
629
- <research_type>
626
+ task(prompt="<research_type>
630
627
  Project Research — Architecture dimension for [domain].
631
628
  </research_type>
632
629
 
@@ -660,13 +657,11 @@ Your ARCHITECTURE.md informs phase structure in roadmap. Include:
660
657
 
661
658
  <output>
662
659
  write to: .planning/research/ARCHITECTURE.md
663
- Use template: ~/.config/opencode/get-shit-done/templates/research-project/ARCHITECTURE.md
660
+ Use template: $HOME/.config/opencode/get-shit-done/templates/research-project/ARCHITECTURE.md
664
661
  </output>
665
- ", subagent_type="general", model="{researcher_model}", description="Architecture research")
666
-
667
- task(prompt="First, read ~/.config/opencode/agents/gsd-project-researcher.md for your role and instructions.
662
+ ", subagent_type="gsd-project-researcher", model="{researcher_model}", description="Architecture research")
668
663
 
669
- <research_type>
664
+ task(prompt="<research_type>
670
665
  Project Research — Pitfalls dimension for [domain].
671
666
  </research_type>
672
667
 
@@ -700,9 +695,9 @@ Your PITFALLS.md prevents mistakes in roadmap/planning. For each pitfall:
700
695
 
701
696
  <output>
702
697
  write to: .planning/research/PITFALLS.md
703
- Use template: ~/.config/opencode/get-shit-done/templates/research-project/PITFALLS.md
698
+ Use template: $HOME/.config/opencode/get-shit-done/templates/research-project/PITFALLS.md
704
699
  </output>
705
- ", subagent_type="general", model="{researcher_model}", description="Pitfalls research")
700
+ ", subagent_type="gsd-project-researcher", model="{researcher_model}", description="Pitfalls research")
706
701
  ```
707
702
 
708
703
  After all 4 agents complete, spawn synthesizer to create SUMMARY.md:
@@ -722,7 +717,7 @@ Synthesize research outputs into SUMMARY.md.
722
717
 
723
718
  <output>
724
719
  write to: .planning/research/SUMMARY.md
725
- Use template: ~/.config/opencode/get-shit-done/templates/research-project/SUMMARY.md
720
+ Use template: $HOME/.config/opencode/get-shit-done/templates/research-project/SUMMARY.md
726
721
  Commit after writing.
727
722
  </output>
728
723
  ", subagent_type="gsd-research-synthesizer", model="{synthesizer_model}", description="Synthesize research")
@@ -887,7 +882,7 @@ If "adjust": Return to scoping.
887
882
  **Commit requirements:**
888
883
 
889
884
  ```bash
890
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs commit "docs: define v1 requirements" --files .planning/REQUIREMENTS.md
885
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs: define v1 requirements" --files .planning/REQUIREMENTS.md
891
886
  ```
892
887
 
893
888
  ## 8. Create Roadmap
@@ -911,7 +906,7 @@ task(prompt="
911
906
  - .planning/PROJECT.md (Project context)
912
907
  - .planning/REQUIREMENTS.md (v1 Requirements)
913
908
  - .planning/research/SUMMARY.md (Research findings - if exists)
914
- - .planning/config.json (Depth and mode settings)
909
+ - .planning/config.json (Granularity and mode settings)
915
910
  </files_to_read>
916
911
 
917
912
  </planning_context>
@@ -1017,7 +1012,7 @@ Use question:
1017
1012
  **Commit roadmap (after approval or auto mode):**
1018
1013
 
1019
1014
  ```bash
1020
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs commit "docs: create roadmap ([N] phases)" --files .planning/ROADMAP.md .planning/STATE.md .planning/REQUIREMENTS.md
1015
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs: create roadmap ([N] phases)" --files .planning/ROADMAP.md .planning/STATE.md .planning/REQUIREMENTS.md
1021
1016
  ```
1022
1017
 
1023
1018
  ## 9. Done
@@ -1098,7 +1093,7 @@ Exit skill and invoke command("/gsd-discuss-phase 1 --auto")
1098
1093
  - [ ] Brownfield detection completed
1099
1094
  - [ ] Deep questioning completed (threads followed, not rushed)
1100
1095
  - [ ] PROJECT.md captures full context → **committed**
1101
- - [ ] config.json has workflow mode, depth, parallelization → **committed**
1096
+ - [ ] config.json has workflow mode, granularity, parallelization → **committed**
1102
1097
  - [ ] Research completed (if selected) — 4 parallel agents spawned → **committed**
1103
1098
  - [ ] Requirements gathered (from research or conversation)
1104
1099
  - [ ] User scoped each category (v1/v2/out of scope)
@@ -86,13 +86,13 @@ Be specific enough for a fresh OpenCode to understand immediately.
86
86
 
87
87
  Use `current-timestamp` for last_updated field. You can use init todos (which provides timestamps) or call directly:
88
88
  ```bash
89
- timestamp=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs current-timestamp full --raw)
89
+ timestamp=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" current-timestamp full --raw)
90
90
  ```
91
91
  </step>
92
92
 
93
93
  <step name="commit">
94
94
  ```bash
95
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs commit "wip: [phase-name] paused at task [X]/[Y]" --files .planning/phases/*/.continue-here.md
95
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "wip: [phase-name] paused at task [X]/[Y]" --files .planning/phases/*/.continue-here.md
96
96
  ```
97
97
  </step>
98
98
 
@@ -65,8 +65,8 @@ Gap: Flow "View dashboard" broken at data fetch
65
65
  Find highest existing phase:
66
66
  ```bash
67
67
  # Get sorted phase list, extract last one
68
- PHASES=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs phases list)
69
- HIGHEST=$(echo "$PHASES" | jq -r '.directories[-1]')
68
+ PHASES=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" phases list)
69
+ HIGHEST=$(printf '%s\n' "$PHASES" | jq -r '.directories[-1]')
70
70
  ```
71
71
 
72
72
  New phases continue from there:
@@ -147,7 +147,7 @@ mkdir -p ".planning/phases/{NN}-{name}"
147
147
  ## 9. Commit Roadmap and Requirements Update
148
148
 
149
149
  ```bash
150
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs commit "docs(roadmap): add gap closure phases {N}-{M}" --files .planning/ROADMAP.md .planning/REQUIREMENTS.md
150
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs(roadmap): add gap closure phases {N}-{M}" --files .planning/ROADMAP.md .planning/REQUIREMENTS.md
151
151
  ```
152
152
 
153
153
  ## 10. Offer Next Steps
@@ -5,7 +5,7 @@ Create executable phase prompts (PLAN.md files) for a roadmap phase with integra
5
5
  <required_reading>
6
6
  read all files referenced by the invoking prompt's execution_context before starting.
7
7
 
8
- @~/.config/opencode/get-shit-done/references/ui-brand.md
8
+ @$HOME/.config/opencode/get-shit-done/references/ui-brand.md
9
9
  </required_reading>
10
10
 
11
11
  <process>
@@ -15,10 +15,11 @@ read all files referenced by the invoking prompt's execution_context before star
15
15
  Load all context in one call (paths only to minimize orchestrator context):
16
16
 
17
17
  ```bash
18
- INIT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs init plan-phase "$PHASE")
18
+ INIT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" init plan-phase "$PHASE")
19
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
19
20
  ```
20
21
 
21
- Parse JSON for: `researcher_model`, `planner_model`, `checker_model`, `research_enabled`, `plan_checker_enabled`, `nyquist_validation_enabled`, `commit_docs`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`, `has_research`, `has_context`, `has_plans`, `plan_count`, `planning_exists`, `roadmap_exists`.
22
+ Parse JSON for: `researcher_model`, `planner_model`, `checker_model`, `research_enabled`, `plan_checker_enabled`, `nyquist_validation_enabled`, `commit_docs`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`, `has_research`, `has_context`, `has_plans`, `plan_count`, `planning_exists`, `roadmap_exists`, `phase_req_ids`.
22
23
 
23
24
  **File paths (for <files_to_read> blocks):** `state_path`, `roadmap_path`, `requirements_path`, `context_path`, `research_path`, `verification_path`, `uat_path`. These are null if files don't exist.
24
25
 
@@ -26,7 +27,9 @@ Parse JSON for: `researcher_model`, `planner_model`, `checker_model`, `research_
26
27
 
27
28
  ## 2. Parse and Normalize Arguments
28
29
 
29
- Extract from $ARGUMENTS: phase number (integer or decimal like `2.1`), flags (`--research`, `--skip-research`, `--gaps`, `--skip-verify`).
30
+ Extract from $ARGUMENTS: phase number (integer or decimal like `2.1`), flags (`--research`, `--skip-research`, `--gaps`, `--skip-verify`, `--prd <filepath>`).
31
+
32
+ Extract `--prd <filepath>` from $ARGUMENTS. If present, set PRD_FILE to the filepath.
30
33
 
31
34
  **If no phase number:** Detect next unplanned phase from roadmap.
32
35
 
@@ -40,13 +43,103 @@ mkdir -p ".planning/phases/${padded_phase}-${phase_slug}"
40
43
  ## 3. Validate Phase
41
44
 
42
45
  ```bash
43
- PHASE_INFO=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "${PHASE}")
46
+ PHASE_INFO=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" roadmap get-phase "${PHASE}")
44
47
  ```
45
48
 
46
49
  **If `found` is false:** Error with available phases. **If `found` is true:** Extract `phase_number`, `phase_name`, `goal` from JSON.
47
50
 
51
+ ## 3.5. Handle PRD Express Path
52
+
53
+ **Skip if:** No `--prd` flag in arguments.
54
+
55
+ **If `--prd <filepath>` provided:**
56
+
57
+ 1. read the PRD file:
58
+ ```bash
59
+ PRD_CONTENT=$(cat "$PRD_FILE" 2>/dev/null)
60
+ if [ -z "$PRD_CONTENT" ]; then
61
+ echo "Error: PRD file not found: $PRD_FILE"
62
+ exit 1
63
+ fi
64
+ ```
65
+
66
+ 2. Display banner:
67
+ ```
68
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
69
+ GSD ► PRD EXPRESS PATH
70
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
71
+
72
+ Using PRD: {PRD_FILE}
73
+ Generating CONTEXT.md from requirements...
74
+ ```
75
+
76
+ 3. Parse the PRD content and generate CONTEXT.md. The orchestrator should:
77
+ - Extract all requirements, user stories, acceptance criteria, and constraints from the PRD
78
+ - Map each to a locked decision (everything in the PRD is treated as a locked decision)
79
+ - Identify any areas the PRD doesn't cover and mark as "OpenCode's Discretion"
80
+ - Create CONTEXT.md in the phase directory
81
+
82
+ 4. write CONTEXT.md:
83
+ ```markdown
84
+ # Phase [X]: [Name] - Context
85
+
86
+ **Gathered:** [date]
87
+ **Status:** Ready for planning
88
+ **Source:** PRD Express Path ({PRD_FILE})
89
+
90
+ <domain>
91
+ ## Phase Boundary
92
+
93
+ [Extracted from PRD — what this phase delivers]
94
+
95
+ </domain>
96
+
97
+ <decisions>
98
+ ## Implementation Decisions
99
+
100
+ {For each requirement/story/criterion in the PRD:}
101
+ ### [Category derived from content]
102
+ - [Requirement as locked decision]
103
+
104
+ ### OpenCode's Discretion
105
+ [Areas not covered by PRD — implementation details, technical choices]
106
+
107
+ </decisions>
108
+
109
+ <specifics>
110
+ ## Specific Ideas
111
+
112
+ [Any specific references, examples, or concrete requirements from PRD]
113
+
114
+ </specifics>
115
+
116
+ <deferred>
117
+ ## Deferred Ideas
118
+
119
+ [Items in PRD explicitly marked as future/v2/out-of-scope]
120
+ [If none: "None — PRD covers phase scope"]
121
+
122
+ </deferred>
123
+
124
+ ---
125
+
126
+ *Phase: XX-name*
127
+ *Context gathered: [date] via PRD Express Path*
128
+ ```
129
+
130
+ 5. Commit:
131
+ ```bash
132
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs(${padded_phase}): generate context from PRD" --files "${phase_dir}/${padded_phase}-CONTEXT.md"
133
+ ```
134
+
135
+ 6. Set `context_content` to the generated CONTEXT.md content and continue to step 5 (Handle Research).
136
+
137
+ **Effect:** This completely bypasses step 4 (Load CONTEXT.md) since we just created it. The rest of the workflow (research, planning, verification) proceeds normally with the PRD-derived context.
138
+
48
139
  ## 4. Load CONTEXT.md
49
140
 
141
+ **Skip if:** PRD express path was used (CONTEXT.md already created in step 3.5).
142
+
50
143
  Check `context_path` from init JSON.
51
144
 
52
145
  If `context_path` is not null, display: `Using phase context from: ${context_path}`
@@ -83,8 +176,7 @@ Display banner:
83
176
  ### Spawn gsd-phase-researcher
84
177
 
85
178
  ```bash
86
- PHASE_DESC=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "${PHASE}" | jq -r '.section')
87
- PHASE_REQ_IDS=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "${PHASE}" | jq -r '.section // empty' | grep -i "Requirements:" | head -1 | sed 's/.*Requirements:\*\*\s*//' | sed 's/[\[\]]//g' | tr ',' '\n' | sed 's/^ *//;s/ *$//' | grep -v '^$' | tr '\n' ',' | sed 's/,$//')
179
+ PHASE_DESC=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" roadmap get-phase "${PHASE}" | jq -r '.section')
88
180
  ```
89
181
 
90
182
  Research prompt:
@@ -106,7 +198,7 @@ Answer: "What do I need to know to PLAN this phase well?"
106
198
  **Phase requirement IDs (MUST address):** {phase_req_ids}
107
199
 
108
200
  **Project instructions:** read ./AGENTS.md if exists — follow project-specific guidelines
109
- **Project skills:** Check .agents/skills/ directory (if exists) — read SKILL.md files, research should account for project skill patterns
201
+ **Project skills:** Check .OpenCode/skills/ or .agents/skills/ directory (if either exists) — read SKILL.md files, research should account for project skill patterns
110
202
  </additional_context>
111
203
 
112
204
  <output>
@@ -116,8 +208,8 @@ write to: {phase_dir}/{phase_num}-RESEARCH.md
116
208
 
117
209
  ```
118
210
  task(
119
- prompt="First, read ~/.config/opencode/agents/gsd-phase-researcher.md for your role and instructions.\n\n" + research_prompt,
120
- subagent_type="general",
211
+ prompt=research_prompt,
212
+ subagent_type="gsd-phase-researcher",
121
213
  model="{researcher_model}",
122
214
  description="Research Phase {phase}"
123
215
  )
@@ -128,30 +220,26 @@ task(
128
220
  - **`## RESEARCH COMPLETE`:** Display confirmation, continue to step 6
129
221
  - **`## RESEARCH BLOCKED`:** Display blocker, offer: 1) Provide context, 2) Skip research, 3) Abort
130
222
 
131
- ## 5.5. Create Validation Strategy (if Nyquist enabled)
132
-
133
- **Skip if:** `nyquist_validation_enabled` is false from INIT JSON.
223
+ ## 5.5. Create Validation Strategy
134
224
 
135
- After researcher completes, check if RESEARCH.md contains a Validation Architecture section:
225
+ MANDATORY unless `nyquist_validation_enabled` is false.
136
226
 
137
227
  ```bash
138
228
  grep -l "## Validation Architecture" "${PHASE_DIR}"/*-RESEARCH.md 2>/dev/null
139
229
  ```
140
230
 
141
231
  **If found:**
142
- 1. read validation template from `~/.config/opencode/get-shit-done/templates/VALIDATION.md`
143
- 2. write to `${PHASE_DIR}/${PADDED_PHASE}-VALIDATION.md`
144
- 3. Fill frontmatter: replace `{N}` with phase number, `{phase-slug}` with phase slug, `{date}` with current date
145
- 4. If `commit_docs` is true:
232
+ 1. read template: `$HOME/.config/opencode/get-shit-done/templates/VALIDATION.md`
233
+ 2. write to `${PHASE_DIR}/${PADDED_PHASE}-VALIDATION.md` (use write tool)
234
+ 3. Fill frontmatter: `{N}` phase number, `{phase-slug}` slug, `{date}` current date
235
+ 4. Verify:
146
236
  ```bash
147
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs commit-docs "docs(phase-${PHASE}): add validation strategy"
237
+ test -f "${PHASE_DIR}/${PADDED_PHASE}-VALIDATION.md" && echo "VALIDATION_CREATED=true" || echo "VALIDATION_CREATED=false"
148
238
  ```
239
+ 5. If `VALIDATION_CREATED=false`: STOP — do not proceed to Step 6
240
+ 6. If `commit_docs`: `commit-docs "docs(phase-${PHASE}): add validation strategy"`
149
241
 
150
- **If not found (and nyquist enabled):** Display warning:
151
- ```
152
- ⚠ Nyquist validation enabled but researcher did not produce a Validation Architecture section.
153
- Continuing without validation strategy. Plans may fail Dimension 8 check.
154
- ```
242
+ **If not found:** Warn and continue plans may fail Dimension 8.
155
243
 
156
244
  ## 6. Check Existing Plans
157
245
 
@@ -166,15 +254,30 @@ ls "${PHASE_DIR}"/*-PLAN.md 2>/dev/null
166
254
  Extract from INIT JSON:
167
255
 
168
256
  ```bash
169
- STATE_PATH=$(echo "$INIT" | jq -r '.state_path // empty')
170
- ROADMAP_PATH=$(echo "$INIT" | jq -r '.roadmap_path // empty')
171
- REQUIREMENTS_PATH=$(echo "$INIT" | jq -r '.requirements_path // empty')
172
- RESEARCH_PATH=$(echo "$INIT" | jq -r '.research_path // empty')
173
- VERIFICATION_PATH=$(echo "$INIT" | jq -r '.verification_path // empty')
174
- UAT_PATH=$(echo "$INIT" | jq -r '.uat_path // empty')
175
- CONTEXT_PATH=$(echo "$INIT" | jq -r '.context_path // empty')
257
+ STATE_PATH=$(printf '%s\n' "$INIT" | jq -r '.state_path // empty')
258
+ ROADMAP_PATH=$(printf '%s\n' "$INIT" | jq -r '.roadmap_path // empty')
259
+ REQUIREMENTS_PATH=$(printf '%s\n' "$INIT" | jq -r '.requirements_path // empty')
260
+ RESEARCH_PATH=$(printf '%s\n' "$INIT" | jq -r '.research_path // empty')
261
+ VERIFICATION_PATH=$(printf '%s\n' "$INIT" | jq -r '.verification_path // empty')
262
+ UAT_PATH=$(printf '%s\n' "$INIT" | jq -r '.uat_path // empty')
263
+ CONTEXT_PATH=$(printf '%s\n' "$INIT" | jq -r '.context_path // empty')
176
264
  ```
177
265
 
266
+ ## 7.5. Verify Nyquist Artifacts
267
+
268
+ Skip if `nyquist_validation_enabled` is false.
269
+
270
+ ```bash
271
+ VALIDATION_EXISTS=$(ls "${PHASE_DIR}"/*-VALIDATION.md 2>/dev/null | head -1)
272
+ ```
273
+
274
+ If missing and Nyquist enabled — ask user:
275
+ 1. Re-run: `/gsd-plan-phase {PHASE} --research`
276
+ 2. Disable Nyquist in config
277
+ 3. Continue anyway (plans fail Dimension 8)
278
+
279
+ Proceed to Step 8 only if user selects 2 or 3.
280
+
178
281
  ## 8. Spawn gsd-planner Agent
179
282
 
180
283
  Display banner:
@@ -206,7 +309,7 @@ Planner prompt:
206
309
  **Phase requirement IDs (every ID MUST appear in a plan's `requirements` field):** {phase_req_ids}
207
310
 
208
311
  **Project instructions:** read ./AGENTS.md if exists — follow project-specific guidelines
209
- **Project skills:** Check .agents/skills/ directory (if exists) — read SKILL.md files, plans should account for project skill rules
312
+ **Project skills:** Check .OpenCode/skills/ or .agents/skills/ directory (if either exists) — read SKILL.md files, plans should account for project skill rules
210
313
  </planning_context>
211
314
 
212
315
  <downstream_consumer>
@@ -229,8 +332,8 @@ Output consumed by /gsd-execute-phase. Plans need:
229
332
 
230
333
  ```
231
334
  task(
232
- prompt="First, read ~/.config/opencode/agents/gsd-planner.md for your role and instructions.\n\n" + filled_prompt,
233
- subagent_type="general",
335
+ prompt=filled_prompt,
336
+ subagent_type="gsd-planner",
234
337
  model="{planner_model}",
235
338
  description="Plan Phase {phase}"
236
339
  )
@@ -271,7 +374,7 @@ Checker prompt:
271
374
  **Phase requirement IDs (MUST ALL be covered):** {phase_req_ids}
272
375
 
273
376
  **Project instructions:** read ./AGENTS.md if exists — verify plans honor project guidelines
274
- **Project skills:** Check .agents/skills/ directory (if exists) — verify plans account for project skill rules
377
+ **Project skills:** Check .OpenCode/skills/ or .agents/skills/ directory (if either exists) — verify plans account for project skill rules
275
378
  </verification_context>
276
379
 
277
380
  <expected_output>
@@ -326,8 +429,8 @@ Return what changed.
326
429
 
327
430
  ```
328
431
  task(
329
- prompt="First, read ~/.config/opencode/agents/gsd-planner.md for your role and instructions.\n\n" + revision_prompt,
330
- subagent_type="general",
432
+ prompt=revision_prompt,
433
+ subagent_type="gsd-planner",
331
434
  model="{planner_model}",
332
435
  description="Revise Phase {phase} plans"
333
436
  )
@@ -350,12 +453,19 @@ Route to `<offer_next>` OR `auto_advance` depending on flags/config.
350
453
  Check for auto-advance trigger:
351
454
 
352
455
  1. Parse `--auto` flag from $ARGUMENTS
353
- 2. read `workflow.auto_advance` from config:
456
+ 2. **Sync chain flag with intent** — if user invoked manually (no `--auto`), clear the ephemeral chain flag from any previous interrupted `--auto` chain. This does NOT touch `workflow.auto_advance` (the user's persistent settings preference):
457
+ ```bash
458
+ if [[ ! "$ARGUMENTS" =~ --auto ]]; then
459
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" config-set workflow._auto_chain_active false 2>/dev/null
460
+ fi
461
+ ```
462
+ 3. read both the chain flag and user preference:
354
463
  ```bash
355
- AUTO_CFG=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs config-get workflow.auto_advance 2>/dev/null || echo "false")
464
+ AUTO_CHAIN=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" config-get workflow._auto_chain_active 2>/dev/null || echo "false")
465
+ AUTO_CFG=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" config-get workflow.auto_advance 2>/dev/null || echo "false")
356
466
  ```
357
467
 
358
- **If `--auto` flag present OR `AUTO_CFG` is true:**
468
+ **If `--auto` flag present OR `AUTO_CHAIN` is true OR `AUTO_CFG` is true:**
359
469
 
360
470
  Display banner:
361
471
  ```
@@ -363,44 +473,16 @@ Display banner:
363
473
  GSD ► AUTO-ADVANCING TO EXECUTE
364
474
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
365
475
 
366
- Plans ready. Spawning execute-phase...
476
+ Plans ready. Launching execute-phase...
367
477
  ```
368
478
 
369
- Spawn execute-phase as task with direct workflow file reference (do NOT use skill tool Skills don't resolve inside task subagents):
479
+ Launch execute-phase using the skill tool to avoid nested task sessions (which cause runtime freezes due to deep agent nesting):
370
480
  ```
371
- task(
372
- prompt="
373
- <objective>
374
- You are the execute-phase orchestrator. Execute all plans for Phase ${PHASE}: ${PHASE_NAME}.
375
- </objective>
376
-
377
- <execution_context>
378
- @~/.config/opencode/get-shit-done/workflows/execute-phase.md
379
- @~/.config/opencode/get-shit-done/references/checkpoints.md
380
- @~/.config/opencode/get-shit-done/references/tdd.md
381
- @~/.config/opencode/get-shit-done/references/model-profile-resolution.md
382
- </execution_context>
383
-
384
- <arguments>
385
- PHASE=${PHASE}
386
- ARGUMENTS='${PHASE} --auto --no-transition'
387
- </arguments>
388
-
389
- <instructions>
390
- 1. read execute-phase.md from execution_context for your complete workflow
391
- 2. Follow ALL steps: initialize, handle_branching, validate_phase, discover_and_group_plans, execute_waves, aggregate_results, close_parent_artifacts, verify_phase_goal, update_roadmap
392
- 3. The --no-transition flag means: after verification + roadmap update, STOP and return status. Do NOT run transition.md.
393
- 4. When spawning executor agents, use subagent_type='gsd-executor' with the existing @file pattern from the workflow
394
- 5. When spawning verifier agents, use subagent_type='gsd-verifier'
395
- 6. Preserve the classifyHandoffIfNeeded workaround (spot-check on that specific error)
396
- 7. Do NOT use the skill tool or /gsd- commands
397
- </instructions>
398
- ",
399
- subagent_type="general",
400
- description="Execute Phase ${PHASE}"
401
- )
481
+ skill(skill="gsd-execute-phase", args="${PHASE} --auto --no-transition")
402
482
  ```
403
483
 
484
+ The `--no-transition` flag tells execute-phase to return status after verification instead of chaining further. This keeps the auto-advance chain flat — each phase runs at the same nesting level rather than spawning deeper task agents.
485
+
404
486
  **Handle execute-phase return:**
405
487
  - **PHASE COMPLETE** → Display final summary:
406
488
  ```