← ClaudeAtlas

sweeping-local-statelisted

Machine-local teardown procedure for finished work — remove the state a merged pull request, a closed pull request, or a completed review leaves on the machine that git teardown never reaches: provisioned databases, containers, queues, buckets, caches, and temp-directory scratch. Driven by a repo-declared `.teamteardown` command list read from the default branch, never from the branch being cleaned up. Loaded by pr-cleanup and by any caller finishing with a PR or a review.
bostonaholic/team · ★ 11 · AI & Automation · score 75
Install: claude install-skill bostonaholic/team
# Sweeping Local State Git teardown removes refs and checkouts. It does not touch what grew alongside them: a database provisioned for the branch, a container still running, a scratch directory under `$TMPDIR`, a bucket of fixtures. That state outlives the branch, and nothing in the git commands notices. This is a building block. A caller that has finished with a pull request — merged, closed, or reviewed — reads this file and follows it. `skills/pr-cleanup/SKILL.md` is the standing caller: it loads this after the worktree is removed and before it reports. ## Ownership boundary Run only the rows marked **this skill**. The others already ran, or will run, in the caller. | State | Owner | |---|---| | Worktrees, local and remote branches, stale tracking refs | the caller (`pr-cleanup` Modes A/B) | | `docs/plans/<id>/` planning scratch | the caller (`pr-cleanup` Mode B step 6) | | Leftover directories under `.claude/worktrees/` | `worktree-isolation` teardown step 7 | | Databases, containers, queues, buckets, caches | **this skill** | | Temp-directory scratch the run recorded | **this skill** | Duplicating a caller's step is not harmless. `pr-cleanup` gates its deletions on a merged-PR verification and on protected-name refusals; a second, ungated pass at the same target is the ungated path those rules exist to prevent. ## Inputs the caller supplies | Variable | Meaning | |---|---| | `PRIMARY_ROOT` | Absolute path to the primary clone, already validated | | `DEFAULT` | Th