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
@@ -0,0 +1,167 @@
1
+ <purpose>
2
+ Audit Nyquist validation gaps for a completed phase. Generate missing tests. Update VALIDATION.md.
3
+ </purpose>
4
+
5
+ <required_reading>
6
+ @$HOME/.config/opencode/get-shit-done/references/ui-brand.md
7
+ </required_reading>
8
+
9
+ <process>
10
+
11
+ ## 0. Initialize
12
+
13
+ ```bash
14
+ INIT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" init phase-op "${PHASE_ARG}")
15
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
16
+ ```
17
+
18
+ Parse: `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`.
19
+
20
+ ```bash
21
+ AUDITOR_MODEL=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" resolve-model gsd-nyquist-auditor --raw)
22
+ NYQUIST_CFG=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" config get workflow.nyquist_validation --raw)
23
+ ```
24
+
25
+ If `NYQUIST_CFG` is `false`: exit with "Nyquist validation is disabled. Enable via /gsd-settings."
26
+
27
+ Display banner: `GSD > VALIDATE PHASE {N}: {name}`
28
+
29
+ ## 1. Detect Input State
30
+
31
+ ```bash
32
+ VALIDATION_FILE=$(ls "${PHASE_DIR}"/*-VALIDATION.md 2>/dev/null | head -1)
33
+ SUMMARY_FILES=$(ls "${PHASE_DIR}"/*-SUMMARY.md 2>/dev/null)
34
+ ```
35
+
36
+ - **State A** (`VALIDATION_FILE` non-empty): Audit existing
37
+ - **State B** (`VALIDATION_FILE` empty, `SUMMARY_FILES` non-empty): Reconstruct from artifacts
38
+ - **State C** (`SUMMARY_FILES` empty): Exit — "Phase {N} not executed. Run /gsd-execute-phase {N} first."
39
+
40
+ ## 2. Discovery
41
+
42
+ ### 2a. read Phase Artifacts
43
+
44
+ read all PLAN and SUMMARY files. Extract: task lists, requirement IDs, key-files changed, verify blocks.
45
+
46
+ ### 2b. Build Requirement-to-task Map
47
+
48
+ Per task: `{ task_id, plan_id, wave, requirement_ids, has_automated_command }`
49
+
50
+ ### 2c. Detect Test Infrastructure
51
+
52
+ State A: Parse from existing VALIDATION.md Test Infrastructure table.
53
+ State B: Filesystem scan:
54
+
55
+ ```bash
56
+ find . -name "pytest.ini" -o -name "jest.config.*" -o -name "vitest.config.*" -o -name "pyproject.toml" 2>/dev/null | head -10
57
+ find . \( -name "*.test.*" -o -name "*.spec.*" -o -name "test_*" \) -not -path "*/node_modules/*" 2>/dev/null | head -40
58
+ ```
59
+
60
+ ### 2d. Cross-Reference
61
+
62
+ Match each requirement to existing tests by filename, imports, test descriptions. Record: requirement → test_file → status.
63
+
64
+ ## 3. Gap Analysis
65
+
66
+ Classify each requirement:
67
+
68
+ | Status | Criteria |
69
+ |--------|----------|
70
+ | COVERED | Test exists, targets behavior, runs green |
71
+ | PARTIAL | Test exists, failing or incomplete |
72
+ | MISSING | No test found |
73
+
74
+ Build: `{ task_id, requirement, gap_type, suggested_test_path, suggested_command }`
75
+
76
+ No gaps → skip to Step 6, set `nyquist_compliant: true`.
77
+
78
+ ## 4. Present Gap Plan
79
+
80
+ Call question with gap table and options:
81
+ 1. "Fix all gaps" → Step 5
82
+ 2. "Skip — mark manual-only" → add to Manual-Only, Step 6
83
+ 3. "Cancel" → exit
84
+
85
+ ## 5. Spawn gsd-nyquist-auditor
86
+
87
+ ```
88
+ task(
89
+ prompt="read $HOME/.config/opencode/agents/gsd-nyquist-auditor.md for instructions.\n\n" +
90
+ "<files_to_read>{PLAN, SUMMARY, impl files, VALIDATION.md}</files_to_read>" +
91
+ "<gaps>{gap list}</gaps>" +
92
+ "<test_infrastructure>{framework, config, commands}</test_infrastructure>" +
93
+ "<constraints>Never modify impl files. Max 3 debug iterations. Escalate impl bugs.</constraints>",
94
+ subagent_type="gsd-nyquist-auditor",
95
+ model="{AUDITOR_MODEL}",
96
+ description="Fill validation gaps for Phase {N}"
97
+ )
98
+ ```
99
+
100
+ Handle return:
101
+ - `## GAPS FILLED` → record tests + map updates, Step 6
102
+ - `## PARTIAL` → record resolved, move escalated to manual-only, Step 6
103
+ - `## ESCALATE` → move all to manual-only, Step 6
104
+
105
+ ## 6. Generate/Update VALIDATION.md
106
+
107
+ **State B (create):**
108
+ 1. read template from `$HOME/.config/opencode/get-shit-done/templates/VALIDATION.md`
109
+ 2. Fill: frontmatter, Test Infrastructure, Per-task Map, Manual-Only, Sign-Off
110
+ 3. write to `${PHASE_DIR}/${PADDED_PHASE}-VALIDATION.md`
111
+
112
+ **State A (update):**
113
+ 1. Update Per-task Map statuses, add escalated to Manual-Only, update frontmatter
114
+ 2. Append audit trail:
115
+
116
+ ```markdown
117
+ ## Validation Audit {date}
118
+ | Metric | Count |
119
+ |--------|-------|
120
+ | Gaps found | {N} |
121
+ | Resolved | {M} |
122
+ | Escalated | {K} |
123
+ ```
124
+
125
+ ## 7. Commit
126
+
127
+ ```bash
128
+ git add {test_files}
129
+ git commit -m "test(phase-${PHASE}): add Nyquist validation tests"
130
+
131
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit-docs "docs(phase-${PHASE}): add/update validation strategy"
132
+ ```
133
+
134
+ ## 8. Results + Routing
135
+
136
+ **Compliant:**
137
+ ```
138
+ GSD > PHASE {N} IS NYQUIST-COMPLIANT
139
+ All requirements have automated verification.
140
+ ▶ Next: /gsd-audit-milestone
141
+ ```
142
+
143
+ **Partial:**
144
+ ```
145
+ GSD > PHASE {N} VALIDATED (PARTIAL)
146
+ {M} automated, {K} manual-only.
147
+ ▶ Retry: /gsd-validate-phase {N}
148
+ ```
149
+
150
+ Display `/new` reminder.
151
+
152
+ </process>
153
+
154
+ <success_criteria>
155
+ - [ ] Nyquist config checked (exit if disabled)
156
+ - [ ] Input state detected (A/B/C)
157
+ - [ ] State C exits cleanly
158
+ - [ ] PLAN/SUMMARY files read, requirement map built
159
+ - [ ] Test infrastructure detected
160
+ - [ ] Gaps classified (COVERED/PARTIAL/MISSING)
161
+ - [ ] User gate with gap table
162
+ - [ ] Auditor spawned with complete context
163
+ - [ ] All three return formats handled
164
+ - [ ] VALIDATION.md created or updated
165
+ - [ ] Test files committed separately
166
+ - [ ] Results with routing presented
167
+ </success_criteria>
@@ -18,8 +18,8 @@ Then verify each level against the actual codebase.
18
18
  </core_principle>
