workflow-cleanup-merged

Community

Safely clean up merged PR branches on GitHub.

Authorlugassawan
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Cleaning up after a merged GitHub PR often leaves behind stale worktrees and both local and remote branches, wasting disk space and confusing future work; this skill performs that cleanup safely and correctly.

Core Features & Use Cases

  • PR-merged verification using GitHub CLI: Confirms the PR is truly in the MERGED state (and reads mergedAt) before deleting anything, avoiding false positives caused by squash merges.
  • Worktree + branch cleanup with safety contracts: Frees the session from active worktrees, syncs local default branch with fast-forward only, and removes the merged branch and its remote counterpart.
  • Multiple removal strategies with robust fallbacks: Uses a rimba post-merge hook fast path when active, otherwise tries rimba removal, and finally falls back to a shell-based probe and git worktree remove with dirty/unpushed safeguards.

Quick Start

Invoke the workflow by running /swe-workbench:cleanup-merged after your PR is confirmed merged on GitHub, optionally providing the PR number.

Dependency Matrix

Required Modules

None required

Components

scripts

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: workflow-cleanup-merged
Download link: https://github.com/lugassawan/swe-workbench/archive/main.zip#workflow-cleanup-merged

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.