merge-and-cleanup

Squash merge pull requests via GitHub CLI and clean up branches and worktrees.

Updated Mar 8, 2026
One-click install
npx skills add https://github.com/cxm6467/caboose-cursor-tools --skill merge-and-cleanup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: merge-and-cleanup
Source: https://github.com/cxm6467/caboose-cursor-tools/tree/main/cursor-plugins/plugins/git-utils/skills/merge-and-cleanup
Command: npx skills add https://github.com/cxm6467/caboose-cursor-tools --skill merge-and-cleanup

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill automates the entire post-review process for pull requests, significantly reducing manual Git operations and potential errors.

Core Features & Use Cases

  • Automated Squash Merging: Safely merges PRs with a squash strategy via GitHub CLI.
  • Branch Management: Automatically deletes local and remote feature branches post-merge.
  • Workflow Synchronization: Switches to the default branch and pulls the latest changes.
  • Worktree Cleanup: Handles cleanup for Git worktrees, ensuring a clean repository state.
  • Safety Checks: Includes checks for uncommitted changes, CI status, and worktree presence.
  • Use Case: After a code review is approved, simply invoke this skill to merge the PR, clean up the branch, and update your local main branch, all in one go.

Quick Start

Use the merge-and-cleanup skill to merge the current pull request and clean up the branch.

Frequently Asked Questions about merge-and-cleanup

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

FAQPage Schema
How do I automate a GitHub PR merge and delete local and remote branches?

Automating a GitHub PR merge and branch cleanup uses squash merging via GitHub CLI, then automatically deletes both local and remote feature branches, switches to the default branch, and pulls the latest changes.

Can I squash merge a pull request and clean up Git worktrees in one step?

Yes, you can squash merge a pull request and clean up Git worktrees in one step. The workflow handles worktree cleanup automatically after merging, ensuring a completely clean local repository state.

What does PR readiness validation check before merging a pull request?

PR readiness validation checks status, CI, and conflicts before merging a pull request. It also includes robust error handling to detect uncommitted changes and prevent merge failures.

How do I switch to the default branch and pull latest changes after a squash merge?

To switch to the default branch and pull latest changes after a squash merge, the workflow automatically transitions your local Git environment to the default branch and fetches updates.

What happens if I have uncommitted changes during an automated PR merge?

If you have uncommitted changes during an automated PR merge, robust error handling detects them and halts the process. This safety check prevents losing work before executing the squash merge and branch deletion.