merge-pr

Verify PR readiness and squash-merge with branch cleanup via gh CLI.

9|2|Updated Mar 7, 2026
One-click install
npx skills add https://github.com/harnessprotocol/harness-kit --skill merge-pr-harnessprotocol
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: merge-pr
Source: https://github.com/harnessprotocol/harness-kit/tree/main/plugins/merge-pr/skills/merge-pr
Command: npx skills add https://github.com/harnessprotocol/harness-kit --skill merge-pr-harnessprotocol

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It removes the uncertainty and manual steps involved in getting a pull request ready to land by checking CI and review status, syncing with the base branch, and then performing a safe squash merge with cleanup.

Core Features & Use Cases

  • PR identification: Finds the open PR on the current branch or works from a user-provided PR number.
  • Readiness verification: Blocks merging when CI is failing or when any CHANGES_REQUESTED reviews exist.
  • Base branch sync: Rebases locally against the base branch if it has advanced, then re-verifies CI before proceeding.
  • User confirmation + merge: Asks for confirmation before squash merging, then deletes the remote branch and syncs the local checkout.

Quick Start

Tell your AI assistant to merge the pull request by asking it: Merge this PR.

Frequently Asked Questions about merge-pr

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

FAQPage Schema
How do I safely squash-merge a pull request after CI passes and reviews are approved?

To safely squash-merge a pull request, the Skill verifies that CI is passing and no CHANGES_REQUESTED reviews remain. It rebases your branch against the base branch if it has advanced, prompts for confirmation, then executes a squash merge with remote branch deletion and local sync.

What happens if my pull request is behind the base branch when I try to merge?

If your pull request is behind the base branch, the Skill enforces a rebase with force-with-lease to sync your changes. After rebasing locally, it re-verifies that CI is still passing before prompting you to proceed with the squash merge.

Do I need the gh CLI installed to squash-merge a pull request through my AI assistant?

Yes, you need the gh CLI installed to use this Skill. It relies on the gh CLI for pull request inspection, checking the PR state and review status, and ultimately executing the squash merge with branch cleanup.

Can I merge a pull request if there are outstanding CHANGES_REQUESTED reviews?

No, you cannot merge a pull request with outstanding CHANGES_REQUESTED reviews. The Skill's readiness verification explicitly blocks the squash merge process until all requested changes are resolved and CI checks are passing.

What's the best way to automate branch cleanup when merging a GitHub pull request?

The best way to automate branch cleanup is using a workflow that verifies PR readiness, performs a squash merge, and deletes the remote branch. This Skill runs gh pr merge --squash --delete-branch and syncs your local checkout automatically.

How do I verify a pull request is ready to merge before squashing?

To verify a pull request is ready to merge, the Skill checks the PR state and reviews using the gh CLI. It blocks the process if CI is failing or if any CHANGES_REQUESTED reviews exist, ensuring only fully approved and tested branches are squashed.