In the CURRENT repo, find branches whose PR is already merged that I forgot to delete, and optionally clean them up. Use for "clean up branches", "stale branches", or "merged branches I can delete".
How this skill is triggered — by the user, by Claude, or both
Slash command
/gh-workflow:stale-branchesThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Find branches in the **current repository** that are safe to delete because their
Find branches in the current repository that are safe to delete because their PR is already merged. Scope is deliberately this repo only — never org-wide.
gh pr list --state merged --author @me --limit 100 --json number,title,headRefName,mergedAtgit branch --format='%(refname:short)'git fetch --prune then git branch -r --format='%(refname:lstrip=3)'headRefName.
Never treat these as stale — exclude them always: main, master, and
anything under release/* or hotfix/*.Then stop and ask which to delete (all / some / none). Do not delete anything before the user confirms, even though prompts are off in this sandbox. Default to deleting nothing.
On confirmation, for each chosen branch:
git branch -D <branch>
(use -D: a squash- or rebase-merged branch is not recognised as merged by
git branch -d, so -d would refuse exactly these. The merged-PR check in
step 1 is the real safety gate — that's what confirms the work is preserved.)git push origin --delete <branch>Never delete a default or protected branch — branch-protection rules on the server are the real backstop; this skill is convenience, not authority.
npx claudepluginhub evaldasguogis/shared-tools-marketplace --plugin gh-workflowCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.