cleanup-local-branches SKILL.md skillA

cleanup-local-branches from pekral/cursor-rules is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.

Install it, pinned
mdr add pekral/cursor-rules/cleanup-local-branches@git:20260613.ac1fa4e

Pins git:20260613.ac1fa4e in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 17 of 17 checks passed
Kind
SKILL.md skill
Repository
pekral/cursor-rules
Path
skills/cleanup-local-branches/SKILL.md
Versions recorded
2
Latest version
git:20260613.0432f6a, committed Jun 13, 2026
First version recorded
Jun 13, 2026
Size
8,910 bytes
Repository stars
12
License
MIT

Use when cleaning up local Git branches after origin pruning. Deletes local branches whose upstream was deleted on origin (marked gone) and local branches with no origin counterpart that have been inactive for more than six months, while always protecting the current branch and the default branches. Previews every deletion before running it.

Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.

What the file says

# 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 matching `release/*` or `hotfix/*`
- Always print the full deletion preview (branch, category, last commit date, merge status, planned action) **before** deleting anything
- Never rewrite history, force-push, or run `git gc` / `git reflog expire`
- Do not delete an unmerged branch automatically — keep it and report it unless the user explicitly authorizes force deletion

---

## Use when
…

Read the whole file at its exact version.

How to install

No tool to install first
claude plugin marketplace add https://markdownregistry.com/mp/a/art_f2egnu3gtunmpjn5/dd4256a27fb7065f9655fea959283ef6af55db9c01952bb9a4cf1abc5b8142b9.json

Then /plugin install cleanup-local-branches@markdownregistry-f2egnu3gtunmpjn5 in Claude Code. It installs git:20260613.0432f6a, the one graded A here, pinned to the commit it was graded at, and leaves it there.

The exact contents, by fingerprint
mdr add pekral/cursor-rules/cleanup-local-branches@sha256:2a111ebfe27ae61b

