pr-cleanup
Installation
SKILL.md
PR Cleanup Skill
Overview
This skill provides safe, systematic cleanup of local branches after PR merge. It implements a Sequential Safety pattern: identify target, verify merge status, delete safely, confirm result. The workflow follows 5 sequential steps to prevent data loss and ensure reliable cleanup.
Instructions
Step 0: CHECK for Worktrees
Goal: Remove any git worktrees referencing the target branch before attempting deletion.
Worktree agents (dispatched with isolation: "worktree") create local branches that block both git branch -d and gh pr merge --delete-branch. Since worktree branches prevent deletion, check and clean up first:
# List worktrees referencing any branch
git worktree list