/merge-pr
Execute PR merge and worktree cleanup in one command.
Usage
/merge-pr 42
Execution Flow
- Get current worktree path and branch name
- Move to main repository
- Remove worktree:
git worktree remove <path> - Delete local branch:
git branch -D <branch> - Merge PR:
gh pr merge <num> --merge --delete-branch - Update main:
git pull origin main
Notes
- If executed from within a worktree (built-in
.claude/worktrees/or manual), automatically detects and moves to main repo - Ensure no uncommitted changes before merging
- Built-in worktreeの自動クリーンアップはディレクトリ削除のみ。PR merge・リモートブランチ削除・main更新はこのskillが担当
- Built-in worktree内から実行する場合、step 3 (
git worktree remove) は自動クリーンアップ済みなら不要。削除前にworktreeの存在を確認する
