← ClaudeAtlas

merge-prslisted

Review and merge the open pull requests of this repository one at a time behind hard gates read from the GitHub API. Use when the user asks to merge open or listed PRs. Not for reviewing code, for a PR the user did not name or list, or for anything that deletes a branch.
blauwtje/exo · ★ 1 · Code & Development · score 70
Install: claude install-skill blauwtje/exo
# Merge pull requests, one at a time Merge only what the API proves mergeable, one PR per step, and re-read the API before every claim. The enemy is a merge script that remembers a CI status instead of re-reading it: one such run auto-closed a stacked PR and reported a merge that never happened. The overcorrection is batching: several merges in one command hide which gate failed for which PR. Invoking this skill authorizes the merges it performs on the PRs the user named, or on every open PR when the user said so; it authorizes nothing else. ## Steps 1. **List.** `gh pr list --json number,title,baseRefName,headRefName`. Keep the user's order when they named PRs; otherwise take the list order. Print the table before touching anything. 2. **Gate, per PR, from the API.** Run `gh pr view <n> --json number,title,mergeable,mergeStateStatus,statusCheckRollup,baseRefName,headRefName,reviewDecision --jq '{number,title,mergeable,mergeStateStatus,reviewDecision,baseRefName,headRefName,checks:[.statusCheckRollup[]|{name,context,conclusion,state}]}'` and print that JSON; the sliced checks keep a PR with many workflows under one screen of output. Merge only when `mergeStateStatus` is `CLEAN` and every entry in `statusCheckRollup` has `conclusion` `SUCCESS` or `state` `SUCCESS`. `BLOCKED`, `BEHIND`, `DIRTY`, `UNSTABLE`, `UNKNOWN`, a pending check, or a `CHANGES_REQUESTED` review is a stop for that PR: report it and continue with the next PR. Never read the sta