git-cleanup

Categorize local git branches and worktrees by merge status.

Updated Nov 23, 2025
One-click install
npx skills add https://github.com/manuelbrandner85/Weltenbibliothekapp --skill git-cleanup-manuelbrandner85
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-cleanup
Source: https://github.com/manuelbrandner85/Weltenbibliothekapp/tree/main/.agents/skills/git-cleanup
Command: npx skills add https://github.com/manuelbrandner85/Weltenbibliothekapp --skill git-cleanup-manuelbrandner85

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the clutter of accumulated local git branches and worktrees, preventing the confusion of stale development environments and ensuring that only active, relevant work remains.

Core Features & Use Cases

  • Intelligent Categorization: Automatically identifies merged, squash-merged, superseded, and active branches.
  • Safety-First Workflow: Implements a two-gate confirmation process to prevent accidental deletion of unpushed or active work.
  • Use Case: After finishing a sprint, use this tool to identify and remove dozens of stale feature branches and orphaned worktrees while keeping your active development branches intact.

Quick Start

Run the git cleanup skill to analyze your local repository and provide a safe plan for removing stale branches and worktrees.

Frequently Asked Questions about git-cleanup

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

FAQPage Schema
How do I safely prune local git branches and worktrees?

You can safely prune local git branches by analyzing the repository to categorize branches by their merge status and remote tracking state, using a two-gate confirmation process to protect active work from accidental deletion.

How does git branch cleanup identify merged and squash-merged branches?

Git branch cleanup identifies merged and squash-merged branches through intelligent categorization, analyzing local repositories to detect superseded and active branches while checking remote tracking state to determine which stale feature branches are safe for removal.

What is the best way to remove stale git branches after a sprint?

The best way to remove stale git branches after a sprint is to run an automated repository maintenance analysis that identifies orphaned worktrees and stale feature branches, providing a safe removal plan while keeping active development branches intact.

Do I need standard git CLI tools and shell access for repository maintenance?

Yes, you need standard git CLI tools and shell access to perform repository maintenance, as the skill requires these standard environments to analyze local repositories and facilitate the safe removal of superseded branches.

Can git cleanup protect unpushed work when removing orphaned worktrees?

Yes, git cleanup protects unpushed work when removing orphaned worktrees by implementing a safety-first workflow with a two-gate confirmation process, ensuring active development branches and uncommitted changes remain intact during branch pruning.