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.
npx skills add pekral/cursor-rules --skill cleanup-local-branchesgit clone --depth 1 https://github.com/pekral/cursor-rulesWrote 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.
[](https://agentmods.dev/skills/pekral/cursor-rules/cleanup-local-branches)<a href="https://agentmods.dev/skills/pekral/cursor-rules/cleanup-local-branches"><img src="https://agentmods.dev/badge/skills/pekral/cursor-rules/cleanup-local-branches.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00065 | $0.02036 |
| Opus 5 | $0.00032 | $0.01018 |
| Sonnet 5 | $0.00013 | $0.00407 |
| Haiku 4.5 | $0.00006 | $0.00204 |
Grade A, and why
cleanup-local-branches 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 6d ago.
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.
How it starts
The opening of the file, as written. The whole thing — 145 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Cleanup Local Branches
Purpose
Prune dead local branches so the working copy only keeps branches that are still alive on origin or still recently active.
Two deletion categories:
- Gone — local branches whose upstream tracking branch was deleted on origin (e.g. the PR was merged and the origin branch removed).
- Stale — local branches that have no counterpart on origin and have not received a commit for more than six months.
Constraints
- Apply
@rules/git/general.mdc - Output must be in English
- This skill deletes local refs only — it never deletes, force-pushes, or modifies any branch on origin
- Never delete the currently checked-out branch
- Never delete protected branches:
main,master,develop,development,production,staging, or any branch matchingrelease/*orhotfix/* - Always print the full deletion preview (branch, category, last commit date, integration status, planned action) before deleting anything
- Never rewrite history, force-push, or run
git gc/git reflog expire - Determine integration status by patch identity against the default branch (
git cherry), so squash- and rebase-merged branches are recognized as integrated - Never delete a
stalebranch that is not integrated into the default branch automatically — keep it and report it unless the user explicitly authorizes force deletion (its commits never reached origin and are unrecoverable)
Use when
- The user asks to clean up, prune, or "pročistit" local branches that no longer exist on origin
- Local branches piled up after their pull requests were merged and the origin branches were deleted
- The repository accumulated old experiment branches that were never pushed and are no longer needed
Execution
1. Refresh remote state
Update remote-tracking refs and prune deleted ones so the gone markers and origin counterparts are accurate:
git fetch --prune origin
If the repository has no origin remote, stop and report that the skill needs an origin remote to decide which branches are alive.
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.
- 6d ago First seen · 145 lines · 65 tokens per session scan A dd4256a27fb7
cleanup-local-branches is a skill published in the GitHub repository pekral/cursor-rules (6 stars, last pushed 6d ago), licensed MIT. It adds 65 tokens to every session and 2,036 once invoked, about $0.0003 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-31.
Other skills, from other repositories
git-advanced-workflows
Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborating on feature branches, or troubleshooting repository issues.
workflow-patterns
Use this skill when implementing tasks according to Conductor's TDD workflow, handling phase checkpoints, managing git commits for tasks, or understanding the verification protocol.
chinese-commit-conventions
A Chinese-language guide to Conventional Commits, a format for writing consistent Git commit messages, plus related changelog, commit-checking, and commit-helper configuration.
managing-git
Manages Git workflows including branching, commits, and pull requests. Use when working with Git, creating commits, opening PRs, managing branches, resolving conflicts, or when asked about version control best practices.
share-a-library
Use when a managed library is ready to publish to GitHub and hand to teammates as an install command. Run the GitHub publishing steps, then return the exact shareable install command.
devops/changelog-generation
A method for creating a CHANGELOG, a document that records what changed in each software release. It reads Git commit history and release-pipeline reports, then groups changes using common commit and changelog conventions.