org-branch-cleanup

org-branch-cleanup is a skill for Codex from vincentkoc/dotskills. It costs 91 tokens per session (1,096 once invoked), scanned A, original, MIT.

A guarded workflow for reviewing and removing stale Git branches across a GitHub organization. It records audit results, checks branch and pull-request status again, and verifies deletions.

In plain words
What is it for?
Use it to audit old, merged, bot-created, or abandoned branches, produce a cleanup ledger, safely delete approved branches, or resume an interrupted cleanup.
Why use it?
It reduces the risk of deleting active, protected, or otherwise important branches by requiring evidence and explicit confirmation.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit Use it to audit old, merged, bot-created, or abandoned branches, produce a cleanup ledger, safely delete approved branches, or resume an interrupted cleanup.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vincentkoc/dotskills/org-branch-cleanup
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add vincentkoc/dotskills --skill org-branch-cleanup
Clone the repo
git clone --depth 1 https://github.com/vincentkoc/dotskills

Made for: Codex.

Its marketplace also offers this one on its own, as the plugin org-branch-cleanup/plugin install org-branch-cleanup after adding the marketplace above.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for org-branch-cleanup

README.md
[![agentmods](https://agentmods.dev/badge/skills/vincentkoc/dotskills/org-branch-cleanup/github.svg)](https://agentmods.dev/skills/vincentkoc/dotskills/org-branch-cleanup)
Your own site
<a href="https://agentmods.dev/skills/vincentkoc/dotskills/org-branch-cleanup"><img src="https://agentmods.dev/badge/skills/vincentkoc/dotskills/org-branch-cleanup/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for org-branch-cleanup

Your own site · 80×15
<a href="https://agentmods.dev/skills/vincentkoc/dotskills/org-branch-cleanup"><img src="https://agentmods.dev/badge/skills/vincentkoc/dotskills/org-branch-cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,096 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00091 $0.01096
Opus 5 $0.00046 $0.00548
Sonnet 5 $0.00018 $0.00219
Haiku 4.5 $0.00009 $0.00110

Measured 11d ago against content hash e4b11204475f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

org-branch-cleanup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/org_branch_cleanup.py, scripts/test_org_branch_cleanup.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/org-branch-cleanup/SKILL.md · 88 lines

How it starts

The opening of the file, as written. The whole thing — 88 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Org Branch Cleanup

Purpose

Remove organization branch clutter without guessing which refs are safe to delete.

The bundled scripts/org_branch_cleanup.py separates the work into read-only audit, explicit apply, and full verification phases. Dry-run evidence is the default; deletion requires an exact organization confirmation.

When to use

  • A GitHub organization has accumulated old or merged development branches.
  • Bot, agent, migration, or dependency branches remain after pull requests merge.
  • A maintainer wants an evidence-backed cleanup ledger rather than broad git push --delete.
  • Branch-heavy security, state, archive, or generated-data repositories need to be separated from ordinary development repos.
  • A previous cleanup stopped midway and must resume without repeating completed deletions.

Workflow

  1. Read the target repository or organization instructions before mutation.
  2. Confirm GitHub authentication and rate-limit headroom:
    • gh auth status
    • gh api rate_limit --jq '.resources | {core,graphql}'
  3. Run a read-only audit:
    python3 scripts/org_branch_cleanup.py audit \
      --org example-org \
      --output /tmp/example-org-branch-audit
    
    Start with --include-repo-regex '^one-repo$' when proving access or policy. Audit output is immutable by default; use a new directory rather than --overwrite.
  4. Inspect audit-summary.json, audit-errors.tsv, and delete-candidates.jsonl.
    • Do not apply a partial audit. Fix failed repository queries or explicitly justify --allow-partial.
    • Default candidates are same-repository PR heads merged at least 14 days ago.
    • Closed-unmerged branches and unassociated stale branches are report-only.
    • Default, fork, archived, protected, and release-like refs are excluded.
    • Repositories matching GHSA, state, or archive patterns are excluded by default. Audit them separately under an explicit retention policy.
  5. Apply only after the candidate set is reviewed:
    python3 scripts/org_branch_cleanup.py apply \
      --candidates /tmp/example-org-branch-audit/delete-candidates.jsonl \
      --confirm-org example-org \
      --output /tmp/example-org-branch-apply
    
    apply requires the clean sibling audit-summary.json. Do not bypass this with --allow-unverified-candidates or --allow-partial-audit without an explicit operator decision.
  6. Treat each preflight skip as a safety result, not a failure.
    • moved: branch SHA changed after the snapshot.
    • protected: REST or ruleset protection blocked deletion.
    • open-pr: a live pull request now uses the branch.
    • missing: GitHub or another operator already removed it.
  7. Verify every deletion:
    python3 scripts/org_branch_cleanup.py verify \
      --ledger /tmp/example-org-branch-apply/deleted.tsv \
      --output /tmp/example-org-branch-apply/verification-rerun.tsv
    
  8. Report exact deleted, skipped, retained, excluded-repository, and verification counts. Preserve the ledger until the cleanup is accepted.

Read the full file on GitHub · 88 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 88 lines · 91 tokens per session scan A e4b11204475f

Subscribe to this mod's changes

org-branch-cleanup is a skill published in the GitHub repository vincentkoc/dotskills (102 stars, last pushed yesterday), licensed MIT. It adds 91 tokens to every session and 1,096 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories