Review all open branches, PRs and worktrees, rank them by priority, judge merge/delete/continue, then delete the dead ones after approval. Use when the user asks for housekeeping, branch cleanup, "what branches are open", or "clean up stale branches".
98%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Medium
Suggest reviewing before use
Audit branches, report, then clean up. Two phases. Never delete before the user approves phase 2.
git fetch. Do not prune: pruning deletes remote-tracking refs. List stale refs with git fetch --prune --dry-run.git branch -a -vv --sort=-committerdategit worktree list/opt/homebrew/bin/gh pr list --state all --limit 500 --json number,title,headRefName,state,mergeable (plain gh needs 1Password and fails in the sandbox; the high limit avoids missing open PRs)origin/main, not local main (fetch does not move local main). Per branch (skip main): git rev-list --left-right --count origin/main...<branch>, git log origin/main..<branch> --format='%h %s', git diff --stat origin/main...<branch>.MERGED, or merging it changes nothing: git merge-tree --write-tree origin/main <branch> prints the tree of origin/main (compare with git rev-parse origin/main^{tree}). git cherry origin/main <branch> is a hint only: squash merges rewrite patches, so its + lines do not prove unique work. Count only commits outside a merged PR as real work./opt/homebrew/bin/gh pr checks <n>. Note failing checks and CONFLICTING mergeable state.git remote (e.g. stale httpsorigin/*) are leftovers. Flag them.Sort by priority (open PRs with green or near-green CI first, then live WIP, then stale). For each branch:
Group dead branches in one table: branch, reason (e.g. "merged as #58"). End with the open decisions that belong to the user (WIP branches whose direction is unclear).
git branch -D <branches> (-D needed; squash-merged branches look unmerged).git push origin --delete <branches>.git update-ref -d <ref> for refs of a non-existent remote.git fetch --prune and git branch -a.Never delete: main, branches with an open PR, branches checked out in a worktree, branches with unmerged unique work. Ask first when in doubt.
git worktree prune/remove and git remote remove fail in the sandbox (.git/worktrees, .git/config read-only). Do not retry. Give the user the exact command to run with !.
Terse. Hemingway. No first person.
koenighotze/wheel-of-meeting
0900db9
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.