merge-pr

Merge prepared GitHub pull requests via squash with verified head SHA and co-author attribution.

Updated Feb 16, 2026
One-click install
npx skills add https://github.com/travis-burmaster/agentbox --skill merge-pr-travis-burmaster
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: merge-pr
Source: https://github.com/travis-burmaster/agentbox/tree/main/agentfork/.agents/archive/merge-pr-v1
Command: npx skills add https://github.com/travis-burmaster/agentbox --skill merge-pr-travis-burmaster

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Merging pull requests manually risks racing stale heads, losing contributor attribution, or leaving stale worktrees behind. This Skill enforces a deterministic squash-merge workflow that verifies the prepared head SHA, required checks, and branch freshness before merging. ## Core Features & Use Cases - Deterministic Squash Merge: Uses gh pr merge --squash --match-head-commit to guarantee the merged head matches the prepared SHA from /prepare-pr. - Attribution Metadata: Builds a merge body with Co-authored-by and Reviewed-by trailers, with a one-time fallback retry on author-email validation errors. - State Verification & Cleanup: Polls until the PR reaches MERGED state, records the merge SHA, posts a confirmation comment, and removes the worktree only after success. - Use Case: After running /review-pr and /prepare-pr on a contributor's PR, invoke this Skill to land it on main with verified checks, proper attribution, and automatic worktree cleanup. ## Quick Start Ask the agent to merge PR number 123 using the merge-pr workflow after preparation is complete.

Frequently Asked Questions about merge-pr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I merge a GitHub PR with squash using gh CLI?

Use gh pr merge with the --squash and --delete-branch flags to land a PR on main. This Skill adds --match-head-commit with the prepared SHA so the merge fails if the PR head changed after preparation.

How to squash merge a pull request without pushing to main?

Run gh pr merge --squash, which performs the merge server-side through GitHub without any local git push. The Skill explicitly forbids git push and uses the GitHub CLI as the only path to main.

Why does gh pr merge fail with a head commit mismatch?

The --match-head-commit flag rejects the merge when the PR head SHA differs from the expected value, which happens if new commits were pushed after preparation. Re-run the preparation step to refresh the SHA before merging.

Can I merge a draft PR or one with failing required checks?

No. The workflow stops if the PR is a draft, if any required checks are failing or pending, or if the branch is behind main. Resolve those conditions through the preparation step first.

How do I add Co-authored-by trailers to a squash merge commit?

Pass a merge body file containing Co-authored-by lines for the contributor and reviewer via the --body-file flag of gh pr merge. The Skill builds this file automatically and verifies the trailers exist in the final merge commit.