get-shit-done-cc 1.5.28 → 1.5.30

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.
@@ -244,8 +244,9 @@ issue:
244
244
  Gather verification context from the phase directory and project state.
245
245
 
246
246
  ```bash
247
- # Phase directory (provided in prompt)
248
- PHASE_DIR=".planning/phases/${PHASE_ARG}"
247
+ # Normalize phase and find directory
248
+ PADDED_PHASE=$(printf "%02d" ${PHASE_ARG} 2>/dev/null || echo "${PHASE_ARG}")
249
+ PHASE_DIR=$(ls -d .planning/phases/${PADDED_PHASE}-* .planning/phases/${PHASE_ARG}-* 2>/dev/null | head -1)
249
250
 
250
251
  # List all PLAN.md files
251
252
  ls "$PHASE_DIR"/*-PLAN.md 2>/dev/null
package/bin/install.js CHANGED
@@ -55,8 +55,6 @@ function parseConfigDirArg() {
55
55
  const explicitConfigDir = parseConfigDirArg();
56
56
  const hasHelp = args.includes('--help') || args.includes('-h');
57
57
  const forceStatusline = args.includes('--force-statusline');
58
- const forceNotify = args.includes('--force-notify');
59
- const noNotify = args.includes('--no-notify');
60
58
 
61
59
  console.log(banner);
62
60
 
@@ -70,8 +68,6 @@ if (hasHelp) {
70
68
  ${cyan}-c, --config-dir <path>${reset} Specify custom Claude config directory
71
69
  ${cyan}-h, --help${reset} Show this help message
72
70
  ${cyan}--force-statusline${reset} Replace existing statusline config
73
- ${cyan}--force-notify${reset} Replace existing notification hook
74
- ${cyan}--no-notify${reset} Skip notification hook installation
75
71
 
76
72
  ${yellow}Examples:${reset}
77
73
  ${dim}# Install to default ~/.claude directory${reset}
@@ -221,10 +217,6 @@ function install(isGlobal) {
221
217
  const srcFile = path.join(hooksSrc, entry);
222
218
  const destFile = path.join(hooksDest, entry);
223
219
  fs.copyFileSync(srcFile, destFile);
224
- // Make shell scripts executable
225
- if (entry.endsWith('.sh')) {
226
- fs.chmodSync(destFile, 0o755);
227
- }
228
220
  }
229
221
  console.log(` ${green}✓${reset} Installed hooks`);
230
222
  }
@@ -233,14 +225,11 @@ function install(isGlobal) {
233
225
  const settingsPath = path.join(claudeDir, 'settings.json');
234
226
  const settings = readSettings(settingsPath);
235
227
  const statuslineCommand = isGlobal
236
- ? '$HOME/.claude/hooks/statusline.sh'
237
- : '.claude/hooks/statusline.sh';
228
+ ? 'node "$HOME/.claude/hooks/statusline.js"'
229
+ : 'node .claude/hooks/statusline.js';
238
230
  const updateCheckCommand = isGlobal
239
- ? '$HOME/.claude/hooks/gsd-check-update.sh'
240
- : '.claude/hooks/gsd-check-update.sh';
241
- const notifyCommand = isGlobal
242
- ? '$HOME/.claude/hooks/gsd-notify.sh'
243
- : '.claude/hooks/gsd-notify.sh';
231
+ ? 'node "$HOME/.claude/hooks/gsd-check-update.js"'
232
+ : 'node .claude/hooks/gsd-check-update.js';
244
233
 
245
234
  // Configure SessionStart hook for update checking
246
235
  if (!settings.hooks) {
@@ -267,13 +256,13 @@ function install(isGlobal) {
267
256
  console.log(` ${green}✓${reset} Configured update check hook`);
268
257
  }
269
258
 
270
- return { settingsPath, settings, statuslineCommand, notifyCommand };
259
+ return { settingsPath, settings, statuslineCommand };
271
260
  }
272
261
 
273
262
  /**
274
- * Apply statusline and notification config, then print completion message
263
+ * Apply statusline config, then print completion message
275
264
  */
276
- function finishInstall(settingsPath, settings, statuslineCommand, notifyCommand, shouldInstallStatusline, shouldInstallNotify) {
265
+ function finishInstall(settingsPath, settings, statuslineCommand, shouldInstallStatusline) {
277
266
  if (shouldInstallStatusline) {
278
267
  settings.statusLine = {
279
268
  type: 'command',
@@ -282,25 +271,6 @@ function finishInstall(settingsPath, settings, statuslineCommand, notifyCommand,
282
271
  console.log(` ${green}✓${reset} Configured statusline`);
283
272
  }
284
273
 
285
- if (shouldInstallNotify) {
286
- if (!settings.hooks.Stop) {
287
- settings.hooks.Stop = [];
288
- }
289
- // Remove any existing GSD notify hook first
290
- settings.hooks.Stop = settings.hooks.Stop.filter(entry =>
291
- !(entry.hooks && entry.hooks.some(h => h.command && h.command.includes('gsd-notify')))
292
- );
293
- settings.hooks.Stop.push({
294
- hooks: [
295
- {
296
- type: 'command',
297
- command: notifyCommand
298
- }
299
- ]
300
- });
301
- console.log(` ${green}✓${reset} Configured completion notifications`);
302
- }
303
-
304
274
  // Always write settings (hooks were already configured in install())
305
275
  writeSettings(settingsPath, settings);
306
276
 
@@ -365,66 +335,6 @@ function handleStatusline(settings, isInteractive, callback) {
365
335
  });
366
336
  }
367
337
 
368
- /**
369
- * Handle notification hook configuration with optional prompt
370
- */
371
- function handleNotifications(settings, isInteractive, callback) {
372
- // Check if --no-notify flag was passed
373
- if (noNotify) {
374
- callback(false);
375
- return;
376
- }
377
-
378
- // Check if GSD notify hook already exists
379
- const hasExisting = settings.hooks?.Stop?.some(entry =>
380
- entry.hooks && entry.hooks.some(h => h.command && h.command.includes('gsd-notify'))
381
- );
382
-
383
- // No existing - just install it
384
- if (!hasExisting) {
385
- callback(true);
386
- return;
387
- }
388
-
389
- // Has existing and --force-notify flag
390
- if (forceNotify) {
391
- callback(true);
392
- return;
393
- }
394
-
395
- // Has existing, non-interactive mode - skip
396
- if (!isInteractive) {
397
- console.log(` ${yellow}⚠${reset} Skipping notifications (already configured)`);
398
- console.log(` Use ${cyan}--force-notify${reset} to replace\n`);
399
- callback(false);
400
- return;
401
- }
402
-
403
- // Has existing, interactive mode - prompt user
404
- const rl = readline.createInterface({
405
- input: process.stdin,
406
- output: process.stdout
407
- });
408
-
409
- console.log(`
410
- ${yellow}⚠${reset} Existing notification hook detected
411
-
412
- GSD includes completion notifications that alert you when:
413
- • A phase completes planning or execution
414
- • Claude stops and needs your input
415
- • Works on Mac, Linux, and Windows
416
-
417
- ${cyan}1${reset}) Keep existing
418
- ${cyan}2${reset}) Replace with GSD notifications
419
- `);
420
-
421
- rl.question(` Choice ${dim}[1]${reset}: `, (answer) => {
422
- rl.close();
423
- const choice = answer.trim() || '1';
424
- callback(choice === '2');
425
- });
426
- }
427
-
428
338
  /**
429
339
  * Prompt for install location
430
340
  */
@@ -448,12 +358,10 @@ function promptLocation() {
448
358
  rl.close();
449
359
  const choice = answer.trim() || '1';
450
360
  const isGlobal = choice !== '2';
451
- const { settingsPath, settings, statuslineCommand, notifyCommand } = install(isGlobal);
361
+ const { settingsPath, settings, statuslineCommand } = install(isGlobal);
452
362
  // Interactive mode - prompt for optional features
453
363
  handleStatusline(settings, true, (shouldInstallStatusline) => {
454
- handleNotifications(settings, true, (shouldInstallNotify) => {
455
- finishInstall(settingsPath, settings, statuslineCommand, notifyCommand, shouldInstallStatusline, shouldInstallNotify);
456
- });
364
+ finishInstall(settingsPath, settings, statuslineCommand, shouldInstallStatusline);
457
365
  });
458
366
  });
459
367
  }
@@ -466,20 +374,16 @@ if (hasGlobal && hasLocal) {
466
374
  console.error(` ${yellow}Cannot use --config-dir with --local${reset}`);
467
375
  process.exit(1);
468
376
  } else if (hasGlobal) {
469
- const { settingsPath, settings, statuslineCommand, notifyCommand } = install(true);
377
+ const { settingsPath, settings, statuslineCommand } = install(true);
470
378
  // Non-interactive - respect flags
471
379
  handleStatusline(settings, false, (shouldInstallStatusline) => {
472
- handleNotifications(settings, false, (shouldInstallNotify) => {
473
- finishInstall(settingsPath, settings, statuslineCommand, notifyCommand, shouldInstallStatusline, shouldInstallNotify);
474
- });
380
+ finishInstall(settingsPath, settings, statuslineCommand, shouldInstallStatusline);
475
381
  });
476
382
  } else if (hasLocal) {
477
- const { settingsPath, settings, statuslineCommand, notifyCommand } = install(false);
383
+ const { settingsPath, settings, statuslineCommand } = install(false);
478
384
  // Non-interactive - respect flags
479
385
  handleStatusline(settings, false, (shouldInstallStatusline) => {
480
- handleNotifications(settings, false, (shouldInstallNotify) => {
481
- finishInstall(settingsPath, settings, statuslineCommand, notifyCommand, shouldInstallStatusline, shouldInstallNotify);
482
- });
386
+ finishInstall(settingsPath, settings, statuslineCommand, shouldInstallStatusline);
483
387
  });
484
388
  } else {
485
389
  promptLocation();
@@ -143,9 +143,12 @@ Route by status (see `<offer_next>`).
143
143
  </process>
144
144
 
145
145
  <offer_next>
146
+ Output this markdown directly (not as a code block). Route based on status:
147
+
148
+ ---
149
+
146
150
  **If passed:**
147
151
 
148
- ```markdown
149
152
  ## ✓ Milestone {version} — Audit Passed
