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 언어
영어
스타
231
포크
36

설치 방법

기본적으로 소스를 먼저 확인하는 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에서 보기