merge-pr

Squash-merge prepared GitHub PRs with exact head-commit matching and cleanup.

202|36|Updated Jan 27, 2026
One-click install
npx skills add https://github.com/adoresever/AGI_Ananas --skill merge-pr-adoresever
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: merge-pr
Source: https://github.com/adoresever/AGI_Ananas/tree/main/26.2.21openclaw-viking/.agents/archive/merge-pr-v1
Command: npx skills add https://github.com/adoresever/AGI_Ananas --skill merge-pr-adoresever

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Merge prepared PRs deterministically via squash and cleanup worktrees after success, without pushing to main or modifying code.

Core Features & Use Cases

  • Deterministic squash merge using --match-head-commit and explicit co-author trailer to preserve authorship.
  • Safety rails: do not push to main, do not use --auto, validate PR state and checks before merging, and perform workspace cleanup after success.
  • Post-merge steps: record merge SHA, add co-author and reviewer trailers to the commit message, and comment on the PR with merge details.
  • Use Case: When a PR is prepared and vetted, this skill merges it atomically and tidies the workspace.

Quick Start

Run the merge-pr skill after the PR has been prepared and validated with /prepare-pr to perform the squash merge and cleanup.

Frequently Asked Questions about merge-pr

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

FAQPage Schema
How do I squash merge a GitHub PR deterministically without pushing to main?

You can squash merge deterministically by applying gh pr merge --squash with --match-head-commit to validate the exact head commit before merging, ensuring workspace cleanup after success without pushing to main.

What is a deterministic squash merge and when do I need it?

A deterministic squash merge uses --match-head-commit to guarantee the PR merges only if the head commit matches your reviewed state exactly. You need it when managing PRs that require exact head-commit matching and post-merge workspace cleanup.

How do I add co-author and reviewer metadata to a squash merge commit message?

You can inject co-author and reviewer metadata into the squash merge commit message during the gh pr merge --squash process using an automated skill that records the merge SHA and adds explicit trailers to preserve authorship.

Can I automate PR workspace cleanup after a successful squash merge?

Yes, you can automate PR workspace cleanup after a successful squash merge by using a skill that validates PR state and checks, performs the merge atomically, and then tidies the worktree automatically.

Why should I use --match-head-commit when merging a prepared PR?

You should use --match-head-commit when merging a prepared PR to ensure the merge fails if the branch receives new commits after your review. This safety rail prevents merging unreviewed code and requires exact head-commit matching.

What are the limitations of automating squash merges for GitHub PRs?

Limitations include not using the --auto flag and never pushing to main. The process requires the PR to be prepared and vetted beforehand, and it validates PR state and checks before performing the atomic squash merge.