150
153
 
151
154
  **Score:** {N}/{M} requirements satisfied
@@ -153,22 +156,22 @@ Route by status (see `<offer_next>`).
153
156
 
154
157
  All requirements covered. Cross-phase integration verified. E2E flows complete.
155
158
 
156
- ---
159
+ ───────────────────────────────────────────────────────────────
157
160
 
158
161
  ## ▶ Next Up
159
162
 
160
163
  **Complete milestone** — archive and tag
161
164
 
162
- `/gsd:complete-milestone {version}`
165
+ /gsd:complete-milestone {version}
163
166
 
164
- <sub>`/clear` first → fresh context window</sub>
165
- ```
167
+ <sub>/clear first → fresh context window</sub>
168
+
169
+ ───────────────────────────────────────────────────────────────
166
170
 
167
171
  ---
168
172
 
169
173
  **If gaps_found:**
170
174
 
171
- ```markdown
172
175
  ## ⚠ Milestone {version} — Gaps Found
173
176
 
174
177
  **Score:** {N}/{M} requirements satisfied
@@ -190,28 +193,28 @@ All requirements covered. Cross-phase integration verified. E2E flows complete.
190
193
  {For each flow gap:}
191
194
  - **{flow name}:** breaks at {step}
192
195
 
193
- ---
196
+ ───────────────────────────────────────────────────────────────
194
197
 
