← ClaudeAtlas

pr-mergelisted

Merge a pull request, then return to the base branch with the merge pulled in — confirm mergeability, merge via gh (repo's default method) and delete the head branch, then check out the PR's base branch (e.g. dev) and pull. Use when the user says "merge the PR", "merge PR
real-case/marvin-toolkit · ★ 0 · AI & Automation · score 68
Install: claude install-skill real-case/marvin-toolkit
# Merge PR Land a pull request and leave the working copy clean on the base branch with the merge already pulled in. The closing step of the PR flow. ## Core principle **Merging is outward-facing and hard to undo — confirm first.** Surface the PR's state, get explicit approval, merge, then put the user back on an up-to-date base branch so they can keep working. ## Input `$ARGUMENTS` — optional PR number (e.g., `42`). If omitted, detect from the current branch. ## Workflow ### 1. Identify the PR and its base ```bash gh pr view <number> --json number,title,baseRefName,headRefName,url,state,isDraft,mergeable,mergeStateStatus,reviewDecision ``` If no PR is found, stop: "No open PR found for the current branch. Provide a PR number: `/marvin:pr-merge 42`". Note the `baseRefName` — that is the branch to return to after merging (typically `dev`; falls back to `.marvin/config.json` `base_branch`, default `dev`). ### 2. Pre-flight Surface the merge readiness and let the user judge: - `state` must be `OPEN` and `isDraft` false — refuse to merge a draft or a closed PR. - `mergeable` / `mergeStateStatus` — flag conflicts (`CONFLICTING`), pending or failing checks (`BLOCKED`, `UNSTABLE`), or behind-base. - `reviewDecision` — note if it is `REVIEW_REQUIRED` or `CHANGES_REQUESTED`. Report blockers plainly. If anything is not green, ask the user whether to proceed anyway or to stop — do not force a merge silently. ### 3. Confirm, then merge **Show the user what will happen** —