gsd-opencode 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/agents/gsd-codebase-mapper.md +743 -0
  2. package/agents/gsd-debugger.md +1191 -0
  3. package/agents/gsd-executor.md +759 -0
  4. package/agents/gsd-integration-checker.md +427 -0
  5. package/agents/gsd-phase-researcher.md +637 -0
  6. package/agents/gsd-plan-checker.md +749 -0
  7. package/agents/gsd-planner.md +1373 -0
  8. package/agents/gsd-project-researcher.md +877 -0
  9. package/agents/gsd-research-synthesizer.md +250 -0
  10. package/agents/gsd-roadmapper.md +610 -0
  11. package/agents/gsd-verifier.md +782 -0
  12. package/bin/install.js +11 -1
  13. package/command/gsd/add-phase.md +6 -8
  14. package/command/gsd/add-todo.md +6 -8
  15. package/command/gsd/audit-milestone.md +257 -0
  16. package/command/gsd/check-todos.md +2 -4
  17. package/command/gsd/complete-milestone.md +53 -23
  18. package/command/gsd/debug.md +120 -30
  19. package/command/gsd/discuss-phase.md +51 -30
  20. package/command/gsd/execute-phase.md +192 -26
  21. package/command/gsd/help.md +68 -77
  22. package/command/gsd/insert-phase.md +7 -7
  23. package/command/gsd/list-phase-assumptions.md +1 -1
  24. package/command/gsd/map-codebase.md +15 -28
  25. package/command/gsd/new-milestone.md +693 -36
  26. package/command/gsd/new-project.md +670 -110
  27. package/command/gsd/pause-work.md +3 -3
  28. package/command/gsd/plan-milestone-gaps.md +284 -0
  29. package/command/gsd/plan-phase.md +449 -42
  30. package/command/gsd/progress.md +72 -42
  31. package/command/gsd/remove-phase.md +17 -19
  32. package/command/gsd/research-phase.md +155 -67
  33. package/command/gsd/resume-work.md +3 -3
  34. package/command/gsd/update.md +172 -0
  35. package/command/gsd/verify-work.md +186 -38
  36. package/command/gsd/whats-new.md +124 -0
  37. package/get-shit-done/references/checkpoints.md +609 -108
  38. package/get-shit-done/references/continuation-format.md +16 -22
  39. package/get-shit-done/references/git-integration.md +4 -4
  40. package/get-shit-done/references/questioning.md +87 -108
  41. package/get-shit-done/references/tdd.md +3 -3
  42. package/get-shit-done/references/ui-brand.md +160 -0
  43. package/get-shit-done/references/verification-patterns.md +595 -0
  44. package/get-shit-done/templates/DEBUG.md +9 -9
  45. package/get-shit-done/templates/UAT.md +247 -0
  46. package/get-shit-done/templates/codebase/architecture.md +6 -6
  47. package/get-shit-done/templates/codebase/concerns.md +2 -2
  48. package/get-shit-done/templates/codebase/conventions.md +2 -2
  49. package/get-shit-done/templates/codebase/structure.md +8 -8
  50. package/get-shit-done/templates/codebase/testing.md +2 -2
  51. package/get-shit-done/templates/context.md +221 -70
  52. package/get-shit-done/templates/continue-here.md +1 -1
  53. package/get-shit-done/templates/debug-subagent-prompt.md +91 -0
  54. package/get-shit-done/templates/discovery.md +5 -5
  55. package/get-shit-done/templates/phase-prompt.md +118 -5
  56. package/get-shit-done/templates/planner-subagent-prompt.md +117 -0
  57. package/get-shit-done/templates/project.md +1 -1
  58. package/get-shit-done/templates/requirements.md +231 -0
  59. package/get-shit-done/templates/research-project/ARCHITECTURE.md +204 -0
  60. package/get-shit-done/templates/research-project/FEATURES.md +147 -0
  61. package/get-shit-done/templates/research-project/PITFALLS.md +200 -0
  62. package/get-shit-done/templates/research-project/STACK.md +120 -0
  63. package/get-shit-done/templates/research-project/SUMMARY.md +170 -0
  64. package/get-shit-done/templates/research.md +4 -4
  65. package/get-shit-done/templates/roadmap.md +26 -20
  66. package/get-shit-done/templates/state.md +3 -18
  67. package/get-shit-done/templates/summary.md +13 -17
  68. package/get-shit-done/templates/user-setup.md +323 -0
  69. package/get-shit-done/templates/verification-report.md +322 -0
  70. package/get-shit-done/workflows/complete-milestone.md +153 -46
  71. package/get-shit-done/workflows/diagnose-issues.md +233 -0
  72. package/get-shit-done/workflows/discovery-phase.md +13 -18
  73. package/get-shit-done/workflows/discuss-phase.md +311 -126
  74. package/get-shit-done/workflows/execute-phase.md +178 -19
  75. package/get-shit-done/workflows/execute-plan.md +169 -151
  76. package/get-shit-done/workflows/list-phase-assumptions.md +7 -7
  77. package/get-shit-done/workflows/map-codebase.md +87 -232
  78. package/get-shit-done/workflows/resume-project.md +20 -22
  79. package/get-shit-done/workflows/transition.md +9 -25
  80. package/get-shit-done/workflows/verify-phase.md +629 -0
  81. package/get-shit-done/workflows/verify-work.md +495 -134
  82. package/package.json +2 -1
  83. package/command/gsd/consider-issues.md +0 -201
  84. package/command/gsd/create-roadmap.md +0 -115
  85. package/command/gsd/discuss-milestone.md +0 -47
  86. package/command/gsd/execute-plan.md +0 -103
  87. package/command/gsd/plan-fix.md +0 -205
  88. package/command/gsd/status.md +0 -127
  89. package/get-shit-done/references/debugging/debugging-mindset.md +0 -253
  90. package/get-shit-done/references/debugging/hypothesis-testing.md +0 -373
  91. package/get-shit-done/references/debugging/investigation-techniques.md +0 -337
  92. package/get-shit-done/references/debugging/verification-patterns.md +0 -425
  93. package/get-shit-done/references/debugging/when-to-research.md +0 -361
  94. package/get-shit-done/references/plan-format.md +0 -475
  95. package/get-shit-done/references/principles.md +0 -157
  96. package/get-shit-done/references/research-pitfalls.md +0 -215
  97. package/get-shit-done/references/scope-estimation.md +0 -256
  98. package/get-shit-done/templates/agent-history.md +0 -263
  99. package/get-shit-done/templates/checkpoint-return.md +0 -204
  100. package/get-shit-done/templates/config.json +0 -26
  101. package/get-shit-done/templates/continuation-prompt.md +0 -235
  102. package/get-shit-done/templates/issues.md +0 -32
  103. package/get-shit-done/templates/milestone-context.md +0 -93
  104. package/get-shit-done/templates/subagent-task-prompt.md +0 -95
  105. package/get-shit-done/templates/uat-issues.md +0 -143
  106. package/get-shit-done/workflows/_archive/execute-phase.md +0 -899
  107. package/get-shit-done/workflows/create-milestone.md +0 -416
  108. package/get-shit-done/workflows/create-roadmap.md +0 -481
  109. package/get-shit-done/workflows/debug.md +0 -426
  110. package/get-shit-done/workflows/discuss-milestone.md +0 -236
  111. package/get-shit-done/workflows/plan-phase.md +0 -701
  112. package/get-shit-done/workflows/research-phase.md +0 -436
