gsd-opencode 1.30.0 → 1.33.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.
- package/agents/gsd-debugger.md +0 -1
- package/agents/gsd-doc-verifier.md +207 -0
- package/agents/gsd-doc-writer.md +608 -0
- package/agents/gsd-executor.md +22 -1
- package/agents/gsd-phase-researcher.md +41 -0
- package/agents/gsd-plan-checker.md +82 -0
- package/agents/gsd-planner.md +123 -194
- package/agents/gsd-security-auditor.md +129 -0
- package/agents/gsd-ui-auditor.md +40 -0
- package/agents/gsd-user-profiler.md +2 -2
- package/agents/gsd-verifier.md +84 -18
- package/commands/gsd/gsd-add-backlog.md +1 -1
- package/commands/gsd/gsd-analyze-dependencies.md +34 -0
- package/commands/gsd/gsd-autonomous.md +6 -2
- package/commands/gsd/gsd-cleanup.md +5 -0
- package/commands/gsd/gsd-debug.md +24 -21
- package/commands/gsd/gsd-discuss-phase.md +7 -2
- package/commands/gsd/gsd-docs-update.md +48 -0
- package/commands/gsd/gsd-execute-phase.md +4 -0
- package/commands/gsd/gsd-help.md +2 -0
- package/commands/gsd/gsd-join-discord.md +2 -1
- package/commands/gsd/gsd-manager.md +1 -0
- package/commands/gsd/gsd-new-project.md +4 -0
- package/commands/gsd/gsd-plan-phase.md +5 -0
- package/commands/gsd/gsd-quick.md +5 -3
- package/commands/gsd/gsd-reapply-patches.md +171 -39
- package/commands/gsd/gsd-research-phase.md +2 -12
- package/commands/gsd/gsd-review-backlog.md +1 -0
- package/commands/gsd/gsd-review.md +3 -2
- package/commands/gsd/gsd-secure-phase.md +35 -0
- package/commands/gsd/gsd-set-profile.md +0 -1
- package/commands/gsd/gsd-thread.md +1 -1
- package/commands/gsd/gsd-workstreams.md +7 -2
- package/get-shit-done/bin/gsd-tools.cjs +42 -8
- package/get-shit-done/bin/lib/commands.cjs +68 -14
- package/get-shit-done/bin/lib/config.cjs +18 -10
- package/get-shit-done/bin/lib/core.cjs +383 -80
- package/get-shit-done/bin/lib/docs.cjs +267 -0
- package/get-shit-done/bin/lib/frontmatter.cjs +47 -2
- package/get-shit-done/bin/lib/init.cjs +85 -5
- package/get-shit-done/bin/lib/milestone.cjs +21 -0
- package/get-shit-done/bin/lib/model-profiles.cjs +2 -0
- package/get-shit-done/bin/lib/phase.cjs +232 -189
- package/get-shit-done/bin/lib/profile-output.cjs +97 -1
- package/get-shit-done/bin/lib/roadmap.cjs +137 -113
- package/get-shit-done/bin/lib/schema-detect.cjs +238 -0
- package/get-shit-done/bin/lib/security.cjs +5 -3
- package/get-shit-done/bin/lib/state.cjs +366 -44
- package/get-shit-done/bin/lib/verify.cjs +158 -14
- package/get-shit-done/bin/lib/workstream.cjs +6 -2
- package/get-shit-done/references/agent-contracts.md +79 -0
- package/get-shit-done/references/artifact-types.md +113 -0
- package/get-shit-done/references/context-budget.md +49 -0
- package/get-shit-done/references/continuation-format.md +15 -15
- package/get-shit-done/references/domain-probes.md +125 -0
- package/get-shit-done/references/gate-prompts.md +100 -0
- package/get-shit-done/references/model-profiles.md +2 -2
- package/get-shit-done/references/planner-gap-closure.md +62 -0
- package/get-shit-done/references/planner-reviews.md +39 -0
- package/get-shit-done/references/planner-revision.md +87 -0
- package/get-shit-done/references/planning-config.md +15 -0
- package/get-shit-done/references/revision-loop.md +97 -0
- package/get-shit-done/references/ui-brand.md +2 -2
- package/get-shit-done/references/universal-anti-patterns.md +58 -0
- package/get-shit-done/references/workstream-flag.md +56 -3
- package/get-shit-done/templates/SECURITY.md +61 -0
- package/get-shit-done/templates/VALIDATION.md +3 -3
- package/get-shit-done/templates/claude-md.md +27 -4
- package/get-shit-done/templates/config.json +4 -0
- package/get-shit-done/templates/debug-subagent-prompt.md +2 -6
- package/get-shit-done/templates/planner-subagent-prompt.md +2 -10
- package/get-shit-done/workflows/add-phase.md +2 -2
- package/get-shit-done/workflows/add-todo.md +1 -1
- package/get-shit-done/workflows/analyze-dependencies.md +96 -0
- package/get-shit-done/workflows/audit-milestone.md +8 -12
- package/get-shit-done/workflows/autonomous.md +158 -13
- package/get-shit-done/workflows/check-todos.md +2 -2
- package/get-shit-done/workflows/complete-milestone.md +13 -4
- package/get-shit-done/workflows/diagnose-issues.md +8 -6
- package/get-shit-done/workflows/discovery-phase.md +1 -1
- package/get-shit-done/workflows/discuss-phase-assumptions.md +24 -6
- package/get-shit-done/workflows/discuss-phase-power.md +291 -0
- package/get-shit-done/workflows/discuss-phase.md +153 -20
- package/get-shit-done/workflows/docs-update.md +1093 -0
- package/get-shit-done/workflows/execute-phase.md +362 -66
- package/get-shit-done/workflows/execute-plan.md +1 -1
- package/get-shit-done/workflows/help.md +9 -6
- package/get-shit-done/workflows/insert-phase.md +2 -2
- package/get-shit-done/workflows/manager.md +27 -26
- package/get-shit-done/workflows/map-codebase.md +10 -32
- package/get-shit-done/workflows/new-milestone.md +14 -8
- package/get-shit-done/workflows/new-project.md +48 -25
- package/get-shit-done/workflows/next.md +1 -1
- package/get-shit-done/workflows/note.md +1 -1
- package/get-shit-done/workflows/pause-work.md +73 -10
- package/get-shit-done/workflows/plan-milestone-gaps.md +2 -2
- package/get-shit-done/workflows/plan-phase.md +184 -32
- package/get-shit-done/workflows/progress.md +20 -20
- package/get-shit-done/workflows/quick.md +102 -84
- package/get-shit-done/workflows/research-phase.md +2 -6
- package/get-shit-done/workflows/resume-project.md +4 -4
- package/get-shit-done/workflows/review.md +56 -3
- package/get-shit-done/workflows/secure-phase.md +154 -0
- package/get-shit-done/workflows/settings.md +13 -2
- package/get-shit-done/workflows/ship.md +13 -4
- package/get-shit-done/workflows/transition.md +6 -6
- package/get-shit-done/workflows/ui-phase.md +4 -14
- package/get-shit-done/workflows/ui-review.md +25 -7
- package/get-shit-done/workflows/update.md +165 -16
- package/get-shit-done/workflows/validate-phase.md +1 -11
- package/get-shit-done/workflows/verify-phase.md +127 -6
- package/get-shit-done/workflows/verify-work.md +69 -21
- package/package.json +1 -1
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
<objective>
|
|
2
|
+
Power user mode for discuss-phase. Generates ALL questions upfront into a JSON state file and an HTML companion UI, then waits for the user to answer at their own pace. When the user signals readiness, processes all answers in one pass and generates CONTEXT.md.
|
|
3
|
+
|
|
4
|
+
**When to use:** Large phases with many gray areas, or when users prefer to answer questions offline / asynchronously rather than interactively in the chat session.
|
|
5
|
+
</objective>
|
|
6
|
+
|
|
7
|
+
<trigger>
|
|
8
|
+
This workflow executes when `--power` flag is present in ARGUMENTS to `/gsd-discuss-phase`.
|
|
9
|
+
|
|
10
|
+
The caller (discuss-phase.md) has already:
|
|
11
|
+
- Validated the phase exists
|
|
12
|
+
- Provided init context: `phase_dir`, `padded_phase`, `phase_number`, `phase_name`, `phase_slug`
|
|
13
|
+
|
|
14
|
+
Begin at **Step 1** immediately.
|
|
15
|
+
</trigger>
|
|
16
|
+
|
|
17
|
+
<step name="analyze">
|
|
18
|
+
Run the same gray area identification as standard discuss-phase mode.
|
|
19
|
+
|
|
20
|
+
1. Load prior context (PROJECT.md, REQUIREMENTS.md, STATE.md, prior CONTEXT.md files)
|
|
21
|
+
2. Scout codebase for reusable assets and patterns relevant to this phase
|
|
22
|
+
3. read the phase goal from ROADMAP.md
|
|
23
|
+
4. Identify ALL gray areas — specific implementation decisions the user should weigh in on
|
|
24
|
+
5. For each gray area, generate 2–4 concrete options with tradeoff descriptions
|
|
25
|
+
|
|
26
|
+
Group questions by topic into sections (e.g., "Visual Style", "Data Model", "Interactions", "Error Handling"). Each section should have 2–6 questions.
|
|
27
|
+
|
|
28
|
+
Do NOT ask the user anything at this stage. Capture everything internally, then proceed to generate.
|
|
29
|
+
</step>
|
|
30
|
+
|
|
31
|
+
<step name="generate_json">
|
|
32
|
+
write all questions to:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
{phase_dir}/{padded_phase}-QUESTIONS.json
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**JSON structure:**
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"phase": "{padded_phase}-{phase_slug}",
|
|
43
|
+
"generated_at": "ISO-8601 timestamp",
|
|
44
|
+
"stats": {
|
|
45
|
+
"total": 0,
|
|
46
|
+
"answered": 0,
|
|
47
|
+
"chat_more": 0,
|
|
48
|
+
"remaining": 0
|
|
49
|
+
},
|
|
50
|
+
"sections": [
|
|
51
|
+
{
|
|
52
|
+
"id": "section-slug",
|
|
53
|
+
"title": "Section Title",
|
|
54
|
+
"questions": [
|
|
55
|
+
{
|
|
56
|
+
"id": "Q-01",
|
|
57
|
+
"title": "Short question title",
|
|
58
|
+
"context": "Codebase info, prior decisions, or constraints relevant to this question",
|
|
59
|
+
"options": [
|
|
60
|
+
{
|
|
61
|
+
"id": "a",
|
|
62
|
+
"label": "Option label",
|
|
63
|
+
"description": "Tradeoff or elaboration for this option"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"id": "b",
|
|
67
|
+
"label": "Another option",
|
|
68
|
+
"description": "Tradeoff or elaboration"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"id": "c",
|
|
72
|
+
"label": "Custom",
|
|
73
|
+
"description": ""
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"answer": null,
|
|
77
|
+
"chat_more": "",
|
|
78
|
+
"status": "unanswered"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Field rules:**
|
|
87
|
+
- `stats.total`: count of all questions across all sections
|
|
88
|
+
- `stats.answered`: count where `answer` is not null and not empty string
|
|
89
|
+
- `stats.chat_more`: count where `chat_more` has content
|
|
90
|
+
- `stats.remaining`: `total - answered`
|
|
91
|
+
- `question.id`: sequential across all sections — Q-01, Q-02, Q-03, ...
|
|
92
|
+
- `question.context`: concrete codebase or prior-decision annotation (not generic)
|
|
93
|
+
- `question.answer`: null until user sets it; once answered, the selected option id or free-text
|
|
94
|
+
- `question.status`: "unanswered" | "answered" | "chat-more" (has chat_more but no answer yet)
|
|
95
|
+
</step>
|
|
96
|
+
|
|
97
|
+
<step name="generate_html">
|
|
98
|
+
write a self-contained HTML companion file to:
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
{phase_dir}/{padded_phase}-QUESTIONS.html
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The file must be a single self-contained HTML file with inline CSS and JavaScript. No external dependencies.
|
|
105
|
+
|
|
106
|
+
**Layout:**
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
┌─────────────────────────────────────────────────────┐
|
|
110
|
+
│ Phase {N}: {phase_name} — Discussion Questions │
|
|
111
|
+
│ ┌──────────────────────────────────────────────┐ │
|
|
112
|
+
│ │ 12 total | 3 answered | 9 remaining │ │
|
|
113
|
+
│ └──────────────────────────────────────────────┘ │
|
|
114
|
+
├─────────────────────────────────────────────────────┤
|
|
115
|
+
│ ▼ Visual Style (3 questions) │
|
|
116
|
+
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
|
|
117
|
+
│ │ Q-01 │ │ Q-02 │ │ Q-03 │ │
|
|
118
|
+
│ │ Layout │ │ Density │ │ Colors │ │
|
|
119
|
+
│ │ ... │ │ ... │ │ ... │ │
|
|
120
|
+
│ └──────────┘ └──────────┘ └──────────┘ │
|
|
121
|
+
│ ▼ Data Model (2 questions) │
|
|
122
|
+
│ ... │
|
|
123
|
+
└─────────────────────────────────────────────────────┘
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**Stats bar:**
|
|
127
|
+
- Total questions, answered count, remaining count
|
|
128
|
+
- A simple CSS progress bar (green fill = answered / total)
|
|
129
|
+
|
|
130
|
+
**Section headers:**
|
|
131
|
+
- Collapsible via click — show/hide questions in the section
|
|
132
|
+
- Show answered count for the section (e.g., "2/4 answered")
|
|
133
|
+
|
|
134
|
+
**question cards (3-column grid):**
|
|
135
|
+
Each card contains:
|
|
136
|
+
- question ID badge (e.g., "Q-01") and title
|
|
137
|
+
- Context annotation (gray italic text)
|
|
138
|
+
- Option list: radio buttons with bold label + description text
|
|
139
|
+
- Chat more textarea (orange border when content present)
|
|
140
|
+
- Card highlighted green when answered
|
|
141
|
+
|
|
142
|
+
**JavaScript behavior:**
|
|
143
|
+
- On radio button select: mark question as answered in page state; update stats bar
|
|
144
|
+
- On textarea input: update chat_more content in page state; show orange border if content present
|
|
145
|
+
- "Save answers" button at top and bottom: serializes page state back to the JSON file path
|
|
146
|
+
|
|
147
|
+
**Save mechanism:**
|
|
148
|
+
The Save button writes the updated JSON back using the File System Access API if available, otherwise generates a downloadable JSON file the user can save over the original. Include clear instructions in the UI:
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
After answering, click "Save answers" — or download the JSON and replace the original file.
|
|
152
|
+
Then return to OpenCode and say "refresh" to process your answers.
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Answered question styling:**
|
|
156
|
+
- Card border: `2px solid #22c55e` (green)
|
|
157
|
+
- Card background: `#f0fdf4` (light green tint)
|
|
158
|
+
|
|
159
|
+
**Unanswered question styling:**
|
|
160
|
+
- Card border: `1px solid #e2e8f0` (gray)
|
|
161
|
+
- Card background: `white`
|
|
162
|
+
|
|
163
|
+
**Chat more textarea:**
|
|
164
|
+
- Placeholder: "Add context, nuance, or clarification for this question..."
|
|
165
|
+
- Normal border: `1px solid #e2e8f0`
|
|
166
|
+
- Active (has content) border: `2px solid #f97316` (orange)
|
|
167
|
+
</step>
|
|
168
|
+
|
|
169
|
+
<step name="notify_user">
|
|
170
|
+
After writing both files, print this message to the user:
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
Questions ready for Phase {N}: {phase_name}
|
|
174
|
+
|
|
175
|
+
HTML (open in browser/IDE): {phase_dir}/{padded_phase}-QUESTIONS.html
|
|
176
|
+
JSON (state file): {phase_dir}/{padded_phase}-QUESTIONS.json
|
|
177
|
+
|
|
178
|
+
{total} questions across {section_count} topics.
|
|
179
|
+
|
|
180
|
+
Open the HTML file, answer the questions at your own pace, then save.
|
|
181
|
+
|
|
182
|
+
When ready, tell me:
|
|
183
|
+
"refresh" — process your answers and update the file
|
|
184
|
+
"finalize" — generate CONTEXT.md from all answered questions
|
|
185
|
+
"explain Q-05" — elaborate on a specific question
|
|
186
|
+
"exit power mode" — return to standard one-by-one discussion (answers carry over)
|
|
187
|
+
```
|
|
188
|
+
</step>
|
|
189
|
+
|
|
190
|
+
<step name="wait_loop">
|
|
191
|
+
Enter wait mode. OpenCode listens for user commands and handles each:
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
**"refresh"** (or "process answers", "update", "re-read"):
|
|
196
|
+
|
|
197
|
+
1. read `{phase_dir}/{padded_phase}-QUESTIONS.json`
|
|
198
|
+
2. Recalculate stats: count answered, chat_more, remaining
|
|
199
|
+
3. write updated stats back to the JSON
|
|
200
|
+
4. Re-generate the HTML file with the updated state (answered cards highlighted green, progress bar updated)
|
|
201
|
+
5. Report to user:
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
Refreshed. Updated state:
|
|
205
|
+
Answered: {answered} / {total}
|
|
206
|
+
Remaining: {remaining}
|
|
207
|
+
Chat-more: {chat_more}
|
|
208
|
+
|
|
209
|
+
{phase_dir}/{padded_phase}-QUESTIONS.html updated.
|
|
210
|
+
|
|
211
|
+
Answer more questions, then say "refresh" again, or say "finalize" when done.
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
**"finalize"** (or "done", "generate context", "write context"):
|
|
217
|
+
|
|
218
|
+
Proceed to the **finalize** step.
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
**"explain Q-{N}"** (or "more info on Q-{N}", "elaborate Q-{N}"):
|
|
223
|
+
|
|
224
|
+
1. Find the question by ID in the JSON
|
|
225
|
+
2. Provide a detailed explanation: why this decision matters, how it affects the downstream plan, what additional context from the codebase is relevant
|
|
226
|
+
3. Return to wait mode
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
**"exit power mode"** (or "switch to interactive"):
|
|
231
|
+
|
|
232
|
+
1. read all currently answered questions from JSON
|
|
233
|
+
2. Load answers into the internal accumulator as if they were answered interactively
|
|
234
|
+
3. Continue with standard `discuss_areas` step from discuss-phase.md for any unanswered questions
|
|
235
|
+
4. Generate CONTEXT.md as normal
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
**Any other message:**
|
|
240
|
+
Respond helpfully, then remind the user of available commands:
|
|
241
|
+
```
|
|
242
|
+
(Power mode active — say "refresh", "finalize", "explain Q-N", or "exit power mode")
|
|
243
|
+
```
|
|
244
|
+
</step>
|
|
245
|
+
|
|
246
|
+
<step name="finalize">
|
|
247
|
+
Process all answered questions from the JSON file and generate CONTEXT.md.
|
|
248
|
+
|
|
249
|
+
1. read `{phase_dir}/{padded_phase}-QUESTIONS.json`
|
|
250
|
+
2. Filter to questions where `answer` is not null/empty
|
|
251
|
+
3. Group decisions by section
|
|
252
|
+
4. For each answered question, format as a decision entry:
|
|
253
|
+
- Decision: the selected option label (or custom text if free-form answer)
|
|
254
|
+
- Rationale: the option description, plus `chat_more` content if present
|
|
255
|
+
- Status: "Decided" if fully answered, "Needs clarification" if only chat_more with no option selected
|
|
256
|
+
|
|
257
|
+
5. write CONTEXT.md using the standard context template format:
|
|
258
|
+
- `<decisions>` section with all answered questions grouped by section
|
|
259
|
+
- `<deferred_ideas>` section for unanswered questions (carry forward for future discussion)
|
|
260
|
+
- `<specifics>` section for any chat_more content that adds nuance
|
|
261
|
+
- `<code_context>` section with reusable assets found during analysis
|
|
262
|
+
- `<canonical_refs>` section (MANDATORY — paths to relevant specs/docs)
|
|
263
|
+
|
|
264
|
+
6. If fewer than 50% of questions were answered, warn the user:
|
|
265
|
+
```
|
|
266
|
+
Warning: Only {answered}/{total} questions answered ({pct}%).
|
|
267
|
+
CONTEXT.md generated with available decisions. Unanswered questions listed as deferred.
|
|
268
|
+
Consider running /gsd-discuss-phase {N} again to refine before planning.
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
7. Print completion message:
|
|
272
|
+
```
|
|
273
|
+
CONTEXT.md written: {phase_dir}/{padded_phase}-CONTEXT.md
|
|
274
|
+
|
|
275
|
+
Decisions captured: {answered}
|
|
276
|
+
Deferred: {remaining}
|
|
277
|
+
|
|
278
|
+
Next step: /gsd-plan-phase {N}
|
|
279
|
+
```
|
|
280
|
+
</step>
|
|
281
|
+
|
|
282
|
+
<success_criteria>
|
|
283
|
+
- Questions generated into well-structured JSON covering all identified gray areas
|
|
284
|
+
- HTML companion file is self-contained and usable without a server
|
|
285
|
+
- Stats bar accurately reflects answered/remaining counts after each refresh
|
|
286
|
+
- Answered questions highlighted green in HTML
|
|
287
|
+
- CONTEXT.md generated in the same format as standard discuss-phase output
|
|
288
|
+
- Unanswered questions preserved as deferred items (not silently dropped)
|
|
289
|
+
- `canonical_refs` section always present in CONTEXT.md (MANDATORY)
|
|
290
|
+
- User knows how to refresh, finalize, explain, or exit power mode
|
|
291
|
+
</success_criteria>
|
|
@@ -4,6 +4,12 @@ Extract implementation decisions that downstream agents need. Analyze the phase
|
|
|
4
4
|
You are a thinking partner, not an interviewer. The user is the visionary — you are the builder. Your job is to capture decisions that will guide research and planning, not to figure out implementation yourself.
|
|
5
5
|
</objective>
|
|
6
6
|
|
|
7
|
+
<required_reading>
|
|
8
|
+
@$HOME/.config/opencode/get-shit-done/references/domain-probes.md
|
|
9
|
+
@$HOME/.config/opencode/get-shit-done/references/gate-prompts.md
|
|
10
|
+
@$HOME/.config/opencode/get-shit-done/references/universal-anti-patterns.md
|
|
11
|
+
</required_reading>
|
|
12
|
+
|
|
7
13
|
<downstream_awareness>
|
|
8
14
|
**CONTEXT.md feeds into:**
|
|
9
15
|
|
|
@@ -137,7 +143,9 @@ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
|
|
|
137
143
|
AGENT_SKILLS_ADVISOR=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" agent-skills gsd-advisor 2>/dev/null)
|
|
138
144
|
```
|
|
139
145
|
|
|
140
|
-
Parse JSON for: `commit_docs`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`, `has_research`, `has_context`, `has_plans`, `has_verification`, `plan_count`, `roadmap_exists`, `planning_exists`.
|
|
146
|
+
Parse JSON for: `commit_docs`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`, `has_research`, `has_context`, `has_plans`, `has_verification`, `plan_count`, `roadmap_exists`, `planning_exists`, `response_language`.
|
|
147
|
+
|
|
148
|
+
**If `response_language` is set:** All user-facing questions, prompts, and explanations in this workflow MUST be presented in `{response_language}`. This includes question labels, option text, gray area descriptions, and discussion summaries. Technical terms, code, and file paths remain in English. Subagent prompts stay in English — only user-facing output is translated.
|
|
141
149
|
|
|
142
150
|
**If `phase_found` is false:**
|
|
143
151
|
```
|
|
@@ -149,12 +157,46 @@ Exit workflow.
|
|
|
149
157
|
|
|
150
158
|
**If `phase_found` is true:** Continue to check_existing.
|
|
151
159
|
|
|
160
|
+
**Power mode** — If `--power` is present in ARGUMENTS:
|
|
161
|
+
- Skip interactive questioning entirely
|
|
162
|
+
- read and execute @$HOME/.config/opencode/get-shit-done/workflows/discuss-phase-power.md end-to-end
|
|
163
|
+
- Do not continue with the steps below
|
|
164
|
+
|
|
152
165
|
**Auto mode** — If `--auto` is present in ARGUMENTS:
|
|
153
166
|
- In `check_existing`: auto-select "Skip" (if context exists) or continue without prompting (if no context/plans)
|
|
154
167
|
- In `present_gray_areas`: auto-select ALL gray areas without asking the user
|
|
155
168
|
- In `discuss_areas`: for each discussion question, choose the recommended option (first option, or the one marked "recommended") without using question
|
|
156
169
|
- Log each auto-selected choice inline so the user can review decisions in the context file
|
|
157
170
|
- After discussion completes, auto-advance to plan-phase (existing behavior)
|
|
171
|
+
|
|
172
|
+
**Chain mode** — If `--chain` is present in ARGUMENTS:
|
|
173
|
+
- Discussion is fully interactive (questions, gray area selection — same as default mode)
|
|
174
|
+
- After discussion completes, auto-advance to plan-phase → execute-phase (same as `--auto`)
|
|
175
|
+
- This is the middle ground: user controls the discuss decisions, then plan+execute run autonomously
|
|
176
|
+
</step>
|
|
177
|
+
|
|
178
|
+
<step name="check_blocking_antipatterns" priority="first">
|
|
179
|
+
**MANDATORY — Check for blocking anti-patterns before any other work.**
|
|
180
|
+
|
|
181
|
+
Look for a `.continue-here.md` in the current phase directory:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
ls ${phase_dir}/.continue-here.md 2>/dev/null || true
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
If `.continue-here.md` exists, parse its "Critical Anti-Patterns" table for rows with `severity` = `blocking`.
|
|
188
|
+
|
|
189
|
+
**If one or more `blocking` anti-patterns are found:**
|
|
190
|
+
|
|
191
|
+
This step cannot be skipped. Before proceeding to `check_existing` or any other step, the agent must demonstrate understanding of each blocking anti-pattern by answering all three questions for each one:
|
|
192
|
+
|
|
193
|
+
1. **What is this anti-pattern?** — Describe it in your own words, not by quoting the handoff.
|
|
194
|
+
2. **How did it manifest?** — Explain the specific failure that caused it to be recorded.
|
|
195
|
+
3. **What structural mechanism (not acknowledgment) prevents it?** — Name the concrete step, checklist item, or enforcement mechanism that stops recurrence.
|
|
196
|
+
|
|
197
|
+
write these answers inline before continuing. If a blocking anti-pattern cannot be answered from the context in `.continue-here.md`, stop and ask the user for clarification.
|
|
198
|
+
|
|
199
|
+
**If no `.continue-here.md` exists, or no `blocking` rows are found:** Proceed directly to `check_existing`.
|
|
158
200
|
</step>
|
|
159
201
|
|
|
160
202
|
<step name="check_existing">
|
|
@@ -182,6 +224,26 @@ If "Skip": Exit workflow
|
|
|
182
224
|
|
|
183
225
|
**If doesn't exist:**
|
|
184
226
|
|
|
227
|
+
**Check for interrupted discussion checkpoint:**
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
ls ${phase_dir}/*-DISCUSS-CHECKPOINT.json 2>/dev/null || true
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
If a checkpoint file exists (previous session was interrupted before CONTEXT.md was written):
|
|
234
|
+
|
|
235
|
+
**If `--auto`:** Auto-select "Resume" — load checkpoint and continue from last completed area.
|
|
236
|
+
|
|
237
|
+
**Otherwise:** Use question:
|
|
238
|
+
- header: "Resume"
|
|
239
|
+
- question: "Found interrupted discussion checkpoint ({N} areas completed out of {M}). Resume from where you left off?"
|
|
240
|
+
- options:
|
|
241
|
+
- "Resume" — Load checkpoint, skip completed areas, continue discussion
|
|
242
|
+
- "Start fresh" — Delete checkpoint, start discussion from scratch
|
|
243
|
+
|
|
244
|
+
If "Resume": Parse the checkpoint JSON. Load `decisions` into the internal accumulator. Set `areas_completed` to skip those areas. Continue to `present_gray_areas` with only the remaining areas.
|
|
245
|
+
If "Start fresh": Delete the checkpoint file. Continue as if no checkpoint existed.
|
|
246
|
+
|
|
185
247
|
Check `has_plans` and `plan_count` from init. **If `has_plans` is true:**
|
|
186
248
|
|
|
187
249
|
**If `--auto`:** Auto-select "Continue and replan after". Log: `[auto] Plans exist — continuing with context capture, will replan after.`
|
|
@@ -489,10 +551,9 @@ After user selects gray areas in present_gray_areas, spawn parallel research age
|
|
|
489
551
|
|
|
490
552
|
1. Display brief status: "Researching {N} areas..."
|
|
491
553
|
|
|
492
|
-
2. For EACH user-selected gray area, spawn a
|
|
554
|
+
2. For EACH user-selected gray area, spawn a relevant subagent using `@subagent prompt` syntax in parallel:
|
|
493
555
|
|
|
494
|
-
|
|
495
|
-
prompt="First, read @$HOME/.config/opencode/agents/gsd-advisor-researcher.md for your role and instructions.
|
|
556
|
+
@gsd-advisor-researcher "First, read @$HOME/.config/opencode/agents/gsd-advisor-researcher.md for your role and instructions.
|
|
496
557
|
|
|
497
558
|
<gray_area>{area_name}: {area_description from gray area identification}</gray_area>
|
|
498
559
|
<phase_context>{phase_goal and description from ROADMAP.md}</phase_context>
|
|
@@ -500,13 +561,9 @@ After user selects gray areas in present_gray_areas, spawn parallel research age
|
|
|
500
561
|
<calibration_tier>{resolved calibration tier: full_maturity | standard | minimal_decisive}</calibration_tier>
|
|
501
562
|
|
|
502
563
|
Research this gray area and return a structured comparison table with rationale.
|
|
503
|
-
${AGENT_SKILLS_ADVISOR}"
|
|
504
|
-
subagent_type="general",
|
|
505
|
-
model="{ADVISOR_MODEL}",
|
|
506
|
-
description="Research: {area_name}"
|
|
507
|
-
)
|
|
564
|
+
${AGENT_SKILLS_ADVISOR}"
|
|
508
565
|
|
|
509
|
-
All
|
|
566
|
+
All subagents spawn simultaneously — do NOT wait for one before starting the next.
|
|
510
567
|
|
|
511
568
|
3. After ALL agents return, SYNTHESIZE results before presenting:
|
|
512
569
|
For each agent's return:
|
|
@@ -640,6 +697,16 @@ Each answer (or answer set, in batch mode) should reveal the next question or ne
|
|
|
640
697
|
```
|
|
641
698
|
After all areas are auto-resolved, skip the "Explore more gray areas" prompt and proceed directly to write_context.
|
|
642
699
|
|
|
700
|
+
**CRITICAL — Auto-mode pass cap:**
|
|
701
|
+
In `--auto` mode, the discuss step MUST complete in a **single pass**. After writing CONTEXT.md once, you are DONE — proceed immediately to write_context and then auto_advance. Do NOT re-read your own CONTEXT.md to find "gaps", "undefined types", or "missing decisions" and run additional passes. This creates a self-feeding loop where each pass generates references that the next pass treats as gaps, consuming unbounded time and resources.
|
|
702
|
+
|
|
703
|
+
Check the pass cap from config:
|
|
704
|
+
```bash
|
|
705
|
+
MAX_PASSES=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" config-get workflow.max_discuss_passes 2>/dev/null || echo "3")
|
|
706
|
+
```
|
|
707
|
+
|
|
708
|
+
If you have already written and committed CONTEXT.md, the discuss step is complete. Move on.
|
|
709
|
+
|
|
643
710
|
**Interactive mode (no `--auto`):**
|
|
644
711
|
|
|
645
712
|
**For each area:**
|
|
@@ -719,6 +786,44 @@ Back to [current area]: [return to current question]"
|
|
|
719
786
|
|
|
720
787
|
Track deferred ideas internally.
|
|
721
788
|
|
|
789
|
+
**Incremental checkpoint — save after each area completes:**
|
|
790
|
+
|
|
791
|
+
After each area is resolved (user says "Next area" or area auto-resolves in `--auto` mode), immediately write a checkpoint file with all decisions captured so far. This prevents data loss if the session is interrupted mid-discussion.
|
|
792
|
+
|
|
793
|
+
**Checkpoint file:** `${phase_dir}/${padded_phase}-DISCUSS-CHECKPOINT.json`
|
|
794
|
+
|
|
795
|
+
write after each area:
|
|
796
|
+
```json
|
|
797
|
+
{
|
|
798
|
+
"phase": "{PHASE_NUM}",
|
|
799
|
+
"phase_name": "{phase_name}",
|
|
800
|
+
"timestamp": "{ISO timestamp}",
|
|
801
|
+
"areas_completed": ["Area 1", "Area 2"],
|
|
802
|
+
"areas_remaining": ["Area 3", "Area 4"],
|
|
803
|
+
"decisions": {
|
|
804
|
+
"Area 1": [
|
|
805
|
+
{"question": "...", "answer": "...", "options_presented": ["..."]},
|
|
806
|
+
{"question": "...", "answer": "...", "options_presented": ["..."]}
|
|
807
|
+
],
|
|
808
|
+
"Area 2": [
|
|
809
|
+
{"question": "...", "answer": "...", "options_presented": ["..."]}
|
|
810
|
+
]
|
|
811
|
+
},
|
|
812
|
+
"deferred_ideas": ["..."],
|
|
813
|
+
"canonical_refs": ["..."]
|
|
814
|
+
}
|
|
815
|
+
```
|
|
816
|
+
|
|
817
|
+
This is a structured checkpoint, not the final CONTEXT.md — the `write_context` step still produces the canonical output. But if the session dies, the next `/gsd-discuss-phase` invocation can detect this checkpoint and offer to resume from it instead of starting from scratch.
|
|
818
|
+
|
|
819
|
+
**On session resume:** In the `check_existing` step, also check for `*-DISCUSS-CHECKPOINT.json`. If found and no CONTEXT.md exists:
|
|
820
|
+
- Display: "Found interrupted discussion checkpoint ({N} areas completed). Resume from checkpoint?"
|
|
821
|
+
- Options: "Resume" / "Start fresh"
|
|
822
|
+
- On "Resume": Load the checkpoint, skip completed areas, continue from where it left off
|
|
823
|
+
- On "Start fresh": Delete the checkpoint, proceed as normal
|
|
824
|
+
|
|
825
|
+
**After write_context completes successfully:** Delete the checkpoint file — the canonical CONTEXT.md now has all decisions.
|
|
826
|
+
|
|
722
827
|
**Track discussion log data internally:**
|
|
723
828
|
For each question asked, accumulate:
|
|
724
829
|
- Area name
|
|
@@ -873,13 +978,14 @@ Created: .planning/phases/${PADDED_PHASE}-${SLUG}/${PADDED_PHASE}-CONTEXT.md
|
|
|
873
978
|
|
|
874
979
|
**Phase ${PHASE}: [Name]** — [Goal from ROADMAP.md]
|
|
875
980
|
|
|
876
|
-
`/
|
|
981
|
+
`/new` then:
|
|
877
982
|
|
|
878
|
-
|
|
983
|
+
`/gsd-plan-phase ${PHASE} ${GSD_WS}`
|
|
879
984
|
|
|
880
985
|
---
|
|
881
986
|
|
|
882
987
|
**Also available:**
|
|
988
|
+
- `/gsd-discuss-phase ${PHASE} --chain ${GSD_WS}` — re-run with auto plan+execute after
|
|
883
989
|
- `/gsd-plan-phase ${PHASE} --skip-research ${GSD_WS}` — plan without research
|
|
884
990
|
- `/gsd-ui-phase ${PHASE} ${GSD_WS}` — generate UI design contract before planning (if phase has frontend work)
|
|
885
991
|
- Review/edit CONTEXT.md before continuing
|
|
@@ -933,6 +1039,12 @@ Created: .planning/phases/${PADDED_PHASE}-${SLUG}/${PADDED_PHASE}-CONTEXT.md
|
|
|
933
1039
|
|
|
934
1040
|
write file.
|
|
935
1041
|
|
|
1042
|
+
**Clean up checkpoint file** — CONTEXT.md is now the canonical record:
|
|
1043
|
+
|
|
1044
|
+
```bash
|
|
1045
|
+
rm -f "${phase_dir}/${padded_phase}-DISCUSS-CHECKPOINT.json"
|
|
1046
|
+
```
|
|
1047
|
+
|
|
936
1048
|
Commit phase context and discussion log:
|
|
937
1049
|
|
|
938
1050
|
```bash
|
|
@@ -961,10 +1073,10 @@ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs(state
|
|
|
961
1073
|
<step name="auto_advance">
|
|
962
1074
|
Check for auto-advance trigger:
|
|
963
1075
|
|
|
964
|
-
1. Parse `--auto`
|
|
965
|
-
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):
|
|
1076
|
+
1. Parse `--auto` and `--chain` flags from $ARGUMENTS
|
|
1077
|
+
2. **Sync chain flag with intent** — if user invoked manually (no `--auto` and no `--chain`), clear the ephemeral chain flag from any previous interrupted `--auto` chain. This does NOT touch `workflow.auto_advance` (the user's persistent settings preference):
|
|
966
1078
|
```bash
|
|
967
|
-
if [[ ! "$ARGUMENTS" =~ --auto ]]; then
|
|
1079
|
+
if [[ ! "$ARGUMENTS" =~ --auto ]] && [[ ! "$ARGUMENTS" =~ --chain ]]; then
|
|
968
1080
|
node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" config-set workflow._auto_chain_active false 2>/dev/null
|
|
969
1081
|
fi
|
|
970
1082
|
```
|
|
@@ -974,12 +1086,12 @@ Check for auto-advance trigger:
|
|
|
974
1086
|
AUTO_CFG=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" config-get workflow.auto_advance 2>/dev/null || echo "false")
|
|
975
1087
|
```
|
|
976
1088
|
|
|
977
|
-
**If `--auto` flag present AND `AUTO_CHAIN` is not true:** Persist chain flag to config (handles direct
|
|
1089
|
+
**If `--auto` or `--chain` flag present AND `AUTO_CHAIN` is not true:** Persist chain flag to config (handles direct usage without new-project):
|
|
978
1090
|
```bash
|
|
979
1091
|
node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" config-set workflow._auto_chain_active true
|
|
980
1092
|
```
|
|
981
1093
|
|
|
982
|
-
**If `--auto` flag present OR `AUTO_CHAIN` is true OR `AUTO_CFG` is true:**
|
|
1094
|
+
**If `--auto` flag present OR `--chain` flag present OR `AUTO_CHAIN` is true OR `AUTO_CFG` is true:**
|
|
983
1095
|
|
|
984
1096
|
Display banner:
|
|
985
1097
|
```
|
|
@@ -1006,8 +1118,9 @@ This keeps the auto-advance chain flat — discuss, plan, and execute all run at
|
|
|
1006
1118
|
|
|
1007
1119
|
Auto-advance pipeline finished: discuss → plan → execute
|
|
1008
1120
|
|
|
1009
|
-
|
|
1010
|
-
|
|
1121
|
+
/new then:
|
|
1122
|
+
|
|
1123
|
+
Next: /gsd-discuss-phase ${NEXT_PHASE} ${WAS_CHAIN ? "--chain" : "--auto"} ${GSD_WS}
|
|
1011
1124
|
```
|
|
1012
1125
|
- **PLANNING COMPLETE** → Planning done, execution didn't complete:
|
|
1013
1126
|
```
|
|
@@ -1025,12 +1138,27 @@ This keeps the auto-advance chain flat — discuss, plan, and execute all run at
|
|
|
1025
1138
|
Continue: /gsd-plan-phase ${PHASE} --gaps ${GSD_WS}
|
|
1026
1139
|
```
|
|
1027
1140
|
|
|
1028
|
-
**If
|
|
1141
|
+
**If none of `--auto`, `--chain`, nor config enabled:**
|
|
1029
1142
|
Route to `confirm_creation` step (existing behavior — show manual next steps).
|
|
1030
1143
|
</step>
|
|
1031
1144
|
|
|
1032
1145
|
</process>
|
|
1033
1146
|
|
|
1147
|
+
<power_user_mode>
|
|
1148
|
+
When `--power` flag is present in ARGUMENTS, skip interactive questioning and execute the power user workflow.
|
|
1149
|
+
|
|
1150
|
+
The power user mode generates ALL questions upfront into machine-readable and human-friendly files, then waits for the user to answer at their own pace before processing all answers in a single pass.
|
|
1151
|
+
|
|
1152
|
+
**Full step-by-step instructions:** @$HOME/.config/opencode/get-shit-done/workflows/discuss-phase-power.md
|
|
1153
|
+
|
|
1154
|
+
**Summary of flow:**
|
|
1155
|
+
1. Run the same phase analysis (gray area identification) as standard mode
|
|
1156
|
+
2. write all questions to `{phase_dir}/{padded_phase}-QUESTIONS.json` and `{phase_dir}/{padded_phase}-QUESTIONS.html`
|
|
1157
|
+
3. Notify user with file paths and wait for a "refresh" or "finalize" command
|
|
1158
|
+
4. On "refresh": read the JSON, process answered questions, update stats and HTML
|
|
1159
|
+
5. On "finalize": read all answers from JSON, generate CONTEXT.md in the standard format
|
|
1160
|
+
</power_user_mode>
|
|
1161
|
+
|
|
1034
1162
|
<success_criteria>
|
|
1035
1163
|
- Phase validated against roadmap
|
|
1036
1164
|
- Prior context loaded (PROJECT.md, REQUIREMENTS.md, STATE.md, prior CONTEXT.md files)
|
|
@@ -1046,4 +1174,9 @@ Route to `confirm_creation` step (existing behavior — show manual next steps).
|
|
|
1046
1174
|
- Deferred ideas preserved for future phases
|
|
1047
1175
|
- STATE.md updated with session info
|
|
1048
1176
|
- User knows next steps
|
|
1177
|
+
- Checkpoint file written after each area completes (incremental save)
|
|
1178
|
+
- Interrupted sessions can be resumed from checkpoint (no re-answering completed areas)
|
|
1179
|
+
- Checkpoint file cleaned up after successful CONTEXT.md write
|
|
1180
|
+
- `--chain` triggers interactive discuss followed by auto plan+execute (no auto-answering)
|
|
1181
|
+
- `--chain` and `--auto` both persist chain flag and auto-advance to plan-phase
|
|
1049
1182
|
</success_criteria>
|