merge
The user has merged a PR. Leave the repo on an up-to-date default branch, with every finished branch and worktree gone and nothing that anyone still needs touched. This skill never merges anything: if the PR is still open, merging is the user's call, and /merge is not that call.
Other agents may share this repo, so "clean up everything" means everything that is provably finished. A branch or worktree that might still hold someone's work stays, and the report says why.
1. Confirm the merge
Find the PR from the argument, the conversation, or the current branch:
gh pr view [<pr>] --json number,title,state,headRefName,baseRefName,mergedAt
If state is not MERGED, stop and say so. If the repo has no GitHub remote (gh fails), take the user's word for it; the script below still demands proof of the merge before anything is removed.
2. Leave the worktree first
Run every later command from the main checkout, the first entry in git worktree list. If the shell is still inside a worktree when that worktree is removed, the shell's working directory disappears.