cleanup-repo

Remove merged branches, worktrees, and empty directories from Git repositories.

Updated Jul 10, 2026
One-click install
npx skills add https://github.com/acme-skunkworks/changelog-core --skill cleanup-repo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cleanup-repo
Source: https://github.com/acme-skunkworks/changelog-core/tree/main/.agents/skills/cleanup-repo
Command: npx skills add https://github.com/acme-skunkworks/changelog-core --skill cleanup-repo

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill automates the cleanup of Git repositories by removing merged branches, worktrees, and unnecessary filesystem files, helping maintain a clean and organized repository.

Core Features & Use Cases

  • Branch Cleanup: Remove merged branches and worktrees from the repository.
  • Filesystem Hygiene: Prune recursively-empty directories and orphaned node_modules directories.
  • Configuration: Allows for configuration of protected branches, Linear team name, and issue keys.
  • Use Case: After a feature branch is merged into the main branch, use this Skill to remove the branch and its associated worktree, ensuring the repository remains tidy.

Quick Start

To clean up merged branches and worktrees, run the cleanup-repo skill with the following command:

cleanup-repo

Frequently Asked Questions about cleanup-repo

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

FAQPage Schema
How do I automatically clean up merged Git branches and worktrees?

You can automate Git branch cleanup by running a command that evaluates merge status against configured criteria, removing merged branches and their associated worktrees. This ensures the repository remains tidy after feature merges.

What is the best way to remove orphaned node_modules and empty directories from my repository?

The best way to remove orphaned node_modules and empty directories is to use a filesystem hygiene tool that detects and prunes recursively-empty folders and orphaned dependency directories. This keeps your workspace clean without manual sorting.

Do I need Node.js and GitHub CLI to automate repository maintenance?

Yes, you need Node.js version 22 or higher, `git`, and the GitHub CLI (`gh`) to automate repository maintenance. These dependencies are required to evaluate merge statuses and execute branch and worktree removal.

Can I protect certain branches from being deleted during Git cleanup?

Yes, you can protect specific branches from being deleted by configuring protected branch rules before running the cleanup. The process checks these configurations to ensure important branches are preserved while pruning merged ones.

How does worktree removal work when cleaning up a Git repository?

Worktree removal works by detecting worktrees associated with merged branches and deleting them based on your configured criteria. This automates the process of clearing out active working directories left behind after a feature merge.