sweeping-local-statelisted
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