Delete-Merged-Branches

Delete remote Git branches with merged pull requests after user confirmation.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/paulinett1508-dev/SuperCartolaManagerv5-production --skill delete-merged-branches-paulinett1508-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Delete-Merged-Branches
Source: https://github.com/paulinett1508-dev/SuperCartolaManagerv5-production/tree/main/.claude/skills/delete-merged-branches
Command: npx skills add https://github.com/paulinett1508-dev/SuperCartolaManagerv5-production --skill delete-merged-branches-paulinett1508-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill removes clutter from your GitHub repository by deleting remote branches whose pull requests were already merged, helping keep your branch list tidy without risking history.

Core Features & Use Cases

  • PR-merge-aware cleanup: Targets only branches with PRs in the GitHub merged state (never just closed).
  • Safety guardrails: Filters out protected branches and never deletes the current working branch.
  • Dry-run by default: Presents a candidate list and requires explicit confirmation before deletion.

Quick Start

Ask to delete merged branches by running /delete-merged-branches and confirming the prompted list of candidate branches.

Frequently Asked Questions about Delete-Merged-Branches

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

FAQPage Schema
How do I delete merged remote branches on GitHub safely?

Deleting merged remote branches safely requires filtering GitHub PR data by a merged state, excluding protected branches, running in dry-run mode by default, and requiring explicit confirmation before calling the Git refs delete endpoint.

Can I clean up git branches without losing pull request artifacts or commit history?

Yes, you can clean up git branches without losing pull request artifacts by targeting only branches with PRs in the merged state, which preserves the original PR data and commit history while removing obsolete remote refs.

What is the best way to automate git branch cleanup for merged pull requests?

The best way to automate git branch cleanup for merged pull requests is to use a workflow that filters by merged PR state, excludes protected branch names and the current branch, and presents a candidate list for explicit user confirmation before deletion.

Does the branch deletion process skip protected branches and the current working branch?

Yes, the remote branch deletion process includes safety guardrails that filter out and skip protected branch names as well as the current working branch to prevent accidental deletion of active development lines.

Do I need to review a dry-run list before remote branches are actually deleted?

Yes, you need to review a dry-run list because the deletion workflow runs in dry-run mode by default, presenting a candidate list of merged branches and requiring your explicit confirmation before executing the actual deletion.