pr-cleanuplisted
Install: claude install-skill bostonaholic/team
# pr-cleanup — post-PR teardown
> Follow `skills/principle-progress-tracking/SKILL.md`: this procedure has more than two steps —
> seed one todo item per step below before starting and mark each complete as you go.
Tidy up git state after a feature branch's PR is finished, in either of two
modes:
- **Mode A — merged.** The work landed upstream: remove the branch's
worktree, resync the default branch, and delete the local feature branch.
Squash merges create a new commit hash that is not in the branch's
history, so `git branch -d` refuses; the merged-PR gate below is what
makes `-D` acceptable.
- **Mode B — closed / abandoned.** The user is discarding the work: close
the PR(s), then delete every trace — worktree, local and remote branches,
planning scratch.
## Input
`$ARGUMENTS` is one of:
- A PR number (digits only) — resolve its head branch via `gh`.
- A full PR URL — same resolution.
- A branch name.
- Nothing — default to the branch checked out in the invoking directory
(step 0 captures it as `$INVOKE_BRANCH` before commands are anchored to
the primary clone).
Refusals, before anything else runs:
- **The PR is open and should stay open.** Cleanup is for finished work;
tell the user to merge or close first.
- **Malformed input.** A PR number that is not digits-only, or a URL that
does not parse, is reported — never guessed at. Gate every `$NUMBER`
mechanically before it reaches a `gh` command, and terminate the
consuming `gh` invocation with