19
19
 
20
20
  <required_reading>
21
- @~/.config/opencode/get-shit-done/references/verification-patterns.md
22
- @~/.config/opencode/get-shit-done/templates/verification-report.md
21
+ @$HOME/.config/opencode/get-shit-done/references/verification-patterns.md
22
+ @$HOME/.config/opencode/get-shit-done/templates/verification-report.md
23
23
  </required_reading>
24
24
 
25
25
  <process>
@@ -28,14 +28,15 @@ Then verify each level against the actual codebase.
28
28
  Load phase operation context:
29
29
 
30
30
  ```bash
31
- INIT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs init phase-op "${PHASE_ARG}")
31
+ INIT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" init phase-op "${PHASE_ARG}")
32
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
32
33
  ```
33
34
 
34
35
  Extract from init JSON: `phase_dir`, `phase_number`, `phase_name`, `has_plans`, `plan_count`.
35
36
 
36
37
  Then load phase details and list plans/summaries:
37
38
  ```bash
38
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "${phase_number}"
39
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" roadmap get-phase "${phase_number}"
39
40
  grep -E "^| ${phase_number}" .planning/REQUIREMENTS.md 2>/dev/null
40
41
  ls "$phase_dir"/*-SUMMARY.md "$phase_dir"/*-PLAN.md 2>/dev/null
41
42
  ```
@@ -50,7 +51,7 @@ Use gsd-tools to extract must_haves from each PLAN:
50
51
 
51
52
  ```bash
52
53
  for plan in "$PHASE_DIR"/*-PLAN.md; do
53
- MUST_HAVES=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs frontmatter get "$plan" --field must_haves)
54
+ MUST_HAVES=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" frontmatter get "$plan" --field must_haves)
54
55
  echo "=== $plan ===" && echo "$MUST_HAVES"
55
56
  done
56
57
  ```
@@ -64,7 +65,7 @@ Aggregate all must_haves across plans for phase-level verification.
64
65
  If no must_haves in frontmatter (MUST_HAVES returns error or empty), check for Success Criteria:
65
66
 
66
67
  ```bash
67
- PHASE_DATA=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "${phase_number}" --raw)
68
+ PHASE_DATA=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" roadmap get-phase "${phase_number}" --raw)
68
69
  ```
69
70
 
70
71
  Parse the `success_criteria` array from the JSON output. If non-empty:
