merge-pr

Merge a prepared GitHub pull request via squash and clean up worktrees.

1|Updated Feb 24, 2026
One-click install
npx skills add https://github.com/victor-brechbill/claw-kernel --skill merge-pr-victor-brechbill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: merge-pr
Source: https://github.com/victor-brechbill/claw-kernel/tree/main/.agents/archive/merge-pr-v1
Command: npx skills add https://github.com/victor-brechbill/claw-kernel --skill merge-pr-victor-brechbill

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the process of merging a prepared GitHub Pull Request (PR) using a squash merge strategy, ensuring a clean and traceable commit history.

Core Features & Use Cases

  • Deterministic Squash Merging: Merges PRs using gh pr merge --squash with specific commit matching to prevent race conditions.
  • Automated Cleanup: Removes temporary worktrees and branches after a successful merge.
  • Safety Guardrails: Includes checks for PR status, required checks, and branch ancestry to prevent accidental merges or data loss.
  • Use Case: After a PR has been reviewed and prepared for merging, this Skill can be invoked to finalize the merge into the main branch, automatically handling the necessary Git operations and cleanup.

Quick Start

Use the merge-pr skill to merge pull request number 123.

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 pull request via automation?

Squash merging a GitHub pull request requires executing a targeted merge command with specific commit matching to prevent race conditions. This Skill uses the gh pr merge --squash strategy to ensure the PR reaches a MERGED state and cleans up temporary worktrees afterward.

What is a squash merge and when should I use it for GitHub PRs?

A squash merge condenses all commits from a pull request into a single commit on the target branch. It is ideal for maintaining a clean and traceable commit history, ensuring the main branch reflects one commit per merged PR.

How do I automate GitHub PR cleanup after a successful merge?

Automating GitHub PR cleanup after a successful merge involves removing temporary worktrees and branches. This Skill handles the cleanup automatically post-merge, ensuring no residual local branches or worktrees remain after the squash merge completes.

What safety checks are needed before merging a GitHub pull request?

Safety checks before merging a GitHub pull request include verifying the PR status, confirming required checks pass, and validating branch ancestry. This Skill enforces these guardrails to prevent accidental merges or data loss.

Does this squash merge tool require a prepared PR with a verified head commit SHA?

Yes, this squash merge tool requires a prepared PR with a verified head commit SHA. Passing safety checks and having the specific commit SHA ensures deterministic merging and prevents race conditions during the GitHub PR merge process.

Why does my automated PR merge fail or get blocked by safety checks?

Automated PR merges fail when required GitHub checks are not passed, the PR status is not ready, or branch ancestry is invalid. This Skill verifies these safety guardrails before executing the squash merge to prevent accidental merges or data loss.