195
198
  ## ▶ Next Up
196
199
 
197
200
  **Plan gap closure** — create phases to complete milestone
198
201
 
199
- `/gsd:plan-milestone-gaps`
202
+ /gsd:plan-milestone-gaps
200
203
 
201
- <sub>`/clear` first → fresh context window</sub>
204
+ <sub>/clear first → fresh context window</sub>
202
205
 
203
- ---
206
+ ───────────────────────────────────────────────────────────────
204
207
 
205
208
  **Also available:**
206
- - `cat .planning/v{version}-MILESTONE-AUDIT.md` — see full report
207
- - `/gsd:complete-milestone {version}` — proceed anyway (accept tech debt)
208
- ```
209
+ - cat .planning/v{version}-MILESTONE-AUDIT.md — see full report
210
+ - /gsd:complete-milestone {version} — proceed anyway (accept tech debt)
211
+
212
+ ───────────────────────────────────────────────────────────────
209
213
 
210
214
  ---
211
215
 
212
216
  **If tech_debt (no blockers but accumulated debt):**
213
217
 
214
- ```markdown
215
218
  ## ⚡ Milestone {version} — Tech Debt Review
216
219
 
217
220
  **Score:** {N}/{M} requirements satisfied
@@ -228,20 +231,21 @@ All requirements met. No critical blockers. Accumulated tech debt needs review.
228
231
 
