land-pr

Merge a pull request and delete its branch using GitHub CLI.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Finishes a pull request and performs branch cleanup to avoid orphaned branches and stale remote-tracking refs, reducing manual git/GitHub CLI steps and human error when closing PRs.

Core Features & Use Cases

  • Detects chained or dependent pull requests that target the current branch and warns to avoid closing dependent work.
  • Merges the PR using a selectable strategy (default squash, or rebase if requested) and deletes the remote branch.
  • Switches to the PR base branch, fetches and pulls updates, and prunes stale remote-tracking references to keep the local repo tidy.
  • Use case: finish a feature branch after review by merging, removing the branch, and ensuring the main branch is up to date.

Quick Start

Land the current pull request using a squash merge, delete the branch, and return to the base branch.

Frequently Asked Questions about land-pr

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

FAQPage Schema
How do I merge a pull request and delete the branch using the GitHub CLI?

To merge a pull request and delete the branch using the GitHub CLI, this Skill performs the merge using a squash or rebase strategy, deletes the remote branch, and switches to the base branch. It automates the entire cleanup process to prevent orphaned branches.

How can I check for dependent pull requests before merging a branch?

To check for dependent pull requests before merging, this Skill detects chained or dependent PRs targeting your current branch and warns you. This prevents accidentally closing dependent work during the merge and branch cleanup process.

How do I keep my local git repository tidy after closing a PR?

To keep your local git repository tidy after closing a PR, this Skill switches to the base branch, fetches and pulls updates, and prunes stale remote-tracking references. This ensures your main branch is up to date and removes orphaned branches.

Can I choose between squash and rebase strategies when landing a PR?

Yes, you can choose between squash and rebase strategies when landing a PR. The default strategy is squash merge, but you can request a rebase merge instead to complete the pull request and clean up the remote branch.

What happens if errors occur during a GitHub CLI pull request merge?

If errors occur during a GitHub CLI pull request merge, the Skill aborts the operation. This safety mechanism ensures your repository remains in a consistent state if the merge, branch deletion, or remote-tracking ref pruning fails.

Do I need gh and git installed to automate pull request branch cleanup?

Yes, you need both gh and git installed to automate pull request branch cleanup. The Skill requires the GitHub CLI and git to perform the merge, delete remote branches, fetch base branch updates, and prune stale references.