gsd-opencode 1.3.31

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 (68) hide show
  1. package/bin/install.js +222 -0
  2. package/command/gsd/add-phase.md +207 -0
  3. package/command/gsd/complete-milestone.md +105 -0
  4. package/command/gsd/consider-issues.md +201 -0
  5. package/command/gsd/create-roadmap.md +115 -0
  6. package/command/gsd/discuss-milestone.md +47 -0
  7. package/command/gsd/discuss-phase.md +60 -0
  8. package/command/gsd/execute-plan.md +128 -0
  9. package/command/gsd/help.md +315 -0
  10. package/command/gsd/insert-phase.md +227 -0
  11. package/command/gsd/list-phase-assumptions.md +50 -0
  12. package/command/gsd/map-codebase.md +84 -0
  13. package/command/gsd/new-milestone.md +59 -0
  14. package/command/gsd/new-project.md +316 -0
  15. package/command/gsd/pause-work.md +122 -0
  16. package/command/gsd/plan-fix.md +205 -0
  17. package/command/gsd/plan-phase.md +67 -0
  18. package/command/gsd/progress.md +316 -0
  19. package/command/gsd/remove-phase.md +338 -0
  20. package/command/gsd/research-phase.md +91 -0
  21. package/command/gsd/resume-work.md +40 -0
  22. package/command/gsd/verify-work.md +71 -0
  23. package/get-shit-done/references/checkpoints.md +287 -0
  24. package/get-shit-done/references/continuation-format.md +255 -0
  25. package/get-shit-done/references/git-integration.md +254 -0
  26. package/get-shit-done/references/plan-format.md +428 -0
  27. package/get-shit-done/references/principles.md +157 -0
  28. package/get-shit-done/references/questioning.md +162 -0
  29. package/get-shit-done/references/research-pitfalls.md +215 -0
  30. package/get-shit-done/references/scope-estimation.md +172 -0
  31. package/get-shit-done/references/tdd.md +263 -0
  32. package/get-shit-done/templates/codebase/architecture.md +255 -0
  33. package/get-shit-done/templates/codebase/concerns.md +310 -0
  34. package/get-shit-done/templates/codebase/conventions.md +307 -0
  35. package/get-shit-done/templates/codebase/integrations.md +280 -0
  36. package/get-shit-done/templates/codebase/stack.md +186 -0
  37. package/get-shit-done/templates/codebase/structure.md +285 -0
  38. package/get-shit-done/templates/codebase/testing.md +480 -0
  39. package/get-shit-done/templates/config.json +18 -0
  40. package/get-shit-done/templates/context.md +161 -0
  41. package/get-shit-done/templates/continue-here.md +78 -0
  42. package/get-shit-done/templates/discovery.md +146 -0
  43. package/get-shit-done/templates/issues.md +32 -0
  44. package/get-shit-done/templates/milestone-archive.md +123 -0
  45. package/get-shit-done/templates/milestone-context.md +93 -0
  46. package/get-shit-done/templates/milestone.md +115 -0
  47. package/get-shit-done/templates/phase-prompt.md +303 -0
  48. package/get-shit-done/templates/project.md +184 -0
  49. package/get-shit-done/templates/research.md +529 -0
  50. package/get-shit-done/templates/roadmap.md +196 -0
  51. package/get-shit-done/templates/state.md +210 -0
  52. package/get-shit-done/templates/summary.md +273 -0
  53. package/get-shit-done/templates/uat-issues.md +143 -0
  54. package/get-shit-done/workflows/complete-milestone.md +643 -0
  55. package/get-shit-done/workflows/create-milestone.md +416 -0
  56. package/get-shit-done/workflows/create-roadmap.md +481 -0
  57. package/get-shit-done/workflows/discovery-phase.md +293 -0
  58. package/get-shit-done/workflows/discuss-milestone.md +236 -0
  59. package/get-shit-done/workflows/discuss-phase.md +247 -0
  60. package/get-shit-done/workflows/execute-phase.md +1625 -0
  61. package/get-shit-done/workflows/list-phase-assumptions.md +178 -0
  62. package/get-shit-done/workflows/map-codebase.md +434 -0
  63. package/get-shit-done/workflows/plan-phase.md +488 -0
  64. package/get-shit-done/workflows/research-phase.md +436 -0
  65. package/get-shit-done/workflows/resume-project.md +287 -0
  66. package/get-shit-done/workflows/transition.md +580 -0
  67. package/get-shit-done/workflows/verify-work.md +202 -0
  68. package/package.json +38 -0
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: gsd:plan-phase
3
+ description: Create detailed execution plan for a phase (PLAN.md)
4
+ argument-hint: "[phase]"
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Write
9
+ - Glob
10
+ - Grep
11
+ - question
12
+ - webfetch
13
+ - mcp__context7__*
14
+ ---
15
+
16
+ <objective>
17
+ Create executable phase prompt with discovery, context injection, and task breakdown.
18
+
19
+ Purpose: Break down roadmap phases into concrete, executable PLAN.md files that Claude can execute.
20
+ Output: One or more PLAN.md files in the phase directory (.planning/phases/XX-name/{phase}-{plan}-PLAN.md)
21
+ </objective>
22
+
23
+ <execution_context>
24
+ @~/.config/opencode/get-shit-done/workflows/plan-phase.md
25
+ @~/.config/opencode/get-shit-done/templates/phase-prompt.md
26
+ @~/.config/opencode/get-shit-done/references/plan-format.md
27
+ @~/.config/opencode/get-shit-done/references/scope-estimation.md
28
+ @~/.config/opencode/get-shit-done/references/checkpoints.md
29
+ @~/.config/opencode/get-shit-done/references/tdd.md
30
+ </execution_context>
31
+
32
+ <context>
33
+ Phase number: $ARGUMENTS (optional - auto-detects next unplanned phase if not provided)
34
+
35
+ **Load project state first:**
36
+ @.planning/STATE.md
37
+
38
+ **Load roadmap:**
39
+ @.planning/ROADMAP.md
40
+
41
+ **Load phase context if exists (created by /gsd:discuss-phase):**
42
+ Check for and read `.planning/phases/XX-name/{phase}-CONTEXT.md` - contains research findings, clarifications, and decisions from phase discussion.
43
+
44
+ **Load codebase context if exists:**
45
+ Check for `.planning/codebase/` and load relevant documents based on phase type.
46
+ </context>
47
+
48
+ <process>
49
+ 1. Check .planning/ directory exists (error if not - user should run /gsd:new-project)
50
+ 2. If phase number provided via $ARGUMENTS, validate it exists in roadmap
51
+ 3. If no phase number, detect next unplanned phase from roadmap
52
+ 4. Follow plan-phase.md workflow:
53
+ - Load project state and accumulated decisions
54
+ - Perform mandatory discovery (Level 0-3 as appropriate)
55
+ - Read project history (prior decisions, issues, concerns)
56
+ - Break phase into tasks
57
+ - Estimate scope and split into multiple plans if needed
58
+ - Create PLAN.md file(s) with executable structure
59
+ </process>
60
+
61
+ <success_criteria>
62
+
63
+ - One or more PLAN.md files created in .planning/phases/XX-name/
64
+ - Each plan has: objective, execution_context, context, tasks, verification, success_criteria, output
65
+ - Tasks are specific enough for Claude to execute
66
+ - User knows next steps (execute plan or review/adjust)
67
+ </success_criteria>
@@ -0,0 +1,316 @@
1
+ ---
2
+ name: gsd:progress
3
+ description: Check project progress, show context, and route to next action (execute or plan)
4
+ allowed-tools:
5
+ - Read
6
+ - Bash
7
+ - Grep
8
+ - Glob
9
+ ---
10
+
11
+ <objective>
12
+ Check project progress, summarize recent work and what's ahead, then intelligently route to the next action - either executing an existing plan or creating the next one.
13
+
14
+ Provides situational awareness before continuing work.
15
+ </objective>
16
+
17
+
18
+ <process>
19
+
20
+ <step name="verify">
21
+ **Verify planning structure exists:**
22
+
23
+ If no `.planning/` directory:
24
+
25
+ ```
26
+ No planning structure found.
27
+
28
+ Run /gsd:new-project to start a new project.
29
+ ```
30
+
31
+ Exit.
32
+
33
+ If missing STATE.md or ROADMAP.md: inform what's missing, suggest running `/gsd:new-project`.
34
+ </step>
35
+
36
+ <step name="load">
37
+ **Load full project context:**
38
+
39
+ - Read `.planning/STATE.md` for living memory (position, decisions, issues)
40
+ - Read `.planning/ROADMAP.md` for phase structure and objectives
41
+ - Read `.planning/PROJECT.md` for current state (What This Is, Core Value, Requirements)
42
+ </step>
43
+
44
+ <step name="recent">
45
+ **Gather recent work context:**
46
+
47
+ - Find 2-3 most recent SUMMARY.md files
48
+ - Extract from each: what was accomplished, key decisions, any issues logged
49
+ - This shows "what we've been working on"
50
+ </step>
51
+
52
+ <step name="position">
53
+ **Parse current position:**
54
+
55
+ - From STATE.md: current phase, plan number, status
56
+ - Calculate: total plans, completed plans, remaining plans
57
+ - Note any blockers, concerns, or deferred issues
58
+ - Check for CONTEXT.md: For phases without PLAN.md files, check if `{phase}-CONTEXT.md` exists in phase directory
59
+ </step>
60
+
61
+ <step name="report">
62
+ **Present rich status report:**
63
+
64
+ ```
65
+ # [Project Name]
66
+
67
+ **Progress:** [████████░░] 8/10 plans complete
68
+
69
+ ## Recent Work
70
+ - [Phase X, Plan Y]: [what was accomplished - 1 line]
71
+ - [Phase X, Plan Z]: [what was accomplished - 1 line]
72
+
73
+ ## Current Position
74
+ Phase [N] of [total]: [phase-name]
75
+ Plan [M] of [phase-total]: [status]
76
+ CONTEXT: [✓ if CONTEXT.md exists | - if not]
77
+
78
+ ## Key Decisions Made
79
+ - [decision 1 from STATE.md]
80
+ - [decision 2]
81
+
82
+ ## Open Issues
83
+ - [any deferred issues or blockers]
84
+
85
+ ## What's Next
86
+ [Next phase/plan objective from ROADMAP]
87
+ ```
88
+
89
+ </step>
90
+
91
+ <step name="route">
92
+ **Determine next action based on verified counts.**
93
+
94
+ **Step 1: Count plans, summaries, and issues in current phase**
95
+
96
+ List files in current phase directory:
97
+
98
+ ```bash
99
+ ls -1 .planning/phases/[current-phase-dir]/*-PLAN.md 2>/dev/null | wc -l
100
+ ls -1 .planning/phases/[current-phase-dir]/*-SUMMARY.md 2>/dev/null | wc -l
101
+ ls -1 .planning/phases/[current-phase-dir]/*-ISSUES.md 2>/dev/null | wc -l
102
+ ls -1 .planning/phases/[current-phase-dir]/*-FIX.md 2>/dev/null | wc -l
103
+ ls -1 .planning/phases/[current-phase-dir]/*-FIX-SUMMARY.md 2>/dev/null | wc -l
104
+ ```
105
+
106
+ State: "This phase has {X} plans, {Y} summaries, {Z} issues files, {W} fix plans."
107
+
108
+ **Step 1.5: Check for unaddressed UAT issues**
109
+
110
+ For each *-ISSUES.md file, check if matching *-FIX.md exists.
111
+ For each *-FIX.md file, check if matching *-FIX-SUMMARY.md exists.
112
+
113
+ Track:
114
+ - `issues_without_fix`: ISSUES.md files without FIX.md
115
+ - `fixes_without_summary`: FIX.md files without FIX-SUMMARY.md
116
+
117
+ **Step 2: Route based on counts**
118
+
119
+ | Condition | Meaning | Action |
120
+ |-----------|---------|--------|
121
+ | fixes_without_summary > 0 | Unexecuted fix plans exist | Go to **Route A** (with FIX.md) |
122
+ | issues_without_fix > 0 | UAT issues need fix plans | Go to **Route E** |
123
+ | summaries < plans | Unexecuted plans exist | Go to **Route A** |
124
+ | summaries = plans AND plans > 0 | Phase complete | Go to Step 3 |
125
+ | plans = 0 | Phase not yet planned | Go to **Route B** |
126
+
127
+ ---
128
+
129
+ **Route A: Unexecuted plan exists**
130
+
131
+ Find first PLAN.md without matching SUMMARY.md.
132
+ Read its `<objective>` section.
133
+
134
+ ```
135
+ ---
136
+
137
+ ## ▶ Next Up
138
+
139
+ **{phase}-{plan}: [Plan Name]** — [objective summary from PLAN.md]
140
+
141
+ `/gsd:execute-plan [full-path-to-PLAN.md]`
142
+
143
+ *`/clear` first → fresh context window*
144
+
145
+ ---
146
+ ```
147
+
148
+ ---
149
+
150
+ **Route B: Phase needs planning**
151
+
152
+ Check if `{phase}-CONTEXT.md` exists in phase directory.
153
+
154
+ **If CONTEXT.md exists:**
155
+
156
+ ```
157
+ ---
158
+
159
+ ## ▶ Next Up
160
+
161
+ **Phase {N}: {Name}** — {Goal from ROADMAP.md}
162
+ *✓ Context gathered, ready to plan*
163
+
164
+ `/gsd:plan-phase {phase-number}`
165
+
166
+ *`/clear` first → fresh context window*
167
+
168
+ ---
169
+ ```
170
+
171
+ **If CONTEXT.md does NOT exist:**
172
+
173
+ ```
174
+ ---
175
+
176
+ ## ▶ Next Up
177
+
178
+ **Phase {N}: {Name}** — {Goal from ROADMAP.md}
179
+
180
+ `/gsd:plan-phase {phase}`
181
+
182
+ *`/clear` first → fresh context window*
183
+
184
+ ---
185
+
186
+ **Also available:**
187
+ - `/gsd:discuss-phase {phase}` — gather context first
188
+ - `/gsd:research-phase {phase}` — investigate unknowns
189
+ - `/gsd:list-phase-assumptions {phase}` — see Claude's assumptions
190
+
191
+ ---
192
+ ```
193
+
194
+ ---
195
+
196
+ **Route E: UAT issues need fix plans**
197
+
198
+ ISSUES.md exists without matching FIX.md. User needs to plan fixes.
199
+
200
+ ```
201
+ ---
202
+
203
+ ## ⚠ UAT Issues Found
204
+
205
+ **{plan}-ISSUES.md** has {N} issues without a fix plan.
206
+
207
+ `/gsd:plan-fix {plan}`
208
+
209
+ *`/clear` first → fresh context window*
210
+
211
+ ---
212
+
213
+ **Also available:**
214
+ - `/gsd:execute-plan [path]` — continue with other work first
215
+ - `/gsd:verify-work {phase}` — run more UAT testing
216
+
217
+ ---
218
+ ```
219
+
220
+ ---
221
+
222
+ **Step 3: Check milestone status (only when phase complete)**
223
+
224
+ Read ROADMAP.md and identify:
225
+ 1. Current phase number
226
+ 2. All phase numbers in current milestone section
227
+
228
+ Count total phases and identify highest phase number.
229
+
230
+ State: "Current phase is {X}. Milestone has {N} phases (highest: {Y})."
231
+
232
+ **Route based on milestone status:**
233
+
234
+ | Condition | Meaning | Action |
235
+ |-----------|---------|--------|
236
+ | current phase < highest phase | More phases remain | Go to **Route C** |
237
+ | current phase = highest phase | Milestone complete | Go to **Route D** |
238
+
239
+ ---
240
+
241
+ **Route C: Phase complete, more phases remain**
242
+
243
+ Read ROADMAP.md to get next phase's name and goal.
244
+
245
+ ```
246
+ ---
247
+
248
+ ## ✓ Phase {Z} Complete
249
+
250
+ ## ▶ Next Up
251
+
252
+ **Phase {Z+1}: {Name}** — {Goal from ROADMAP.md}
253
+
254
+ `/gsd:plan-phase {Z+1}`
255
+
256
+ *`/clear` first → fresh context window*
257
+
258
+ ---
259
+
260
+ **Also available:**
261
+ - `/gsd:verify-work {Z}` — user acceptance test before continuing
262
+ - `/gsd:discuss-phase {Z+1}` — gather context first
263
+ - `/gsd:research-phase {Z+1}` — investigate unknowns
264
+
265
+ ---
266
+ ```
267
+
268
+ ---
269
+
270
+ **Route D: Milestone complete**
271
+
272
+ ```
273
+ ---
274
+
275
+ ## 🎉 Milestone Complete
276
+
277
+ All {N} phases finished!
278
+
279
+ ## ▶ Next Up
280
+
281
+ **Complete Milestone** — archive and prepare for next
282
+
283
+ `/gsd:complete-milestone`
284
+
285
+ *`/clear` first → fresh context window*
286
+
287
+ ---
288
+
289
+ **Also available:**
290
+ - `/gsd:verify-work` — user acceptance test before completing milestone
291
+
292
+ ---
293
+ ```
294
+
295
+ </step>
296
+
297
+ <step name="edge_cases">
298
+ **Handle edge cases:**
299
+
300
+ - Phase complete but next phase not planned → offer `/gsd:plan-phase [next]`
301
+ - All work complete → offer milestone completion
302
+ - Blockers present → highlight before offering to continue
303
+ - Handoff file exists → mention it, offer `/gsd:resume-work`
304
+ </step>
305
+
306
+ </process>
307
+
308
+ <success_criteria>
309
+
310
+ - [ ] Rich context provided (recent work, decisions, issues)
311
+ - [ ] Current position clear with visual progress
312
+ - [ ] What's next clearly explained
313
+ - [ ] Smart routing: /gsd:execute-plan if plan exists, /gsd:plan-phase if not
314
+ - [ ] User confirms before any action
315
+ - [ ] Seamless handoff to appropriate gsd command
316
+ </success_criteria>
@@ -0,0 +1,338 @@
1
+ ---
2
+ name: gsd:remove-phase
3
+ description: Remove a future phase from roadmap and renumber subsequent phases
4
+ argument-hint: <phase-number>
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Bash
9
+ - Glob
10
+ ---
11
+
12
+ <objective>
13
+ Remove an unstarted future phase from roadmap and renumber all subsequent phases to maintain a clean, linear sequence.
14
+
15
+ Purpose: Clean removal of work you've decided not to do, without poluting context with cancelled/deferred markers.
16
+ Output: Phase deleted, all subsequent phases renumbered, git commit as historical record.
17
+ </objective>
18
+
19
+ <execution_context>
20
+ @.planning/ROADMAP.md
21
+ @.planning/STATE.md
22
+ </execution_context>
23
+
24
+ <process>
25
+
26
+ <step name="parse_arguments">
27
+ Parse command arguments:
28
+ - Argument is phase number to remove (integer or decimal)
29
+ - Example: `/gsd:remove-phase 17` → phase = 17
30
+ - Example: `/gsd:remove-phase 16.1` → phase = 16.1
31
+
32
+ If no argument provided:
33
+
34
+ ```
35
+ ERROR: Phase number required
36
+ Usage: /gsd:remove-phase <phase-number>
37
+ Example: /gsd:remove-phase 17
38
+ ```
39
+
40
+ Exit.
41
+ </step>
42
+
43
+ <step name="load_state">
44
+ Load project state:
45
+
46
+ ```bash
47
+ cat .planning/STATE.md 2>/dev/null
48
+ cat .planning/ROADMAP.md 2>/dev/null
49
+ ```
50
+
51
+ Parse current phase number from STATE.md "Current Position" section.
52
+ </step>
53
+
54
+ <step name="validate_phase_exists">
55
+ Verify that target phase exists in ROADMAP.md:
56
+
57
+ 1. Search for `### Phase {target}:` heading
58
+ 2. If not found:
59
+
60
+ ```
61
+ ERROR: Phase {target} not found in roadmap
62
+ Available phases: [list phase numbers]
63
+ ```
64
+
65
+ Exit.
66
+ </step>
67
+
68
+ <step name="validate_future_phase">
69
+ Verify that phase is a future phase (not started):
70
+
71
+ 1. Compare target phase to current phase from STATE.md
72
+ 2. Target must be > current phase number
73
+
74
+ If target <= current phase:
75
+
76
+ ```
77
+ ERROR: Cannot remove Phase {target}
78
+
79
+ Only future phases can be removed:
80
+ - Current phase: {current}
81
+ - Phase {target} is current or completed
82
+
83
+ To abandon current work, use /gsd:pause-work instead.
84
+ ```
85
+
86
+ Exit.
87
+
88
+ 3. Check for SUMMARY.md files in phase directory:
89
+
90
+ ```bash
91
+ ls .planning/phases/{target}-*/*-SUMMARY.md 2>/dev/null
92
+ ```
93
+
94
+ If any SUMMARY.md files exist:
95
+
96
+ ```
97
+ ERROR: Phase {target} has completed work
98
+
99
+ Found executed plans:
100
+ - {list of SUMMARY.md files}
101
+
102
+ Cannot remove phases with completed work.
103
+ ```
104
+
105
+ Exit.
106
+ </step>
107
+
108
+ <step name="gather_phase_info">
109
+ Collect information about phase being removed:
110
+
111
+ 1. Extract phase name from ROADMAP.md heading: `### Phase {target}: {Name}`
112
+ 2. Find phase directory: `.planning/phases/{target}-{slug}/`
113
+ 3. Find all subsequent phases (integer and decimal) that need renumbering
114
+
115
+ **Subsequent phase detection:**
116
+
117
+ For integer phase removal (e.g., 17):
118
+ - Find all phases > 17 (integers: 18, 19, 20...)
119
+ - Find all decimal phases >= 17.0 and < 18.0 (17.1, 17.2...) → these become 16.x
120
+ - Find all decimal phases for subsequent integers (18.1, 19.1...) → renumber with their parent
121
+
122
+ For decimal phase removal (e.g., 17.1):
123
+ - Find all decimal phases > 17.1 and < 18 (17.2, 17.3...) → renumber down
124
+ - Integer phases unchanged
125
+
126
+ List all phases that will be renumbered.
127
+ </step>
128
+
129
+ <step name="confirm_removal">
130
+ Present removal summary and confirm:
131
+
132
+ ```
133
+ Removing Phase {target}: {Name}
134
+
135
+ This will:
136
+ - Delete: .planning/phases/{target}-{slug}/
137
+ - Renumber {N} subsequent phases:
138
+ - Phase 18 → Phase 17
139
+ - Phase 18.1 → Phase 17.1
140
+ - Phase 19 → Phase 18
141
+ [etc.]
142
+
143
+ Proceed? (y/n)
144
+ ```
145
+
146
+ Wait for confirmation.
147
+ </step>
148
+
149
+ <step name="delete_phase_directory">
150
+ Delete target phase directory if it exists:
151
+
152
+ ```bash
153
+ if [ -d ".planning/phases/{target}-{slug}" ]; then
154
+ rm -rf ".planning/phases/{target}-${slug}"
155
+ echo "Deleted: .planning/phases/{target}-${slug}/"
156
+ fi
157
+ ```
158
+
159
+ If directory doesn't exist, note: "No directory to delete (phase not yet created)"
160
+ </step>
161
+
162
+ <step name="renumber_directories">
163
+ Rename all subsequent phase directories:
164
+
165
+ For each phase directory that needs renumbering (in reverse order to avoid conflicts):
166
+
167
+ ```bash
168
+ # Example: renaming 18-dashboard to 17-dashboard
169
+ mv ".planning/phases/18-dashboard" ".planning/phases/17-dashboard"
170
+ ```
171
+
172
+ Process in descending order (20→19, then 19→18, then 18→17) to avoid overwriting.
173
+
174
+ Also rename decimal phase directories:
175
+ - `17.1-fix-bug` → `16.1-fix-bug` (if removing integer 17)
176
+ - `17.2-hotfix` → `17.1-hotfix` (if removing decimal 17.1)
177
+ </step>
178
+
179
+ <step name="rename_files_in_directories">
180
+ Rename plan files inside renumbered directories:
181
+
182
+ For each renumbered directory, rename files that contain phase number:
183
+
184
+ ```bash
185
+ # Inside 17-dashboard (was 18-dashboard):
186
+ mv "18-01-PLAN.md" "17-01-PLAN.md"
187
+ mv "18-02-PLAN.md" "17-02-PLAN.md"
188
+ mv "18-01-SUMMARY.md" "17-01-SUMMARY.md" # if exists
189
+ # etc.
190
+ ```
191
+
192
+ Also handle CONTEXT.md and DISCOVERY.md (these don't have phase prefixes, so no rename needed).
193
+ </step>
194
+
195
+ <step name="update_roadmap">
196
+ Update ROADMAP.md:
197
+
198
+ 1. **Remove** phase section entirely:
199
+ - Delete from `### Phase {target}:` to next phase heading (or section end)
200
+
201
+ 2. **Remove from phase list:**
202
+ - Delete line `- [ ] **Phase {target}: {Name}**` or similar
203
+
204
+ 3. **Remove from Progress table:**
205
+ - Delete of row for Phase {target}
206
+
207
+ 4. **Renumber all subsequent phases:**
208
+ - `### Phase 18:` → `### Phase 17:`
209
+ - `- [ ] **Phase 18:` → `- [ ] **Phase 17:`
210
+ - Table rows: `| 18. Dashboard |` → `| 17. Dashboard |`
211
+ - Plan references: `18-01:` → `17-01:`
212
+
213
+ 5. **Update dependency references:**
214
+ - `**Depends on:** Phase 18` → `**Depends on:** Phase 17`
215
+ - For phase that depended on removed phase:
216
+ - `**Depends on:** Phase 17` (removed) → `**Depends on:** Phase 16`
217
+
218
+ 6. **Renumber decimal phases:**
219
+ - `### Phase 17.1:` → `### Phase 16.1:` (if integer 17 removed)
220
+ - Update all references consistently
221
+
222
+ Write updated ROADMAP.md.
223
+ </step>
224
+
225
+ <step name="update_state">
226
+ Update STATE.md:
227
+
228
+ 1. **Update total phase count:**
229
+ - `Phase: 16 of 20` → `Phase: 16 of 19`
230
+
231
+ 2. **Recalculate progress percentage:**
232
+ - New percentage based on completed plans / new total plans
233
+
234
+ Do NOT add a "Roadmap Evolution" note - git commit is the record.
235
+
236
+ Write updated STATE.md.
237
+ </step>
238
+
239
+ <step name="update_file_contents">
240
+ Search for and update phase references inside plan files:
241
+
242
+ ```bash
243
+ # Find files that reference to old phase numbers
244
+ grep -r "Phase 18" .planning/phases/17-*/ 2>/dev/null
245
+ grep -r "Phase 19" .planning/phases/18-*/ 2>/dev/null
246
+ # etc.
247
+ ```
248
+
249
+ Update any internal references to reflect new numbering.
250
+ </step>
251
+
252
+ <step name="commit">
253
+ Stage and commit removal:
254
+
255
+ ```bash
256
+ git add .planning/
257
+ git commit -m "chore: remove phase {target} ({original-phase-name})"
258
+ ```
259
+
260
+ The commit message preserves the historical record of what was removed.
261
+ </step>
262
+
263
+ <step name="completion">
264
+ Present completion summary:
265
+
266
+ ```
267
+ Phase {target} ({original-name}) removed.
268
+
269
+ Changes:
270
+ - Deleted: .planning/phases/{target}-{slug}/
271
+ - Renumbered: Phases {first-renumbered}-{last-old} → {first-renumbered-1}-{last-new}
272
+ - Updated: ROADMAP.md, STATE.md
273
+ - Committed: chore: remove phase {target} ({original-name})
274
+
275
+ Current roadmap: {total-remaining} phases
276
+ Current position: Phase {current} of {new-total}
277
+
278
+ ---
279
+
280
+ ## What's Next
281
+
282
+ Would you like to:
283
+ - `/gsd:progress` — see updated roadmap status
284
+ - Continue with current phase
285
+ - Review roadmap
286
+
287
+ ---
288
+ ```
289
+ </step>
290
+
291
+ </process>
292
+
293
+ <anti_patterns>
294
+
295
+ - Don't remove completed phases (have SUMMARY.md files)
296
+ - Don't remove current or past phases
297
+ - Don't leave gaps in numbering - always renumber
298
+ - Don't add "removed phase" notes to STATE.md - git commit is the record
299
+ - Don't ask about each decimal phase - just renumber them
300
+ - Don't modify completed phase directories
301
+ </anti_patterns>
302
+
303
+ <edge_cases>
304
+
305
+ **Removing a decimal phase (e.g., 17.1):**
306
+ - Only affects other decimals in same series (17.2 → 17.1, 17.3 → 17.2)
307
+ - Integer phases unchanged
308
+ - Simpler operation
309
+
310
+ **No subsequent phases to renumber:**
311
+ - Removing last phase (e.g., Phase 20 when that's the end)
312
+ - Just delete and update ROADMAP.md, no renumbering needed
313
+
314
+ **Phase directory doesn't exist:**
315
+ - Phase may be in ROADMAP.md but directory not created yet
316
+ - Skip directory deletion, proceed with ROADMAP.md updates
317
+
318
+ **Decimal phases under removed integer:**
319
+ - Removing Phase 17 when 17.1, 17.2 exist
320
+ - 17.1 → 16.1, 17.2 → 16.2
321
+ - They maintain their position in execution order (after current last integer)
322
+
323
+ </edge_cases>
324
+
325
+ <success_criteria>
326
+ Phase removal is complete when:
327
+
328
+ - [ ] Target phase validated as future/unstarted
329
+ - [ ] Phase directory deleted (if existed)
330
+ - [ ] All subsequent phase directories renumbered
331
+ - [ ] Files inside directories renamed ({old}-01-PLAN.md → {new}-01-PLAN.md)
332
+ - [ ] ROADMAP.md updated (section removed, all references renumbered)
333
+ - [ ] STATE.md updated (phase count, progress percentage)
334
+ - [ ] Dependency references updated in subsequent phases
335
+ - [ ] Changes committed with descriptive message
336
+ - [ ] No gaps in phase numbering
337
+ - [ ] User informed of changes
338
+ </success_criteria>