229
232
  ### Total: {N} items across {M} phases
230
233
 
231
- ---
234
+ ───────────────────────────────────────────────────────────────
232
235
 
233
236
  ## ▶ Options
234
237
 
235
238
  **A. Complete milestone** — accept debt, track in backlog
236
239
 
237
- `/gsd:complete-milestone {version}`
240
+ /gsd:complete-milestone {version}
238
241
 
239
242
  **B. Plan cleanup phase** — address debt before completing
240
243
 
241
- `/gsd:plan-milestone-gaps`
244
+ /gsd:plan-milestone-gaps
242
245
 
243
- <sub>`/clear` first → fresh context window</sub>
244
- ```
246
+ <sub>/clear first → fresh context window</sub>
247
+
248
+ ───────────────────────────────────────────────────────────────
245
249
  </offer_next>
246
250
 
247
251
  <success_criteria>
@@ -109,14 +109,14 @@ Roadmap created:
109
109
 
110
110
  **Phase 1: [Name]** — [Goal from ROADMAP.md]
111
111
 
112
- `/gsd:plan-phase 1`
112
+ `/gsd:discuss-phase 1` — gather context and clarify approach
113
113
 
114
114
  <sub>`/clear` first → fresh context window</sub>
115
115
 
116
116
  ---
117
117
 
118
118
  **Also available:**
119
- - `/gsd:discuss-phase 1` — gather context first
119
+ - `/gsd:plan-phase 1` — skip discussion, plan directly
120
120
  - Review roadmap
121
121
 
122
122
  ---
@@ -35,10 +35,10 @@ Phase number: $ARGUMENTS (required)
35
35
  <process>
36
36
  1. Validate phase number (error if missing or not in roadmap)
37
37
  2. Check if CONTEXT.md exists (offer update/view/skip if yes)
38
- 3. **Analyze phase** — Identify domain boundary and gray areas by category
39
- 4. **Present gray areas** — Multi-select AskUserQuestion: which to discuss?
40
- 5. **Deep-dive each area** — Loop per area until user says "move on"
41
- 6. **Write CONTEXT.md** — Structured by decisions made
38
+ 3. **Analyze phase** — Identify domain and generate phase-specific gray areas
39
+ 4. **Present gray areas** — Multi-select: which to discuss? (NO skip option)
40
+ 5. **Deep-dive each area** — 4 questions per area, then offer more/next
41
+ 6. **Write CONTEXT.md** — Sections match areas discussed
42
42
  7. Offer next steps (research or plan)
43
43
 
44
44
  **CRITICAL: Scope guardrail**
@@ -47,18 +47,27 @@ Phase number: $ARGUMENTS (required)
47
47
  - If user suggests new capabilities: "That's its own phase. I'll note it for later."
48
48
  - Capture deferred ideas — don't lose them, don't act on them
49
49
 
50
- **Gray area categories (use what's relevant):**
51
- - **UI** Layout, visual presentation, information density
52
- - **UX** Interactions, flows, feedback
53
- - **Behavior** Runtime behavior, state changes
54
- - **Empty/Edge States** What shows in unusual situations
55
- - **Content** What information is shown/hidden
50
+ **Domain-aware gray areas:**
51
+ Gray areas depend on what's being built. Analyze the phase goal:
52
+ - Something users SEE → layout, density, interactions, states
53
+ - Something users CALL → responses, errors, auth, versioning
54
+ - Something users RUN output format, flags, modes, error handling
55
+ - Something users READ structure, tone, depth, flow
56
+ - Something being ORGANIZED → criteria, grouping, naming, exceptions
56
57
 
57
- **Do NOT ask about (downstream agents handle these):**
58
- - Technical implementation (researcher investigates)
59
- - Architecture choices (planner decides)
60
- - Performance concerns (researcher/planner handle)
61
- - Scope expansion (roadmap defines scope)
58
+ Generate 3-4 **phase-specific** gray areas, not generic categories.
59
+
60
+ **Probing depth:**
61
+ - Ask 4 questions per area before checking
62
+ - "More questions about [area], or move to next?"
63
+ - If more → ask 4 more, check again
64
+ - After all areas → "Ready to create context?"
65
+
66
+ **Do NOT ask about (Claude handles these):**
67
+ - Technical implementation
68
+ - Architecture choices
69
+ - Performance concerns
70
+ - Scope expansion
62
71
  </process>
63
72
 
64
73
  <success_criteria>
@@ -105,9 +105,7 @@ Phase: $ARGUMENTS
105
105
  </process>
106
106
 
107
107
  <offer_next>
108
- **MANDATORY: Present copy/paste-ready next command.**
109
-
110
- After verification completes, route based on status:
108
+ Output this markdown directly (not as a code block). Route based on status:
111
109
 
112
110
  | Status | Route |
113
111
  |--------|-------|
@@ -120,7 +118,6 @@ After verification completes, route based on status:
120
118
 
121
119
  **Route A: Phase verified, more phases remain**
122
120
 
123
- ```
124
121
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
125
122
  GSD ► PHASE {Z} COMPLETE ✓
