gsd-opencode 1.33.2 → 1.35.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.
- package/agents/gsd-advisor-researcher.md +23 -0
- package/agents/gsd-ai-researcher.md +142 -0
- package/agents/gsd-code-fixer.md +523 -0
- package/agents/gsd-code-reviewer.md +361 -0
- package/agents/gsd-debugger.md +14 -1
- package/agents/gsd-domain-researcher.md +162 -0
- package/agents/gsd-eval-auditor.md +170 -0
- package/agents/gsd-eval-planner.md +161 -0
- package/agents/gsd-executor.md +70 -7
- package/agents/gsd-framework-selector.md +167 -0
- package/agents/gsd-intel-updater.md +320 -0
- package/agents/gsd-phase-researcher.md +26 -0
- package/agents/gsd-plan-checker.md +12 -0
- package/agents/gsd-planner.md +16 -6
- package/agents/gsd-project-researcher.md +23 -0
- package/agents/gsd-ui-researcher.md +23 -0
- package/agents/gsd-verifier.md +55 -1
- package/commands/gsd/gsd-add-backlog.md +1 -1
- package/commands/gsd/gsd-add-phase.md +1 -1
- package/commands/gsd/gsd-add-todo.md +1 -1
- package/commands/gsd/gsd-ai-integration-phase.md +36 -0
- package/commands/gsd/gsd-audit-fix.md +33 -0
- package/commands/gsd/gsd-autonomous.md +1 -0
- package/commands/gsd/gsd-check-todos.md +1 -1
- package/commands/gsd/gsd-code-review-fix.md +52 -0
- package/commands/gsd/gsd-code-review.md +55 -0
- package/commands/gsd/gsd-complete-milestone.md +1 -1
- package/commands/gsd/gsd-debug.md +1 -1
- package/commands/gsd/gsd-eval-review.md +32 -0
- package/commands/gsd/gsd-explore.md +27 -0
- package/commands/gsd/gsd-from-gsd2.md +45 -0
- package/commands/gsd/gsd-health.md +1 -1
- package/commands/gsd/gsd-import.md +36 -0
- package/commands/gsd/gsd-insert-phase.md +1 -1
- package/commands/gsd/gsd-intel.md +183 -0
- package/commands/gsd/gsd-manager.md +1 -1
- package/commands/gsd/gsd-next.md +2 -0
- package/commands/gsd/gsd-reapply-patches.md +58 -3
- package/commands/gsd/gsd-remove-phase.md +1 -1
- package/commands/gsd/gsd-review.md +4 -2
- package/commands/gsd/gsd-scan.md +26 -0
- package/commands/gsd/gsd-set-profile.md +1 -1
- package/commands/gsd/gsd-thread.md +1 -1
- package/commands/gsd/gsd-undo.md +34 -0
- package/commands/gsd/gsd-workstreams.md +6 -6
- package/get-shit-done/bin/gsd-tools.cjs +143 -5
- package/get-shit-done/bin/lib/commands.cjs +10 -2
- package/get-shit-done/bin/lib/config.cjs +71 -37
- package/get-shit-done/bin/lib/core.cjs +70 -8
- package/get-shit-done/bin/lib/gsd2-import.cjs +511 -0
- package/get-shit-done/bin/lib/init.cjs +20 -6
- package/get-shit-done/bin/lib/intel.cjs +660 -0
- package/get-shit-done/bin/lib/learnings.cjs +378 -0
- package/get-shit-done/bin/lib/milestone.cjs +25 -15
- package/get-shit-done/bin/lib/model-profiles.cjs +17 -17
- package/get-shit-done/bin/lib/phase.cjs +148 -112
- package/get-shit-done/bin/lib/roadmap.cjs +12 -5
- package/get-shit-done/bin/lib/security.cjs +119 -0
- package/get-shit-done/bin/lib/state.cjs +283 -221
- package/get-shit-done/bin/lib/template.cjs +8 -4
- package/get-shit-done/bin/lib/verify.cjs +42 -5
- package/get-shit-done/references/ai-evals.md +156 -0
- package/get-shit-done/references/ai-frameworks.md +186 -0
- package/get-shit-done/references/common-bug-patterns.md +114 -0
- package/get-shit-done/references/few-shot-examples/plan-checker.md +73 -0
- package/get-shit-done/references/few-shot-examples/verifier.md +109 -0
- package/get-shit-done/references/gates.md +70 -0
- package/get-shit-done/references/ios-scaffold.md +123 -0
- package/get-shit-done/references/model-profile-resolution.md +6 -7
- package/get-shit-done/references/model-profiles.md +20 -14
- package/get-shit-done/references/planning-config.md +237 -0
- package/get-shit-done/references/thinking-models-debug.md +44 -0
- package/get-shit-done/references/thinking-models-execution.md +50 -0
- package/get-shit-done/references/thinking-models-planning.md +62 -0
- package/get-shit-done/references/thinking-models-research.md +50 -0
- package/get-shit-done/references/thinking-models-verification.md +55 -0
- package/get-shit-done/references/thinking-partner.md +96 -0
- package/get-shit-done/references/universal-anti-patterns.md +6 -1
- package/get-shit-done/references/verification-overrides.md +227 -0
- package/get-shit-done/templates/AI-SPEC.md +246 -0
- package/get-shit-done/workflows/add-tests.md +3 -0
- package/get-shit-done/workflows/add-todo.md +2 -0
- package/get-shit-done/workflows/ai-integration-phase.md +284 -0
- package/get-shit-done/workflows/audit-fix.md +154 -0
- package/get-shit-done/workflows/autonomous.md +33 -2
- package/get-shit-done/workflows/check-todos.md +2 -0
- package/get-shit-done/workflows/cleanup.md +2 -0
- package/get-shit-done/workflows/code-review-fix.md +497 -0
- package/get-shit-done/workflows/code-review.md +515 -0
- package/get-shit-done/workflows/complete-milestone.md +40 -15
- package/get-shit-done/workflows/diagnose-issues.md +1 -1
- package/get-shit-done/workflows/discovery-phase.md +3 -1
- package/get-shit-done/workflows/discuss-phase-assumptions.md +1 -1
- package/get-shit-done/workflows/discuss-phase.md +21 -7
- package/get-shit-done/workflows/do.md +2 -0
- package/get-shit-done/workflows/docs-update.md +2 -0
- package/get-shit-done/workflows/eval-review.md +155 -0
- package/get-shit-done/workflows/execute-phase.md +307 -57
- package/get-shit-done/workflows/execute-plan.md +64 -93
- package/get-shit-done/workflows/explore.md +136 -0
- package/get-shit-done/workflows/help.md +1 -1
- package/get-shit-done/workflows/import.md +273 -0
- package/get-shit-done/workflows/inbox.md +387 -0
- package/get-shit-done/workflows/manager.md +4 -10
- package/get-shit-done/workflows/new-milestone.md +3 -1
- package/get-shit-done/workflows/new-project.md +2 -0
- package/get-shit-done/workflows/new-workspace.md +2 -0
- package/get-shit-done/workflows/next.md +56 -0
- package/get-shit-done/workflows/note.md +2 -0
- package/get-shit-done/workflows/plan-phase.md +97 -17
- package/get-shit-done/workflows/plant-seed.md +3 -0
- package/get-shit-done/workflows/pr-branch.md +41 -13
- package/get-shit-done/workflows/profile-user.md +4 -2
- package/get-shit-done/workflows/quick.md +99 -4
- package/get-shit-done/workflows/remove-workspace.md +2 -0
- package/get-shit-done/workflows/review.md +53 -6
- package/get-shit-done/workflows/scan.md +98 -0
- package/get-shit-done/workflows/secure-phase.md +2 -0
- package/get-shit-done/workflows/settings.md +18 -3
- package/get-shit-done/workflows/ship.md +3 -0
- package/get-shit-done/workflows/ui-phase.md +10 -2
- package/get-shit-done/workflows/ui-review.md +2 -0
- package/get-shit-done/workflows/undo.md +314 -0
- package/get-shit-done/workflows/update.md +2 -0
- package/get-shit-done/workflows/validate-phase.md +2 -0
- package/get-shit-done/workflows/verify-phase.md +83 -0
- package/get-shit-done/workflows/verify-work.md +12 -1
- package/package.json +1 -1
- package/skills/gsd-code-review/SKILL.md +48 -0
- package/skills/gsd-code-review-fix/SKILL.md +44 -0
|
@@ -73,6 +73,8 @@ If `threats_open: 0` → skip to Step 6 directly.
|
|
|
73
73
|
|
|
74
74
|
## 4. Present Threat Plan
|
|
75
75
|
|
|
76
|
+
|
|
77
|
+
**Text mode (`workflow.text_mode: true` in config or `--text` flag):** Set `TEXT_MODE=true` if `--text` is present in `$ARGUMENTS` OR `text_mode` from init JSON is `true`. When TEXT_MODE is active, replace every `question` call with a plain-text numbered list and ask the user to type their choice number. This is required for non-OpenCode runtimes (OpenAI Codex, Gemini CLI, etc.) where `question` is not available.
|
|
76
78
|
Call question with threat table and options:
|
|
77
79
|
1. "Verify all open threats" → Step 5
|
|
78
80
|
2. "Accept all open — document in accepted risks log" → add to SECURITY.md accepted risks, set all CLOSED, Step 6
|
|
@@ -32,12 +32,15 @@ Parse current values (default to `true` if not present):
|
|
|
32
32
|
- `workflow.nyquist_validation` — validation architecture research during plan-phase (default: true if absent)
|
|
33
33
|
- `workflow.ui_phase` — generate UI-SPEC.md design contracts for frontend phases (default: true if absent)
|
|
34
34
|
- `workflow.ui_safety_gate` — prompt to run /gsd-ui-phase before planning frontend phases (default: true if absent)
|
|
35
|
+
- `workflow.ai_integration_phase` — framework selection + eval strategy for AI phases (default: true if absent)
|
|
35
36
|
- `model_profile` — which model each agent uses (default: `simple`)
|
|
36
37
|
- `git.branching_strategy` — branching approach (default: `"none"`)
|
|
37
38
|
- `workflow.use_worktrees` — whether parallel executor agents run in worktree isolation (default: `true`)
|
|
38
39
|
</step>
|
|
39
40
|
|
|
40
41
|
<step name="present_settings">
|
|
42
|
+
|
|
43
|
+
**Text mode (`workflow.text_mode: true` in config or `--text` flag):** Set `TEXT_MODE=true` if `--text` is present in `$ARGUMENTS` OR `text_mode` from init JSON is `true`. When TEXT_MODE is active, replace every `question` call with a plain-text numbered list and ask the user to type their choice number. This is required for non-OpenCode runtimes (OpenAI Codex, Gemini CLI, etc.) where `question` is not available.
|
|
41
44
|
Use question with current values pre-selected:
|
|
42
45
|
|
|
43
46
|
```
|
|
@@ -118,6 +121,15 @@ question([
|
|
|
118
121
|
{ label: "No", description: "No prompt — plan-phase proceeds without UI-SPEC check." }
|
|
119
122
|
]
|
|
120
123
|
},
|
|
124
|
+
{
|
|
125
|
+
question: "Enable AI Phase? (framework selection + eval strategy for AI phases)",
|
|
126
|
+
header: "AI Phase",
|
|
127
|
+
multiSelect: false,
|
|
128
|
+
options: [
|
|
129
|
+
{ label: "Yes (Recommended)", description: "Run /gsd-ai-phase before planning AI system phases. Surfaces the right framework, researches its docs, and designs the evaluation strategy." },
|
|
130
|
+
{ label: "No", description: "Skip AI design contract. Good for non-AI phases or when framework is already decided." }
|
|
131
|
+
]
|
|
132
|
+
},
|
|
121
133
|
{
|
|
122
134
|
question: "Git branching strategy?",
|
|
123
135
|
header: "Branching",
|
|
@@ -161,7 +173,7 @@ question([
|
|
|
161
173
|
multiSelect: false,
|
|
162
174
|
options: [
|
|
163
175
|
{ label: "Yes (Recommended)", description: "Each parallel executor runs in its own worktree branch — no conflicts between agents." },
|
|
164
|
-
{ label: "No", description: "Disable worktree isolation.
|
|
176
|
+
{ label: "No", description: "Disable worktree isolation. Agents run sequentially on the main working tree. Use if EnterWorktree creates branches from wrong base (known cross-platform issue)." }
|
|
165
177
|
]
|
|
166
178
|
}
|
|
167
179
|
])
|
|
@@ -174,7 +186,7 @@ Merge new settings into existing config.json:
|
|
|
174
186
|
```json
|
|
175
187
|
{
|
|
176
188
|
...existing_config,
|
|
177
|
-
"model_profile": "simple" | "smart" | "genius" | "inherit",
|
|
189
|
+
"model_profile": "simple" | "smart" | "genius" | "adaptive" | "inherit",
|
|
178
190
|
"workflow": {
|
|
179
191
|
"research": true/false,
|
|
180
192
|
"plan_check": true/false,
|
|
@@ -183,6 +195,7 @@ Merge new settings into existing config.json:
|
|
|
183
195
|
"nyquist_validation": true/false,
|
|
184
196
|
"ui_phase": true/false,
|
|
185
197
|
"ui_safety_gate": true/false,
|
|
198
|
+
"ai_integration_phase": true/false,
|
|
186
199
|
"text_mode": true/false,
|
|
187
200
|
"research_before_questions": true/false,
|
|
188
201
|
"discuss_mode": "discuss" | "assumptions",
|
|
@@ -244,6 +257,7 @@ write `~/.gsd/defaults.json` with:
|
|
|
244
257
|
"nyquist_validation": <current>,
|
|
245
258
|
"ui_phase": <current>,
|
|
246
259
|
"ui_safety_gate": <current>,
|
|
260
|
+
"ai_integration_phase": <current>,
|
|
247
261
|
"skip_discuss": <current>
|
|
248
262
|
}
|
|
249
263
|
}
|
|
@@ -268,6 +282,7 @@ Display:
|
|
|
268
282
|
| Nyquist Validation | {On/Off} |
|
|
269
283
|
| UI Phase | {On/Off} |
|
|
270
284
|
| UI Safety Gate | {On/Off} |
|
|
285
|
+
| AI Integration Phase | {On/Off} |
|
|
271
286
|
| Git Branching | {None/Per Phase/Per Milestone} |
|
|
272
287
|
| Skip Discuss | {On/Off} |
|
|
273
288
|
| Context Warnings | {On/Off} |
|
|
@@ -287,7 +302,7 @@ Quick commands:
|
|
|
287
302
|
|
|
288
303
|
<success_criteria>
|
|
289
304
|
- [ ] Current config read
|
|
290
|
-
- [ ] User presented with
|
|
305
|
+
- [ ] User presented with 14 settings (profile + 11 workflow toggles + git branching + ctx warnings)
|
|
291
306
|
- [ ] Config updated with model_profile, workflow, and git sections
|
|
292
307
|
- [ ] User offered to save as global defaults (~/.gsd/defaults.json)
|
|
293
308
|
- [ ] Changes confirmed to user
|
|
@@ -161,6 +161,9 @@ Report: "PR #{number} created: {url}"
|
|
|
161
161
|
<step name="optional_review">
|
|
162
162
|
Ask if user wants to trigger a code review:
|
|
163
163
|
|
|
164
|
+
|
|
165
|
+
**Text mode (`workflow.text_mode: true` in config or `--text` flag):** Set `TEXT_MODE=true` if `--text` is present in `$ARGUMENTS` OR `text_mode` from init JSON is `true`. When TEXT_MODE is active, replace every `question` call with a plain-text numbered list and ask the user to type their choice number. This is required for non-OpenCode runtimes (OpenAI Codex, Gemini CLI, etc.) where `question` is not available.
|
|
166
|
+
|
|
164
167
|
```
|
|
165
168
|
question:
|
|
166
169
|
question: "PR created. Run a code review before merge?"
|
|
@@ -83,6 +83,8 @@ Continue (non-blocking).
|
|
|
83
83
|
UI_SPEC_FILE=$(ls "${PHASE_DIR}"/*-UI-SPEC.md 2>/dev/null | head -1)
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
+
|
|
87
|
+
**Text mode (`workflow.text_mode: true` in config or `--text` flag):** Set `TEXT_MODE=true` if `--text` is present in `$ARGUMENTS` OR `text_mode` from init JSON is `true`. When TEXT_MODE is active, replace every `question` call with a plain-text numbered list and ask the user to type their choice number. This is required for non-OpenCode runtimes (OpenAI Codex, Gemini CLI, etc.) where `question` is not available.
|
|
86
88
|
**If exists:** Use question:
|
|
87
89
|
- header: "Existing UI-SPEC"
|
|
88
90
|
- question: "UI-SPEC.md already exists for Phase {N}. What would you like to do?"
|
|
@@ -251,11 +253,17 @@ Dimensions: 6/6 passed
|
|
|
251
253
|
|
|
252
254
|
## ▶ Next Up
|
|
253
255
|
|
|
256
|
+
{If CONTEXT.md exists for this phase:}
|
|
254
257
|
**Plan Phase {N}** — planner will use UI-SPEC.md as design context
|
|
255
258
|
|
|
256
|
-
`/new` then:
|
|
259
|
+
`/new` then: `/gsd-plan-phase {N}`
|
|
260
|
+
|
|
261
|
+
{If CONTEXT.md does NOT exist:}
|
|
262
|
+
**Discuss Phase {N}** — gather implementation context before planning
|
|
263
|
+
|
|
264
|
+
`/new` then: `/gsd-discuss-phase {N}`
|
|
257
265
|
|
|
258
|
-
`/gsd-plan-phase {N}`
|
|
266
|
+
(or `/gsd-plan-phase {N}` to skip discussion)
|
|
259
267
|
|
|
260
268
|
───────────────────────────────────────────────────────────────
|
|
261
269
|
```
|
|
@@ -44,6 +44,8 @@ UI_REVIEW_FILE=$(ls "${PHASE_DIR}"/*-UI-REVIEW.md 2>/dev/null | head -1)
|
|
|
44
44
|
|
|
45
45
|
**If `SUMMARY_FILES` empty:** Exit — "Phase {N} not executed. Run /gsd-execute-phase {N} first."
|
|
46
46
|
|
|
47
|
+
|
|
48
|
+
**Text mode (`workflow.text_mode: true` in config or `--text` flag):** Set `TEXT_MODE=true` if `--text` is present in `$ARGUMENTS` OR `text_mode` from init JSON is `true`. When TEXT_MODE is active, replace every `question` call with a plain-text numbered list and ask the user to type their choice number. This is required for non-OpenCode runtimes (OpenAI Codex, Gemini CLI, etc.) where `question` is not available.
|
|
47
49
|
**If `UI_REVIEW_FILE` non-empty:** Use question:
|
|
48
50
|
- header: "Existing UI Review"
|
|
49
51
|
- question: "UI-REVIEW.md already exists for Phase {N}."
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
<objective>
|
|
2
|
+
Safe git revert workflow. Rolls back GSD phase or plan commits using the phase manifest with dependency checks and a confirmation gate. Uses git revert --no-commit (NEVER git reset) to preserve history.
|
|
3
|
+
</objective>
|
|
4
|
+
|
|
5
|
+
<required_reading>
|
|
6
|
+
@$HOME/.config/opencode/get-shit-done/references/ui-brand.md
|
|
7
|
+
@$HOME/.config/opencode/get-shit-done/references/gate-prompts.md
|
|
8
|
+
</required_reading>
|
|
9
|
+
|
|
10
|
+
<process>
|
|
11
|
+
|
|
12
|
+
<step name="banner" priority="first">
|
|
13
|
+
Display the stage banner:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
17
|
+
GSD ► UNDO
|
|
18
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
19
|
+
```
|
|
20
|
+
</step>
|
|
21
|
+
|
|
22
|
+
<step name="parse_arguments">
|
|
23
|
+
Parse $ARGUMENTS for the undo mode:
|
|
24
|
+
|
|
25
|
+
- `--last N` → MODE=last, COUNT=N (integer, default 10 if N missing)
|
|
26
|
+
- `--phase NN` → MODE=phase, TARGET_PHASE=NN (two-digit phase number)
|
|
27
|
+
- `--plan NN-MM` → MODE=plan, TARGET_PLAN=NN-MM (phase-plan ID)
|
|
28
|
+
|
|
29
|
+
If no valid argument is provided, display usage and exit:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
Usage: /gsd-undo --last N | --phase NN | --plan NN-MM
|
|
33
|
+
|
|
34
|
+
Modes:
|
|
35
|
+
--last N Show last N GSD commits for interactive selection
|
|
36
|
+
--phase NN Revert all commits for phase NN
|
|
37
|
+
--plan NN-MM Revert all commits for plan NN-MM
|
|
38
|
+
|
|
39
|
+
Examples:
|
|
40
|
+
/gsd-undo --last 5
|
|
41
|
+
/gsd-undo --phase 03
|
|
42
|
+
/gsd-undo --plan 03-02
|
|
43
|
+
```
|
|
44
|
+
</step>
|
|
45
|
+
|
|
46
|
+
<step name="gather_commits">
|
|
47
|
+
Based on MODE, gather candidate commits.
|
|
48
|
+
|
|
49
|
+
**MODE=last:**
|
|
50
|
+
|
|
51
|
+
Run:
|
|
52
|
+
```bash
|
|
53
|
+
git log --oneline --no-merges -${COUNT}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Filter for GSD conventional commits matching `type(scope): message` pattern (e.g., `feat(04-01):`, `docs(03):`, `fix(02-03):`).
|
|
57
|
+
|
|
58
|
+
Display a numbered list of matching commits:
|
|
59
|
+
```
|
|
60
|
+
Recent GSD commits:
|
|
61
|
+
1. abc1234 feat(04-01): implement auth endpoint
|
|
62
|
+
2. def5678 docs(03-02): complete plan summary
|
|
63
|
+
3. ghi9012 fix(02-03): correct validation logic
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
**Text mode (`workflow.text_mode: true` in config or `--text` flag):** Set `TEXT_MODE=true` if `--text` is present in `$ARGUMENTS` OR `text_mode` from init JSON is `true`. When TEXT_MODE is active, replace every `question` call with a plain-text numbered list and ask the user to type their choice number. This is required for non-OpenCode runtimes (OpenAI Codex, Gemini CLI, etc.) where `question` is not available.
|
|
68
|
+
Use question to ask:
|
|
69
|
+
- question: "Which commits to revert? Enter numbers (e.g., 1,3) or 'all'"
|
|
70
|
+
- header: "Select"
|
|
71
|
+
|
|
72
|
+
Parse the user's selection into COMMITS list.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
**MODE=phase:**
|
|
77
|
+
|
|
78
|
+
read `.planning/.phase-manifest.json` if it exists.
|
|
79
|
+
|
|
80
|
+
If the file exists and `manifest.phases?.[TARGET_PHASE]?.commits` is a non-empty array:
|
|
81
|
+
- Use `manifest.phases[TARGET_PHASE].commits` entries as COMMITS (each entry is a commit hash)
|
|
82
|
+
|
|
83
|
+
If the file does not exist, or `manifest.phases?.[TARGET_PHASE]` is missing:
|
|
84
|
+
- Display: "Manifest has no entry for phase ${TARGET_PHASE} (or file missing), falling back to git log search"
|
|
85
|
+
- Fallback: run git log and filter for the target phase scope:
|
|
86
|
+
```bash
|
|
87
|
+
git log --oneline --no-merges --all | grep -E "\(0*${TARGET_PHASE}(-[0-9]+)?\):" | head -50
|
|
88
|
+
```
|
|
89
|
+
- Use matching commits as COMMITS
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
**MODE=plan:**
|
|
94
|
+
|
|
95
|
+
Run:
|
|
96
|
+
```bash
|
|
97
|
+
git log --oneline --no-merges --all | grep -E "\(${TARGET_PLAN}\)" | head -50
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Use matching commits as COMMITS.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
**Empty check:**
|
|
105
|
+
|
|
106
|
+
If COMMITS is empty after gathering:
|
|
107
|
+
```
|
|
108
|
+
No commits found for ${MODE} ${TARGET}. Nothing to revert.
|
|
109
|
+
```
|
|
110
|
+
Exit cleanly.
|
|
111
|
+
</step>
|
|
112
|
+
|
|
113
|
+
<step name="dependency_check">
|
|
114
|
+
**Applies when MODE=phase or MODE=plan.**
|
|
115
|
+
|
|
116
|
+
Skip this step entirely for MODE=last.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
**MODE=phase:**
|
|
121
|
+
|
|
122
|
+
read `.planning/ROADMAP.md` inline.
|
|
123
|
+
|
|
124
|
+
Search for phases that list a dependency on the target phase. Look for patterns like:
|
|
125
|
+
- "Depends on: Phase ${TARGET_PHASE}"
|
|
126
|
+
- "Depends on: ${TARGET_PHASE}"
|
|
127
|
+
- "depends_on: [${TARGET_PHASE}]"
|
|
128
|
+
|
|
129
|
+
For each dependent phase N found:
|
|
130
|
+
1. Check if `.planning/phases/${N}-*/` directory exists
|
|
131
|
+
2. If directory exists, check for any PLAN.md or SUMMARY.md files inside it
|
|
132
|
+
|
|
133
|
+
If any downstream phase has started work, collect warnings:
|
|
134
|
+
```
|
|
135
|
+
⚠ Downstream dependency detected:
|
|
136
|
+
Phase ${N} depends on Phase ${TARGET_PHASE} and has started work.
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
**MODE=plan:**
|
|
142
|
+
|
|
143
|
+
Extract the phase number from TARGET_PLAN (the NN part of NN-MM). Extract the plan number (the MM part).
|
|
144
|
+
|
|
145
|
+
Look for later plans in the same phase directory (`.planning/phases/${NN}-*/`). For each later plan (plans with number > MM):
|
|
146
|
+
1. read the later plan's PLAN.md
|
|
147
|
+
2. Check if its `<files>` sections or `consumes` fields reference outputs from the target plan
|
|
148
|
+
|
|
149
|
+
If any later plan references the target plan's outputs, collect warnings:
|
|
150
|
+
```
|
|
151
|
+
⚠ Intra-phase dependency detected:
|
|
152
|
+
Plan ${LATER_PLAN} in phase ${NN} references outputs from plan ${TARGET_PLAN}.
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
If any warnings exist (from either mode):
|
|
158
|
+
- Display all warnings
|
|
159
|
+
- Use question with approve-revise-abort pattern:
|
|
160
|
+
- question: "Downstream work depends on the target being reverted. Proceed anyway?"
|
|
161
|
+
- header: "Confirm"
|
|
162
|
+
- options: Proceed | Abort
|
|
163
|
+
|
|
164
|
+
If user selects "Abort": exit with "Revert cancelled. No changes made."
|
|
165
|
+
</step>
|
|
166
|
+
|
|
167
|
+
<step name="confirm_revert">
|
|
168
|
+
Display the confirmation gate using approve-revise-abort pattern from gate-prompts.md.
|
|
169
|
+
|
|
170
|
+
Show:
|
|
171
|
+
```
|
|
172
|
+
The following commits will be reverted (in reverse chronological order):
|
|
173
|
+
|
|
174
|
+
{hash} — {message}
|
|
175
|
+
{hash} — {message}
|
|
176
|
+
...
|
|
177
|
+
|
|
178
|
+
Total: {N} commit(s) to revert
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Use question:
|
|
182
|
+
- question: "Proceed with revert?"
|
|
183
|
+
- header: "Approve?"
|
|
184
|
+
- options: Approve | Abort
|
|
185
|
+
|
|
186
|
+
If "Abort": display "Revert cancelled. No changes made." and exit.
|
|
187
|
+
If "Approve": ask for a reason:
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
question(
|
|
191
|
+
header: "Reason",
|
|
192
|
+
question: "Brief reason for the revert (used in commit message):",
|
|
193
|
+
options: []
|
|
194
|
+
)
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Store the response as REVERT_REASON. Continue to execute_revert.
|
|
198
|
+
</step>
|
|
199
|
+
|
|
200
|
+
<step name="execute_revert">
|
|
201
|
+
**HARD CONSTRAINT: Use git revert --no-commit. NEVER use git reset (except for conflict cleanup as documented below).**
|
|
202
|
+
|
|
203
|
+
**Dirty-tree guard (run first, before any revert):**
|
|
204
|
+
|
|
205
|
+
Run `git status --porcelain`. If the output is non-empty, display the dirty files and abort:
|
|
206
|
+
```
|
|
207
|
+
Working tree has uncommitted changes. Commit or stash them before running /gsd-undo.
|
|
208
|
+
```
|
|
209
|
+
Exit immediately — do not proceed to any revert operations.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
Sort COMMITS in reverse chronological order (newest first). If commits came from git log (already newest-first), they are already in correct order.
|
|
214
|
+
|
|
215
|
+
For each commit hash in COMMITS:
|
|
216
|
+
```bash
|
|
217
|
+
git revert --no-commit ${HASH}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
If any revert fails (merge conflict or error):
|
|
221
|
+
1. Display the error message
|
|
222
|
+
2. Run cleanup — handle both first-call and mid-sequence cases:
|
|
223
|
+
```bash
|
|
224
|
+
# Try git revert --abort first (works if this is the first failed revert)
|
|
225
|
+
git revert --abort 2>/dev/null
|
|
226
|
+
# If prior --no-commit reverts already staged cleanly before this failure,
|
|
227
|
+
# revert --abort may be a no-op. Clean up staged and working tree changes:
|
|
228
|
+
git reset HEAD 2>/dev/null
|
|
229
|
+
git restore . 2>/dev/null
|
|
230
|
+
```
|
|
231
|
+
3. Display:
|
|
232
|
+
```
|
|
233
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
234
|
+
║ ERROR ║
|
|
235
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
236
|
+
|
|
237
|
+
Revert failed on commit ${HASH}.
|
|
238
|
+
Likely cause: merge conflict with subsequent changes.
|
|
239
|
+
|
|
240
|
+
**To fix:** Resolve the conflict manually or revert commits individually.
|
|
241
|
+
All pending reverts have been aborted — working tree is clean.
|
|
242
|
+
```
|
|
243
|
+
4. Exit with error.
|
|
244
|
+
|
|
245
|
+
After all reverts are staged successfully, create a single commit:
|
|
246
|
+
|
|
247
|
+
For MODE=phase:
|
|
248
|
+
```bash
|
|
249
|
+
git commit -m "revert(${TARGET_PHASE}): undo phase ${TARGET_PHASE} — ${REVERT_REASON}"
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
For MODE=plan:
|
|
253
|
+
```bash
|
|
254
|
+
git commit -m "revert(${TARGET_PLAN}): undo plan ${TARGET_PLAN} — ${REVERT_REASON}"
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
For MODE=last:
|
|
258
|
+
```bash
|
|
259
|
+
git commit -m "revert: undo ${N} selected commits — ${REVERT_REASON}"
|
|
260
|
+
```
|
|
261
|
+
</step>
|
|
262
|
+
|
|
263
|
+
<step name="summary">
|
|
264
|
+
Display the completion banner:
|
|
265
|
+
|
|
266
|
+
```
|
|
267
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
268
|
+
GSD ► UNDO COMPLETE ✓
|
|
269
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Show summary:
|
|
273
|
+
```
|
|
274
|
+
✓ ${N} commit(s) reverted
|
|
275
|
+
✓ Single revert commit created: ${REVERT_HASH}
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
Show next steps:
|
|
279
|
+
```
|
|
280
|
+
───────────────────────────────────────────────────────────────
|
|
281
|
+
|
|
282
|
+
## ▶ Next Up
|
|
283
|
+
|
|
284
|
+
**Review state** — verify project is in expected state after revert
|
|
285
|
+
|
|
286
|
+
/new then:
|
|
287
|
+
|
|
288
|
+
/gsd-progress
|
|
289
|
+
|
|
290
|
+
───────────────────────────────────────────────────────────────
|
|
291
|
+
|
|
292
|
+
**Also available:**
|
|
293
|
+
- `/gsd-execute-phase ${PHASE}` — re-execute if needed
|
|
294
|
+
- `/gsd-undo --last 1` — undo the revert itself if something went wrong
|
|
295
|
+
|
|
296
|
+
───────────────────────────────────────────────────────────────
|
|
297
|
+
```
|
|
298
|
+
</step>
|
|
299
|
+
|
|
300
|
+
</process>
|
|
301
|
+
|
|
302
|
+
<success_criteria>
|
|
303
|
+
- [ ] Arguments parsed correctly for all three modes
|
|
304
|
+
- [ ] --phase mode reads .planning/.phase-manifest.json using manifest.phases[TARGET_PHASE].commits
|
|
305
|
+
- [ ] --phase mode falls back to git log if manifest entry missing
|
|
306
|
+
- [ ] Dependency check warns when downstream phases have started (MODE=phase)
|
|
307
|
+
- [ ] Dependency check warns when later plans reference target plan outputs (MODE=plan)
|
|
308
|
+
- [ ] Dirty-tree guard aborts if working tree has uncommitted changes
|
|
309
|
+
- [ ] Confirmation gate shown before any revert execution
|
|
310
|
+
- [ ] Reverts use git revert --no-commit in reverse chronological order
|
|
311
|
+
- [ ] Single commit created after all reverts staged
|
|
312
|
+
- [ ] Error handling cleans up both first-call and mid-sequence conflict cases
|
|
313
|
+
- [ ] git reset --hard is NEVER used anywhere in this workflow
|
|
314
|
+
</success_criteria>
|
|
@@ -341,6 +341,8 @@ Your custom files in other locations are preserved:
|
|
|
341
341
|
If you've modified any GSD files directly, they'll be automatically backed up to `gsd-local-patches/` and can be reapplied with `/gsd-reapply-patches` after the update.
|
|
342
342
|
```
|
|
343
343
|
|
|
344
|
+
|
|
345
|
+
**Text mode (`workflow.text_mode: true` in config or `--text` flag):** Set `TEXT_MODE=true` if `--text` is present in `$ARGUMENTS` OR `text_mode` from init JSON is `true`. When TEXT_MODE is active, replace every `question` call with a plain-text numbered list and ask the user to type their choice number. This is required for non-OpenCode runtimes (OpenAI Codex, Gemini CLI, etc.) where `question` is not available.
|
|
344
346
|
Use question:
|
|
345
347
|
- question: "Proceed with update?"
|
|
346
348
|
- Options:
|
|
@@ -83,6 +83,8 @@ No gaps → skip to Step 6, set `nyquist_compliant: true`.
|
|
|
83
83
|
|
|
84
84
|
## 4. Present Gap Plan
|
|
85
85
|
|
|
86
|
+
|
|
87
|
+
**Text mode (`workflow.text_mode: true` in config or `--text` flag):** Set `TEXT_MODE=true` if `--text` is present in `$ARGUMENTS` OR `text_mode` from init JSON is `true`. When TEXT_MODE is active, replace every `question` call with a plain-text numbered list and ask the user to type their choice number. This is required for non-OpenCode runtimes (OpenAI Codex, Gemini CLI, etc.) where `question` is not available.
|
|
86
88
|
Call question with gap table and options:
|
|
87
89
|
1. "Fix all gaps" → Step 5
|
|
88
90
|
2. "Skip — mark manual-only" → add to Manual-Only, Step 6
|
|
@@ -183,6 +183,89 @@ grep -E "Phase ${PHASE_NUM}" .planning/REQUIREMENTS.md 2>/dev/null || true
|
|
|
183
183
|
For each requirement: parse description → identify supporting truths/artifacts → status: ✓ SATISFIED / ✗ BLOCKED / ? NEEDS HUMAN.
|
|
184
184
|
</step>
|
|
185
185
|
|
|
186
|
+
<step name="behavioral_verification">
|
|
187
|
+
**Run the project's test suite and CLI commands to verify behavior, not just structure.**
|
|
188
|
+
|
|
189
|
+
Static checks (grep, file existence, wiring) catch structural gaps but miss runtime
|
|
190
|
+
failures. This step runs actual tests and project commands to verify the phase goal
|
|
191
|
+
is behaviorally achieved.
|
|
192
|
+
|
|
193
|
+
This follows Anthropic's harness engineering principle: separating generation from
|
|
194
|
+
evaluation, with the evaluator interacting with the running system rather than
|
|
195
|
+
inspecting static artifacts.
|
|
196
|
+
|
|
197
|
+
**Step 1: Run test suite**
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
# Detect test runner and run all tests (timeout: 5 minutes)
|
|
201
|
+
TEST_EXIT=0
|
|
202
|
+
timeout 300 bash -c '
|
|
203
|
+
if [ -f "package.json" ]; then
|
|
204
|
+
npm test 2>&1
|
|
205
|
+
elif [ -f "Cargo.toml" ]; then
|
|
206
|
+
cargo test 2>&1
|
|
207
|
+
elif [ -f "go.mod" ]; then
|
|
208
|
+
go test ./... 2>&1
|
|
209
|
+
elif [ -f "pyproject.toml" ] || [ -f "requirements.txt" ]; then
|
|
210
|
+
python -m pytest -q --tb=short 2>&1 || uv run python -m pytest -q --tb=short 2>&1
|
|
211
|
+
else
|
|
212
|
+
echo "⚠ No test runner detected — skipping test suite"
|
|
213
|
+
exit 1
|
|
214
|
+
fi
|
|
215
|
+
'
|
|
216
|
+
TEST_EXIT=$?
|
|
217
|
+
if [ "${TEST_EXIT}" -eq 0 ]; then
|
|
218
|
+
echo "✓ Test suite passed"
|
|
219
|
+
elif [ "${TEST_EXIT}" -eq 124 ]; then
|
|
220
|
+
echo "⚠ Test suite timed out after 5 minutes"
|
|
221
|
+
else
|
|
222
|
+
echo "✗ Test suite failed (exit code ${TEST_EXIT})"
|
|
223
|
+
fi
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Record: total tests, passed, failed, coverage (if available).
|
|
227
|
+
|
|
228
|
+
**If any tests fail:** Mark as `behavioral_failures` — these are BLOCKER severity
|
|
229
|
+
regardless of whether static checks passed. A phase cannot be verified if tests fail.
|
|
230
|
+
|
|
231
|
+
**Step 2: Run project CLI/commands from success criteria (if testable)**
|
|
232
|
+
|
|
233
|
+
For each success criterion that describes a user command (e.g., "User can run
|
|
234
|
+
`mixtiq validate`", "User can run `npm start`"):
|
|
235
|
+
|
|
236
|
+
1. Check if the command exists and required inputs are available:
|
|
237
|
+
- Look for example files in `templates/`, `fixtures/`, `test/`, `examples/`, or `testdata/`
|
|
238
|
+
- Check if the CLI binary/script exists on PATH or in the project
|
|
239
|
+
2. **If no suitable inputs or fixtures exist:** Mark as `? NEEDS HUMAN` with reason
|
|
240
|
+
"No test fixtures available — requires manual verification" and move on.
|
|
241
|
+
Do NOT invent example inputs.
|
|
242
|
+
3. If inputs are available: run the command and verify it exits successfully.
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
# Only run if both command and input exist
|
|
246
|
+
if command -v {project_cli} &>/dev/null && [ -f "{example_input}" ]; then
|
|
247
|
+
{project_cli} {example_input} 2>&1
|
|
248
|
+
fi
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Record: command, exit code, output summary, pass/fail (or SKIPPED if no fixtures).
|
|
252
|
+
|
|
253
|
+
**Step 3: Report**
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
## Behavioral Verification
|
|
257
|
+
|
|
258
|
+
| Check | Result | Detail |
|
|
259
|
+
|-------|--------|--------|
|
|
260
|
+
| Test suite | {N} passed, {M} failed | {first failure if any} |
|
|
261
|
+
| {CLI command 1} | ✓ / ✗ | {output summary} |
|
|
262
|
+
| {CLI command 2} | ✓ / ✗ | {output summary} |
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
**If all behavioral checks pass:** Continue to scan_antipatterns.
|
|
266
|
+
**If any fail:** Add to verification gaps with BLOCKER severity.
|
|
267
|
+
</step>
|
|
268
|
+
|
|
186
269
|
<step name="scan_antipatterns">
|
|
187
270
|
Extract files modified in this phase from SUMMARY.md, scan each:
|
|
188
271
|
|
|
@@ -248,6 +248,8 @@ Display the returned checkpoint EXACTLY as-is:
|
|
|
248
248
|
- Do NOT add commentary before or after the block.
|
|
249
249
|
- If you notice protocol/meta markers such as `to=all:`, role-routing text, XML system tags, hidden instruction markers, ad copy, or any unrelated suffix, discard the draft and output `{CHECKPOINT}` only.
|
|
250
250
|
|
|
251
|
+
|
|
252
|
+
**Text mode (`workflow.text_mode: true` in config or `--text` flag):** Set `TEXT_MODE=true` if `--text` is present in `$ARGUMENTS` OR `text_mode` from init JSON is `true`. When TEXT_MODE is active, replace every `question` call with a plain-text numbered list and ask the user to type their choice number. This is required for non-OpenCode runtimes (OpenAI Codex, Gemini CLI, etc.) where `question` is not available.
|
|
251
253
|
Wait for user response (plain text, no question).
|
|
252
254
|
</step>
|
|
253
255
|
|
|
@@ -437,8 +439,17 @@ If `SECURITY_CFG` is `true` AND `SECURITY_FILE` exists: check frontmatter `threa
|
|
|
437
439
|
```
|
|
438
440
|
|
|
439
441
|
If `SECURITY_CFG` is `false` OR (`SECURITY_FILE` exists AND `threats_open` is `0`):
|
|
442
|
+
|
|
443
|
+
**Auto-transition: mark phase complete in ROADMAP.md and STATE.md**
|
|
444
|
+
|
|
445
|
+
Execute the transition workflow inline (do NOT use task — the orchestrator context already holds the UAT results and phase data needed for accurate transition):
|
|
446
|
+
|
|
447
|
+
read and follow `$HOME/.config/opencode/get-shit-done/workflows/transition.md`.
|
|
448
|
+
|
|
449
|
+
After transition completes, present next-step options to the user:
|
|
450
|
+
|
|
440
451
|
```
|
|
441
|
-
All tests passed.
|
|
452
|
+
All tests passed. Phase {phase} marked complete.
|
|
442
453
|
|
|
443
454
|
- `/gsd-plan-phase {next}` — Plan next phase
|
|
444
455
|
- `/gsd-execute-phase {next}` — Execute next phase
|
package/package.json
CHANGED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gsd-code-review
|
|
3
|
+
description: Implementation of one of the commands
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<objective>
|
|
7
|
+
Review source files changed during a phase for bugs, security vulnerabilities, and code quality problems.
|
|
8
|
+
|
|
9
|
+
Spawns the gsd-code-reviewer agent to analyze code at the specified depth level. Produces REVIEW.md artifact in the phase directory with severity-classified findings.
|
|
10
|
+
|
|
11
|
+
Arguments:
|
|
12
|
+
- Phase number (required) — which phase's changes to review (e.g., "2" or "02")
|
|
13
|
+
- `--depth=quick|standard|deep` (optional) — review depth level, overrides workflow.code_review_depth config
|
|
14
|
+
- quick: Pattern-matching only (~2 min)
|
|
15
|
+
- standard: Per-file analysis with language-specific checks (~5-15 min, default)
|
|
16
|
+
- deep: Cross-file analysis including import graphs and call chains (~15-30 min)
|
|
17
|
+
- `--files file1,file2,...` (optional) — explicit comma-separated file list, skips SUMMARY/git scoping (highest precedence for scoping)
|
|
18
|
+
|
|
19
|
+
Output: {padded_phase}-REVIEW.md in phase directory + inline summary of findings
|
|
20
|
+
</objective>
|
|
21
|
+
|
|
22
|
+
<execution_context>
|
|
23
|
+
@$HOME/.config/opencode/get-shit-done/workflows/code-review.md
|
|
24
|
+
</execution_context>
|
|
25
|
+
|
|
26
|
+
<context>
|
|
27
|
+
Phase: $ARGUMENTS (first positional argument is phase number)
|
|
28
|
+
|
|
29
|
+
Optional flags parsed from $ARGUMENTS:
|
|
30
|
+
- `--depth=VALUE` — Depth override (quick|standard|deep). If provided, overrides workflow.code_review_depth config.
|
|
31
|
+
- `--files=file1,file2,...` — Explicit file list override. Has highest precedence for file scoping per D-08. When provided, workflow skips SUMMARY.md extraction and git diff fallback entirely.
|
|
32
|
+
|
|
33
|
+
Context files (AGENTS.md, SUMMARY.md, phase state) are resolved inside the workflow via `gsd-tools init phase-op` and delegated to agent via `<files_to_read>` blocks.
|
|
34
|
+
</context>
|
|
35
|
+
|
|
36
|
+
<process>
|
|
37
|
+
This command is a thin dispatch layer. It parses arguments and delegates to the workflow.
|
|
38
|
+
|
|
39
|
+
Execute the code-review workflow from @$HOME/.config/opencode/get-shit-done/workflows/code-review.md end-to-end.
|
|
40
|
+
|
|
41
|
+
The workflow (not this command) enforces these gates:
|
|
42
|
+
- Phase validation (before config gate)
|
|
43
|
+
- Config gate check (workflow.code_review)
|
|
44
|
+
- File scoping (--files override > SUMMARY.md > git diff fallback)
|
|
45
|
+
- Empty scope check (skip if no files)
|
|
46
|
+
- Agent spawning (gsd-code-reviewer)
|
|
47
|
+
- Result presentation (inline summary + next steps)
|
|
48
|
+
</process>
|