merge-and-cleanup

Automate PR squash merging and branch cleanup in Git repositories.

2|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/juslee/aios --skill merge-and-cleanup-juslee
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: merge-and-cleanup
Source: https://github.com/juslee/aios/tree/main/.claude/skills/merge-and-cleanup
Command: npx skills add https://github.com/juslee/aios --skill merge-and-cleanup-juslee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates the end-to-end process of merging a PR with a single commit, cleaning up related branches/worktrees, and updating the main branch.

Core Features & Use Cases

  • End-to-end PR merge: detect PR, verify CI, perform squash merge, and clean up branches and worktrees.
  • Branch hygiene: delete remote and local branches and remove the worktree when applicable.
  • Mainline sync: switch to main, pull latest changes, and report a concise summary.

Quick Start

Run this skill to squash-merge the current PR, remove the remote and local branches, delete any worktree, switch to main, and report the outcome.

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 squash-merging a PR and cleaning up Git branches?

This Skill automates squash-merging a PR and branch cleanup by verifying CI, merging, deleting local and remote branches, and removing worktrees. It switches to main, pulls updates, and reports the outcome.

What is the best way to delete a Git worktree after merging a feature branch?

Deleting a Git worktree after merging is handled by automating cleanup alongside the squash merge. This Skill removes the worktree and deletes branches immediately after merging to maintain mainline hygiene.

Does this PR merge automation verify CI checks before squashing the commit?

Yes, this PR merge automation verifies CI checks before performing the squash merge. It ensures CI passes before merging the PR, cleaning up branches, and syncing the mainline repository.

How does Git branch cleanup work after a squash merge to main?

Git branch cleanup after a squash merge deletes remote and local feature branches. This automation executes the deletion, removes associated worktrees, switches to main, and pulls the latest updates.

Can I use this to sync the main branch automatically after a PR merge?

Yes, you can use this to sync the main branch automatically after a PR merge. Following the squash merge and branch cleanup, the automation switches to main and pulls the latest changes to update your local repository.