126
123
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -136,24 +133,22 @@ Goal verified ✓
136
133
 
137
134
  **Phase {Z+1}: {Name}** — {Goal from ROADMAP.md}
138
135
 
139
- `/gsd:plan-phase {Z+1}`
136
+ /gsd:discuss-phase {Z+1} — gather context and clarify approach
140
137
 
141
- <sub>`/clear` first → fresh context window</sub>
138
+ <sub>/clear first → fresh context window</sub>
142
139
 
143
140
  ───────────────────────────────────────────────────────────────
144
141
 
145
142
  **Also available:**
146
- - `/gsd:verify-work {Z}`manual acceptance testing before continuing
147
- - `/gsd:discuss-phase {Z+1}`gather context first
143
+ - /gsd:plan-phase {Z+1} — skip discussion, plan directly
144
+ - /gsd:verify-work {Z} — manual acceptance testing before continuing
148
145
 
149
146
  ───────────────────────────────────────────────────────────────
150
- ```
151
147
 
152
148
  ---
153
149
 
154
150
  **Route B: Phase verified, milestone complete**
155
151
 
156
- ```
157
152
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
158
153
  GSD ► MILESTONE COMPLETE 🎉
159
154
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -169,24 +164,22 @@ All phase goals verified ✓
169
164
 
170
165
  **Audit milestone** — verify requirements, cross-phase integration, E2E flows
171
166
 
172
- `/gsd:audit-milestone`
167
+ /gsd:audit-milestone
173
168
 
174
- <sub>`/clear` first → fresh context window</sub>
169
+ <sub>/clear first → fresh context window</sub>
175
170
 
176
171
  ───────────────────────────────────────────────────────────────
177
172
 
178
173
  **Also available:**
179
- - `/gsd:verify-work` — manual acceptance testing
180
- - `/gsd:complete-milestone` — skip audit, archive directly
174
+ - /gsd:verify-work — manual acceptance testing
175
+ - /gsd:complete-milestone — skip audit, archive directly
181
176
 
182
177
  ───────────────────────────────────────────────────────────────
183
- ```
184
178
 
185
179
  ---
186
180
 
187
181
  **Route C: Gaps found — need additional planning**
188
182
 
189
- ```
190
183
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
191
184
  GSD ► PHASE {Z} GAPS FOUND ⚠
192
185
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -194,7 +187,7 @@ All phase goals verified ✓
194
187
  **Phase {Z}: {Name}**
195
188
 
196
189
  Score: {N}/{M} must-haves verified
