cleaning-up-merged-branches
Syncs main and deletes the local feature branch after a PR is merged on GitHub. Use when the user says they merged or squash-merged a PR ("I merged PR 411 on…
от vscarpenter★ 41 звезда на GitHub
Установить cleaning-up-merged-branches в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Cleaning up merged branches
Sync main and remove the now-stale local feature branch after the user merges a
PR on GitHub. This repo squash-merges PRs by default, so the plain git branch -d
refuses to delete the branch — verify the content actually landed in main, then
force-delete.
Steps
- Fetch, prune stale remote-tracking refs, and note the current branch:
git fetch origin --prune && git branch --show-current - Switch to
mainand pull the merge (localmainstill points at the pre-merge commit until you do this):git checkout main && git pull origin main - Try the safe delete of the feature branch:
git branch -d <branch>- Succeeds → done; go to Verify.
- Fails with
error: the branch '<branch>' is not fully merged→ expected for a squash merge. GitHub squashed the branch into one new commit, so its original commits are not ancestors ofmaineven though the content landed. Continue.
- Confirm the branch's content is fully in
mainbefore force-deleting. The':!.blume'pathspec excludes local.blume/tool artifacts that are never committed:git diff main <branch> -- . ':!.blume'- Empty output → content is fully in
main; safe to force-delete. - Non-empty output → the branch has unmerged changes. Stop, show the diff to the user, and do NOT force-delete.
- Empty output → content is fully in
- Force-delete the redundant local branch:
git branch -D <branch>
Verify
git branchshows the feature branch is gone and you are onmain.git log --oneline -1showsmainat the squash-merge commit.
Gotchas
- Deleting multiple branches at once: zsh does not word-split an unquoted
variable (unlike bash), so
git branch -D $branchespasses the whole list as one bad refspec and deletes nothing. Pipe the list throughxargsinstead:... | xargs git branch -D. - Deleting remote branches (
git push origin --delete <branch>) is externally visible — confirm with the user first. Local cleanup above does not require it;git fetch origin --prunealready drops stale remote-tracking refs.
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл cleaning-up-merged-branches?
Syncs main and deletes the local feature branch after a PR is merged on GitHub. Use when the user says they merged or squash-merged a PR ("I merged PR 411 on GitHub", "merged the PR", "clean up the branch"). Codifies this repo's squash-merge default, where `git branch -d` wrongly reports "not fully merged" and a verified force-delete is required.
Как установить скилл cleaning-up-merged-branches?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл cleaning-up-merged-branches запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…