fix(gsd): rebuild STATE.md after skip-slice and strengthen rethink prompt

This commit is contained in:
Tibsfox 2026-04-05 10:55:30 -07:00
parent 092d1c0a9e
commit 8ccab86aac
2 changed files with 10 additions and 1 deletions

View file

@ -930,6 +930,14 @@ export function registerDbTools(pi: ExtensionAPI): void {
updateSliceStatus(params.milestoneId, params.sliceId, "skipped");
invalidateStateCache();
// Rebuild STATE.md so it reflects the skip immediately (#3477).
// Without this, /gsd auto reads stale STATE.md and resumes the skipped slice.
try {
const basePath = process.cwd();
const { rebuildState } = await import("../doctor.js");
await rebuildState(basePath);
} catch { /* non-fatal — STATE.md staleness is better than crashing */ }
return {
content: [{ type: "text" as const, text: `Skipped slice ${params.sliceId} (${params.milestoneId}). Reason: ${params.reason ?? "User-directed skip"}. Auto-mode will advance past this slice.` }],
details: {

View file

@ -46,11 +46,12 @@ reason: "<reason>"
Remove the `{ID}-PARKED.md` file from the milestone directory to reactivate it.
### Skip a slice
Mark a slice as skipped so auto-mode advances past it without executing. Use the `gsd_skip_slice` tool:
Mark a slice as skipped so auto-mode advances past it without executing. **You MUST call the `gsd_skip_slice` tool** — editing the roadmap markdown alone is NOT sufficient because auto-mode reads slice status from the database, not the roadmap file:
```
gsd_skip_slice({ milestoneId: "M003", sliceId: "S02", reason: "Descoped — feature moved to M005" })
```
Skipped slices are treated as closed by the state machine (like "complete" but distinct). Use when a slice is no longer needed or has been superseded. The slice data is preserved for reference.
**Do NOT** just check the slice checkbox in the roadmap — this does not update the DB and auto-mode will resume the slice.
### Discard a milestone
**Permanently** delete a milestone directory and prune it from QUEUE-ORDER.json. **Always confirm with the user before discarding.** Warn explicitly if the milestone has completed work.