197
- Report: `.planning/phases/{phase_dir}/{phase}-VERIFICATION.md`
190
+ Report: .planning/phases/{phase_dir}/{phase}-VERIFICATION.md
198
191
 
199
192
  ### What's Missing
200
193
 
@@ -206,23 +199,24 @@ Report: `.planning/phases/{phase_dir}/{phase}-VERIFICATION.md`
206
199
 
207
200
  **Plan gap closure** — create additional plans to complete the phase
208
201
 
209
- `/gsd:plan-phase {Z} --gaps`
202
+ /gsd:plan-phase {Z} --gaps
210
203
 
211
- <sub>`/clear` first → fresh context window</sub>
204
+ <sub>/clear first → fresh context window</sub>
212
205
 
213
206
  ───────────────────────────────────────────────────────────────
214
207
 
215
208
  **Also available:**
216
- - `cat .planning/phases/{phase_dir}/{phase}-VERIFICATION.md` — see full report
217
- - `/gsd:verify-work {Z}` — manual testing before planning
209
+ - cat .planning/phases/{phase_dir}/{phase}-VERIFICATION.md — see full report
210
+ - /gsd:verify-work {Z} — manual testing before planning
218
211
 
219
212
  ───────────────────────────────────────────────────────────────
220
- ```
221
213
 
222
- After user runs `/gsd:plan-phase {Z} --gaps`:
214
+ ---
215
+
216
+ After user runs /gsd:plan-phase {Z} --gaps:
223
217
  1. Planner reads VERIFICATION.md gaps
224
218
  2. Creates plans 04, 05, etc. to close gaps
225
- 3. User runs `/gsd:execute-phase {Z}` again
219
+ 3. User runs /gsd:execute-phase {Z} again
226
220
  4. Execute-phase runs incomplete plans (04, 05...)
227
221
  5. Verifier runs again → loop until passed
228
222
  </offer_next>
@@ -842,10 +842,15 @@ Present completion with next steps:
842
842
 
843
843
  **Phase 1: [Phase Name]** — [Goal from ROADMAP.md]
844
844
 
845
- `/gsd:plan-phase 1`
845
+ `/gsd:discuss-phase 1` — gather context and clarify approach
846
846
 
847
847
  <sub>`/clear` first → fresh context window</sub>
848
848
 
849
+ ---
850
+
851
+ **Also available:**
852
+ - `/gsd:plan-phase 1` — skip discussion, plan directly
853
+
849
854
  ───────────────────────────────────────────────────────────────
850
855
  ```
851
856
 
@@ -887,7 +892,7 @@ Present completion with next steps:
887
892
  - [ ] STATE.md initialized
888
893
  - [ ] REQUIREMENTS.md traceability updated
889
894
  - [ ] Phase directories created → **committed**
890
- - [ ] User knows next step is `/gsd:plan-phase 1`
895
+ - [ ] User knows next step is `/gsd:discuss-phase 1`
891
896
 
892
897
  **Atomic commits:** Each phase commits its artifacts immediately. If context is lost, artifacts persist.
893
898
 
