Agent skill
branch-cleaner
Identify and clean up stale git branches locally and on remotes with safe, reversible steps. Use when asked to prune, list, or delete merged/old branches or audit branch hygiene.
Install this agent skill to your Project
npx add-skill https://github.com/jMerta/codex-skills/tree/main/branch-cleaner
SKILL.md
Branch cleaner
Goal
Safely identify stale branches and provide explicit delete/prune commands.
Inputs to confirm (ask if missing)
- Default branch (main/master/develop).
- Remote name (origin) and whether remote deletion is desired.
- Safety rules: keep patterns (release/, hotfix/), minimum age, merged-only.
Workflow
- Sync and inspect
- Run
git fetch --prune. - Check
git statusand note uncommitted changes.
- Run
- Build candidate lists
- Local merged into default:
git branch --merged <base> - Local not merged (list only):
git branch --no-merged <base> - Remote merged:
git branch -r --merged <base> - Stale by date:
git for-each-ref --sort=committerdate refs/heads --format="%(committerdate:short) %(refname:short)"
- Local merged into default:
- Exclude protected branches
- Always keep
<base>, current branch, and user-provided patterns.
- Always keep
- Confirm with user
- Present candidates grouped by local vs remote.
- Provide delete commands
- Delete branches approved for deletion by the user
Optional GitHub CLI checks
gh pr list --state merged --base <base>to correlate merged branches.gh pr view <branch>to verify status if needed.
Deliverables
- Candidate lists and rationale.
- Warnings for unmerged or recently updated branches.
- Don't remove remote branches unless explicitly approved.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
vps-checkup
SSH into an Ubuntu VPS (Docker) for a read-only health/security/update report (UFW + fail2ban) and propose fixes; apply updates/restarts only with explicit confirmation. Use when the user wants a read-only VPS health/security check.
ci-fix
Fix GitHub Actions CI failures using GitHub CLI (gh): inspect runs/logs, identify root cause, patch workflows/code, rerun jobs, and summarize verification. Use when GitHub Actions CI is failing or needs diagnosis.
dependency-upgrader
Upgrade dependencies for Java/Kotlin (Gradle/Maven) and TypeScript/Node projects with minimal risk: plan the bump, apply changes incrementally, run tests/builds, and document breaking changes. Use when the user asks to bump deps, update frameworks, or address CVEs.
plan-work
Plan work before coding: do repo research, analyze options/risks, and ask clarifying questions before proposing an implementation plan. Use when the user asks for a plan, design/approach, scope breakdown, or implementation steps.
coding-guidelines-gen
Generate nested AGENTS.md coding guidelines per module (monorepo-aware), detect languages/tooling, ask architecture preferences, and set up missing formatters/linters (Spotless for JVM). Use when the user wants module-scoped AGENTS.md coding guidelines or to set up missing formatters/linters.
ui-ux-pro-max
Use when designing, building, or refining frontend UI/UX: layouts, components, visual systems, typography, color, and UX patterns for websites, landing pages, dashboards, and product interfaces. Provides searchable styles, palettes, font pairings, charts, and stack best practices (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind).
Didn't find tool you were looking for?