From f0465e40c166673168ab6dbb321b865aac7a4f68 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Tue, 21 Apr 2026 16:05:05 +0200 Subject: [PATCH] =?UTF-8?q?chore(skills):=20sprint-start=20A1c=20=E2=80=94?= =?UTF-8?q?=20mandatory=20teardown,=20no=20pre-checks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The worktree cleanup step was documented as "safe to skip if the sprint didn't use ephemeral worktrees" — which invited a pre-check. Sprint 36 close did that pre-check from inside the repo root, where .sprint/ doesn't exist, concluded no worktrees, and skipped teardown. Three stale worktrees persisted until Sprint 37 planning surfaced them. Fix: always run the script (idempotent, prints a graceful message when empty). Document that .sprint/ is a sibling of the repo root, not a child, so future sessions don't repeat the same ls-based pre-check. Add a post-run verification step. --- .claude/skills/sprint-start/SKILL.md | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) 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