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