diff --git a/.claude/skills/sprint-start/SKILL.md b/.claude/skills/sprint-start/SKILL.md index 60f8a7dff..29f501407 100644 --- a/.claude/skills/sprint-start/SKILL.md +++ b/.claude/skills/sprint-start/SKILL.md @@ -130,17 +130,34 @@ If the user raises items that should be tracked, create Q-NNN entries or backlog tickets on the spot. If process changes are agreed, update the relevant skill files or CLAUDE.md immediately — don't defer them. -#### A1c. Clean up sprint worktrees +#### A1c. Clean up sprint worktrees (MANDATORY — do not skip) -Remove ephemeral worktrees for the closed sprint. Run the teardown script: +Always run the teardown script. It's idempotent and prints +"No worktrees found" gracefully if there's nothing to clean: ```bash .claude/skills/sprint-start/scripts/sprint-teardown.sh {N} ``` -This removes all worktrees under `.sprint/sprint-{N}/` and prunes git -metadata. Safe to skip if the sprint didn't use ephemeral worktrees -(e.g. legacy persistent worktree setup). +**Do not try to pre-check whether worktrees exist by running `ls` +locally.** Sprint worktrees live at +`$(dirname )/.sprint/sprint-{N}/` — a *sibling* of the +repo root, not a child. Running `ls .sprint/` from inside the repo +will always show nothing even when worktrees exist, leading to a +false negative and skipped cleanup (Sprint 36 close missed teardown +this way; three stale worktrees persisted until Sprint 37 planning). + +The script knows the correct path via its own `SCRIPT_DIR` — trust it. + +Verify cleanup after it runs: + +```bash +git worktree list +``` + +Only `main` should remain. Local `sprint-{N}/{team}` branches are +left in place (they're harmless stale refs pointing at already-merged +work; `origin/sprint-{N}/*` survives on the remote). #### A2. Bump the version