@@ -100,7 +101,7 @@ Use gsd-tools for artifact verification against must_haves in each PLAN:
100
101
 
101
102
  ```bash
102
103
  for plan in "$PHASE_DIR"/*-PLAN.md; do
103
- ARTIFACT_RESULT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs verify artifacts "$plan")
104
+ ARTIFACT_RESULT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" verify artifacts "$plan")
104
105
  echo "=== $plan ===" && echo "$ARTIFACT_RESULT"
105
106
  done
106
107
  ```
@@ -132,7 +133,7 @@ Use gsd-tools for key link verification against must_haves in each PLAN:
132
133
 
133
134
  ```bash
134
135
  for plan in "$PHASE_DIR"/*-PLAN.md; do
135
- LINKS_RESULT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs verify key-links "$plan")
136
+ LINKS_RESULT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" verify key-links "$plan")
136
137
  echo "=== $plan ===" && echo "$LINKS_RESULT"
137
138
  done
138
139
  ```
@@ -213,7 +214,7 @@ REPORT_PATH="$PHASE_DIR/${PHASE_NUM}-VERIFICATION.md"
213
214
 
214
215
  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
 
216
- See ~/.config/opencode/get-shit-done/templates/verification-report.md for complete template.
217
+ See $HOME/.config/opencode/get-shit-done/templates/verification-report.md for complete template.
217
218
  </step>
218
219
 
219
220
  <step name="return_to_orchestrator">
@@ -15,7 +15,7 @@ No Pass/Fail buttons. No severity questions. Just: "Here's what should happen. D
15
15
  </philosophy>
16
16
 
17
17
  <template>
18
- @~/.config/opencode/get-shit-done/templates/UAT.md
18
+ @$HOME/.config/opencode/get-shit-done/templates/UAT.md
19
19
  </template>
20
20
 
21
21
  <process>
@@ -24,7 +24,8 @@ No Pass/Fail buttons. No severity questions. Just: "Here's what should happen. D
24
24
  If $ARGUMENTS contains a phase number, load context:
25
25
 
26
26
  ```bash
27
- INIT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs init verify-work "${PHASE_ARG}")
27
+ INIT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" init verify-work "${PHASE_ARG}")
28
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
28
29
  ```
29
30
 
30
31
  Parse JSON for: `planner_model`, `checker_model`, `commit_docs`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `has_verification`.
@@ -108,6 +109,19 @@ Examples:
108
109
  → Expected: "Clicking Reply opens inline composer below comment. Submitting shows reply nested under parent with visual indentation."
109
110
 
110
111
  Skip internal/non-observable items (refactors, type changes, etc.).
112
+
113
+ **Cold-start smoke test injection:**
114
+
115
+ After extracting tests from SUMMARYs, scan the SUMMARY files for modified/created file paths. If ANY path matches these patterns:
116
+
117
+ `server.ts`, `server.js`, `app.ts`, `app.js`, `index.ts`, `index.js`, `main.ts`, `main.js`, `database/*`, `db/*`, `seed/*`, `seeds/*`, `migrations/*`, `startup*`, `docker-compose*`, `Dockerfile*`
118
+
119
+ Then **prepend** this test to the test list:
120
+
121
+ - name: "Cold Start Smoke Test"
122
+ - expected: "Kill any running server/service. Clear ephemeral state (temp DBs, caches, lock files). Start the application from scratch. Server boots without errors, any seed/migration completes, and a primary query (health check, homepage load, or basic API call) returns live data."
123
+
124
+ This catches bugs that only manifest on fresh start — race conditions in startup sequences, silent seed failures, missing environment setup — which pass against warm state but break in production.
111
125
  </step>
112
126
 
113
127
  <step name="create_uat_file">
@@ -292,7 +306,7 @@ Clear Current Test section:
292
306
 
293
307
  Commit the UAT file:
294
308
  ```bash
295
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs commit "test({phase_num}): complete UAT - {passed} passed, {issues} issues" --files ".planning/phases/XX-name/{phase_num}-UAT.md"
309
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "test({phase_num}): complete UAT - {passed} passed, {issues} issues" --files ".planning/phases/XX-name/{phase_num}-UAT.md"
296
310
  ```
297
311
 
298
312
  Present summary:
@@ -334,7 +348,7 @@ Spawning parallel debug agents to investigate each issue.
334
348
  ```
335
349
 
336
350
  - Load diagnose-issues workflow
337
- - Follow @~/.config/opencode/get-shit-done/workflows/diagnose-issues.md
351
+ - Follow @$HOME/.config/opencode/get-shit-done/workflows/diagnose-issues.md
338
352
  - Spawn parallel debug agents for each issue
339
353
  - Collect root causes
340
354
  - Update UAT.md with root causes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gsd-opencode",
3
- "version": "1.20.4",
3
+ "version": "1.22.1",
4
4
  "description": "GSD-OpenCode distribution manager - install, verify, and maintain your GSD-OpenCode installation",
5
5
  "type": "module",
6
6
  "main": "bin/gsd.js",