Skip to main content

cleanup-complete-branches

Clean up completed Git branches and worktrees for this repository, both locally and on GitHub. Use when the user says "/cleanup-complete-branches", "$cleanup-complete-branches", "clean up complete branches", "remove merged branches", "delete completed worktrees", "prune old worktrees", or asks to remove local and remote branches after pull requests are merged or closed.

インストールへ移動

ソース情報

リポジトリ
jtenniswood/esphome-media-player
ソースの最終更新活動
2026年7月7日 09:04
検出された SKILL.md の言語
英語
スター
230
フォーク
35

インストール方法

デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。

ソースファイルを確認

インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。

ファイルエクスプローラー
3 ファイル

SKILL.md を表示中

SKILL.md
ソースの指示 · 読み取り専用プレビュー
name
cleanup-complete-branches
description
Clean up completed Git branches and worktrees for this repository, both locally and on GitHub. Use when the user says "/cleanup-complete-branches", "$cleanup-complete-branches", "clean up complete branches", "remove merged branches", "delete completed worktrees", "prune old worktrees", or asks to remove local and remote branches after pull requests are merged or closed.
# Cleanup Complete Branches Remove completed worktrees, local branches, and GitHub branches without touching active work. ## Workflow ### 1. Start With A Preview Always run the bundled script in dry-run mode first: ```bash python3 .agents/skills/cleanup-complete-branches/scripts/cleanup_complete_branches.py ``` Dry-run mode fetches and prunes remotes, then reports what would be removed. It must not delete anything. Review the output before applying changes. Treat these as blockers: - A worktree is dirty. - A branch has no merged GitHub PR and is not merged into `origin/main`. - The branch name is protected. - GitHub CLI authentication is missing and completion cannot be proven from git history alone. ### 2. Apply The Cleanup If the dry run only lists completed branches and clean worktrees, apply it: ```bash python3 .agents/skills/cleanup-complete-branches/scripts/cleanup_complete_branches.py --apply ``` The script removes clean completed worktrees first, then deletes matching local branches, then deletes matching `origin` branches on GitHub. ### 3. Optional Cases Only remove closed-but-unmerged PR branches when the user explicitly asks for branches from abandoned or closed PRs to be removed: ```bash python3 .agents/skills/cleanup-complete-branches/scripts/cleanup_complete_branches.py --apply --include-closed-unmerged ``` Use `--force-worktrees` only when the user explicitly accepts losing uncommitted files inside completed worktrees: ```bash python3 .agents/skills/cleanup-complete-branches/scripts/cleanup_complete_branches.py --apply --force-worktrees ``` ## Safety Rules - Never delete `main`, `master`, `develop`, `dev`, `release`, `staging`, or `production`. - Never delete the currently checked-out branch. - Never delete a dirty worktree unless the user explicitly requested force. - Prefer GitHub PR status for squashed PRs, because git ancestry may not show squashed branches as merged. - If a branch is ambiguous, report it and leave it alone. - Do not close GitHub issues or PRs as part of cleanup. ## Reporting Summarize: - Worktrees removed or skipped. - Local branches removed or skipped. - GitHub branches removed or skipped. - Any branches that need the user's decision.
GitHubで見る