The line at the top of this page pins the label git:20260613.ac1fa4e, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_f2egnu3gtunmpjn5.svg)](https://markdownregistry.com/a/art_f2egnu3gtunmpjn5)

2 badge image fetches in 30 days. What the badge shows.

Ask from your agent
claude mcp add --transport http markdownregistry https://markdownregistry.com/mcp/registry

Then ask it: what changed in pekral/cursor-rules/cleanup-local-branches since the version I have? It reads every saved version here, no key and no account. Any agent that speaks MCP can add it.

Got a copy of cleanup-local-branches from somewhere else? Ask it: where did my cleanup-local-branches come from, and what was changed? It names the public original, the version yours is closest to and every changed line. The text is not kept.

Versions

The registry has recorded 2 versions of this file, all committed on Jun 13, 2026.

Watch this file (sign in, one email per new version)

versioncommittedcommitsizeaudit
git:20260613.0432f6a latest2026-06-13 0432f6a 8,910 BA view · diff
git:20260613.ac1fa4e2026-06-13 ac1fa4e 6,057 BA view
Keep it current by itself, install once

Committed this skill to a repository? Install the markdownregistry skill updates app on it, or on all of them. When the registry saves a newer version, a pull request brings your copy to it within minutes, the newest version first, then what changed and any check it newly trips. A copy you edited is never touched, and nothing is deleted.

Install on GitHub

It asks to read and write contents and pull requests, and to read metadata. No workflow file, no Actions setting, nothing runs on your runners. Uninstall it and everything the registry kept about your repository is deleted.

Keep it current by itself

Committed this skill to a repository? Add one workflow file, and when a newer version is saved, a pull request brings your copy to it, the newest version first, then what changed and any check it newly trips. A copy you edited is never touched, and nothing is deleted.

mkdir -p .github/workflows && curl -fsSL https://markdownregistry.com/ci/skill-updates.yml -o .github/workflows/skill-updates.yml

It runs daily on GitHub Actions, no key and no account. Read the workflow before you add it.

Check a whole project

From the root of your project, one line hashes each installed skill's SKILL.md, your AGENTS.md and your CLAUDE.md, and asks the registry once. Only the fingerprints and paths are sent.

sha256sum .claude/skills/*/SKILL.md AGENTS.md CLAUDE.md | curl -s --data-binary @- https://markdownregistry.com/api/v1/check-copies

In CI, add --fail-with-body: the answer is 409 when any file is behind, so the step fails and still prints which files.

sha256sum .claude/skills/*/SKILL.md AGENTS.md CLAUDE.md | curl -s --fail-with-body --data-binary @- https://markdownregistry.com/api/v1/check-copies

No sha256sum on your machine? shasum -a 256 prints the same lines.

Audit of the latest version

A  17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • pass: Frontmatter block present
  • pass: Frontmatter declares a name
  • pass: Frontmatter declares a description
  • pass: Size between 200 bytes and 200 KB (8910 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

pekral/cursor-rules · 12 stars · license MIT · pushed 2026-10-03 · branch master

API

GET https://markdownregistry.com/api/v1/artifacts/art_f2egnu3gtunmpjn5
GET https://markdownregistry.com/api/v1/resolve?ref=pekral/cursor-rules/cleanup-local-branches
GET https://markdownregistry.com/api/v1/blob/2a111ebfe27ae61be417ffa63a4275c8581e387b9e28e9e4876dae6edac3c8e4

Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.

More from pekral/cursor-rules

CLAUDE.md CLAUDE.md file
pekral/cursor-rules · CLAUDE.md
git:20260809.a06a16f · audit A · 12 stars
analyze-problem SKILL.md skill
pekral/cursor-rules · skills/analyze-problem/SKILL.md · Use when structured problem analysis for debugging, root cause
git:20260825.343ade7 · audit A · 12 stars
api-review SKILL.md skill
pekral/cursor-rules · skills/api-review/SKILL.md · Use when reviewing HTTP API design in a PR or change set — endpoints, routes, HTTP methods, status codes, idempotency…
git:20260716.7828b68 · audit A · 12 stars
article-writing SKILL.md skill
pekral/cursor-rules · skills/article-writing/SKILL.md · Use when writing articles, guides, blog posts, tutorials, newsletter issues, or other long-form content longer than a…
git:20260614.7dae13a · audit A · 12 stars
assignment-compliance-check SKILL.md skill
pekral/cursor-rules · skills/assignment-compliance-check/SKILL.md · Use when checking that the pull request implementation actually fulfills the business requirements stated in the linked…
git:20260716.7828b68 · audit A · 12 stars
automation-audit-ops SKILL.md skill
pekral/cursor-rules · skills/automation-audit-ops/SKILL.md · Use when you need an evidence-first, read-only inventory of every automation in this repo (GitHub Actions, Claude Code…
git:20260615.cc39a4d · audit A · 12 stars
autonomous-loops SKILL.md skill
pekral/cursor-rules · skills/autonomous-loops/SKILL.md · Use when choosing how to run Claude Code autonomously on this project — from a single sequential pipeline to…
git:20261003.14c8a0b · audit A · 12 stars
benchmark-optimization-loop SKILL.md skill
pekral/cursor-rules · skills/benchmark-optimization-loop/SKILL.md · Use when a goal is vague speed ("make it faster", "reduce p95", "cut query time") and you need a bounded, measured loop…
git:20260615.62f6e3e · audit A · 12 stars
benchmark SKILL.md skill
pekral/cursor-rules · skills/benchmark/SKILL.md · Use when measuring performance baselines or detecting regressions before and after a change in a Laravel app — page…
git:20260615.d3ee2d6 · audit A · 12 stars
blueprint SKILL.md skill
pekral/cursor-rules · skills/blueprint/SKILL.md · Use when a single objective is too large for one pull request and must span multiple sessions or PRs. Turns the…
git:20260716.78e7355 · audit A · 12 stars
class-refactoring SKILL.md skill
pekral/cursor-rules · skills/class-refactoring/SKILL.md · Use when refactor PHP classes to improve structure, readability,
git:20260825.68f0a25 · audit A · 12 stars
code-review-bugsnag SKILL.md skill
pekral/cursor-rules · skills/code-review-bugsnag/SKILL.md · Use when run code review for a Bugsnag error and publish results to
git:20260825.343ade7 · audit A · 12 stars

Every file in pekral/cursor-rules

Browse by kind, by grade A, or by owner.