prune-stale-branches

Prune stale GitHub remote branches with a dry-run-first workflow.

Updated Sep 30, 2021
One-click install
npx skills add https://github.com/isymchych/accel-os --skill prune-stale-branches
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prune-stale-branches
Source: https://github.com/isymchych/accel-os/tree/main/ai/codex/skills/prune-stale-branches
Command: npx skills add https://github.com/isymchych/accel-os --skill prune-stale-branches

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gh, git, and includes scripts (resource) components.

What problem does it solve?

Prune stale GitHub remote branches in the current repository, guarding active work while keeping the history clean.

Core Features & Use Cases

  • Safe, dry-run-first pruning of stale remote branches
  • Special handling for spr/* branches to respect PR status
  • Explicit confirmation required before deleting non-main branches

Quick Start

Run the prune-stale-branches.ts script to start safely pruning stale branches in your repository.

Frequently Asked Questions about prune-stale-branches

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

FAQPage Schema
How do I safely prune stale remote branches in GitHub?

To safely prune stale GitHub remote branches, you run a dry-run-first workflow that lists candidate branches and deletes them only after explicit confirmation with a dedicated token.

Does pruning stale branches affect spr/* branches with open pull requests?

Pruning stale branches includes special handling for spr/* branches to respect PR status, ensuring active work is guarded while keeping repository history clean.

What do I need to delete stale remote branches in my current repository?

To delete stale remote branches, you need gh authentication and an origin remote configured in your current repository to enforce the required safety checks.

Can I preview stale branches before deleting them from my repository?

Yes, you can preview stale branches before deletion using the dry-run mode, which prints both candidate and skipped non-main branches for your review.

Are main branches deleted when pruning stale remote branches?

No, main branches are not deleted when pruning stale remote branches; the workflow applies only to non-main branches and requires explicit confirmation before deletion.