diff --git a/commands/gsd/add-backlog.md b/commands/gsd/add-backlog.md index ef7b389f7..0ea4de97d 100644 --- a/commands/gsd/add-backlog.md +++ b/commands/gsd/add-backlog.md @@ -27,14 +27,10 @@ the normal phase sequence and accumulate context over time. ``` If no 999.x phases exist, start at 999.1. -3. **Create the phase directory:** - ```bash - SLUG=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" generate-slug "$ARGUMENTS" --raw) - mkdir -p ".planning/phases/${NEXT}-${SLUG}" - touch ".planning/phases/${NEXT}-${SLUG}/.gitkeep" - ``` - -4. **Add to ROADMAP.md** under a `## Backlog` section. If the section doesn't exist, create it at the end: +3. **Add to ROADMAP.md** under a `## Backlog` section. If the section doesn't exist, create it at the end. + Write the ROADMAP entry BEFORE creating the directory — this ensures directory existence is always + a reliable indicator that the phase is already registered, which prevents false duplicate detection + in any hook that checks for existing 999.x directories (#2280): ```markdown ## Backlog @@ -49,6 +45,13 @@ the normal phase sequence and accumulate context over time. - [ ] TBD (promote with /gsd-review-backlog when ready) ``` +4. **Create the phase directory:** + ```bash + SLUG=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" generate-slug "$ARGUMENTS" --raw) + mkdir -p ".planning/phases/${NEXT}-${SLUG}" + touch ".planning/phases/${NEXT}-${SLUG}/.gitkeep" + ``` + 5. **Commit:** ```bash node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs: add backlog item ${NEXT} — ${ARGUMENTS}" --files .planning/ROADMAP.md ".planning/phases/${NEXT}-${SLUG}/.gitkeep"