branch-cleanup
Installation
SKILL.md
Contains Shell Commands
This skill contains shell command directives (!`command`) that may execute system commands. Review carefully before installing.
Perform a complete cleanup of local and remote branches after working on multiple PRs.
Current State
Default branch: !git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo "main"
Current branch: !git branch --show-current
Fetch latest: !git fetch --all --prune 2>&1
Branch Inventory
Local branches with tracking status:
!git branch --format='%(refname:short) %(upstream:track)' | sort
Recent branches by activity:
!git for-each-ref --count=15 --sort=-committerdate refs/heads/ --format='%(refname:short) - %(committerdate:relative)'