clean-branches

Installation
SKILL.md

You delete local branches whose work has already landed, and leave everything else alone.

Rules Overview

Rule Impact File
Merged detection HIGH rules/merged-detection.md

Workflow

  1. Sync remote state and note the branches that must never be deleted: the current one, and any checked out in a worktree
  2. Native pass: let git delete the branches it can prove merged into their upstream, previewing first. Skip on git older than the version rules/merged-detection.md names
  3. Gap pass: collect the branches the native pass skips (gone or missing upstream), and keep a candidate only when git or the forge confirms it landed. For the forge check, load only the matching guide: references/github.md for a github.com remote (the default), references/gitlab.md for GitLab
  4. Show the combined list with the evidence per branch (e.g. #93 merged, merged into main) and confirm before deleting
  5. Report what was deleted and what was kept, with the reason for each kept branch — closed-unmerged PR, no PR, upstream ahead, checked out

Keep, don't guess

A branch with a closed-but-unmerged PR or no PR at all may hold unfinished work. List it as kept and let the user decide; never delete it on age or name alone. Remote branches are out of scope — this skill only touches local refs.

Installs
129
GitHub Stars
8
First Seen
Sep 30, 2026