mergedlisted
Install: claude install-skill zahidakhyar/skills
# Merged
Clean up after a PR merge, then point to the next piece of work. Runs without confirmation except at the points marked **ask**.
## Arguments
A token starting with `--` is a flag; the one remaining token is the PR ref (number or branch name). No ref → the current branch.
| Flag | Effect |
|---|---|
| `--dry-run` | Show the commands that would run; execute nothing that changes state. |
| `--close-issues` | Step 6 closes issues that are still `OPEN`. Without this flag step 6 only reports. Needed because GitHub acts on `Closes #N` only for PRs into the default branch; a PR into `dev` leaves its issue open. |
## Flow
0. **Repo** — detect sub-repos: `for d in */; do [ -d "$d.git" ] && echo "$d"; done`. No output → the current repo only. Output (a layout like `acme/` or the `workspace/` root) → look for the PR in each sub-repo (`gh pr view <ref>` from inside that directory); steps 1–7 run in the sub-repo that holds the PR. Other sub-repos are left alone: not pulled, not in the table. PR found in more than one sub-repo → pick the one whose head branch still exists locally (`git -C <dir> branch --list <head>`); still more than one, or none → **ask** which repo.
1. **PR** — from the ref or the current branch.
`gh pr view <ref> --json number,url,state,mergedAt,baseRefName,headRefName,body,closingIssuesReferences`
`state` is not `MERGED` → stop, report the state. Delete nothing. Cleanup is only for PRs already in base.
`<head>` is a long-lived branch (`dev`, `dev