From atelier
Use when the user wants to clean up merged branches locally and on remote. Lists merged branches, confirms before deleting, and prunes stale remote refs.
How this skill is triggered — by the user, by Claude, or both
Slash command
/atelier:cleanupThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Safe deletion of local and remote branches that have been merged into main. Always shows what
Safe deletion of local and remote branches that have been merged into main. Always shows what will be deleted and confirms before proceeding.
git branch --merged main | grep -v '^\*\|main\|master'
Filter out:
*)git branch -r --merged origin/main | grep -v 'origin/main\|origin/master'
Filter out:
For each branch found, verify it is fully merged:
git log --oneline main..<branch>
If output is empty: branch is fully merged. Safe to delete.
If output is non-empty: branch has commits not in main. Do NOT delete. Warn the user.
Before deleting a remote branch, check for open PRs:
gh pr list --head <branch> --state open
If any open PRs exist: skip deletion of that branch. Note it and ask the user if they want to close the PR first.
Display a summary:
Local branches to delete:
branch-1
branch-2
Remote branches to delete:
origin/branch-3
origin/branch-4
Branches with open PRs (will be skipped):
branch-5
Ask for explicit confirmation:
Proceed with deletion? (yes/no)
Use -d (safe delete only — fails if not fully merged):
git branch -d <branch>
Never use -D — it force-deletes without checking.
Report each deletion:
Deleted: branch-1
Deleted: branch-2
git push origin --delete <branch>
Report each deletion:
Deleted remote: origin/branch-3
Deleted remote: origin/branch-4
git remote prune origin
Summary:
cleanup complete:
Local branches deleted: N
Remote branches deleted: M
Stale refs pruned
-d not -D: safe mode onlygit log main..<branch> output requiredIf git branch -d <branch> fails (branch not fully merged):
Cannot delete <branch>: not fully merged
Skip it and continue with others. Note it in the final report.
If git push origin --delete <branch> fails (remote branch doesn't exist), skip and continue.
Related: cap (commit and push), git-guard (merge strategy verification)
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub 89jobrien/bazaar --plugin atelier