merge-pr

Merge GitHub pull requests via squash and clean up worktrees.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill automates the process of merging prepared GitHub Pull Requests (PRs) using a squash strategy, ensuring a clean and efficient integration of changes.

Core Features & Use Cases

  • Automated Merging: Merges PRs using gh pr merge --squash.
  • Branch Cleanup: Automatically deletes the source branch after a successful merge.
  • Worktree Isolation: Performs all operations within a dedicated worktree to prevent interference with the main repository.
  • Use Case: After a PR has been reviewed and is ready for integration, use this Skill to merge it into the main branch without manual intervention, ensuring the PR state is MERGED and the worktree is cleaned up.

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 automatically merge a GitHub pull request using squash?

To automatically squash and merge a GitHub pull request, this Skill executes `gh pr merge --squash` within an isolated worktree. It verifies the final PR state is `MERGED` and automatically deletes the source branch to ensure a clean repository.

What is the best way to clean up git worktrees after merging a pull request?

The best way to clean up git worktrees after merging a pull request is to use an automated Skill that removes the worktree and deletes the source branch immediately upon verifying a successful squash merge.

Do I need the GitHub CLI installed to automate a squash merge?

Yes, you need the GitHub CLI and Git installed and configured to automate a squash merge. This Skill relies on the `gh pr merge --squash` command to integrate code changes and verify the PR state.

Can I automate branch deletion when merging GitHub PRs?

Yes, you can automate branch deletion when merging GitHub PRs. Upon a successful squash merge, this Skill automatically deletes the source branch and removes the dedicated worktree to maintain a clean repository state.

Why use a dedicated worktree for automated pull request merges?

Using a dedicated worktree for automated pull request merges prevents interference with your main repository. This Skill performs all merge operations within the isolated worktree before cleaning it up.