merge

Merge open pull requests with a merge commit via GitHub CLI.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/nicolasrouanne/claude --skill merge-nicolasrouanne
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: merge
Source: https://github.com/nicolasrouanne/claude/tree/main/.claude/skills/merge
Command: npx skills add https://github.com/nicolasrouanne/claude --skill merge-nicolasrouanne

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Merge a pull request using a merge commit and delegate cleanup to the /worktree clean skill, reducing manual steps and ensuring a clean project history.

Core Features & Use Cases

  • Identify the PR to merge from an argument, the current branch, or a PR URL/number.
  • Validate the PR is OPEN and that mergeStateStatus is not BLOCKED, BEHIND, or DIRTY.
  • Merge the PR with a merge commit using gh pr merge <number> --merge.
  • Delegate cleanup to the /worktree clean skill to remove the worktree and prune merged branches.
  • Provide clear feedback if no PR is found or the PR cannot be merged.

Quick Start

Ask Claude to merge the current PR using a merge commit and then run cleanup with /worktree clean.

Frequently Asked Questions about merge

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

FAQPage Schema
How do I merge a pull request using a merge commit and clean up branches automatically?

To merge a pull request using a merge commit, the skill executes gh pr merge with the --merge flag and delegates branch removal to the worktree clean workflow. It validates the PR is open and unblocked before merging and cleaning up.

What's the best way to automate GitHub PR merges and worktree cleanup in one step?

Automating GitHub PR merges and worktree cleanup is handled by validating the PR state, executing a merge commit via GitHub CLI, and pruning the local worktree and merged branches through the worktree clean workflow.

Why does a pull request merge fail when the branch is behind or blocked?

A pull request merge fails when mergeStateStatus is BLOCKED, BEHIND, or DIRTY. The skill checks PR metadata to ensure the state is open and clean before attempting to merge and run automated cleanup.

Do I need the GitHub CLI to merge pull requests and clean up local worktrees?

Yes, you need the GitHub CLI (gh) installed to merge pull requests. The skill uses gh to access PR metadata, validate the merge state, execute the merge commit, and trigger the worktree clean workflow.

Can I merge a pull request from a URL or branch name instead of a PR number?

Yes, you can merge a pull request from an explicit PR number, a URL, or by detecting the PR mapped to your current branch. The skill identifies the target PR and validates its state before merging.

What happens to local worktrees after merging a pull request?

After merging a pull request, the skill delegates cleanup to the worktree clean workflow, which removes the local worktree and prunes the merged branches to ensure a clean project history and environment.