gsd-opencode 1.3.33 → 1.4.2
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/LICENSE +21 -0
- package/command/gsd/add-phase.md +3 -3
- package/command/gsd/add-todo.md +182 -0
- package/command/gsd/check-todos.md +217 -0
- package/command/gsd/complete-milestone.md +4 -3
- package/command/gsd/consider-issues.md +5 -5
- package/command/gsd/create-roadmap.md +4 -4
- package/command/gsd/debug.md +58 -0
- package/command/gsd/discuss-phase.md +3 -4
- package/command/gsd/execute-phase.md +137 -0
- package/command/gsd/execute-plan.md +70 -95
- package/command/gsd/help.md +83 -6
- package/command/gsd/insert-phase.md +16 -16
- package/command/gsd/list-phase-assumptions.md +8 -8
- package/command/gsd/map-codebase.md +11 -11
- package/command/gsd/new-milestone.md +1 -1
- package/command/gsd/new-project.md +26 -7
- package/command/gsd/pause-work.md +4 -3
- package/command/gsd/plan-fix.md +8 -8
- package/command/gsd/plan-phase.md +9 -9
- package/command/gsd/progress.md +20 -11
- package/command/gsd/remove-phase.md +15 -15
- package/command/gsd/research-phase.md +10 -10
- package/command/gsd/resume-work.md +4 -5
- package/command/gsd/status.md +127 -0
- package/command/gsd/verify-work.md +8 -8
- package/get-shit-done/references/continuation-format.md +8 -8
- package/get-shit-done/references/debugging/debugging-mindset.md +253 -0
- package/get-shit-done/references/debugging/hypothesis-testing.md +373 -0
- package/get-shit-done/references/debugging/investigation-techniques.md +337 -0
- package/get-shit-done/references/debugging/verification-patterns.md +425 -0
- package/get-shit-done/references/debugging/when-to-research.md +361 -0
- package/get-shit-done/references/plan-format.md +68 -21
- package/get-shit-done/references/questioning.md +12 -12
- package/get-shit-done/references/research-pitfalls.md +2 -2
- package/get-shit-done/references/scope-estimation.md +95 -11
- package/get-shit-done/templates/DEBUG.md +159 -0
- package/get-shit-done/templates/agent-history.md +263 -0
- package/get-shit-done/templates/checkpoint-return.md +204 -0
- package/get-shit-done/templates/codebase/architecture.md +4 -4
- package/get-shit-done/templates/codebase/concerns.md +1 -1
- package/get-shit-done/templates/codebase/structure.md +11 -11
- package/get-shit-done/templates/config.json +8 -0
- package/get-shit-done/templates/context.md +0 -21
- package/get-shit-done/templates/continuation-prompt.md +235 -0
- package/get-shit-done/templates/milestone-archive.md +1 -1
- package/get-shit-done/templates/phase-prompt.md +289 -129
- package/get-shit-done/templates/roadmap.md +1 -1
- package/get-shit-done/templates/state.md +11 -0
- package/get-shit-done/templates/subagent-task-prompt.md +95 -0
- package/get-shit-done/templates/summary.md +2 -2
- package/get-shit-done/workflows/_archive/execute-phase.md +899 -0
- package/get-shit-done/workflows/complete-milestone.md +1 -1
- package/get-shit-done/workflows/create-milestone.md +1 -1
- package/get-shit-done/workflows/create-roadmap.md +2 -2
- package/get-shit-done/workflows/debug.md +426 -0
- package/get-shit-done/workflows/discovery-phase.md +1 -1
- package/get-shit-done/workflows/discuss-milestone.md +6 -6
- package/get-shit-done/workflows/discuss-phase.md +12 -22
- package/get-shit-done/workflows/execute-phase.md +272 -1504
- package/get-shit-done/workflows/execute-plan.md +1813 -0
- package/get-shit-done/workflows/map-codebase.md +9 -9
- package/get-shit-done/workflows/plan-phase.md +262 -49
- package/get-shit-done/workflows/resume-project.md +28 -2
- package/get-shit-done/workflows/transition.md +4 -4
- package/get-shit-done/workflows/verify-work.md +4 -4
- package/package.json +1 -1
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
<purpose>
|
|
2
|
-
Execute a phase
|
|
2
|
+
Execute all plans in a phase using wave-based parallel execution. Orchestrator stays lean by delegating plan execution to subagents.
|
|
3
3
|
</purpose>
|
|
4
4
|
|
|
5
|
+
<core_principle>
|
|
6
|
+
The orchestrator's job is coordination, not execution. Each subagent loads the full execute-plan context itself. Orchestrator discovers plans, analyzes dependencies, groups into waves, spawns agents, handles checkpoints, collects results.
|
|
7
|
+
</core_principle>
|
|
8
|
+
|
|
5
9
|
<required_reading>
|
|
6
10
|
Read STATE.md before any operation to load project context.
|
|
7
11
|
</required_reading>
|
|
@@ -16,15 +20,12 @@ cat .planning/STATE.md 2>/dev/null
|
|
|
16
20
|
```
|
|
17
21
|
|
|
18
22
|
**If file exists:** Parse and internalize:
|
|
19
|
-
|
|
20
23
|
- Current position (phase, plan, status)
|
|
21
24
|
- Accumulated decisions (constraints on this execution)
|
|
22
25
|
- Deferred issues (context for deviations)
|
|
23
26
|
- Blockers/concerns (things to watch for)
|
|
24
|
-
- Brief alignment status
|
|
25
27
|
|
|
26
28
|
**If file missing but .planning/ exists:**
|
|
27
|
-
|
|
28
29
|
```
|
|
29
30
|
STATE.md missing but planning artifacts exist.
|
|
30
31
|
Options:
|
|
@@ -33,1593 +34,360 @@ Options:
|
|
|
33
34
|
```
|
|
34
35
|
|
|
35
36
|
**If .planning/ doesn't exist:** Error - project not initialized.
|
|
36
|
-
|
|
37
|
-
This ensures every execution has full project context.
|
|
38
37
|
</step>
|
|
39
38
|
|
|
40
|
-
<step name="
|
|
41
|
-
|
|
42
|
-
- Check roadmap for "In progress" phase
|
|
43
|
-
- Find plans in that phase directory
|
|
44
|
-
- Identify first plan without corresponding SUMMARY
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
cat .planning/ROADMAP.md
|
|
48
|
-
# Look for phase with "In progress" status
|
|
49
|
-
# Then find plans in that phase
|
|
50
|
-
ls .planning/phases/XX-name/*-PLAN.md 2>/dev/null | sort
|
|
51
|
-
ls .planning/phases/XX-name/*-SUMMARY.md 2>/dev/null | sort
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
**Logic:**
|
|
55
|
-
|
|
56
|
-
- If `01-01-PLAN.md` exists but `01-01-SUMMARY.md` doesn't → execute 01-01
|
|
57
|
-
- If `01-01-SUMMARY.md` exists but `01-02-SUMMARY.md` doesn't → execute 01-02
|
|
58
|
-
- Pattern: Find first PLAN file without matching SUMMARY file
|
|
59
|
-
|
|
60
|
-
**Decimal phase handling:**
|
|
61
|
-
|
|
62
|
-
Phase directories can be integer or decimal format:
|
|
63
|
-
|
|
64
|
-
- Integer: `.planning/phases/01-foundation/01-01-PLAN.md`
|
|
65
|
-
- Decimal: `.planning/phases/01.1-hotfix/01.1-01-PLAN.md`
|
|
66
|
-
|
|
67
|
-
Parse phase number from path (handles both formats):
|
|
39
|
+
<step name="validate_phase">
|
|
40
|
+
Confirm phase exists and has plans:
|
|
68
41
|
|
|
69
42
|
```bash
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
- Integer: `01-01-SUMMARY.md`
|
|
77
|
-
- Decimal: `01.1-01-SUMMARY.md`
|
|
78
|
-
|
|
79
|
-
Confirm with user if ambiguous.
|
|
80
|
-
|
|
81
|
-
<config-check>
|
|
82
|
-
```bash
|
|
83
|
-
cat .planning/config.json 2>/dev/null
|
|
84
|
-
```
|
|
85
|
-
</config-check>
|
|
86
|
-
|
|
87
|
-
<if mode="yolo">
|
|
88
|
-
```
|
|
89
|
-
⚡ Auto-approved: Execute {phase}-{plan}-PLAN.md
|
|
90
|
-
[Plan X of Y for Phase Z]
|
|
91
|
-
|
|
92
|
-
Starting execution...
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
Proceed directly to parse_segments step.
|
|
96
|
-
</if>
|
|
97
|
-
|
|
98
|
-
<if mode="interactive" OR="custom with gates.execute_next_plan true">
|
|
99
|
-
Present:
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
Found plan to execute: {phase}-{plan}-PLAN.md
|
|
103
|
-
[Plan X of Y for Phase Z]
|
|
104
|
-
|
|
105
|
-
Proceed with execution?
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
Wait for confirmation before proceeding.
|
|
109
|
-
</if>
|
|
110
|
-
</step>
|
|
111
|
-
|
|
112
|
-
<step name="record_start_time">
|
|
113
|
-
Record execution start time for performance tracking:
|
|
43
|
+
PHASE_DIR=$(ls -d .planning/phases/${PHASE_ARG}* 2>/dev/null | head -1)
|
|
44
|
+
if [ -z "$PHASE_DIR" ]; then
|
|
45
|
+
echo "ERROR: No phase directory matching '${PHASE_ARG}'"
|
|
46
|
+
exit 1
|
|
47
|
+
fi
|
|
114
48
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
49
|
+
PLAN_COUNT=$(ls -1 "$PHASE_DIR"/*-PLAN.md 2>/dev/null | wc -l | tr -d ' ')
|
|
50
|
+
if [ "$PLAN_COUNT" -eq 0 ]; then
|
|
51
|
+
echo "ERROR: No plans found in $PHASE_DIR"
|
|
52
|
+
exit 1
|
|
53
|
+
fi
|
|
118
54
|
```
|
|
119
55
|
|
|
120
|
-
|
|
56
|
+
Report: "Found {N} plans in {phase_dir}"
|
|
121
57
|
</step>
|
|
122
58
|
|
|
123
|
-
<step name="
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
Plans are divided into segments by checkpoints. Each segment is routed to optimal execution context (subagent or main).
|
|
127
|
-
|
|
128
|
-
**1. Check for checkpoints:**
|
|
59
|
+
<step name="discover_plans">
|
|
60
|
+
List all plans and extract metadata:
|
|
129
61
|
|
|
130
62
|
```bash
|
|
131
|
-
#
|
|
132
|
-
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
**2. Analyze execution strategy:**
|
|
136
|
-
|
|
137
|
-
**If NO checkpoints found:**
|
|
138
|
-
|
|
139
|
-
- **Fully autonomous plan** - spawn single subagent for entire plan
|
|
140
|
-
- Subagent gets fresh 200k context, executes all tasks, creates SUMMARY, commits
|
|
141
|
-
- Main context: Just orchestration (~5% usage)
|
|
142
|
-
|
|
143
|
-
**If checkpoints found, parse into segments:**
|
|
144
|
-
|
|
145
|
-
Segment = tasks between checkpoints (or start→first checkpoint, or last checkpoint→end)
|
|
146
|
-
|
|
147
|
-
**For each segment, determine routing:**
|
|
148
|
-
|
|
149
|
-
```
|
|
150
|
-
Segment routing rules:
|
|
151
|
-
|
|
152
|
-
IF segment has no prior checkpoint:
|
|
153
|
-
→ SUBAGENT (first segment, nothing to depend on)
|
|
154
|
-
|
|
155
|
-
IF segment follows checkpoint:human-verify:
|
|
156
|
-
→ SUBAGENT (verification is just confirmation, doesn't affect next work)
|
|
157
|
-
|
|
158
|
-
IF segment follows checkpoint:decision OR checkpoint:human-action:
|
|
159
|
-
→ MAIN CONTEXT (next tasks need the decision/result)
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
**3. Execution pattern:**
|
|
163
|
-
|
|
164
|
-
**Pattern A: Fully autonomous (no checkpoints)**
|
|
165
|
-
|
|
166
|
-
```
|
|
167
|
-
Spawn subagent → execute all tasks → SUMMARY → commit → report back
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
**Pattern B: Segmented with verify-only checkpoints**
|
|
171
|
-
|
|
172
|
-
```
|
|
173
|
-
Segment 1 (tasks 1-3): Spawn subagent → execute → report back
|
|
174
|
-
Checkpoint 4 (human-verify): Main context → you verify → continue
|
|
175
|
-
Segment 2 (tasks 5-6): Spawn NEW subagent → execute → report back
|
|
176
|
-
Checkpoint 7 (human-verify): Main context → you verify → continue
|
|
177
|
-
Aggregate results → SUMMARY → commit
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
**Pattern C: Decision-dependent (must stay in main)**
|
|
63
|
+
# Get all plans
|
|
64
|
+
ls -1 "$PHASE_DIR"/*-PLAN.md 2>/dev/null | sort
|
|
181
65
|
|
|
66
|
+
# Get completed plans (have SUMMARY.md)
|
|
67
|
+
ls -1 "$PHASE_DIR"/*-SUMMARY.md 2>/dev/null | sort
|
|
182
68
|
```
|
|
183
|
-
Checkpoint 1 (decision): Main context → you decide → continue in main
|
|
184
|
-
Tasks 2-5: Main context (need decision from checkpoint 1)
|
|
185
|
-
No segmentation benefit - execute entirely in main
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
**4. Why this works:**
|
|
189
|
-
|
|
190
|
-
**Segmentation benefits:**
|
|
191
|
-
|
|
192
|
-
- Fresh context for each autonomous segment (0% start every time)
|
|
193
|
-
- Main context only for checkpoints (~10-20% total)
|
|
194
|
-
- Can handle 10+ task plans if properly segmented
|
|
195
|
-
- Quality impossible to degrade in autonomous segments
|
|
196
|
-
|
|
197
|
-
**When segmentation provides no benefit:**
|
|
198
|
-
|
|
199
|
-
- Checkpoint is decision/human-action and following tasks depend on outcome
|
|
200
|
-
- Better to execute sequentially in main than break flow
|
|
201
|
-
|
|
202
|
-
**5. Implementation:**
|
|
203
|
-
|
|
204
|
-
**For fully autonomous plans:**
|
|
205
|
-
|
|
206
|
-
```
|
|
207
|
-
Use Task tool with subagent_type="general-purpose":
|
|
208
|
-
|
|
209
|
-
Prompt: "Execute plan at .planning/phases/{phase}-{plan}-PLAN.md
|
|
210
|
-
|
|
211
|
-
This is an autonomous plan (no checkpoints). Execute all tasks, create SUMMARY.md in phase directory, commit with message following plan's commit guidance.
|
|
212
|
-
|
|
213
|
-
Follow all deviation rules and authentication gate protocols from the plan.
|
|
214
|
-
|
|
215
|
-
When complete, report: plan name, tasks completed, SUMMARY path, commit hash."
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
**For segmented plans (has verify-only checkpoints):**
|
|
219
|
-
|
|
220
|
-
```
|
|
221
|
-
Execute segment-by-segment:
|
|
222
|
-
|
|
223
|
-
For each autonomous segment:
|
|
224
|
-
Spawn subagent with prompt: "Execute tasks [X-Y] from plan at .planning/phases/{phase}-{plan}-PLAN.md. Read the plan for full context and deviation rules. Do NOT create SUMMARY or commit - just execute these tasks and report results."
|
|
225
|
-
|
|
226
|
-
Wait for subagent completion
|
|
227
|
-
|
|
228
|
-
For each checkpoint:
|
|
229
|
-
Execute in main context
|
|
230
|
-
Wait for user interaction
|
|
231
|
-
Continue to next segment
|
|
232
|
-
|
|
233
|
-
After all segments complete:
|
|
234
|
-
Aggregate all results
|
|
235
|
-
Create SUMMARY.md
|
|
236
|
-
Commit with all changes
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
**For decision-dependent plans:**
|
|
240
|
-
|
|
241
|
-
```
|
|
242
|
-
Execute in main context (standard flow below)
|
|
243
|
-
No subagent routing
|
|
244
|
-
Quality maintained through small scope (2-3 tasks per plan)
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
See step name="segment_execution" for detailed segment execution loop.
|
|
248
|
-
</step>
|
|
249
|
-
|
|
250
|
-
<step name="segment_execution">
|
|
251
|
-
**Detailed segment execution loop for segmented plans.**
|
|
252
|
-
|
|
253
|
-
**This step applies ONLY to segmented plans (Pattern B: has checkpoints, but they're verify-only).**
|
|
254
69
|
|
|
255
|
-
For
|
|
70
|
+
For each plan, read frontmatter to extract:
|
|
71
|
+
- `wave: N` - Execution wave (pre-computed)
|
|
72
|
+
- `autonomous: true/false` - Whether plan has checkpoints
|
|
256
73
|
|
|
257
|
-
|
|
74
|
+
Build plan inventory:
|
|
75
|
+
- Plan path
|
|
76
|
+
- Plan ID (e.g., "03-01")
|
|
77
|
+
- Wave number
|
|
78
|
+
- Autonomous flag
|
|
79
|
+
- Completion status (SUMMARY exists = complete)
|
|
258
80
|
|
|
259
|
-
|
|
260
|
-
1. Parse plan to identify segments:
|
|
261
|
-
- Read plan file
|
|
262
|
-
- Find checkpoint locations: grep -n "type=\"checkpoint" PLAN.md
|
|
263
|
-
- Identify checkpoint types: grep "type=\"checkpoint" PLAN.md | grep -o 'checkpoint:[^"]*'
|
|
264
|
-
- Build segment map:
|
|
265
|
-
* Segment 1: Start → first checkpoint (tasks 1-X)
|
|
266
|
-
* Checkpoint 1: Type and location
|
|
267
|
-
* Segment 2: After checkpoint 1 → next checkpoint (tasks X+1 to Y)
|
|
268
|
-
* Checkpoint 2: Type and location
|
|
269
|
-
* ... continue for all segments
|
|
270
|
-
|
|
271
|
-
2. For each segment in order:
|
|
272
|
-
|
|
273
|
-
A. Determine routing (apply rules from parse_segments):
|
|
274
|
-
- No prior checkpoint? → Subagent
|
|
275
|
-
- Prior checkpoint was human-verify? → Subagent
|
|
276
|
-
- Prior checkpoint was decision/human-action? → Main context
|
|
277
|
-
|
|
278
|
-
B. If routing = Subagent:
|
|
279
|
-
```
|
|
280
|
-
Spawn Task tool with subagent_type="general-purpose":
|
|
281
|
-
|
|
282
|
-
Prompt: "Execute tasks [task numbers/names] from plan at [plan path].
|
|
283
|
-
|
|
284
|
-
**Context:**
|
|
285
|
-
- Read the full plan for objective, context files, and deviation rules
|
|
286
|
-
- You are executing a SEGMENT of this plan (not the full plan)
|
|
287
|
-
- Other segments will be executed separately
|
|
288
|
-
|
|
289
|
-
**Your responsibilities:**
|
|
290
|
-
- Execute only the tasks assigned to you
|
|
291
|
-
- Follow all deviation rules and authentication gate protocols
|
|
292
|
-
- Track deviations for later Summary
|
|
293
|
-
- DO NOT create SUMMARY.md (will be created after all segments complete)
|
|
294
|
-
- DO NOT commit (will be done after all segments complete)
|
|
295
|
-
|
|
296
|
-
**Report back:**
|
|
297
|
-
- Tasks completed
|
|
298
|
-
- Files created/modified
|
|
299
|
-
- Deviations encountered
|
|
300
|
-
- Any issues or blockers"
|
|
301
|
-
|
|
302
|
-
Wait for subagent to complete
|
|
303
|
-
Capture results (files changed, deviations, etc.)
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
C. If routing = Main context:
|
|
307
|
-
Execute tasks in main using standard execution flow (step name="execute")
|
|
308
|
-
Track results locally
|
|
309
|
-
|
|
310
|
-
D. After segment completes (whether subagent or main):
|
|
311
|
-
Continue to next checkpoint/segment
|
|
312
|
-
|
|
313
|
-
3. After ALL segments complete:
|
|
314
|
-
|
|
315
|
-
A. Aggregate results from all segments:
|
|
316
|
-
- Collect files created/modified from all segments
|
|
317
|
-
- Collect deviations from all segments
|
|
318
|
-
- Collect decisions from all checkpoints
|
|
319
|
-
- Merge into complete picture
|
|
320
|
-
|
|
321
|
-
B. Create SUMMARY.md:
|
|
322
|
-
- Use aggregated results
|
|
323
|
-
- Document all work from all segments
|
|
324
|
-
- Include deviations from all segments
|
|
325
|
-
- Note which segments were subagented
|
|
326
|
-
|
|
327
|
-
C. Commit:
|
|
328
|
-
- Stage all files from all segments
|
|
329
|
-
- Stage SUMMARY.md
|
|
330
|
-
- Commit with message following plan guidance
|
|
331
|
-
- Include note about segmented execution if relevant
|
|
332
|
-
|
|
333
|
-
D. Report completion
|
|
334
|
-
|
|
335
|
-
**Example execution trace:**
|
|
336
|
-
|
|
337
|
-
````
|
|
338
|
-
|
|
339
|
-
Plan: 01-02-PLAN.md (8 tasks, 2 verify checkpoints)
|
|
340
|
-
|
|
341
|
-
Parsing segments...
|
|
342
|
-
|
|
343
|
-
- Segment 1: Tasks 1-3 (autonomous)
|
|
344
|
-
- Checkpoint 4: human-verify
|
|
345
|
-
- Segment 2: Tasks 5-6 (autonomous)
|
|
346
|
-
- Checkpoint 7: human-verify
|
|
347
|
-
- Segment 3: Task 8 (autonomous)
|
|
348
|
-
|
|
349
|
-
Routing analysis:
|
|
350
|
-
|
|
351
|
-
- Segment 1: No prior checkpoint → SUBAGENT ✓
|
|
352
|
-
- Checkpoint 4: Verify only → MAIN (required)
|
|
353
|
-
- Segment 2: After verify → SUBAGENT ✓
|
|
354
|
-
- Checkpoint 7: Verify only → MAIN (required)
|
|
355
|
-
- Segment 3: After verify → SUBAGENT ✓
|
|
356
|
-
|
|
357
|
-
Execution:
|
|
358
|
-
[1] Spawning subagent for tasks 1-3...
|
|
359
|
-
→ Subagent completes: 3 files modified, 0 deviations
|
|
360
|
-
[2] Executing checkpoint 4 (human-verify)...
|
|
361
|
-
════════════════════════════════════════
|
|
362
|
-
CHECKPOINT: Verification Required
|
|
363
|
-
Task 4 of 8: Verify database schema
|
|
364
|
-
I built: User and Session tables with relations
|
|
365
|
-
How to verify: Check src/db/schema.ts for correct types
|
|
366
|
-
════════════════════════════════════════
|
|
367
|
-
User: "approved"
|
|
368
|
-
[3] Spawning subagent for tasks 5-6...
|
|
369
|
-
→ Subagent completes: 2 files modified, 1 deviation (added error handling)
|
|
370
|
-
[4] Executing checkpoint 7 (human-verify)...
|
|
371
|
-
User: "approved"
|
|
372
|
-
[5] Spawning subagent for task 8...
|
|
373
|
-
→ Subagent completes: 1 file modified, 0 deviations
|
|
374
|
-
|
|
375
|
-
Aggregating results...
|
|
376
|
-
|
|
377
|
-
- Total files: 6 modified
|
|
378
|
-
- Total deviations: 1
|
|
379
|
-
- Segmented execution: 3 subagents, 2 checkpoints
|
|
380
|
-
|
|
381
|
-
Creating SUMMARY.md...
|
|
382
|
-
Committing...
|
|
383
|
-
✓ Complete
|
|
384
|
-
|
|
385
|
-
````
|
|
386
|
-
|
|
387
|
-
**Benefits of this pattern:**
|
|
388
|
-
- Main context usage: ~20% (just orchestration + checkpoints)
|
|
389
|
-
- Subagent 1: Fresh 0-30% (tasks 1-3)
|
|
390
|
-
- Subagent 2: Fresh 0-30% (tasks 5-6)
|
|
391
|
-
- Subagent 3: Fresh 0-20% (task 8)
|
|
392
|
-
- All autonomous work: Peak quality
|
|
393
|
-
- Can handle large plans with many tasks if properly segmented
|
|
394
|
-
|
|
395
|
-
**When NOT to use segmentation:**
|
|
396
|
-
- Plan has decision/human-action checkpoints that affect following tasks
|
|
397
|
-
- Following tasks depend on checkpoint outcome
|
|
398
|
-
- Better to execute in main sequentially in those cases
|
|
81
|
+
Skip completed plans. If all complete, report "Phase already executed" and exit.
|
|
399
82
|
</step>
|
|
400
83
|
|
|
401
|
-
<step name="
|
|
402
|
-
Read
|
|
403
|
-
```bash
|
|
404
|
-
cat .planning/phases/XX-name/{phase}-{plan}-PLAN.md
|
|
405
|
-
````
|
|
406
|
-
|
|
407
|
-
This IS the execution instructions. Follow it exactly.
|
|
408
|
-
|
|
409
|
-
**If plan references CONTEXT.md:**
|
|
410
|
-
The CONTEXT.md file provides the user's vision for this phase — how they imagine it working, what's essential, and what's out of scope. Honor this context throughout execution.
|
|
411
|
-
</step>
|
|
412
|
-
|
|
413
|
-
<step name="previous_phase_check">
|
|
414
|
-
Before executing, check if previous phase had issues:
|
|
415
|
-
|
|
416
|
-
```bash
|
|
417
|
-
# Find previous phase summary
|
|
418
|
-
ls .planning/phases/*/SUMMARY.md 2>/dev/null | sort -r | head -2 | tail -1
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
If previous phase SUMMARY.md has "Issues Encountered" != "None" or "Next Phase Readiness" mentions blockers:
|
|
422
|
-
|
|
423
|
-
Use AskUserQuestion:
|
|
424
|
-
|
|
425
|
-
- header: "Previous Issues"
|
|
426
|
-
- question: "Previous phase had unresolved items: [summary]. How to proceed?"
|
|
427
|
-
- options:
|
|
428
|
-
- "Proceed anyway" - Issues won't block this phase
|
|
429
|
-
- "Address first" - Let's resolve before continuing
|
|
430
|
-
- "Review previous" - Show me the full summary
|
|
431
|
-
</step>
|
|
432
|
-
|
|
433
|
-
<step name="execute">
|
|
434
|
-
Execute each task in the prompt. **Deviations are normal** - handle them automatically using embedded rules below.
|
|
435
|
-
|
|
436
|
-
1. Read the @context files listed in the prompt
|
|
437
|
-
|
|
438
|
-
2. For each task:
|
|
439
|
-
|
|
440
|
-
**If `type="auto"`:**
|
|
441
|
-
|
|
442
|
-
**Before executing:** Check if task has `tdd="true"` attribute:
|
|
443
|
-
- If yes: Follow TDD execution flow (see `<tdd_execution>`) - RED → GREEN → REFACTOR cycle with atomic commits per stage
|
|
444
|
-
- If no: Standard implementation
|
|
445
|
-
|
|
446
|
-
- Work toward task completion
|
|
447
|
-
- **If CLI/API returns authentication error:** Handle as authentication gate (see below)
|
|
448
|
-
- **When you discover additional work not in plan:** Apply deviation rules (see below) automatically
|
|
449
|
-
- Continue implementing, applying rules as needed
|
|
450
|
-
- Run the verification
|
|
451
|
-
- Confirm done criteria met
|
|
452
|
-
- **Commit the task** (see `<task_commit>` below)
|
|
453
|
-
- Track task completion and commit hash for Summary documentation
|
|
454
|
-
- Continue to next task
|
|
455
|
-
|
|
456
|
-
**If `type="checkpoint:*"`:**
|
|
457
|
-
|
|
458
|
-
- STOP immediately (do not continue to next task)
|
|
459
|
-
- Execute checkpoint_protocol (see below)
|
|
460
|
-
- Wait for user response
|
|
461
|
-
- Verify if possible (check files, env vars, etc.)
|
|
462
|
-
- Only after user confirmation: continue to next task
|
|
463
|
-
|
|
464
|
-
3. Run overall verification checks from `<verification>` section
|
|
465
|
-
4. Confirm all success criteria from `<success_criteria>` section met
|
|
466
|
-
5. Document all deviations in Summary (automatic - see deviation_documentation below)
|
|
467
|
-
</step>
|
|
468
|
-
|
|
469
|
-
<authentication_gates>
|
|
470
|
-
|
|
471
|
-
## Handling Authentication Errors During Execution
|
|
472
|
-
|
|
473
|
-
**When you encounter authentication errors during `type="auto"` task execution:**
|
|
474
|
-
|
|
475
|
-
This is NOT a failure. Authentication gates are expected and normal. Handle them dynamically:
|
|
476
|
-
|
|
477
|
-
**Authentication error indicators:**
|
|
478
|
-
|
|
479
|
-
- CLI returns: "Error: Not authenticated", "Not logged in", "Unauthorized", "401", "403"
|
|
480
|
-
- API returns: "Authentication required", "Invalid API key", "Missing credentials"
|
|
481
|
-
- Command fails with: "Please run {tool} login" or "Set {ENV_VAR} environment variable"
|
|
482
|
-
|
|
483
|
-
**Authentication gate protocol:**
|
|
484
|
-
|
|
485
|
-
1. **Recognize it's an auth gate** - Not a bug, just needs credentials
|
|
486
|
-
2. **STOP current task execution** - Don't retry repeatedly
|
|
487
|
-
3. **Create dynamic checkpoint:human-action** - Present it to user immediately
|
|
488
|
-
4. **Provide exact authentication steps** - CLI commands, where to get keys
|
|
489
|
-
5. **Wait for user to authenticate** - Let them complete auth flow
|
|
490
|
-
6. **Verify authentication works** - Test that credentials are valid
|
|
491
|
-
7. **Retry the original task** - Resume automation where you left off
|
|
492
|
-
8. **Continue normally** - Don't treat this as an error in Summary
|
|
493
|
-
|
|
494
|
-
**Example: Vercel deployment hits auth error**
|
|
495
|
-
|
|
496
|
-
```
|
|
497
|
-
Task 3: Deploy to Vercel
|
|
498
|
-
Running: vercel --yes
|
|
499
|
-
|
|
500
|
-
Error: Not authenticated. Please run 'vercel login'
|
|
501
|
-
|
|
502
|
-
[Create checkpoint dynamically]
|
|
503
|
-
|
|
504
|
-
════════════════════════════════════════
|
|
505
|
-
CHECKPOINT: Authentication Required
|
|
506
|
-
════════════════════════════════════════
|
|
507
|
-
|
|
508
|
-
Task 3 of 8: Authenticate Vercel CLI
|
|
509
|
-
|
|
510
|
-
I tried to deploy but got authentication error.
|
|
511
|
-
|
|
512
|
-
What you need to do:
|
|
513
|
-
Run: vercel login
|
|
514
|
-
|
|
515
|
-
This will open your browser - complete the authentication flow.
|
|
516
|
-
|
|
517
|
-
I'll verify after: vercel whoami returns your account
|
|
518
|
-
|
|
519
|
-
Type "done" when authenticated
|
|
520
|
-
════════════════════════════════════════
|
|
521
|
-
|
|
522
|
-
[Wait for user response]
|
|
523
|
-
|
|
524
|
-
[User types "done"]
|
|
525
|
-
|
|
526
|
-
Verifying authentication...
|
|
527
|
-
Running: vercel whoami
|
|
528
|
-
✓ Authenticated as: user@example.com
|
|
529
|
-
|
|
530
|
-
Retrying deployment...
|
|
531
|
-
Running: vercel --yes
|
|
532
|
-
✓ Deployed to: https://myapp-abc123.vercel.app
|
|
533
|
-
|
|
534
|
-
Task 3 complete. Continuing to task 4...
|
|
535
|
-
```
|
|
536
|
-
|
|
537
|
-
**In Summary documentation:**
|
|
538
|
-
|
|
539
|
-
Document authentication gates as normal flow, not deviations:
|
|
540
|
-
|
|
541
|
-
```markdown
|
|
542
|
-
## Authentication Gates
|
|
543
|
-
|
|
544
|
-
During execution, I encountered authentication requirements:
|
|
545
|
-
|
|
546
|
-
1. Task 3: Vercel CLI required authentication
|
|
547
|
-
- Paused for `vercel login`
|
|
548
|
-
- Resumed after authentication
|
|
549
|
-
- Deployed successfully
|
|
550
|
-
|
|
551
|
-
These are normal gates, not errors.
|
|
552
|
-
```
|
|
553
|
-
|
|
554
|
-
**Key principles:**
|
|
555
|
-
|
|
556
|
-
- Authentication gates are NOT failures or bugs
|
|
557
|
-
- They're expected interaction points during first-time setup
|
|
558
|
-
- Handle them gracefully and continue automation after unblocked
|
|
559
|
-
- Don't mark tasks as "failed" or "incomplete" due to auth gates
|
|
560
|
-
- Document them as normal flow, separate from deviations
|
|
561
|
-
</authentication_gates>
|
|
562
|
-
|
|
563
|
-
<deviation_rules>
|
|
564
|
-
|
|
565
|
-
## Automatic Deviation Handling
|
|
566
|
-
|
|
567
|
-
**While executing tasks, you WILL discover work not in the plan.** This is normal.
|
|
568
|
-
|
|
569
|
-
Apply these rules automatically. Track all deviations for Summary documentation.
|
|
570
|
-
|
|
571
|
-
---
|
|
572
|
-
|
|
573
|
-
**RULE 1: Auto-fix bugs**
|
|
574
|
-
|
|
575
|
-
**Trigger:** Code doesn't work as intended (broken behavior, incorrect output, errors)
|
|
576
|
-
|
|
577
|
-
**Action:** Fix immediately, track for Summary
|
|
578
|
-
|
|
579
|
-
**Examples:**
|
|
580
|
-
|
|
581
|
-
- Wrong SQL query returning incorrect data
|
|
582
|
-
- Logic errors (inverted condition, off-by-one, infinite loop)
|
|
583
|
-
- Type errors, null pointer exceptions, undefined references
|
|
584
|
-
- Broken validation (accepts invalid input, rejects valid input)
|
|
585
|
-
- Security vulnerabilities (SQL injection, XSS, CSRF, insecure auth)
|
|
586
|
-
- Race conditions, deadlocks
|
|
587
|
-
- Memory leaks, resource leaks
|
|
588
|
-
|
|
589
|
-
**Process:**
|
|
590
|
-
|
|
591
|
-
1. Fix the bug inline
|
|
592
|
-
2. Add/update tests to prevent regression
|
|
593
|
-
3. Verify fix works
|
|
594
|
-
4. Continue task
|
|
595
|
-
5. Track in deviations list: `[Rule 1 - Bug] [description]`
|
|
596
|
-
|
|
597
|
-
**No user permission needed.** Bugs must be fixed for correct operation.
|
|
598
|
-
|
|
599
|
-
---
|
|
600
|
-
|
|
601
|
-
**RULE 2: Auto-add missing critical functionality**
|
|
602
|
-
|
|
603
|
-
**Trigger:** Code is missing essential features for correctness, security, or basic operation
|
|
604
|
-
|
|
605
|
-
**Action:** Add immediately, track for Summary
|
|
606
|
-
|
|
607
|
-
**Examples:**
|
|
608
|
-
|
|
609
|
-
- Missing error handling (no try/catch, unhandled promise rejections)
|
|
610
|
-
- No input validation (accepts malicious data, type coercion issues)
|
|
611
|
-
- Missing null/undefined checks (crashes on edge cases)
|
|
612
|
-
- No authentication on protected routes
|
|
613
|
-
- Missing authorization checks (users can access others' data)
|
|
614
|
-
- No CSRF protection, missing CORS configuration
|
|
615
|
-
- No rate limiting on public APIs
|
|
616
|
-
- Missing required database indexes (causes timeouts)
|
|
617
|
-
- No logging for errors (can't debug production)
|
|
618
|
-
|
|
619
|
-
**Process:**
|
|
620
|
-
|
|
621
|
-
1. Add the missing functionality inline
|
|
622
|
-
2. Add tests for the new functionality
|
|
623
|
-
3. Verify it works
|
|
624
|
-
4. Continue task
|
|
625
|
-
5. Track in deviations list: `[Rule 2 - Missing Critical] [description]`
|
|
626
|
-
|
|
627
|
-
**Critical = required for correct/secure/performant operation**
|
|
628
|
-
**No user permission needed.** These are not "features" - they're requirements for basic correctness.
|
|
629
|
-
|
|
630
|
-
---
|
|
631
|
-
|
|
632
|
-
**RULE 3: Auto-fix blocking issues**
|
|
633
|
-
|
|
634
|
-
**Trigger:** Something prevents you from completing current task
|
|
635
|
-
|
|
636
|
-
**Action:** Fix immediately to unblock, track for Summary
|
|
637
|
-
|
|
638
|
-
**Examples:**
|
|
639
|
-
|
|
640
|
-
- Missing dependency (package not installed, import fails)
|
|
641
|
-
- Wrong types blocking compilation
|
|
642
|
-
- Broken import paths (file moved, wrong relative path)
|
|
643
|
-
- Missing environment variable (app won't start)
|
|
644
|
-
- Database connection config error
|
|
645
|
-
- Build configuration error (webpack, tsconfig, etc.)
|
|
646
|
-
- Missing file referenced in code
|
|
647
|
-
- Circular dependency blocking module resolution
|
|
648
|
-
|
|
649
|
-
**Process:**
|
|
650
|
-
|
|
651
|
-
1. Fix the blocking issue
|
|
652
|
-
2. Verify task can now proceed
|
|
653
|
-
3. Continue task
|
|
654
|
-
4. Track in deviations list: `[Rule 3 - Blocking] [description]`
|
|
655
|
-
|
|
656
|
-
**No user permission needed.** Can't complete task without fixing blocker.
|
|
657
|
-
|
|
658
|
-
---
|
|
659
|
-
|
|
660
|
-
**RULE 4: Ask about architectural changes**
|
|
661
|
-
|
|
662
|
-
**Trigger:** Fix/addition requires significant structural modification
|
|
663
|
-
|
|
664
|
-
**Action:** STOP, present to user, wait for decision
|
|
665
|
-
|
|
666
|
-
**Examples:**
|
|
667
|
-
|
|
668
|
-
- Adding new database table (not just column)
|
|
669
|
-
- Major schema changes (changing primary key, splitting tables)
|
|
670
|
-
- Introducing new service layer or architectural pattern
|
|
671
|
-
- Switching libraries/frameworks (React → Vue, REST → GraphQL)
|
|
672
|
-
- Changing authentication approach (sessions → JWT)
|
|
673
|
-
- Adding new infrastructure (message queue, cache layer, CDN)
|
|
674
|
-
- Changing API contracts (breaking changes to endpoints)
|
|
675
|
-
- Adding new deployment environment
|
|
676
|
-
|
|
677
|
-
**Process:**
|
|
678
|
-
|
|
679
|
-
1. STOP current task
|
|
680
|
-
2. Present clearly:
|
|
681
|
-
|
|
682
|
-
```
|
|
683
|
-
⚠️ Architectural Decision Needed
|
|
684
|
-
|
|
685
|
-
Current task: [task name]
|
|
686
|
-
Discovery: [what you found that prompted this]
|
|
687
|
-
Proposed change: [architectural modification]
|
|
688
|
-
Why needed: [rationale]
|
|
689
|
-
Impact: [what this affects - APIs, deployment, dependencies, etc.]
|
|
690
|
-
Alternatives: [other approaches, or "none apparent"]
|
|
691
|
-
|
|
692
|
-
Proceed with proposed change? (yes / different approach / defer)
|
|
693
|
-
```
|
|
694
|
-
|
|
695
|
-
3. WAIT for user response
|
|
696
|
-
4. If approved: implement, track as `[Rule 4 - Architectural] [description]`
|
|
697
|
-
5. If different approach: discuss and implement
|
|
698
|
-
6. If deferred: log to ISSUES.md, continue without change
|
|
699
|
-
|
|
700
|
-
**User decision required.** These changes affect system design.
|
|
701
|
-
|
|
702
|
-
---
|
|
703
|
-
|
|
704
|
-
**RULE 5: Log non-critical enhancements**
|
|
705
|
-
|
|
706
|
-
**Trigger:** Improvement that would enhance code but isn't essential now
|
|
707
|
-
|
|
708
|
-
**Action:** Add to .planning/ISSUES.md automatically, continue task
|
|
709
|
-
|
|
710
|
-
**Examples:**
|
|
711
|
-
|
|
712
|
-
- Performance optimization (works correctly, just slower than ideal)
|
|
713
|
-
- Code refactoring (works, but could be cleaner/DRY-er)
|
|
714
|
-
- Better naming (works, but variables could be clearer)
|
|
715
|
-
- Organizational improvements (works, but file structure could be better)
|
|
716
|
-
- Nice-to-have UX improvements (works, but could be smoother)
|
|
717
|
-
- Additional test coverage beyond basics (basics exist, could be more thorough)
|
|
718
|
-
- Documentation improvements (code works, docs could be better)
|
|
719
|
-
- Accessibility enhancements beyond minimum
|
|
720
|
-
|
|
721
|
-
**Process:**
|
|
722
|
-
|
|
723
|
-
1. Create .planning/ISSUES.md if doesn't exist (use `~/.config/opencode/get-shit-done/templates/issues.md`)
|
|
724
|
-
2. Add entry with ISS-XXX number (auto-increment)
|
|
725
|
-
3. Brief notification: `📋 Logged enhancement: [brief] (ISS-XXX)`
|
|
726
|
-
4. Continue task without implementing
|
|
727
|
-
|
|
728
|
-
**No user permission needed.** Logging for future consideration.
|
|
729
|
-
|
|
730
|
-
---
|
|
731
|
-
|
|
732
|
-
**RULE PRIORITY (when multiple could apply):**
|
|
733
|
-
|
|
734
|
-
1. **If Rule 4 applies** → STOP and ask (architectural decision)
|
|
735
|
-
2. **If Rules 1-3 apply** → Fix automatically, track for Summary
|
|
736
|
-
3. **If Rule 5 applies** → Log to ISSUES.md, continue
|
|
737
|
-
4. **If genuinely unsure which rule** → Apply Rule 4 (ask user)
|
|
738
|
-
|
|
739
|
-
**Edge case guidance:**
|
|
740
|
-
|
|
741
|
-
- "This validation is missing" → Rule 2 (critical for security)
|
|
742
|
-
- "This validation could be better" → Rule 5 (enhancement)
|
|
743
|
-
- "This crashes on null" → Rule 1 (bug)
|
|
744
|
-
- "This could be faster" → Rule 5 (enhancement) UNLESS actually timing out → Rule 2 (critical)
|
|
745
|
-
- "Need to add table" → Rule 4 (architectural)
|
|
746
|
-
- "Need to add column" → Rule 1 or 2 (depends: fixing bug or adding critical field)
|
|
747
|
-
|
|
748
|
-
**When in doubt:** Ask yourself "Does this affect correctness, security, or ability to complete task?"
|
|
749
|
-
|
|
750
|
-
- YES → Rules 1-3 (fix automatically)
|
|
751
|
-
- NO → Rule 5 (log it)
|
|
752
|
-
- MAYBE → Rule 4 (ask user)
|
|
753
|
-
|
|
754
|
-
</deviation_rules>
|
|
755
|
-
|
|
756
|
-
<deviation_documentation>
|
|
757
|
-
|
|
758
|
-
## Documenting Deviations in Summary
|
|
759
|
-
|
|
760
|
-
After all tasks complete, Summary MUST include deviations section.
|
|
761
|
-
|
|
762
|
-
**If no deviations:**
|
|
763
|
-
|
|
764
|
-
```markdown
|
|
765
|
-
## Deviations from Plan
|
|
766
|
-
|
|
767
|
-
None - plan executed exactly as written.
|
|
768
|
-
```
|
|
769
|
-
|
|
770
|
-
**If deviations occurred:**
|
|
771
|
-
|
|
772
|
-
```markdown
|
|
773
|
-
## Deviations from Plan
|
|
774
|
-
|
|
775
|
-
### Auto-fixed Issues
|
|
776
|
-
|
|
777
|
-
**1. [Rule 1 - Bug] Fixed case-sensitive email uniqueness constraint**
|
|
778
|
-
|
|
779
|
-
- **Found during:** Task 4 (Follow/unfollow API implementation)
|
|
780
|
-
- **Issue:** User.email unique constraint was case-sensitive - Test@example.com and test@example.com were both allowed, causing duplicate accounts
|
|
781
|
-
- **Fix:** Changed to `CREATE UNIQUE INDEX users_email_unique ON users (LOWER(email))`
|
|
782
|
-
- **Files modified:** src/models/User.ts, migrations/003_fix_email_unique.sql
|
|
783
|
-
- **Verification:** Unique constraint test passes - duplicate emails properly rejected
|
|
784
|
-
- **Commit:** abc123f
|
|
785
|
-
|
|
786
|
-
**2. [Rule 2 - Missing Critical] Added JWT expiry validation to auth middleware**
|
|
787
|
-
|
|
788
|
-
- **Found during:** Task 3 (Protected route implementation)
|
|
789
|
-
- **Issue:** Auth middleware wasn't checking token expiry - expired tokens were being accepted
|
|
790
|
-
- **Fix:** Added exp claim validation in middleware, reject with 401 if expired
|
|
791
|
-
- **Files modified:** src/middleware/auth.ts, src/middleware/auth.test.ts
|
|
792
|
-
- **Verification:** Expired token test passes - properly rejects with 401
|
|
793
|
-
- **Commit:** def456g
|
|
794
|
-
|
|
795
|
-
### Deferred Enhancements
|
|
796
|
-
|
|
797
|
-
Logged to .planning/ISSUES.md for future consideration:
|
|
798
|
-
|
|
799
|
-
- ISS-001: Refactor UserService into smaller modules (discovered in Task 3)
|
|
800
|
-
- ISS-002: Add connection pooling for Redis (discovered in Task 6)
|
|
801
|
-
|
|
802
|
-
---
|
|
803
|
-
|
|
804
|
-
**Total deviations:** 4 auto-fixed (1 bug, 1 missing critical, 1 blocking, 1 architectural with approval), 3 deferred
|
|
805
|
-
**Impact on plan:** All auto-fixes necessary for correctness/security/performance. No scope creep.
|
|
806
|
-
```
|
|
807
|
-
|
|
808
|
-
**This provides complete transparency:**
|
|
809
|
-
|
|
810
|
-
- Every deviation documented
|
|
811
|
-
- Why it was needed
|
|
812
|
-
- What rule applied
|
|
813
|
-
- What was done
|
|
814
|
-
- User can see exactly what happened beyond the plan
|
|
815
|
-
|
|
816
|
-
</deviation_documentation>
|
|
817
|
-
|
|
818
|
-
<tdd_plan_execution>
|
|
819
|
-
## TDD Plan Execution
|
|
820
|
-
|
|
821
|
-
When executing a plan with `type: tdd` in frontmatter, follow the RED-GREEN-REFACTOR cycle for the single feature defined in the plan.
|
|
822
|
-
|
|
823
|
-
**1. Check test infrastructure (if first TDD plan):**
|
|
824
|
-
If no test framework configured:
|
|
825
|
-
- Detect project type from package.json/requirements.txt/etc.
|
|
826
|
-
- Install minimal test framework (Jest, pytest, Go testing, etc.)
|
|
827
|
-
- Create test config file
|
|
828
|
-
- Verify: run empty test suite
|
|
829
|
-
- This is part of the RED phase, not a separate task
|
|
830
|
-
|
|
831
|
-
**2. RED - Write failing test:**
|
|
832
|
-
- Read `<behavior>` element for test specification
|
|
833
|
-
- Create test file if doesn't exist (follow project conventions)
|
|
834
|
-
- Write test(s) that describe expected behavior
|
|
835
|
-
- Run tests - MUST fail (if passes, test is wrong or feature exists)
|
|
836
|
-
- Commit: `test({phase}-{plan}): add failing test for [feature]`
|
|
837
|
-
|
|
838
|
-
**3. GREEN - Implement to pass:**
|
|
839
|
-
- Read `<implementation>` element for guidance
|
|
840
|
-
- Write minimal code to make test pass
|
|
841
|
-
- Run tests - MUST pass
|
|
842
|
-
- Commit: `feat({phase}-{plan}): implement [feature]`
|
|
843
|
-
|
|
844
|
-
**4. REFACTOR (if needed):**
|
|
845
|
-
- Clean up code if obvious improvements
|
|
846
|
-
- Run tests - MUST still pass
|
|
847
|
-
- Commit only if changes made: `refactor({phase}-{plan}): clean up [feature]`
|
|
848
|
-
|
|
849
|
-
**Commit pattern for TDD plans:**
|
|
850
|
-
Each TDD plan produces 2-3 atomic commits:
|
|
851
|
-
1. `test({phase}-{plan}): add failing test for X`
|
|
852
|
-
2. `feat({phase}-{plan}): implement X`
|
|
853
|
-
3. `refactor({phase}-{plan}): clean up X` (optional)
|
|
854
|
-
|
|
855
|
-
**Error handling:**
|
|
856
|
-
- If test doesn't fail in RED phase: Test is wrong or feature already exists. Investigate before proceeding.
|
|
857
|
-
- If test doesn't pass in GREEN phase: Debug implementation, keep iterating until green.
|
|
858
|
-
- If tests fail in REFACTOR phase: Undo refactor, commit was premature.
|
|
859
|
-
|
|
860
|
-
**Verification:**
|
|
861
|
-
After TDD plan completion, ensure:
|
|
862
|
-
- All tests pass
|
|
863
|
-
- Test coverage for the new behavior exists
|
|
864
|
-
- No unrelated tests broken
|
|
865
|
-
|
|
866
|
-
**Why TDD uses dedicated plans:** TDD requires 2-3 execution cycles (RED → GREEN → REFACTOR), each with file reads, test runs, and potential debugging. This consumes 40-50% of context for a single feature. Dedicated plans ensure full quality throughout the cycle.
|
|
867
|
-
|
|
868
|
-
**Comparison:**
|
|
869
|
-
- Standard plans: Multiple tasks, 1 commit per task, 2-4 commits total
|
|
870
|
-
- TDD plans: Single feature, 2-3 commits for RED/GREEN/REFACTOR cycle
|
|
871
|
-
|
|
872
|
-
See `~/.config/opencode/get-shit-done/references/tdd.md` for TDD plan structure.
|
|
873
|
-
</tdd_plan_execution>
|
|
874
|
-
|
|
875
|
-
<task_commit>
|
|
876
|
-
## Task Commit Protocol
|
|
877
|
-
|
|
878
|
-
After each task completes (verification passed, done criteria met), commit immediately:
|
|
879
|
-
|
|
880
|
-
**1. Identify modified files:**
|
|
881
|
-
|
|
882
|
-
Track files changed during this specific task (not the entire plan):
|
|
84
|
+
<step name="group_by_wave">
|
|
85
|
+
Read `wave` from each plan's frontmatter and group by wave number:
|
|
883
86
|
|
|
884
87
|
```bash
|
|
885
|
-
|
|
88
|
+
# For each plan, extract wave from frontmatter
|
|
89
|
+
for plan in $PHASE_DIR/*-PLAN.md; do
|
|
90
|
+
wave=$(grep "^wave:" "$plan" | cut -d: -f2 | tr -d ' ')
|
|
91
|
+
autonomous=$(grep "^autonomous:" "$plan" | cut -d: -f2 | tr -d ' ')
|
|
92
|
+
echo "$plan:$wave:$autonomous"
|
|
93
|
+
done
|
|
886
94
|
```
|
|
887
95
|
|
|
888
|
-
**
|
|
889
|
-
|
|
890
|
-
Stage each file individually (NEVER use `git add .` or `git add -A`):
|
|
891
|
-
|
|
892
|
-
```bash
|
|
893
|
-
# Example - adjust to actual files modified by this task
|
|
894
|
-
git add src/api/auth.ts
|
|
895
|
-
git add src/types/user.ts
|
|
96
|
+
**Group plans:**
|
|
896
97
|
```
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
| `feat` | New feature, endpoint, component, functionality | feat(08-02): create user registration endpoint |
|
|
903
|
-
| `fix` | Bug fix, error correction | fix(08-02): correct email validation regex |
|
|
904
|
-
| `test` | Test-only changes (TDD RED phase) | test(08-02): add failing test for password hashing |
|
|
905
|
-
| `refactor` | Code cleanup, no behavior change (TDD REFACTOR phase) | refactor(08-02): extract validation to helper |
|
|
906
|
-
| `perf` | Performance improvement | perf(08-02): add database index for user lookups |
|
|
907
|
-
| `docs` | Documentation changes | docs(08-02): add API endpoint documentation |
|
|
908
|
-
| `style` | Formatting, linting fixes | style(08-02): format auth module |
|
|
909
|
-
| `chore` | Config, tooling, dependencies | chore(08-02): add bcrypt dependency |
|
|
910
|
-
|
|
911
|
-
**4. Craft commit message:**
|
|
912
|
-
|
|
913
|
-
Format: `{type}({phase}-{plan}): {task-name-or-description}`
|
|
914
|
-
|
|
915
|
-
```bash
|
|
916
|
-
git commit -m "{type}({phase}-{plan}): {concise task description}
|
|
917
|
-
|
|
918
|
-
- {key change 1}
|
|
919
|
-
- {key change 2}
|
|
920
|
-
- {key change 3}
|
|
921
|
-
"
|
|
98
|
+
waves = {
|
|
99
|
+
1: [plan-01, plan-02],
|
|
100
|
+
2: [plan-03, plan-04],
|
|
101
|
+
3: [plan-05]
|
|
102
|
+
}
|
|
922
103
|
```
|
|
923
104
|
|
|
924
|
-
**
|
|
925
|
-
|
|
926
|
-
```bash
|
|
927
|
-
# Standard plan task
|
|
928
|
-
git commit -m "feat(08-02): create user registration endpoint
|
|
929
|
-
|
|
930
|
-
- POST /auth/register validates email and password
|
|
931
|
-
- Checks for duplicate users
|
|
932
|
-
- Returns JWT token on success
|
|
933
|
-
"
|
|
934
|
-
|
|
935
|
-
# Another standard task
|
|
936
|
-
git commit -m "fix(08-02): correct email validation regex
|
|
105
|
+
**No dependency analysis needed.** Wave numbers are pre-computed during `/gsd:plan-phase`.
|
|
937
106
|
|
|
938
|
-
|
|
939
|
-
- Added tests for edge cases
|
|
940
|
-
"
|
|
107
|
+
Report wave structure to user:
|
|
941
108
|
```
|
|
109
|
+
Execution Plan:
|
|
110
|
+
Wave 1 (parallel): 03-01, 03-02
|
|
111
|
+
Wave 2 (parallel): 03-03 [checkpoint], 03-04
|
|
112
|
+
Wave 3: 03-05
|
|
942
113
|
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
**5. Record commit hash:**
|
|
946
|
-
|
|
947
|
-
After committing, capture hash for SUMMARY.md:
|
|
948
|
-
|
|
949
|
-
```bash
|
|
950
|
-
TASK_COMMIT=$(git rev-parse --short HEAD)
|
|
951
|
-
echo "Task ${TASK_NUM} committed: ${TASK_COMMIT}"
|
|
114
|
+
Total: 5 plans in 3 waves
|
|
952
115
|
```
|
|
116
|
+
</step>
|
|
953
117
|
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
TASK_COMMITS+=("Task ${TASK_NUM}: ${TASK_COMMIT}")
|
|
957
|
-
```
|
|
958
|
-
|
|
959
|
-
**Atomic commit benefits:**
|
|
960
|
-
- Each task independently revertable
|
|
961
|
-
- Git bisect finds exact failing task
|
|
962
|
-
- Git blame traces line to specific task context
|
|
963
|
-
- Clear history for Claude in future sessions
|
|
964
|
-
- Better observability for AI-automated workflow
|
|
965
|
-
|
|
966
|
-
</task_commit>
|
|
967
|
-
|
|
968
|
-
<step name="checkpoint_protocol">
|
|
969
|
-
When encountering `type="checkpoint:*"`:
|
|
970
|
-
|
|
971
|
-
**Critical: Claude automates everything with CLI/API before checkpoints.** Checkpoints are for verification and decisions, not manual work.
|
|
972
|
-
|
|
973
|
-
**Display checkpoint clearly:**
|
|
974
|
-
|
|
975
|
-
```
|
|
976
|
-
════════════════════════════════════════
|
|
977
|
-
CHECKPOINT: [Type]
|
|
978
|
-
════════════════════════════════════════
|
|
979
|
-
|
|
980
|
-
Task [X] of [Y]: [Action/What-Built/Decision]
|
|
981
|
-
|
|
982
|
-
[Display task-specific content based on type]
|
|
983
|
-
|
|
984
|
-
[Resume signal instruction]
|
|
985
|
-
════════════════════════════════════════
|
|
986
|
-
```
|
|
987
|
-
|
|
988
|
-
**For checkpoint:human-verify (90% of checkpoints):**
|
|
989
|
-
|
|
990
|
-
```
|
|
991
|
-
I automated: [what was automated - deployed, built, configured]
|
|
992
|
-
|
|
993
|
-
How to verify:
|
|
994
|
-
1. [Step 1 - exact command/URL]
|
|
995
|
-
2. [Step 2 - what to check]
|
|
996
|
-
3. [Step 3 - expected behavior]
|
|
997
|
-
|
|
998
|
-
[Resume signal - e.g., "Type 'approved' or describe issues"]
|
|
999
|
-
```
|
|
1000
|
-
|
|
1001
|
-
**For checkpoint:decision (9% of checkpoints):**
|
|
1002
|
-
|
|
1003
|
-
```
|
|
1004
|
-
Decision needed: [decision]
|
|
118
|
+
<step name="execute_waves">
|
|
119
|
+
Execute each wave in sequence. Autonomous plans within a wave run in parallel.
|
|
1005
120
|
|
|
1006
|
-
|
|
121
|
+
**For each wave:**
|
|
1007
122
|
|
|
1008
|
-
|
|
1009
|
-
1. [option-id]: [name]
|
|
1010
|
-
Pros: [pros]
|
|
1011
|
-
Cons: [cons]
|
|
123
|
+
1. **Spawn all autonomous agents in wave simultaneously:**
|
|
1012
124
|
|
|
1013
|
-
|
|
1014
|
-
Pros: [pros]
|
|
1015
|
-
Cons: [cons]
|
|
125
|
+
Use Task tool with multiple parallel calls. Each agent gets prompt from subagent-task-prompt template:
|
|
1016
126
|
|
|
1017
|
-
|
|
1018
|
-
|
|
127
|
+
```
|
|
128
|
+
<objective>
|
|
129
|
+
Execute plan {plan_number} of phase {phase_number}-{phase_name}.
|
|
1019
130
|
|
|
1020
|
-
|
|
131
|
+
Commit each task atomically. Create SUMMARY.md. Update STATE.md.
|
|
132
|
+
</objective>
|
|
1021
133
|
|
|
1022
|
-
|
|
1023
|
-
|
|
134
|
+
<execution_context>
|
|
135
|
+
@~/.config/opencode/get-shit-done/workflows/execute-plan.md
|
|
136
|
+
@~/.config/opencode/get-shit-done/templates/summary.md
|
|
137
|
+
@~/.config/opencode/get-shit-done/references/checkpoints.md
|
|
138
|
+
@~/.config/opencode/get-shit-done/references/tdd.md
|
|
139
|
+
</execution_context>
|
|
1024
140
|
|
|
1025
|
-
|
|
141
|
+
<context>
|
|
142
|
+
Plan: @{plan_path}
|
|
143
|
+
Project state: @.planning/STATE.md
|
|
144
|
+
Config: @.planning/config.json (if exists)
|
|
145
|
+
</context>
|
|
1026
146
|
|
|
1027
|
-
|
|
1028
|
-
[
|
|
147
|
+
<success_criteria>
|
|
148
|
+
- [ ] All tasks executed
|
|
149
|
+
- [ ] Each task committed individually
|
|
150
|
+
- [ ] SUMMARY.md created in plan directory
|
|
151
|
+
- [ ] STATE.md updated with position and decisions
|
|
152
|
+
</success_criteria>
|
|
153
|
+
```
|
|
1029
154
|
|
|
1030
|
-
|
|
155
|
+
2. **Wait for all agents in wave to complete:**
|
|
1031
156
|
|
|
1032
|
-
|
|
1033
|
-
```
|
|
157
|
+
Task tool blocks until each agent finishes. All parallel agents return together.
|
|
1034
158
|
|
|
1035
|
-
|
|
159
|
+
3. **Collect results from wave:**
|
|
1036
160
|
|
|
1037
|
-
|
|
161
|
+
For each completed agent:
|
|
162
|
+
- Verify SUMMARY.md exists at expected path
|
|
163
|
+
- Note any issues reported
|
|
164
|
+
- Record completion
|
|
1038
165
|
|
|
1039
|
-
|
|
1040
|
-
- If verification passes or N/A: continue to next task
|
|
1041
|
-
- If verification fails: inform user, wait for resolution
|
|
166
|
+
4. **Handle failures:**
|
|
1042
167
|
|
|
1043
|
-
|
|
1044
|
-
|
|
168
|
+
If any agent in wave fails:
|
|
169
|
+
- Report which plan failed and why
|
|
170
|
+
- Ask user: "Continue with remaining waves?" or "Stop execution?"
|
|
171
|
+
- If continue: proceed to next wave (dependent plans may also fail)
|
|
172
|
+
- If stop: exit with partial completion report
|
|
1045
173
|
|
|
1046
|
-
|
|
1047
|
-
If any task verification fails:
|
|
174
|
+
5. **Execute checkpoint plans between waves:**
|
|
1048
175
|
|
|
1049
|
-
|
|
176
|
+
See `<checkpoint_handling>` for details.
|
|
1050
177
|
|
|
1051
|
-
|
|
1052
|
-
"Verification failed for Task [X]: [task name]
|
|
178
|
+
6. **Proceed to next wave**
|
|
1053
179
|
|
|
1054
|
-
Expected: [verification criteria]
|
|
1055
|
-
Actual: [what happened]
|
|
1056
|
-
|
|
1057
|
-
How to proceed?
|
|
1058
|
-
|
|
1059
|
-
1. Retry - Try the task again
|
|
1060
|
-
2. Skip - Mark as incomplete, continue
|
|
1061
|
-
3. Stop - Pause execution, investigate"
|
|
1062
|
-
|
|
1063
|
-
Wait for user decision.
|
|
1064
|
-
|
|
1065
|
-
If user chose "Skip", note it in SUMMARY.md under "Issues Encountered".
|
|
1066
180
|
</step>
|
|
1067
181
|
|
|
1068
|
-
<step name="
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
182
|
+
<step name="checkpoint_handling">
|
|
183
|
+
Plans with `autonomous: false` require user interaction.
|
|
184
|
+
|
|
185
|
+
**Detection:** Check `autonomous` field in frontmatter.
|
|
186
|
+
|
|
187
|
+
**Execution flow for checkpoint plans:**
|
|
188
|
+
|
|
189
|
+
1. **Spawn agent for checkpoint plan:**
|
|
190
|
+
```
|
|
191
|
+
Task(prompt="{subagent-task-prompt}", subagent_type="general")
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
2. **Agent runs until checkpoint:**
|
|
195
|
+
- Executes auto tasks normally
|
|
196
|
+
- Reaches checkpoint task (e.g., `type="checkpoint:human-verify"`) or auth gate
|
|
197
|
+
- Agent returns with structured checkpoint (see checkpoint-return.md template)
|
|
198
|
+
|
|
199
|
+
3. **Agent return includes (structured format):**
|
|
200
|
+
- Completed Tasks table with commit hashes and files
|
|
201
|
+
- Current task name and blocker
|
|
202
|
+
- Checkpoint type and details for user
|
|
203
|
+
- What's awaited from user
|
|
204
|
+
|
|
205
|
+
4. **Orchestrator presents checkpoint to user:**
|
|
206
|
+
|
|
207
|
+
Extract and display the "Checkpoint Details" and "Awaiting" sections from agent return:
|
|
208
|
+
```
|
|
209
|
+
## Checkpoint: [Type]
|
|
210
|
+
|
|
211
|
+
**Plan:** 03-03 Dashboard Layout
|
|
212
|
+
**Progress:** 2/3 tasks complete
|
|
213
|
+
|
|
214
|
+
[Checkpoint Details section from agent return]
|
|
215
|
+
|
|
216
|
+
[Awaiting section from agent return]
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
5. **User responds:**
|
|
220
|
+
- "approved" / "done" → spawn continuation agent
|
|
221
|
+
- Description of issues → spawn continuation agent with feedback
|
|
222
|
+
- Decision selection → spawn continuation agent with choice
|
|
223
|
+
|
|
224
|
+
6. **Spawn continuation agent (NOT resume):**
|
|
225
|
+
|
|
226
|
+
Use the continuation-prompt.md template:
|
|
227
|
+
```
|
|
228
|
+
Task(
|
|
229
|
+
prompt=filled_continuation_template,
|
|
230
|
+
subagent_type="general"
|
|
231
|
+
)
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Fill template with:
|
|
235
|
+
- `{completed_tasks_table}`: From agent's checkpoint return
|
|
236
|
+
- `{resume_task_number}`: Current task from checkpoint
|
|
237
|
+
- `{resume_task_name}`: Current task name from checkpoint
|
|
238
|
+
- `{user_response}`: What user provided
|
|
239
|
+
- `{resume_instructions}`: Based on checkpoint type (see continuation-prompt.md)
|
|
240
|
+
|
|
241
|
+
7. **Continuation agent executes:**
|
|
242
|
+
- Verifies previous commits exist
|
|
243
|
+
- Continues from resume point
|
|
244
|
+
- May hit another checkpoint (repeat from step 4)
|
|
245
|
+
- Or completes plan
|
|
246
|
+
|
|
247
|
+
8. **Repeat until plan completes or user stops**
|
|
248
|
+
|
|
249
|
+
**Why fresh agent instead of resume:**
|
|
250
|
+
Resume relies on OpenCode's internal serialization which breaks with parallel tool calls.
|
|
251
|
+
Fresh agents with explicit state are more reliable and maintain full context.
|
|
252
|
+
|
|
253
|
+
**Checkpoint in parallel context:**
|
|
254
|
+
If a plan in a parallel wave has a checkpoint:
|
|
255
|
+
- Spawn as normal
|
|
256
|
+
- Agent pauses at checkpoint and returns with structured state
|
|
257
|
+
- Other parallel agents may complete while waiting
|
|
258
|
+
- Present checkpoint to user
|
|
259
|
+
- Spawn continuation agent with user response
|
|
260
|
+
- Wait for all agents to finish before next wave
|
|
1088
261
|
</step>
|
|
1089
262
|
|
|
1090
|
-
<step name="
|
|
1091
|
-
|
|
1092
|
-
Use ~/.config/opencode/get-shit-done/templates/summary.md for structure.
|
|
1093
|
-
|
|
1094
|
-
**File location:** `.planning/phases/XX-name/{phase}-{plan}-SUMMARY.md`
|
|
1095
|
-
|
|
1096
|
-
**Frontmatter population:**
|
|
1097
|
-
|
|
1098
|
-
Before writing summary content, populate frontmatter fields from execution context:
|
|
1099
|
-
|
|
1100
|
-
1. **Basic identification:**
|
|
1101
|
-
- phase: From PLAN.md frontmatter
|
|
1102
|
-
- plan: From PLAN.md frontmatter
|
|
1103
|
-
- subsystem: Categorize based on phase focus (auth, payments, ui, api, database, infra, testing, etc.)
|
|
1104
|
-
- tags: Extract tech keywords (libraries, frameworks, tools used)
|
|
1105
|
-
|
|
1106
|
-
2. **Dependency graph:**
|
|
1107
|
-
- requires: List prior phases this built upon (check PLAN.md context section for referenced prior summaries)
|
|
1108
|
-
- provides: Extract from accomplishments - what was delivered
|
|
1109
|
-
- affects: Infer from phase description/goal what future phases might need this
|
|
1110
|
-
|
|
1111
|
-
3. **Tech tracking:**
|
|
1112
|
-
- tech-stack.added: New libraries from package.json changes or requirements
|
|
1113
|
-
- tech-stack.patterns: Architectural patterns established (from decisions/accomplishments)
|
|
1114
|
-
|
|
1115
|
-
4. **File tracking:**
|
|
1116
|
-
- key-files.created: From "Files Created/Modified" section
|
|
1117
|
-
- key-files.modified: From "Files Created/Modified" section
|
|
1118
|
-
|
|
1119
|
-
5. **Decisions:**
|
|
1120
|
-
- key-decisions: Extract from "Decisions Made" section
|
|
1121
|
-
|
|
1122
|
-
6. **Issues:**
|
|
1123
|
-
- issues-created: Check if ISSUES.md was updated during execution
|
|
1124
|
-
|
|
1125
|
-
7. **Metrics:**
|
|
1126
|
-
- duration: From $DURATION variable
|
|
1127
|
-
- completed: From $PLAN_END_TIME (date only, format YYYY-MM-DD)
|
|
1128
|
-
|
|
1129
|
-
Note: If subsystem/affects are unclear, use best judgment based on phase name and accomplishments. Can be refined later.
|
|
1130
|
-
|
|
1131
|
-
**Title format:** `# Phase [X] Plan [Y]: [Name] Summary`
|
|
1132
|
-
|
|
1133
|
-
The one-liner must be SUBSTANTIVE:
|
|
1134
|
-
|
|
1135
|
-
- Good: "JWT auth with refresh rotation using jose library"
|
|
1136
|
-
- Bad: "Authentication implemented"
|
|
1137
|
-
|
|
1138
|
-
**Include performance data:**
|
|
1139
|
-
|
|
1140
|
-
- Duration: `$DURATION`
|
|
1141
|
-
- Started: `$PLAN_START_TIME`
|
|
1142
|
-
- Completed: `$PLAN_END_TIME`
|
|
1143
|
-
- Tasks completed: (count from execution)
|
|
1144
|
-
- Files modified: (count from execution)
|
|
1145
|
-
|
|
1146
|
-
**Next Step section:**
|
|
1147
|
-
|
|
1148
|
-
- If more plans exist in this phase: "Ready for {phase}-{next-plan}-PLAN.md"
|
|
1149
|
-
- If this is the last plan: "Phase complete, ready for transition"
|
|
1150
|
-
</step>
|
|
1151
|
-
|
|
1152
|
-
<step name="update_current_position">
|
|
1153
|
-
Update Current Position section in STATE.md to reflect plan completion.
|
|
1154
|
-
|
|
1155
|
-
**Format:**
|
|
263
|
+
<step name="aggregate_results">
|
|
264
|
+
After all waves complete, aggregate results:
|
|
1156
265
|
|
|
1157
266
|
```markdown
|
|
1158
|
-
Phase:
|
|
1159
|
-
Plan: [just completed] of [total in phase]
|
|
1160
|
-
Status: [In progress / Phase complete]
|
|
1161
|
-
Last activity: [today] - Completed {phase}-{plan}-PLAN.md
|
|
267
|
+
## Phase {X}: {Name} Execution Complete
|
|
1162
268
|
|
|
1163
|
-
|
|
1164
|
-
|
|
269
|
+
**Waves executed:** {N}
|
|
270
|
+
**Plans completed:** {M} of {total}
|
|
1165
271
|
|
|
1166
|
-
|
|
272
|
+
### Wave Summary
|
|
1167
273
|
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
274
|
+
| Wave | Plans | Status |
|
|
275
|
+
|------|-------|--------|
|
|
276
|
+
| 1 | plan-01, plan-02 | ✓ Complete |
|
|
277
|
+
| CP | plan-03 | ✓ Verified |
|
|
278
|
+
| 2 | plan-04 | ✓ Complete |
|
|
279
|
+
| 3 | plan-05 | ✓ Complete |
|
|
1172
280
|
|
|
1173
|
-
|
|
281
|
+
### Plan Details
|
|
1174
282
|
|
|
1175
|
-
|
|
283
|
+
1. **03-01**: [one-liner from SUMMARY.md]
|
|
284
|
+
2. **03-02**: [one-liner from SUMMARY.md]
|
|
285
|
+
...
|
|
1176
286
|
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
Phase: 2 of 4 (Authentication)
|
|
1181
|
-
Plan: Not started
|
|
1182
|
-
Status: Ready to execute
|
|
1183
|
-
Last activity: 2025-01-18 - Phase 1 complete
|
|
1184
|
-
|
|
1185
|
-
Progress: ██████░░░░ 40%
|
|
287
|
+
### Issues Encountered
|
|
288
|
+
[Aggregate from all SUMMARYs, or "None"]
|
|
1186
289
|
```
|
|
1187
|
-
|
|
1188
|
-
After:
|
|
1189
|
-
|
|
1190
|
-
```markdown
|
|
1191
|
-
## Current Position
|
|
1192
|
-
|
|
1193
|
-
Phase: 2 of 4 (Authentication)
|
|
1194
|
-
Plan: 1 of 2 in current phase
|
|
1195
|
-
Status: In progress
|
|
1196
|
-
Last activity: 2025-01-19 - Completed 02-01-PLAN.md
|
|
1197
|
-
|
|
1198
|
-
Progress: ███████░░░ 50%
|
|
1199
|
-
```
|
|
1200
|
-
|
|
1201
|
-
**Step complete when:**
|
|
1202
|
-
|
|
1203
|
-
- [ ] Phase number shows current phase (X of total)
|
|
1204
|
-
- [ ] Plan number shows plans complete in current phase (N of total-in-phase)
|
|
1205
|
-
- [ ] Status reflects current state (In progress / Phase complete)
|
|
1206
|
-
- [ ] Last activity shows today's date and the plan just completed
|
|
1207
|
-
- [ ] Progress bar calculated correctly from total completed plans
|
|
1208
|
-
</step>
|
|
1209
|
-
|
|
1210
|
-
<step name="extract_decisions_and_issues">
|
|
1211
|
-
Extract decisions, issues, and concerns from SUMMARY.md into STATE.md accumulated context.
|
|
1212
|
-
|
|
1213
|
-
**Decisions Made:**
|
|
1214
|
-
|
|
1215
|
-
- Read SUMMARY.md "## Decisions Made" section
|
|
1216
|
-
- If content exists (not "None"):
|
|
1217
|
-
- Add each decision to STATE.md Decisions table
|
|
1218
|
-
- Format: `| [phase number] | [decision summary] | [rationale] |`
|
|
1219
|
-
|
|
1220
|
-
**Deferred Issues:**
|
|
1221
|
-
|
|
1222
|
-
- Read SUMMARY.md to check if new issues were logged to ISSUES.md
|
|
1223
|
-
- If new ISS-XXX entries created:
|
|
1224
|
-
- Update STATE.md "Deferred Issues" section
|
|
1225
|
-
|
|
1226
|
-
**Blockers/Concerns:**
|
|
1227
|
-
|
|
1228
|
-
- Read SUMMARY.md "## Next Phase Readiness" section
|
|
1229
|
-
- If contains blockers or concerns:
|
|
1230
|
-
- Add to STATE.md "Blockers/Concerns Carried Forward"
|
|
1231
|
-
</step>
|
|
1232
|
-
|
|
1233
|
-
<step name="update_session_continuity">
|
|
1234
|
-
Update Session Continuity section in STATE.md to enable resumption in future sessions.
|
|
1235
|
-
|
|
1236
|
-
**Format:**
|
|
1237
|
-
|
|
1238
|
-
```markdown
|
|
1239
|
-
Last session: [current date and time]
|
|
1240
|
-
Stopped at: Completed {phase}-{plan}-PLAN.md
|
|
1241
|
-
Resume file: [path to .continue-here if exists, else "None"]
|
|
1242
|
-
```
|
|
1243
|
-
|
|
1244
|
-
**Size constraint note:** Keep STATE.md under 150 lines total.
|
|
1245
|
-
</step>
|
|
1246
|
-
|
|
1247
|
-
<step name="issues_review_gate">
|
|
1248
|
-
Before proceeding, check SUMMARY.md content.
|
|
1249
|
-
|
|
1250
|
-
If "Issues Encountered" is NOT "None":
|
|
1251
|
-
|
|
1252
|
-
<if mode="yolo">
|
|
1253
|
-
```
|
|
1254
|
-
⚡ Auto-approved: Issues acknowledgment
|
|
1255
|
-
⚠️ Note: Issues were encountered during execution:
|
|
1256
|
-
- [Issue 1]
|
|
1257
|
-
- [Issue 2]
|
|
1258
|
-
(Logged - continuing in yolo mode)
|
|
1259
|
-
```
|
|
1260
|
-
|
|
1261
|
-
Continue without waiting.
|
|
1262
|
-
</if>
|
|
1263
|
-
|
|
1264
|
-
<if mode="interactive" OR="custom with gates.issues_review true">
|
|
1265
|
-
Present issues and wait for acknowledgment before proceeding.
|
|
1266
|
-
</if>
|
|
1267
290
|
</step>
|
|
1268
291
|
|
|
1269
292
|
<step name="update_roadmap">
|
|
1270
|
-
Update
|
|
1271
|
-
|
|
1272
|
-
```bash
|
|
1273
|
-
ROADMAP_FILE=".planning/ROADMAP.md"
|
|
1274
|
-
```
|
|
1275
|
-
|
|
1276
|
-
**If more plans remain in this phase:**
|
|
1277
|
-
|
|
1278
|
-
- Update plan count: "2/3 plans complete"
|
|
1279
|
-
- Keep phase status as "In progress"
|
|
1280
|
-
|
|
1281
|
-
**If this was the last plan in the phase:**
|
|
1282
|
-
|
|
1283
|
-
- Mark phase complete: status → "Complete"
|
|
1284
|
-
- Add completion date
|
|
1285
|
-
</step>
|
|
1286
|
-
|
|
1287
|
-
<step name="git_commit_metadata">
|
|
1288
|
-
Commit execution metadata (SUMMARY + STATE + ROADMAP):
|
|
1289
|
-
|
|
1290
|
-
**Note:** All task code has already been committed during execution (one commit per task).
|
|
1291
|
-
PLAN.md was already committed during plan-phase. This final commit captures execution results only.
|
|
1292
|
-
|
|
1293
|
-
**1. Stage execution artifacts:**
|
|
293
|
+
Update ROADMAP.md to reflect phase completion:
|
|
1294
294
|
|
|
1295
295
|
```bash
|
|
1296
|
-
|
|
1297
|
-
|
|
296
|
+
# Mark phase complete
|
|
297
|
+
# Update completion date
|
|
298
|
+
# Update status
|
|
1298
299
|
```
|
|
1299
300
|
|
|
1300
|
-
|
|
1301
|
-
|
|
301
|
+
Commit roadmap update:
|
|
1302
302
|
```bash
|
|
1303
303
|
git add .planning/ROADMAP.md
|
|
304
|
+
git commit -m "docs(phase-{X}): complete phase execution"
|
|
1304
305
|
```
|
|
1305
|
-
|
|
1306
|
-
**3. Verify staging:**
|
|
1307
|
-
|
|
1308
|
-
```bash
|
|
1309
|
-
git status
|
|
1310
|
-
# Should show only execution artifacts (SUMMARY, STATE, ROADMAP), no code files
|
|
1311
|
-
```
|
|
1312
|
-
|
|
1313
|
-
**4. Commit metadata:**
|
|
1314
|
-
|
|
1315
|
-
```bash
|
|
1316
|
-
git commit -m "$(cat <<'EOF'
|
|
1317
|
-
docs({phase}-{plan}): complete [plan-name] plan
|
|
1318
|
-
|
|
1319
|
-
Tasks completed: [N]/[N]
|
|
1320
|
-
- [Task 1 name]
|
|
1321
|
-
- [Task 2 name]
|
|
1322
|
-
- [Task 3 name]
|
|
1323
|
-
|
|
1324
|
-
SUMMARY: .planning/phases/XX-name/{phase}-{plan}-SUMMARY.md
|
|
1325
|
-
EOF
|
|
1326
|
-
)"
|
|
1327
|
-
```
|
|
1328
|
-
|
|
1329
|
-
**Example:**
|
|
1330
|
-
|
|
1331
|
-
```bash
|
|
1332
|
-
git commit -m "$(cat <<'EOF'
|
|
1333
|
-
docs(08-02): complete user registration plan
|
|
1334
|
-
|
|
1335
|
-
Tasks completed: 3/3
|
|
1336
|
-
- User registration endpoint
|
|
1337
|
-
- Password hashing with bcrypt
|
|
1338
|
-
- Email confirmation flow
|
|
1339
|
-
|
|
1340
|
-
SUMMARY: .planning/phases/08-user-auth/08-02-registration-SUMMARY.md
|
|
1341
|
-
EOF
|
|
1342
|
-
)"
|
|
1343
|
-
```
|
|
1344
|
-
|
|
1345
|
-
**Git log after plan execution:**
|
|
1346
|
-
|
|
1347
|
-
```
|
|
1348
|
-
abc123f docs(08-02): complete user registration plan
|
|
1349
|
-
def456g feat(08-02): add email confirmation flow
|
|
1350
|
-
hij789k feat(08-02): implement password hashing with bcrypt
|
|
1351
|
-
lmn012o feat(08-02): create user registration endpoint
|
|
1352
|
-
```
|
|
1353
|
-
|
|
1354
|
-
Each task has its own commit, followed by one metadata commit documenting plan completion.
|
|
1355
|
-
|
|
1356
|
-
For commit message conventions, see ~/.config/opencode/get-shit-done/references/git-integration.md
|
|
1357
|
-
</step>
|
|
1358
|
-
|
|
1359
|
-
<step name="update_codebase_map">
|
|
1360
|
-
**If .planning/codebase/ exists:**
|
|
1361
|
-
|
|
1362
|
-
Check what changed across all task commits in this plan:
|
|
1363
|
-
|
|
1364
|
-
```bash
|
|
1365
|
-
# Find first task commit (right after previous plan's docs commit)
|
|
1366
|
-
FIRST_TASK=$(git log --oneline --grep="feat({phase}-{plan}):" --grep="fix({phase}-{plan}):" --grep="test({phase}-{plan}):" --reverse | head -1 | cut -d' ' -f1)
|
|
1367
|
-
|
|
1368
|
-
# Get all changes from first task through now
|
|
1369
|
-
git diff --name-only ${FIRST_TASK}^..HEAD 2>/dev/null
|
|
1370
|
-
```
|
|
1371
|
-
|
|
1372
|
-
**Update only if structural changes occurred:**
|
|
1373
|
-
|
|
1374
|
-
| Change Detected | Update Action |
|
|
1375
|
-
|-----------------|---------------|
|
|
1376
|
-
| New directory in src/ | STRUCTURE.md: Add to directory layout |
|
|
1377
|
-
| package.json deps changed | STACK.md: Add/remove from dependencies list |
|
|
1378
|
-
| New file pattern (e.g., first .test.ts) | CONVENTIONS.md: Note new pattern |
|
|
1379
|
-
| New external API client | INTEGRATIONS.md: Add service entry with file path |
|
|
1380
|
-
| Config file added/changed | STACK.md: Update configuration section |
|
|
1381
|
-
| File renamed/moved | Update paths in relevant docs |
|
|
1382
|
-
|
|
1383
|
-
**Skip update if only:**
|
|
1384
|
-
- Code changes within existing files
|
|
1385
|
-
- Bug fixes
|
|
1386
|
-
- Content changes (no structural impact)
|
|
1387
|
-
|
|
1388
|
-
**Update format:**
|
|
1389
|
-
Make single targeted edits - add a bullet point, update a path, or remove a stale entry. Don't rewrite sections.
|
|
1390
|
-
|
|
1391
|
-
```bash
|
|
1392
|
-
git add .planning/codebase/*.md
|
|
1393
|
-
git commit --amend --no-edit # Include in metadata commit
|
|
1394
|
-
```
|
|
1395
|
-
|
|
1396
|
-
**If .planning/codebase/ doesn't exist:**
|
|
1397
|
-
Skip this step.
|
|
1398
|
-
</step>
|
|
1399
|
-
|
|
1400
|
-
<step name="check_phase_issues">
|
|
1401
|
-
**Check if issues were created during this phase:**
|
|
1402
|
-
|
|
1403
|
-
```bash
|
|
1404
|
-
# Check if ISSUES.md exists and has issues from current phase
|
|
1405
|
-
if [ -f .planning/ISSUES.md ]; then
|
|
1406
|
-
grep -E "Phase ${PHASE}.*Task" .planning/ISSUES.md | grep -v "^#" || echo "NO_ISSUES_THIS_PHASE"
|
|
1407
|
-
fi
|
|
1408
|
-
```
|
|
1409
|
-
|
|
1410
|
-
**If issues were created during this phase:**
|
|
1411
|
-
|
|
1412
|
-
```
|
|
1413
|
-
📋 Issues logged during this phase:
|
|
1414
|
-
- ISS-XXX: [brief description]
|
|
1415
|
-
- ISS-YYY: [brief description]
|
|
1416
|
-
|
|
1417
|
-
Review these now?
|
|
1418
|
-
```
|
|
1419
|
-
|
|
1420
|
-
Use AskUserQuestion:
|
|
1421
|
-
- header: "Phase Issues"
|
|
1422
|
-
- question: "[N] issues were logged during this phase. Review now?"
|
|
1423
|
-
- options:
|
|
1424
|
-
- "Review issues" - Analyze with /gsd:consider-issues
|
|
1425
|
-
- "Continue" - Address later, proceed to next work
|
|
1426
|
-
|
|
1427
|
-
**If "Review issues" selected:**
|
|
1428
|
-
- Invoke: `SlashCommand("/gsd:consider-issues")`
|
|
1429
|
-
- After consider-issues completes, return to offer_next
|
|
1430
|
-
|
|
1431
|
-
**If "Continue" selected or no issues found:**
|
|
1432
|
-
- Proceed to offer_next step
|
|
1433
|
-
|
|
1434
|
-
**In YOLO mode:**
|
|
1435
|
-
- Note issues were logged but don't prompt: `📋 [N] issues logged this phase (review later with /gsd:consider-issues)`
|
|
1436
|
-
- Continue to offer_next automatically
|
|
1437
306
|
</step>
|
|
1438
307
|
|
|
1439
308
|
<step name="offer_next">
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
Do NOT skip this verification. Do NOT assume phase or milestone completion without checking.
|
|
1443
|
-
|
|
1444
|
-
**Step 1: Count plans and summaries in current phase**
|
|
1445
|
-
|
|
1446
|
-
List files in the phase directory:
|
|
1447
|
-
|
|
1448
|
-
```bash
|
|
1449
|
-
ls -1 .planning/phases/[current-phase-dir]/*-PLAN.md 2>/dev/null | wc -l
|
|
1450
|
-
ls -1 .planning/phases/[current-phase-dir]/*-SUMMARY.md 2>/dev/null | wc -l
|
|
1451
|
-
```
|
|
1452
|
-
|
|
1453
|
-
State the counts: "This phase has [X] plans and [Y] summaries."
|
|
1454
|
-
|
|
1455
|
-
**Step 2: Route based on plan completion**
|
|
1456
|
-
|
|
1457
|
-
Compare the counts from Step 1:
|
|
1458
|
-
|
|
1459
|
-
| Condition | Meaning | Action |
|
|
1460
|
-
|-----------|---------|--------|
|
|
1461
|
-
| summaries < plans | More plans remain | Go to **Route A** |
|
|
1462
|
-
| summaries = plans | Phase complete | Go to Step 3 |
|
|
1463
|
-
|
|
1464
|
-
---
|
|
1465
|
-
|
|
1466
|
-
**Route A: More plans remain in this phase**
|
|
309
|
+
Present next steps based on milestone status:
|
|
1467
310
|
|
|
1468
|
-
|
|
1469
|
-
- Find the first PLAN.md file that has no matching SUMMARY.md
|
|
1470
|
-
- Read its `<objective>` section
|
|
1471
|
-
|
|
1472
|
-
<if mode="yolo">
|
|
311
|
+
**If more phases remain:**
|
|
1473
312
|
```
|
|
1474
|
-
|
|
1475
|
-
Summary: .planning/phases/{phase-dir}/{phase}-{plan}-SUMMARY.md
|
|
1476
|
-
|
|
1477
|
-
{Y} of {X} plans complete for Phase {Z}.
|
|
313
|
+
## Next Up
|
|
1478
314
|
|
|
1479
|
-
|
|
1480
|
-
```
|
|
315
|
+
**Phase {X+1}: {Name}** — {Goal}
|
|
1481
316
|
|
|
1482
|
-
|
|
1483
|
-
</if>
|
|
317
|
+
`/gsd:plan-phase {X+1}`
|
|
1484
318
|
|
|
1485
|
-
|
|
319
|
+
*`/clear` first for fresh context*
|
|
1486
320
|
```
|
|
1487
|
-
Plan {phase}-{plan} complete.
|
|
1488
|
-
Summary: .planning/phases/{phase-dir}/{phase}-{plan}-SUMMARY.md
|
|
1489
|
-
|
|
1490
|
-
{Y} of {X} plans complete for Phase {Z}.
|
|
1491
|
-
|
|
1492
|
-
---
|
|
1493
|
-
|
|
1494
|
-
## ▶ Next Up
|
|
1495
|
-
|
|
1496
|
-
**{phase}-{next-plan}: [Plan Name]** — [objective from next PLAN.md]
|
|
1497
|
-
|
|
1498
|
-
`/gsd:execute-plan .planning/phases/{phase-dir}/{phase}-{next-plan}-PLAN.md`
|
|
1499
321
|
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
---
|
|
1503
|
-
|
|
1504
|
-
**Also available:**
|
|
1505
|
-
- `/gsd:verify-work {phase}-{plan}` — manual acceptance testing before continuing
|
|
1506
|
-
- Review what was built before continuing
|
|
1507
|
-
|
|
1508
|
-
---
|
|
322
|
+
**If milestone complete:**
|
|
1509
323
|
```
|
|
324
|
+
MILESTONE COMPLETE!
|
|
1510
325
|
|
|
1511
|
-
|
|
1512
|
-
</if>
|
|
1513
|
-
|
|
1514
|
-
**STOP here if Route A applies. Do not continue to Step 3.**
|
|
1515
|
-
|
|
1516
|
-
---
|
|
1517
|
-
|
|
1518
|
-
**Step 3: Check milestone status (only when all plans in phase are complete)**
|
|
1519
|
-
|
|
1520
|
-
Read ROADMAP.md and extract:
|
|
1521
|
-
1. Current phase number (from the plan just completed)
|
|
1522
|
-
2. All phase numbers listed in the current milestone section
|
|
1523
|
-
|
|
1524
|
-
To find phases in the current milestone, look for:
|
|
1525
|
-
- Phase headers: lines starting with `### Phase` or `#### Phase`
|
|
1526
|
-
- Phase list items: lines like `- [ ] **Phase X:` or `- [x] **Phase X:`
|
|
1527
|
-
|
|
1528
|
-
Count total phases in the current milestone and identify the highest phase number.
|
|
1529
|
-
|
|
1530
|
-
State: "Current phase is {X}. Milestone has {N} phases (highest: {Y})."
|
|
1531
|
-
|
|
1532
|
-
**Step 4: Route based on milestone status**
|
|
1533
|
-
|
|
1534
|
-
| Condition | Meaning | Action |
|
|
1535
|
-
|-----------|---------|--------|
|
|
1536
|
-
| current phase < highest phase | More phases remain | Go to **Route B** |
|
|
1537
|
-
| current phase = highest phase | Milestone complete | Go to **Route C** |
|
|
1538
|
-
|
|
1539
|
-
---
|
|
1540
|
-
|
|
1541
|
-
**Route B: Phase complete, more phases remain in milestone**
|
|
1542
|
-
|
|
1543
|
-
Read ROADMAP.md to get the next phase's name and goal.
|
|
1544
|
-
|
|
1545
|
-
```
|
|
1546
|
-
Plan {phase}-{plan} complete.
|
|
1547
|
-
Summary: .planning/phases/{phase-dir}/{phase}-{plan}-SUMMARY.md
|
|
1548
|
-
|
|
1549
|
-
## ✓ Phase {Z}: {Phase Name} Complete
|
|
1550
|
-
|
|
1551
|
-
All {Y} plans finished.
|
|
1552
|
-
|
|
1553
|
-
---
|
|
1554
|
-
|
|
1555
|
-
## ▶ Next Up
|
|
1556
|
-
|
|
1557
|
-
**Phase {Z+1}: {Next Phase Name}** — {Goal from ROADMAP.md}
|
|
1558
|
-
|
|
1559
|
-
`/gsd:plan-phase {Z+1}`
|
|
1560
|
-
|
|
1561
|
-
<sub>`/clear` first → fresh context window</sub>
|
|
1562
|
-
|
|
1563
|
-
---
|
|
1564
|
-
|
|
1565
|
-
**Also available:**
|
|
1566
|
-
- `/gsd:verify-work {Z}` — manual acceptance testing before continuing
|
|
1567
|
-
- `/gsd:discuss-phase {Z+1}` — gather context first
|
|
1568
|
-
- `/gsd:research-phase {Z+1}` — investigate unknowns
|
|
1569
|
-
- Review phase accomplishments before continuing
|
|
1570
|
-
|
|
1571
|
-
---
|
|
1572
|
-
```
|
|
1573
|
-
|
|
1574
|
-
---
|
|
1575
|
-
|
|
1576
|
-
**Route C: Milestone complete (all phases done)**
|
|
1577
|
-
|
|
1578
|
-
```
|
|
1579
|
-
🎉 MILESTONE COMPLETE!
|
|
1580
|
-
|
|
1581
|
-
Plan {phase}-{plan} complete.
|
|
1582
|
-
Summary: .planning/phases/{phase-dir}/{phase}-{plan}-SUMMARY.md
|
|
1583
|
-
|
|
1584
|
-
## ✓ Phase {Z}: {Phase Name} Complete
|
|
1585
|
-
|
|
1586
|
-
All {Y} plans finished.
|
|
1587
|
-
|
|
1588
|
-
════════════════════════════════════════
|
|
1589
|
-
All {N} phases complete!
|
|
1590
|
-
Milestone is 100% done.
|
|
1591
|
-
════════════════════════════════════════
|
|
1592
|
-
|
|
1593
|
-
---
|
|
1594
|
-
|
|
1595
|
-
## ▶ Next Up
|
|
1596
|
-
|
|
1597
|
-
**Complete Milestone** — archive and prepare for next
|
|
326
|
+
All {N} phases executed.
|
|
1598
327
|
|
|
1599
328
|
`/gsd:complete-milestone`
|
|
1600
|
-
|
|
1601
|
-
<sub>`/clear` first → fresh context window</sub>
|
|
1602
|
-
|
|
1603
|
-
---
|
|
1604
|
-
|
|
1605
|
-
**Also available:**
|
|
1606
|
-
- `/gsd:verify-work` — manual acceptance testing before completing milestone
|
|
1607
|
-
- `/gsd:add-phase <description>` — add another phase before completing
|
|
1608
|
-
- Review accomplishments before archiving
|
|
1609
|
-
|
|
1610
|
-
---
|
|
1611
329
|
```
|
|
1612
|
-
|
|
1613
330
|
</step>
|
|
1614
331
|
|
|
1615
332
|
</process>
|
|
1616
333
|
|
|
1617
|
-
<
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
-
|
|
1622
|
-
-
|
|
1623
|
-
-
|
|
1624
|
-
-
|
|
1625
|
-
|
|
334
|
+
<context_efficiency>
|
|
335
|
+
**Why this works:**
|
|
336
|
+
|
|
337
|
+
Orchestrator context usage: ~10-15%
|
|
338
|
+
- Read plan frontmatter (small)
|
|
339
|
+
- Analyze dependencies (logic, no heavy reads)
|
|
340
|
+
- Fill template strings
|
|
341
|
+
- Spawn Task calls
|
|
342
|
+
- Collect results
|
|
343
|
+
|
|
344
|
+
Each subagent: Fresh 200k context
|
|
345
|
+
- Loads full execute-plan workflow
|
|
346
|
+
- Loads templates, references
|
|
347
|
+
- Executes plan with full capacity
|
|
348
|
+
- Creates SUMMARY, commits
|
|
349
|
+
|
|
350
|
+
**No polling.** Task tool blocks until completion. No TaskOutput loops.
|
|
351
|
+
|
|
352
|
+
**No context bleed.** Orchestrator never reads workflow internals. Just paths and results.
|
|
353
|
+
</context_efficiency>
|
|
354
|
+
|
|
355
|
+
<failure_handling>
|
|
356
|
+
**Subagent fails mid-plan:**
|
|
357
|
+
- SUMMARY.md won't exist
|
|
358
|
+
- Orchestrator detects missing SUMMARY
|
|
359
|
+
- Reports failure, asks user how to proceed
|
|
360
|
+
|
|
361
|
+
**Dependency chain breaks:**
|
|
362
|
+
- Wave 1 plan fails
|
|
363
|
+
- Wave 2 plans depending on it will likely fail
|
|
364
|
+
- Orchestrator can still attempt them (user choice)
|
|
365
|
+
- Or skip dependent plans entirely
|
|
366
|
+
|
|
367
|
+
**All agents in wave fail:**
|
|
368
|
+
- Something systemic (git issues, permissions, etc.)
|
|
369
|
+
- Stop execution
|
|
370
|
+
- Report for manual investigation
|
|
371
|
+
|
|
372
|
+
**Checkpoint fails to resolve:**
|
|
373
|
+
- User can't approve or provides repeated issues
|
|
374
|
+
- Ask: "Skip this plan?" or "Abort phase execution?"
|
|
375
|
+
- Record partial progress in STATE.md
|
|
376
|
+
</failure_handling>
|
|
377
|
+
|
|
378
|
+
<resumption>
|
|
379
|
+
**Resuming interrupted execution:**
|
|
380
|
+
|
|
381
|
+
If phase execution was interrupted (context limit, user exit, error):
|
|
382
|
+
|
|
383
|
+
1. Run `/gsd:execute-phase {phase}` again
|
|
384
|
+
2. discover_plans finds completed SUMMARYs
|
|
385
|
+
3. Skips completed plans
|
|
386
|
+
4. Resumes from first incomplete plan
|
|
387
|
+
5. Continues wave-based execution
|
|
388
|
+
|
|
389
|
+
**STATE.md tracks:**
|
|
390
|
+
- Last completed plan
|
|
391
|
+
- Current wave
|
|
392
|
+
- Any pending checkpoints
|
|
393
|
+
</resumption>
|