/waylode:merge-prsfrom Waylode
Merges open GitHub pull requests safely and in order: lists, filters drafts/conflicts/failing checks, reviews unreviewed PRs, shows a plan, then merges each pinned to the checked head commit. Never uses admin overrides or force-pushes.
Ships in Waylode. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Merging a pull request changes the remote, which other people and CI see. So this skill shows its plan and waits for the owner's yes every run. Invoking the skill does not count as that yes.
What this skill never does:
gh pr merge --admin, or any other way past a branch protection;waylode:commit-and-merge defines it), or any branch when the owner did not ask;gh auth status must pass.gh repo view --json nameWithOwner,defaultBranchRef,mergeCommitAllowed,squashMergeAllowed,rebaseMergeAllowed,deleteBranchOnMerge,viewerPermission.viewerPermission below WRITE cannot merge. Say so and stop.waylode_insights with the absolute repo_path, then git fetch origin.
waylode:commit-and-merge does, including its remote expansion (refs/remotes/origin/<value>) and the protected names. A pull request's head is locked-in when it matches either.deleteBranchOnMerge is true, GitHub deletes a pull request's head branch when it merges, with or without --delete-branch.
waylode:commit-and-merge "Before you start" says, unless a calling skill (waylode:wrap-up) holds it. You need it for local verification (step 2) and for moving the local default branch (step 6).gh pr list --state merged --limit 20 --json number,mergeCommit, plus the default branch's git log --first-parent (merge commits or single squashed commits).Run gh pr list --state open --limit 200 --json number,title,author,headRefName,headRefOid,baseRefName,isDraft,isCrossRepository,mergeable,mergeStateStatus,reviewDecision,labels,updatedAt.
mergeable can read UNKNOWN while GitHub computes it. Re-read that pull request after a few seconds, at most three times, and then report it as unknown.Read the checks. Run gh pr checks <n> --required --json name,state,bucket and read the bucket of each row. With --json the command exits 0 even while checks are pending, so never judge by its exit status.
gh pr checks <n> --json name,state,bucket too, and report what ran.Then check each pull request in order, and put it in the first bucket that fits.
| Bucket | When |
|---|---|
| skip: draft | isDraft |
| skip: not into the default branch | baseRefName is neither the default branch nor another open pull request's head (a stack) |
| skip: conflicts | mergeable is CONFLICTING (mergeStateStatus DIRTY) |
| skip: changes requested | reviewDecision is CHANGES_REQUESTED |
| checks failing | a required check's bucket is fail or cancel |
| checks pending | a required check's bucket is pending |
| no checks | no required checks: nothing has verified it |
| behind | mergeStateStatus is BEHIND: the base protection wants it up to date |
| blocked | mergeStateStatus is BLOCKED: a required review, a required conversation resolution or another rule is unmet. Name which one; GitHub's branch protection decides, not this skill. |
| needs review | no person has approved the diff (reviewDecision empty or REVIEW_REQUIRED), and nothing above applies |
| ready | mergeStateStatus CLEAN, HAS_HOOKS or UNSTABLE, every required check passing, and the diff approved by a person or reviewed in step 3 |
Only ready pull requests merge. A "needs review" pull request becomes ready only if step 3 finds nothing critical, and GitHub itself does not block it.
Stacks. A pull request whose base is another open pull request's head merges after that one.
gh pr edit <n> --base <default>). Ask before doing that.No checks. A pull request nothing has verified is not ready. Offer to verify it locally:
git fetch origin +pull/<n>/head:refs/remotes/pr/<n>. The + lets it follow a force-push.headRefOid. If it differs, the head moved: re-read the pull request.waylode:commit-and-merge step 4 does, with this skill holding the lock. That uses the repository's full gate, or waylode:merge-train for several pull requests.What gets reviewed: every pull request in "needs review", and any ready one whose diff no person has approved.
gh pr diff <n> with the strongest model the host has. In Claude Code that is an Agent with model: "opus".devmap_impact on the symbols the diff changes, and the repository's instructions.What a review can do:
Show one row per pull request:
headRefOid as read now);Order. Stacks go bottom first. Otherwise the oldest ready pull request goes first, then the smallest. Wait for the owner's yes, and take the plan as they edit it.
For each pull request in the approved order:
gh pr view <n> --json headRefOid,mergeable,mergeStateStatus,reviewDecision).
BEHIND and new conflicts show up here.gh pr merge <n> --<method> --match-head-commit <pinned sha>.
--delete-branch only if the owner asked for it and the head branch is not locked-in. That flag deletes the local branch as well as the remote one.deleteBranchOnMerge is on, the remote head is deleted anyway. Only merge a locked-in head after the owner's explicit yes from "Before you start".gh pr view <n> --json state,mergeCommit. Only MERGED with a merge commit counts.gh pr update-branch <n>: it pushes a commit to that branch.git fetch origin.git rev-list --count origin/<default>..<default> is 0). Do it the way waylode:commit-and-merge step 5 lands (compare-and-swap, or --ff-only in its checkout). Otherwise report the divergence and leave it.waylode_list_tasks) whose branch or pull request merged:
waylode_landed, using base: origin/<default>;waylode_complete_task, with the pull request number in the summary. Done is evidence-gated, so a card may land in review instead; say which.Give the owner:
A pull request that is "merged" only because auto-merge was turned on has not merged yet.
Release the lock, unless a calling skill holds it.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
pull-request-merging, github-cli, merge-workflow, safe-merging
9 skills in this plugin
/collisionsDetect overlapping uncommitted edits across Waylode worktrees and agent sessions. Use when two agents, worktrees, or checkouts might be touching the same files, before merging or continuing a parked rebase, or when the user asks who is editing what./commit-and-mergeCommit the finished work in a repository's worktrees and merge the verified branches into its default branch, while keeping every locked-in branch in place. Locked-in means a locked worktree, a branch a live agent holds, a protected or archive name, or the repository's own list (git config gitpulse.lockedBranch, such as labs/**). A locked-in branch may be merged once it verifies, but is never deleted, rewritten or committed into. Use when asked to "commit and merge the branches", "merge everything into main", "land the lanes", or "merge but keep my locked branches". It never pushes and never deletes a remote branch./insightsRead Waylode repository insights over MCP — worktrees, agent sessions, uncommitted changes, overlapping dirty files, ledger verdicts, and code-graph availability. Use when an agent needs a honest snapshot of a checkout before editing, when multiple worktrees or coding agents are in flight, or when the user asks what is happening in a Waylode-managed repo./loadCheck host load before heavy builds and tests, and know what to do when Waylode refuses one. Use before running cargo, go, npm/bun/pnpm test, vitest or jest, before an unbounded grep, rg or go test, and whenever a command was refused for host load or the session brief says host load is elevated, severe or UNKNOWN./merge-trainVerify several branches together with ONE full gate run instead of one per branch, in any repository. Merges the batch onto a persistent integration worktree, runs the repository's own full gate once, compares individual failures against the default branch (which is often already red), re-checks suspected failures alone, and bisects with only the failing tests to name the branch that broke them. Use when two or more finished branches or lanes are waiting to merge, when asked to "verify these branches together", "run a merge train", or "check what this batch breaks". Produces a verified train branch and a report; it never lands, pushes or deletes anything./tasksFile, import, list, read, complete, merge and delete tasks on the Waylode task board over MCP — the board a person sees in Waylode and launches agents from. Use when an agent needs to record follow-up work, plan upcoming tasks, put Markdown task briefs from a repository's tasks/ folder onto the board, read a task's brief before implementing it, mark the task it was launched on done when the work is finished, merge duplicate tasks into one, or delete a task that should not exist, with a recorded reason.npx claudepluginhub bharathvbcr/gitpulse --plugin waylodeOther plugins' skills for the same job