chore(skills): sprint-start A1c — mandatory teardown, no pre-checks
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.
This commit is contained in:
@@ -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
|
or backlog tickets on the spot. If process changes are agreed, update
|
||||||
the relevant skill files or CLAUDE.md immediately — don't defer them.
|
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
|
```bash
|
||||||
.claude/skills/sprint-start/scripts/sprint-teardown.sh {N}
|
.claude/skills/sprint-start/scripts/sprint-teardown.sh {N}
|
||||||
```
|
```
|
||||||
|
|
||||||
This removes all worktrees under `.sprint/sprint-{N}/` and prunes git
|
**Do not try to pre-check whether worktrees exist by running `ls`
|
||||||
metadata. Safe to skip if the sprint didn't use ephemeral worktrees
|
locally.** Sprint worktrees live at
|
||||||
(e.g. legacy persistent worktree setup).
|
`$(dirname <repo-root>)/.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
|
#### A2. Bump the version
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user