auto-merge-and-cleanup

Merge a feature branch into main and clean up branches and worktree.

4|3|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/cacr92/WeReply --skill auto-merge-and-cleanup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auto-merge-and-cleanup
Source: https://github.com/cacr92/WeReply/tree/main/.claude/skills/auto-merge-and-cleanup
Command: npx skills add https://github.com/cacr92/WeReply --skill auto-merge-and-cleanup

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the final steps of a development workflow by merging a completed feature branch into the main branch, synchronizing the remote repository, and cleaning up all associated branches and temporary files.

Core Features & Use Cases

  • Automated Merging: Merges the current feature branch into main using a non-fast-forward strategy to preserve history.
  • Remote Synchronization: Pushes the merged main branch to the remote repository.
  • Branch Cleanup: Deletes both the remote and local feature branches after a successful merge.
  • Worktree Removal: Removes the associated local worktree directory.
  • Temporary File Cleanup: Deletes task-specific temporary files.
  • Use Case: After completing all development tasks and passing tests for a new feature, this Skill automatically handles the Git operations to integrate the feature into the main codebase and clean up the development environment.

Quick Start

Execute the auto-merge-and-cleanup skill to finalize the development branch.

Frequently Asked Questions about auto-merge-and-cleanup

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

FAQPage Schema
How do I automate Git merge and cleanup after finishing a feature branch?

To automate Git merge and cleanup, this Skill merges your completed feature branch into main, pushes to the remote, deletes local and remote branches, removes the worktree, and cleans temporary files for a finalized workflow.

What is the best way to merge a feature branch into main without losing commit history?

The best way to merge a feature branch into main while preserving history is using a non-fast-forward merge strategy, which this Skill applies automatically before synchronizing your remote repository and cleaning up branches.

How does Git worktree removal work during branch cleanup?

Git worktree removal during branch cleanup deletes the associated local worktree directory after a successful merge, ensuring your local development environment is cleaned up alongside the local and remote feature branch deletions.

Do I need to manually delete remote and local branches after a merge?

You do not need to manually delete remote and local branches after a merge, as this Skill automatically removes both the remote and local feature branches along with temporary files once the merge and remote push complete.

What happens to uncommitted changes when automating a Git merge?

When automating a Git merge, this Skill checks for uncommitted changes before proceeding, ensuring that your working directory is clean before merging into main and executing the remote synchronization and cleanup steps.

Can I use this automated Git cleanup if my repository has temporary task files?

You can use this automated Git cleanup with temporary task files, as the process explicitly deletes task-specific temporary files alongside removing the worktree and deleting both local and remote feature branches.