plugins/devops/git-workflow/skills/branch-cleanup/SKILL.md
Comprehensive git branch cleanup and organization
npx skillsauth add basher83/lunar-claude branch-cleanupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Perform a complete cleanup of local and remote branches after working on multiple PRs.
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
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)'
Remote branches:
!git branch -r --format='%(refname:short)' | grep -v HEAD | sort
Merged into default branch: !git branch --merged
Branches with gone remotes:
!git branch -vv | grep ': gone]' | awk '{print $1}' | sort
Never delete branches matching these patterns:
main, master, develop, staging, productionrelease/* branches (unless explicitly confirmed)renovate/* branches (managed by Renovate bot)Review the branch inventory above. Categorize branches:
release/* branches, branches with unpushed commitsPresent the cleanup plan and ask the user to select scope:
If "Review each" is selected, iterate through candidates asking per-branch confirmation.
After confirmation, execute in order:
git remote prune origingit branch -d <branch>git branch -D <branch>Record each branch name and SHA before deleting: git rev-parse <branch>
If deletion fails, ask user: Force delete, Skip, or Abort.
Ask whether to delete corresponding remote branches on origin.
Report:
git checkout -b <branch> <sha>testing
Audit and improve CLAUDE.md files in repositories. Use when user asks to check, audit, update, improve, or fix CLAUDE.md files. Scans for all CLAUDE.md files, evaluates quality against templates, outputs quality report, then makes targeted updates. Also use when the user mentions "CLAUDE.md maintenance" or "project memory optimization".
tools
Operational tooling for Talos Linux Kubernetes clusters via Sidero Omni with Proxmox infrastructure provider, covering machine classes, CEL storage selectors, and provider lifecycle management.
tools
Best practices for git workflow automation including atomic commits, branch naming, conventional commit format, and changelog generation.
tools
Summarize the current state of the git repository