@@ -1,701 +0,0 @@
1
- <decimal_phase_numbering>
2
- Decimal phases enable urgent work insertion without renumbering:
3
-
4
- - Integer phases (1, 2, 3) = planned milestone work
5
- - Decimal phases (2.1, 2.2) = urgent insertions between integers
6
-
7
- **Rules:**
8
- - Decimals between consecutive integers (2.1 between 2 and 3)
9
- - Filesystem sorting works automatically (2 < 2.1 < 2.2 < 3)
10
- - Directory format: `02.1-description/`, Plan format: `02.1-01-PLAN.md`
11
-
12
- **Validation:** Integer X must exist and be complete, X+1 must exist, decimal X.Y must not exist, Y >= 1
13
- </decimal_phase_numbering>
14
-
15
- <required_reading>
16
- **Read these files NOW:**
17
-
18
- 1. ~/.config/opencode/get-shit-done/templates/phase-prompt.md
19
- 2. ~/.config/opencode/get-shit-done/references/plan-format.md
20
- 3. ~/.config/opencode/get-shit-done/references/scope-estimation.md
21
- 4. ~/.config/opencode/get-shit-done/references/checkpoints.md
22
- 5. ~/.config/opencode/get-shit-done/references/tdd.md
23
- 6. .planning/ROADMAP.md
24
- 7. .planning/PROJECT.md
25
-
26
- **Load domain expertise from ROADMAP:**
27
- - Parse ROADMAP.md's `## Domain Expertise` section for paths
28
- - Read each domain SKILL.md (these serve as indexes)
29
- - Determine phase type and load ONLY references relevant to THIS phase type from each SKILL.md's `<references_index>`
30
- </required_reading>
31
-
32
- <purpose>
33
- Create executable phase prompts (PLAN.md files) optimized for parallel execution.
34
-
35
- PLAN.md IS the prompt that Opencode agent executes. Plans are grouped into execution waves based on dependencies - independent plans run in parallel, dependent plans wait for predecessors.
36
- </purpose>
37
-
38
- <planning_principles>
39
- **Parallel by default:** Think in dependency graphs, not sequential lists. Ask "what does this need?" not "what comes next?"
40
-
41
- **Vertical slices over horizontal layers:** Group by feature (User: model + API + UI) not by type (all models → all APIs → all UIs).
42
-
43
- **Explicit dependencies:** Every plan declares what it needs (`depends_on`) and what it touches (`files_modified`). Empty dependencies = parallel candidate.
44
-
45
- **Secure by design:** Assume hostile input on every boundary. Validate, parameterize, authenticate, fail closed.
46
-
47
- **Performance by design:** Assume production load, not demo conditions. Plan for efficient data access, appropriate caching, minimal round trips.
48
-
49
- **Observable by design:** Plan to debug your own work. Include meaningful error messages, appropriate logging, and clear failure states.
50
- </planning_principles>
51
-
52
- <process>
53
-
54
- <step name="load_project_state" priority="first">
55
- Read `.planning/STATE.md` and parse:
56
- - Current position (which phase we're planning)
57
- - Accumulated decisions (constraints on this phase)
58
- - Deferred issues (candidates for inclusion)
59
- - Blockers/concerns (things this phase may address)
60
- - Brief alignment status
61
-
62
- If STATE.md missing but .planning/ exists, offer to reconstruct or continue without.
63
- </step>
64
-
65
- <step name="load_codebase_context">
66
- Check for codebase map:
67
-
68
- ```bash
69
- ls .planning/codebase/*.md 2>/dev/null
70
- ```
71
-
72
- **If .planning/codebase/ exists:** Load relevant documents based on phase type:
73
-
74
- | Phase Keywords | Load These |
75
- |----------------|------------|
76
- | UI, frontend, components | CONVENTIONS.md, STRUCTURE.md |
77
- | API, backend, endpoints | ARCHITECTURE.md, CONVENTIONS.md |
78
- | database, schema, models | ARCHITECTURE.md, STACK.md |
79
- | testing, tests | TESTING.md, CONVENTIONS.md |
80
- | integration, external API | INTEGRATIONS.md, STACK.md |
81
- | refactor, cleanup | CONCERNS.md, ARCHITECTURE.md |
82
- | setup, config | STACK.md, STRUCTURE.md |
83
- | (default) | STACK.md, ARCHITECTURE.md |
84
-
85
- Track extracted constraints for PLAN.md context section.
86
- </step>
87
-
88
- <step name="identify_phase">
89
- Check roadmap and existing phases:
90
-
91
- ```bash
92
- cat .planning/ROADMAP.md
93
- ls .planning/phases/
94
- ```
95
-
96
- If multiple phases available, ask which one to plan. If obvious (first incomplete phase), proceed.
97
-
98
- **Phase number parsing:** Regex `^(\d+)(?:\.(\d+))?$` - Group 1: integer, Group 2: decimal (optional)
99
-
100
- **If decimal phase:** Validate integer X exists and is complete, X+1 exists in roadmap, decimal X.Y doesn't exist, Y >= 1.
101
-
102
- Read any existing PLAN.md or DISCOVERY.md in the phase directory.
103
- </step>
104
-
105
- <step name="mandatory_discovery">
106
- **Discovery is MANDATORY unless you can prove current context exists.**
107
-
108
- <discovery_decision>
109
- **Level 0 - Skip** (pure internal work, existing patterns only)
110
- - ALL work follows established codebase patterns (grep confirms)
111
- - No new external dependencies
112
- - Pure internal refactoring or feature extension
113
- - Examples: Add delete button, add field to model, create CRUD endpoint
114
-
115
- **Level 1 - Quick Verification** (2-5 min)
116
- - Single known library, confirming syntax/version
117
- - Low-risk decision (easily changed later)
118
- - Action: Context7 resolve-library-id + query-docs, no DISCOVERY.md needed
119
-
120
- **Level 2 - Standard Research** (15-30 min)
121
- - Choosing between 2-3 options
122
- - New external integration (API, service)
123
- - Medium-risk decision
124
- - Action: Route to workflows/discovery-phase.md depth=standard, produces DISCOVERY.md
125
-
126
- **Level 3 - Deep Dive** (1+ hour)
127
- - Architectural decision with long-term impact
128
- - Novel problem without clear patterns
129
- - High-risk, hard to change later
130
- - Action: Route to workflows/discovery-phase.md depth=deep, full DISCOVERY.md
131
-
132
- **Depth indicators:**
133
- - Level 2+: New library not in package.json, external API, "choose/select/evaluate" in description, roadmap marked Research: Yes
134
- - Level 3: "architecture/design/system", multiple external services, data modeling, auth design, real-time/distributed
135
- </discovery_decision>
136
-
137
- If roadmap flagged `Research: Likely`, Level 0 (skip) is not available.
138
-
139
- For niche domains (3D, games, audio, shaders, ML), suggest `/gsd-research-phase` before plan-phase.
140
- </step>
141
-
142
- <step name="read_project_history">
143
- **Intelligent context assembly from frontmatter dependency graph:**
144
-
145
- **1. Scan all summary frontmatter (cheap - first ~25 lines):**
146
-
147
- ```bash
148
- for f in .planning/phases/*/*-SUMMARY.md; do
149
- # Extract frontmatter only (between first two --- markers)
150
- sed -n '1,/^---$/p; /^---$/q' "$f" | head -30
151
- done
152
- ```
153
-
154
- Parse YAML to extract: phase, subsystem, requires, provides, affects, tags, key-decisions, key-files
155
-
156
- **2. Build dependency graph for current phase:**
157
-
158
- - **Check affects field:** Which prior phases have current phase in their `affects` list? → Direct dependencies
159
- - **Check subsystem:** Which prior phases share same subsystem? → Related work
160
- - **Check requires chains:** If phase X requires phase Y, and we need X, we also need Y → Transitive dependencies
161
- - **Check roadmap:** Any phases marked as dependencies in ROADMAP.md phase description?
162
-
163
- **3. Select relevant summaries:**
164
-
165
- Auto-select phases that match ANY of:
166
- - Current phase name/number appears in prior phase's `affects` field
167
- - Same `subsystem` value
168
- - In `requires` chain (transitive closure)
169
- - Explicitly mentioned in STATE.md decisions as affecting current phase
170
-
171
- Typical selection: 2-4 prior phases (immediately prior + related subsystem work)
172
-
173
- **4. Extract context from frontmatter (WITHOUT opening full summaries yet):**
174
-
175
- From selected phases' frontmatter, extract:
176
- - **Tech available:** Union of all tech-stack.added lists
177
- - **Patterns established:** Union of all tech-stack.patterns and patterns-established
178
- - **Key files:** Union of all key-files (for @context references)
179
- - **Decisions:** Extract key-decisions from frontmatter
180
-
181
- **5. Now read FULL summaries for selected phases:**
182
-
183
- Only now open and read complete SUMMARY.md files for the selected relevant phases. Extract:
184
- - Detailed "Accomplishments" section
185
- - "Next Phase Readiness" warnings/blockers
186
- - "Issues Encountered" that might affect current phase
187
- - "Deviations from Plan" for patterns
188
-
189
- **From STATE.md:** Decisions → constrain approach. Deferred issues → candidates. Blockers → may need to address.
190
-
191
- **From ISSUES.md:**
192
-
193
- ```bash
194
- cat .planning/ISSUES.md 2>/dev/null
195
- ```
196
-
197
- Assess each open issue - relevant to this phase? Waiting long enough? Natural to address now? Blocking something?
198
-
199
- **Answer before proceeding:**
200
- - Q1: What decisions from previous phases constrain this phase?
201
- - Q2: Are there deferred issues that should become tasks?
202
- - Q3: Are there concerns from "Next Phase Readiness" that apply?
203
- - Q4: Given all context, does the roadmap's description still make sense?
204
-
205
- **Track for PLAN.md context section:**
206
- - Which summaries were selected (for @context references)
207
- - Tech stack available (from frontmatter)
208
- - Established patterns (from frontmatter)
209
- - Key files to reference (from frontmatter)
210
- - Applicable decisions (from frontmatter + full summary)
211
- - Issues being addressed (from ISSUES.md)
212
- - Concerns being verified (from "Next Phase Readiness")
213
- </step>
214
-
215
- <step name="gather_phase_context">
216
- Understand:
217
- - Phase goal (from roadmap)
218
- - What exists already (scan codebase if mid-project)
219
- - Dependencies met (previous phases complete?)
220
- - Any {phase}-RESEARCH.md (from /gsd-research-phase)
221
- - Any DISCOVERY.md (from mandatory discovery)
222
- - Any {phase}-CONTEXT.md (from /gsd-discuss-phase)
223
-
224
- ```bash
225
- # If mid-project, understand current state
226
- ls -la src/ 2>/dev/null
227
- cat package.json 2>/dev/null | head -20
228
-
229
- # Check for ecosystem research (from /gsd-research-phase)
230
- cat .planning/phases/XX-name/${PHASE}-RESEARCH.md 2>/dev/null
231
-
232
- # Check for phase context (from /gsd-discuss-phase)
233
- cat .planning/phases/XX-name/${PHASE}-CONTEXT.md 2>/dev/null
234
- ```
235
-
236
- **If RESEARCH.md exists:** Use standard_stack (these libraries), architecture_patterns (follow in task structure), dont_hand_roll (NEVER custom solutions for listed problems), common_pitfalls (inform verification), code_examples (reference in actions).
237
-
238
- **If CONTEXT.md exists:** Honor vision, prioritize essential, respect boundaries, incorporate specifics.
239
-
240
- **If neither exist:** Suggest /gsd-research-phase for niche domains, /gsd-discuss-phase for simpler domains, or proceed with roadmap only.
241
- </step>
242
-
243
- <step name="break_into_tasks">
244
- Decompose phase into tasks. **Think dependencies first, not sequence.**
245
-
246
- For each potential task, ask:
247
- 1. **What does this task NEED?** (files, types, APIs that must exist)
248
- 2. **What does this task CREATE?** (files, types, APIs others might need)
249
- 3. **Can this run independently?** (no dependencies = Wave 1 candidate)
250
-
251
- **Standard tasks need:**
252
- - **Type**: auto, checkpoint:human-verify, checkpoint:decision (human-action rarely needed)
253
- - **Task name**: Clear, action-oriented
254
- - **Files**: Which files created/modified (for auto tasks)
255
- - **Action**: Specific implementation (including what to avoid and WHY)
256
- - **Verify**: How to prove it worked
257
- - **Done**: Acceptance criteria
258
-
259
- **TDD detection:** For each potential task, evaluate TDD fit:
260
-
261
- TDD candidates (create dedicated TDD plans):
262
- - Business logic with defined inputs/outputs
263
- - API endpoints with request/response contracts
264
- - Data transformations, parsing, formatting
265
- - Validation rules and constraints
266
- - Algorithms with testable behavior
267
- - State machines and workflows
268
-
269
- Standard tasks (remain in standard plans):
270
- - UI layout, styling, visual components
271
- - Configuration changes
272
- - Glue code connecting existing components
273
- - One-off scripts and migrations
274
- - Simple CRUD with no business logic
275
-
276
- **Heuristic:** Can you write `expect(fn(input)).toBe(output)` before writing `fn`?
277
- → Yes: Create a dedicated TDD plan for this feature (one feature per TDD plan)
278
- → No: Standard task in standard plan
279
-
280
- **Why TDD gets its own plan:** TDD requires 2-3 execution cycles (RED → GREEN → REFACTOR), each with file reads, test runs, and potential debugging. Embedded in a multi-task plan, TDD work consumes 50-60% of context alone, degrading quality for remaining tasks.
281
-
282
- **Test framework:** If project has no test setup and TDD plans are needed, the first TDD plan's RED phase handles framework setup as part of writing the first test.
283
-
284
- See `~/.config/opencode/get-shit-done/references/tdd.md` for TDD plan structure.
285
-
286
- **Checkpoints:** Visual/functional verification → checkpoint:human-verify. Implementation choices → checkpoint:decision. Manual action (email, 2FA) → checkpoint:human-action (rare).
287
-
288
- **Critical:** If external resource has CLI/API (Vercel, Stripe, etc.), use type="auto" to automate. Only checkpoint for verification AFTER automation.
289
-
290
- See ~/.config/opencode/get-shit-done/references/checkpoints.md for checkpoint structure.
291
- </step>
292
-
293
- <step name="build_dependency_graph">
294
- **Map task dependencies explicitly before grouping into plans.**
295
-
296
- **1. For each task identified, record:**
297
- - `needs`: What must exist before this task runs (files, types, prior task outputs)
298
- - `creates`: What this task produces (files, types, exports)
299
- - `has_checkpoint`: Does this task require user interaction?
300
-
301
- **2. Build the dependency graph:**
302
-
303
- ```
304
- Example phase with 6 tasks:
305
-
306
- Task A (User model): needs nothing, creates src/models/user.ts
307
- Task B (Product model): needs nothing, creates src/models/product.ts
308
- Task C (User API): needs Task A, creates src/api/users.ts
309
- Task D (Product API): needs Task B, creates src/api/products.ts
310
- Task E (Dashboard): needs Task C + D, creates src/components/Dashboard.tsx
311
- Task F (Verify UI): checkpoint:human-verify, needs Task E
312
-
313
- Dependency graph:
314
- A ──→ C ──┐
315
- ├──→ E ──→ F
316
- B ──→ D ──┘
317
-
318
- Wave analysis:
319
- Wave 1: A, B (independent roots)
320
- Wave 2: C, D (depend only on Wave 1)
321
- Wave 3: E (depends on Wave 2)
322
- Wave 4: F (checkpoint, depends on Wave 3)
323
- ```
324
-
325
- **3. Identify parallelization opportunities:**
326
-
327
- | Pattern | Result |
328
- |---------|--------|
329
- | No dependencies | Wave 1 (parallel) |
330
- | Depends only on Wave 1 | Wave 2 (parallel) |
331
- | Has checkpoint | Runs in wave, but can pause/resume |
332
- | Shared file conflict | Must be sequential |
333
-
334
- **4. Detect and prefer vertical slices:**
335
-
336
- **Sequential (horizontal layers) - AVOID:**
337
- ```
338
- Plan 01: Create User model, Product model, Order model
339
- Plan 02: Create User API, Product API, Order API
340
- Plan 03: Create User UI, Product UI, Order UI
341
- ```
342
- Result: Fully sequential (02 needs 01, 03 needs 02)
343
-
344
- **Parallel (vertical slices) - PREFER:**
345
- ```
346
- Plan 01: User feature (model + API + UI)
347
- Plan 02: Product feature (model + API + UI)
348
- Plan 03: Order feature (model + API + UI)
349
- ```
350
- Result: All three can run in parallel (Wave 1)
351
-
352
- **When vertical slices work:**
353
- - Features are independent (no shared types/data)
354
- - Each slice is self-contained
355
- - No cross-feature dependencies
356
-
357
- **When horizontal layers are necessary:**
358
- - Shared foundation required (auth before protected features)
359
- - Genuine type dependencies (Order needs User type)
360
- - Infrastructure setup (database before all features)
361
-
362
- **5. Output: Dependency map for each plan**
363
-
364
- For each plan, determine:
365
- - `depends_on: []` - plan IDs this plan requires (empty = parallel candidate)
366
- - `files_modified: []` - files this plan touches (for conflict detection)
367
- - `autonomous: true|false` - has checkpoints requiring user interaction?
368
- </step>
369
-
370
- <step name="assign_waves">
371
- **Compute wave numbers before writing plans.**
372
-
373
- Wave assignment algorithm (run in memory before writing any files):
374
-
375
- ```
376
- waves = {} # plan_id -> wave_number
377
-
378
- for each plan in plan_order:
379
- if plan.depends_on is empty:
380
- plan.wave = 1
381
- else:
382
- # Wave = max wave of dependencies + 1
383
- plan.wave = max(waves[dep] for dep in plan.depends_on) + 1
384
-
385
- waves[plan.id] = plan.wave
386
- ```
387
-
388
- **Example:**
389
-
390
- ```
391
- Plan 01: depends_on: [] → wave: 1
392
- Plan 02: depends_on: [] → wave: 1
393
- Plan 03: depends_on: ["01"] → wave: 2
394
- Plan 04: depends_on: ["02"] → wave: 2
395
- Plan 05: depends_on: ["03", "04"] → wave: 3
396
- ```
397
-
398
- Store wave number with each plan in memory. Write to frontmatter in next step.
399
- </step>
400
-
401
- <step name="group_into_plans">
402
- **Group tasks into plans based on dependency waves and autonomy.**
403
-
404
- **Grouping rules:**
405
-
406
- 1. **Same-wave tasks with no file conflicts → can be in parallel plans**
407
- 2. **Tasks with shared files → must be in same plan or sequential plans**
408
- 3. **Checkpoint tasks → mark plan as `autonomous: false`**
409
- 4. **Each plan: 2-3 tasks max, single concern, ~50% context target**
410
-
411
- **Plan assignment algorithm:**
412
-
413
- ```
414
- 1. Start with Wave 1 tasks (no dependencies)
415
- 2. Group into plans by:
416
- - Feature affinity (vertical slice)
417
- - File ownership (no conflicts)
418
- - Checkpoint presence (group checkpoints with related auto tasks)
419
- 3. Move to Wave 2 tasks, repeat
420
- 4. Continue until all tasks assigned
421
- ```
422
-
423
- **Example grouping:**
424
-
425
- ```
426
- Tasks identified:
427
- - A: User model (Wave 1, auto)
428
- - B: Product model (Wave 1, auto)
429
- - C: User API (Wave 2, auto)
430
- - D: Product API (Wave 2, auto)
431
- - E: Dashboard (Wave 3, auto)
432
- - F: Verify Dashboard (Wave 3, checkpoint)
433
-
434
- Grouping into plans:
435
- Plan 01: [A, C] - User feature (model + API)
436
- depends_on: [], autonomous: true
437
-
438
- Plan 02: [B, D] - Product feature (model + API)
439
- depends_on: [], autonomous: true
440
-
441
- Plan 03: [E, F] - Dashboard (build + verify)
442
- depends_on: ["01", "02"], autonomous: false
443
-
444
- Wave structure:
445
- Wave 1 (parallel): Plan 01, Plan 02
446
- Wave 2: Plan 03 (has checkpoint, runs after Wave 1)
447
- ```
448
- </step>
449
-
450
- <step name="estimate_scope">
451
- After grouping, verify each plan fits context budget.
452
-
453
- **Check depth setting:**
454
- ```bash
455
- cat .planning/config.json 2>/dev/null | grep depth
456
- ```
457
-
458
- <depth_aware_splitting>
459
- **Depth controls compression tolerance, not artificial inflation.**
460
-
461
- | Depth | Typical Plans/Phase | Tasks/Plan |
462
- |-------|---------------------|------------|
463
- | Quick | 1-3 | 2-3 |
464
- | Standard | 3-5 | 2-3 |
465
- | Comprehensive | 5-10 | 2-3 |
466
-
467
- **Key principle:** Derive plans from actual work. Depth determines how aggressively you combine things, not a target to hit.
468
-
469
- - Comprehensive auth phase = 8 plans (because auth genuinely has 8 concerns)
470
- - Comprehensive "add config file" phase = 1 plan (because that's all it is)
471
-
472
- For comprehensive depth:
473
- - Create MORE plans when the work warrants it, not bigger ones
474
- - If a phase has 15 tasks, that's 5-8 plans (not 3 plans with 5 tasks each)
475
- - Each plan stays focused: 2-3 tasks, single concern
476
-
477
- For quick depth:
478
- - Combine aggressively into fewer plans
479
- - 1-3 plans per phase is fine
480
- - Focus on critical path
481
- </depth_aware_splitting>
482
-
483
- **ALWAYS split if:** >3 tasks, multiple subsystems, >5 files in any task, complex domains (auth, payments).
484
-
485
- **Each plan must be:** 2-3 tasks max, ~50% context target, independently committable.
486
-
487
- See ~/.config/opencode/get-shit-done/references/scope-estimation.md for complete guidance.
488
- </step>
489
-
490
- <step name="confirm_breakdown">
491
- <if mode="yolo">
492
- Auto-approve and proceed to write_phase_prompt.
493
- </if>
494
-
495
- <if mode="interactive">
496
- Present breakdown with wave structure:
497
-
498
- ```
499
- Phase [X] breakdown:
500
-
501
- ## Execution Waves
502
-
503
- **Wave 1 (parallel):**
504
- {phase}-01: [Plan Name] [autonomous]
505
- - Task: [brief]
506
- - Task: [brief]
507
-
508
- {phase}-02: [Plan Name] [autonomous]
509
- - Task: [brief]
510
- - Task: [brief]
511
-
512
- **Wave 2 (parallel):**
513
- {phase}-03: [Plan Name] (depends: 01, 02) [autonomous]
514
- - Task: [brief]
515
-
516
- **Wave 3:**
517
- {phase}-04: [Plan Name] (depends: 03) [has checkpoint]
518
- - Task: [brief]
519
- - Checkpoint: [type]
520
-
521
- ---
522
- Total: [N] plans in [M] waves
523
- Parallel plans: [X]
524
- Sequential plans: [Y]
525
-
526
- Does this look right? (yes / adjust / start over)
527
- ```
528
-
529
- Wait for confirmation. If "adjust": revise. If "start over": return to gather_phase_context.
530
- </if>
531
- </step>
532
-
533
- <step name="write_phase_prompt">
534
- Use template from `~/.config/opencode/get-shit-done/templates/phase-prompt.md`.
535
-
536
- **Single plan:** Write to `.planning/phases/XX-name/{phase}-01-PLAN.md`
537
-
538
- **Multiple plans:** Write separate files ({phase}-01-PLAN.md, {phase}-02-PLAN.md, etc.)
539
-
540
- Each plan follows template structure with:
541
- - Frontmatter (phase, plan, type, depends_on, files_modified, autonomous, domain)
542
- - Objective (plan-specific goal, purpose, output)
543
- - Execution context (execute-plan.md, summary template, checkpoints.md if needed)
544
- - Context (@references to PROJECT, ROADMAP, STATE, codebase docs, RESEARCH/DISCOVERY/CONTEXT if exist, prior summaries, source files)
545
- - Tasks (XML format with types)
546
- - Verification, Success criteria, Output specification
547
-
548
- **Plan frontmatter:**
549
-
550
- ```yaml
551
- ---
552
- phase: XX-name
553
- plan: NN
554
- type: execute
555
- wave: N # Execution wave (1, 2, 3...). Computed at plan time.
556
- depends_on: [] # Plan IDs this plan requires.
557
- files_modified: [] # Files this plan touches.
558
- autonomous: true # false if plan has checkpoints requiring user interaction
559
- domain: [optional]
560
- ---
561
- ```
562
-
563
- **Wave is pre-computed:** Wave numbers are assigned during planning (see `assign_waves` step). `/gsd-execute-phase` reads `wave` directly from frontmatter and groups plans by wave number. No runtime dependency analysis needed.
564
-
565
- **Context section - parallel-aware:**
566
-
567
- Only include prior plan SUMMARY references if this plan genuinely needs decisions/outputs:
568
-
569
- ```markdown
570
- <context>
571
- @.planning/PROJECT.md
572
- @.planning/ROADMAP.md
573
- @.planning/STATE.md
574
-
575
- # Only reference prior plans if genuinely needed:
576
- # - This plan uses types/exports from prior plan
577
- # - This plan continues work from prior plan
578
- # - Prior plan made decision that affects this plan
579
- #
580
- # Do NOT reflexively chain: Plan 02 refs 01, Plan 03 refs 02...
581
- # Independent plans need no prior SUMMARY references.
582
-
583
- @path/to/relevant/source.ts
584
- </context>
585
- ```
586
-
587
- **For plans with checkpoints:**
588
-
589
- Include checkpoint reference in execution_context:
590
- ```markdown
591
- <execution_context>
592
- @~/.config/opencode/get-shit-done/workflows/execute-plan.md
593
- @~/.config/opencode/get-shit-done/templates/summary.md
594
- @~/.config/opencode/get-shit-done/references/checkpoints.md
595
- </execution_context>
596
- ```
597
-
598
- Checkpoint plans can still run in parallel waves. When they hit a checkpoint, they pause and return to the orchestrator. User responds, orchestrator resumes the agent.
599
- </step>
600
-
601
- <step name="git_commit">
602
- Commit phase plan(s):
603
-
604
- ```bash
605
- # Stage all PLAN.md files for this phase
606
- git add .planning/phases/${PHASE}-*/${PHASE}-*-PLAN.md
607
-
608
- # Also stage DISCOVERY.md if it was created during mandatory_discovery
609
- git add .planning/phases/${PHASE}-*/DISCOVERY.md 2>/dev/null
610
-
611
- git commit -m "$(cat <<'EOF'
612
- docs(${PHASE}): create phase plan
613
-
614
- Phase ${PHASE}: ${PHASE_NAME}
615
- - [N] plan(s) in [M] wave(s)
616
- - [X] parallel, [Y] sequential
617
- - Ready for execution
618
- EOF
619
- )"
620
- ```
621
-
622
- Confirm: "Committed: docs(${PHASE}): create phase plan"
623
- </step>
624
-
625
- <step name="offer_next">
626
- ```
627
- Phase {X} planned: {N} plan(s) in {M} wave(s)
628
-
629
- ## Wave Structure
630
- Wave 1 (parallel): {plan-01}, {plan-02}
631
- Wave 2: {plan-03}
632
- ...
633
-
634
- ---
635
-
636
- ## Next Up
637
-
638
- [If 1 plan created:]
639
- **{phase}-01: [Plan Name]** - [objective summary]
640
-
641
- `/gsd-execute-plan .planning/phases/XX-name/{phase}-01-PLAN.md`
642
-
643
- [If 2+ plans created:]
644
- **Phase {X}: [Phase Name]** - {N} plans in {M} waves
645
-
646
- `/gsd-execute-phase {X}`
647
-
648
- *`/clear` first - fresh context window*
649
-
650
- ---
651
-
652
- **Also available:**
653
- - Review/adjust plans before executing
654
- [If 2+ plans: - `/gsd-execute-plan {phase}-01-PLAN.md` - run plans one at a time]
655
- [If 2+ plans: - View all plans: `ls .planning/phases/XX-name/*-PLAN.md`]
656
-
657
- ---
658
- ```
659
- </step>
660
-
661
- </process>
662
-
663
- <task_quality>
664
- **Good tasks:** Specific files, actions, verification
665
- - "Add User model to Prisma schema with email, passwordHash, createdAt"
666
- - "Create POST /api/auth/login endpoint with bcrypt validation"
667
-
668
- **Bad tasks:** Vague, not actionable
669
- - "Set up authentication" / "Make it secure" / "Handle edge cases"
670
-
671
- If you can't specify Files + Action + Verify + Done, the task is too vague.
672
-
673
- **TDD candidates get dedicated plans.** If "Create price calculator with discount rules" warrants TDD, create a TDD plan for it. See `~/.config/opencode/get-shit-done/references/tdd.md` for TDD plan structure.
674
- </task_quality>
675
-
676
- <anti_patterns>
677
- - No story points or hour estimates
678
- - No team assignments
679
- - No acceptance criteria committees
680
- - No sub-sub-sub tasks
681
- - **No reflexive sequential chaining** (Plan 02 depends on 01 "just because")
682
- Tasks are instructions for Claude, not Jira tickets.
683
- </anti_patterns>
684
-
685
- <success_criteria>
686
- Phase planning complete when:
687
- - [ ] STATE.md read, project history absorbed
688
- - [ ] Mandatory discovery completed (Level 0-3)
689
- - [ ] Prior decisions, issues, concerns synthesized
690
- - [ ] Dependency graph built (needs/creates for each task)
691
- - [ ] Tasks grouped into plans by wave, not by sequence
692
- - [ ] PLAN file(s) exist with XML structure
693
- - [ ] Each plan: depends_on, files_modified, autonomous in frontmatter
694
- - [ ] Each plan: Objective, context, tasks, verification, success criteria, output
695
- - [ ] Each plan: 2-3 tasks (~50% context)
696
- - [ ] Each task: Type, Files (if auto), Action, Verify, Done
697
- - [ ] Checkpoints properly structured
698
- - [ ] Wave structure maximizes parallelism
699
- - [ ] PLAN file(s) committed to git
700
- - [ ] User knows next steps and wave structure
701
- </success_criteria>