Pr merge

From phatblat/dotfiles · View interactive version

Pr merge is an AI agent skill from the GitHub repository phatblat/dotfiles. Merge the current branch's PR after confirmation

How to use this skill

Skill file

pr-merge

Use this skill when the user asks to run the migrated command pr-merge or invokes $pr-merge.

Command Template

Merge PR

Merge the GitHub PR for the current branch. This is the ONLY authorized path to merge a PR.

Instructions

1. Find the PR

gh pr view --json number,url,title,state,mergeable,mergeStateStatus,reviewDecision,statusCheckRollup \
  --jq '{number, url, title, state, mergeable, mergeStateStatus, reviewDecision, checks: [.statusCheckRollup[]? | {name: .name, status: .status, conclusion: .conclusion}]}'

If no PR exists, stop: "No open PR found for branch $(git branch --show-current)."

2. Check Readiness

Report any blockers:

If there are blockers, report them and stop. Do not proceed.

3. Confirm with User

Present the PR summary and ask for confirmation:

PR #<number>: <title>
CI: ✅ all passing (or ❌ N failing)
Reviews: ✅ approved (or ⚠️ pending / ❌ changes requested)
Conflicts: none (or ⚠️ has conflicts)

Merge method?

Use AskUserQuestion to let the user pick the merge method:

4. Merge

gh pr merge <number> --<method> --delete-branch

Where <method> is squash, rebase, or merge based on the user's choice.

5. Report

✅ Merged PR #<number> via <method>
<pr_url>
Branch deleted: <branch>

6. Clean Up Local

git checkout main && git pull --prune

The --prune flag removes local remote-tracking refs for branches deleted on the remote (including the just-merged branch).

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.