@@ -37,13 +37,7 @@ Phase number: $ARGUMENTS (optional - auto-detects next unplanned phase if not pr
37
37
  - `--gaps` — Gap closure mode (reads VERIFICATION.md, skips research)
38
38
  - `--skip-verify` — Skip planner → checker verification loop
39
39
 
40
- Check for existing research and plans:
41
-
42
- ```bash
43
- ls .planning/phases/${PHASE}-*/*-RESEARCH.md 2>/dev/null
44
- ls .planning/phases/${PHASE}-*/*-PLAN.md 2>/dev/null
45
- ```
46
-
40
+ Normalize phase input in step 2 before any directory lookups.
47
41
  </context>
48
42
 
49
43
  <process>
@@ -56,7 +50,7 @@ ls .planning/ 2>/dev/null
56
50
 
57
51
  **If not found:** Error - user should run `/gsd:new-project` first.
58
52
 
59
- ## 2. Parse Arguments
53
+ ## 2. Parse and Normalize Arguments
60
54
 
61
55
  Extract from $ARGUMENTS:
62
56
 
@@ -68,6 +62,24 @@ Extract from $ARGUMENTS:
68
62
 
69
63
  **If no phase number:** Detect next unplanned phase from roadmap.
70
64
 
65
+ **Normalize phase to zero-padded format:**
66
+
67
+ ```bash
68
+ # Normalize phase number (8 → 08, but preserve decimals like 2.1 → 02.1)
69
+ if [[ "$PHASE" =~ ^[0-9]+$ ]]; then
70
+ PHASE=$(printf "%02d" "$PHASE")
71
+ elif [[ "$PHASE" =~ ^([0-9]+)\.([0-9]+)$ ]]; then
72
+ PHASE=$(printf "%02d.%s" "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}")
73
+ fi
74
+ ```
75
+
76
+ **Check for existing research and plans:**
77
+
78
+ ```bash
79
+ ls .planning/phases/${PHASE}-*/*-RESEARCH.md 2>/dev/null
80
+ ls .planning/phases/${PHASE}-*/*-PLAN.md 2>/dev/null
81
+ ```
82
+
71
83
  ## 3. Validate Phase
72
84
 
73
85
  ```bash
@@ -79,14 +91,13 @@ grep -A5 "Phase ${PHASE}:" .planning/ROADMAP.md 2>/dev/null
79
91
  ## 4. Ensure Phase Directory Exists
80
92
 
81
93
  ```bash
82
- # Match both zero-padded (05-*) and unpadded (5-*) folders
83
- PADDED_PHASE=$(printf "%02d" ${PHASE})
84
- PHASE_DIR=$(ls -d .planning/phases/${PADDED_PHASE}-* .planning/phases/${PHASE}-* 2>/dev/null | head -1)
94
+ # PHASE is already normalized (08, 02.1, etc.) from step 2
95
+ PHASE_DIR=$(ls -d .planning/phases/${PHASE}-* 2>/dev/null | head -1)
85
96
  if [ -z "$PHASE_DIR" ]; then
86
- # Create phase directory from roadmap name with zero-padded phase number
97
+ # Create phase directory from roadmap name
87
98
  PHASE_NAME=$(grep "Phase ${PHASE}:" .planning/ROADMAP.md | sed 's/.*Phase [0-9]*: //' | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
88
- mkdir -p ".planning/phases/${PADDED_PHASE}-${PHASE_NAME}"
89
- PHASE_DIR=".planning/phases/${PADDED_PHASE}-${PHASE_NAME}"
99
+ mkdir -p ".planning/phases/${PHASE}-${PHASE_NAME}"
100
+ PHASE_DIR=".planning/phases/${PHASE}-${PHASE_NAME}"
90
101
  fi
91
102
  ```
92
103
 
@@ -408,7 +419,13 @@ Wait for user response.
408
419
 
409
420
  ## 13. Present Final Status
410
421
 
411
- ```
422
+ Route to `<offer_next>`.
423
+
424
+ </process>
425
+
426
+ <offer_next>
427
+ Output this markdown directly (not as a code block):
428
+
412
429
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
413
430
  GSD ► PHASE {X} PLANNED ✓
414
431
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -429,20 +446,18 @@ Verification: {Passed | Passed with override | Skipped}
429
446
 
430
447
  **Execute Phase {X}** — run all {N} plans
431
448
 
432
- `/gsd:execute-phase {X}`
449
+ /gsd:execute-phase {X}
433
450
 
434
- <sub>`/clear` first → fresh context window</sub>
451
+ <sub>/clear first → fresh context window</sub>
435
452
 
436
453
  ───────────────────────────────────────────────────────────────
437
454
 
438
455
  **Also available:**
439
- - `cat .planning/phases/{phase-dir}/*-PLAN.md` — review plans
440
- - `/gsd:plan-phase {X} --research` — re-research first
456
+ - cat .planning/phases/{phase-dir}/*-PLAN.md — review plans
457
+ - /gsd:plan-phase {X} --research — re-research first
441
458
 
442
459
  ───────────────────────────────────────────────────────────────
443
- ```
444
-
445
- </process>
460
+ </offer_next>
446
461
 
447
462
  <success_criteria>
448
463
  - [ ] .planning/ directory validated