← Back to list

branch-cleaner
by jMerta
Codex CLI skills catalog
⭐ 103🍴 7📅 Jan 23, 2026
SKILL.md
name: branch-cleaner description: 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.
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.
Score
Total Score
65/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
✓人気
GitHub Stars 100以上
+5
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon