merge-pr

Merge GitHub pull requests and clean up worktrees and branches.

5|1|Updated Dec 12, 2025
One-click install
npx skills add https://github.com/ncukondo/reference-manager --skill merge-pr-ncukondo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: merge-pr
Source: https://github.com/ncukondo/reference-manager/tree/main/.claude/skills/merge-pr
Command: npx skills add https://github.com/ncukondo/reference-manager --skill merge-pr-ncukondo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Merges a pull request and automatically cleans up the associated worktree and branches, reducing manual cleanup and error-prone steps after merging.

Core Features & Use Cases

  • Single-command PR merging that handles CI waiting, merge strategy selection (squash by default, with --merge or --rebase options), and post-merge housekeeping.
  • Worktree and branch cleanup: switches to main, kills running agents, removes worktrees, and deletes local and remote branches to keep the repository clean.
  • Post-merge updates: optionally updates roadmaps or related task status after successful merges.

Quick Start

Run the one-command script with the PR number to merge the PR, clean up any worktrees, and delete local and remote branches.

Frequently Asked Questions about merge-pr

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

FAQPage Schema
How do I merge a GitHub PR and automatically clean up local branches?

You can merge a GitHub PR and automatically clean up local branches by running a single shell command that executes the merge, switches to main, and deletes both local and remote branches to keep the repository clean.

Can I choose between squash, merge, and rebase strategies when merging a pull request?

Yes, you can choose between squash, merge, and rebase strategies when merging a pull request. The workflow defaults to squash but supports --merge or --rebase options to fit your git workflow.

How does a git worktree workflow handle branch deletion after a PR merge?

A git worktree workflow handles branch deletion after a PR merge by automatically switching to main, killing running agents, removing worktrees, and deleting local and remote branches to prevent manual cleanup errors.

Does PR merging wait for CI checks to pass before completing the merge?

Yes, PR merging waits for CI checks to pass before completing the merge. The workflow includes built-in CI-wait and safety checks to ensure continuous integration finishes successfully prior to the actual merge operation.

What is the best way to merge multiple pull requests at once with automatic cleanup?

The best way to merge multiple pull requests at once with automatic cleanup is using a shell script workflow that processes single or multiple PRs sequentially, handling CI waiting, merging, and worktree cleanup in one command.

Can I update related task status automatically after a successful PR merge?

Yes, you can update related task status automatically after a successful PR merge. The workflow includes optional post-merge updates to modify roadmaps or associated task statuses immediately following the merge operation.