agentleFS
Dev-Wesley-13Dev-Wesley-13/git-parity/skills/cleanup/SKILL.md

cleanup

Skill4 starsChanged 16 days agoApache-2.0View on GitHub

List local branches that are already merged and stale worktree records across all tracked repositories, then delete only what the user approves. Run only when the user explicitly asks to clean up branches.

84 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use you-might-not-need-a-callback, you-might-not-need-a-memo and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • bibektimilsina00Skill

    you-might-not-need-a-callback

    Analyze and fix useCallback anti-patterns in your code

    Also in 3 projects that use this

  • bibektimilsina00Skill

    you-might-not-need-a-memo

    Analyze and fix useMemo/React.memo anti-patterns in your code

    Also in 3 projects that use this

  • Scylla23Skill

    redo

    Re-run the last routed task one model tier up (haiku → sonnet → opus → fable). User-invoked escalation when the previous result missed. Pass --dry-run to preview without running.

    Also in 3 projects that use this

  • SocialKit-APISkill

    video-transcripts

    Extract transcripts from social videos through SocialKit across YouTube, TikTok, Instagram, Facebook, X/Twitter, LinkedIn, and direct video file URLs. Use when the user asks to transcribe, get captions or subtitles, pull the spoken text, or read what a video says, including one video or many at once. Returns full text plus timestamped segments. Not for posting, private accounts, or unrelated website scraping.

    Also in 3 projects that use this

  • SentrySkill

    db-migrate

    Create database migrations using Drizzle Kit. Use when adding/modifying tables, columns, or indexes. Ensures schema.ts and migrations stay in sync.

    Also in 3 projects that use this

  • AnasX7Skill

    improve

    Survey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for OTHER models/agents to execute. Strictly read-only on source code — never implements, fixes, or refactors anything itself. Use when asked to audit a codebase, find improvement opportunities (bugs, security, performance, test coverage, tech debt, migrations, DX), suggest features or where to take the project next (roadmap, product direction), or generate handoff plans for another agent to implement.

    Also in 5 projects that use this

  • +3 more from bibektimilsina00

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 71 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If no report appears above (only Claude Code runs that line), run the script once yourself and use its output: bash …

    line 15
  2. Distinctive:

    Ask what to delete, one decision per repository and group ("merged", "squash-merged").

    line 28
  3. Distinctive:

    Delete only branches listed under "Merged into the base" or "Squash-merged".

    line 34
  4. Distinctive:

    Never delete the current branch, the base branch, a branch checked out in a worktree, or any remote branch.

    line 36

“Common” is measured: kept by at least 6 in 10 of the 71 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

git-parity: cleanup

Report (already generated; nothing was deleted):

!bash "${CLAUDE_PLUGIN_ROOT}/scripts/git-parity.sh" cleanup $ARGUMENTS

If no report appears above (only Claude Code runs that line), run the script once yourself and use its output: bash <plugin-root>/scripts/git-parity.sh cleanup <arguments the user gave>, where <plugin-root> is two directories above this file.

On Windows the script needs a POSIX shell. When the repositories live in WSL, run this (the quoting is deliberate: write the script's Windows path with forward slashes, no backslashes and no inner quotes, because PowerShell strips the quotes and bash eats backslashes):

wsl.exe -d <distro> -- bash -c 'bash "$(wslpath -u <windows-path-with-forward-slashes>/scripts/git-parity.sh)" cleanup <arguments>'

Examples of the path: C:/Users/me/.codex/plugins/cache/git-parity/git-parity/<version> or //wsl.localhost/Ubuntu-24.04/home/me/project/.agents/plugins/git-parity. Otherwise use Git Bash. Do not reimplement the script in PowerShell, and do not edit line endings: the file already uses LF.

If the output ends with a "Setup" section or a "Note:" about the current repository, no list (or not this repository) is saved yet. After the report, tell the user in one or two sentences which groups were detected, ask about anything listed under "Ask the user about", and ask once whether to save. On a yes, run the printed add command(s) exactly; if a command fails, show it so the user can run it. Do not ask again in this session after a no.

What to do

  1. Show the report grouped as it is, translating prose to the user's language; keep names and commands verbatim. For long lists, show the count and the first few names, and offer the full list.
  2. Ask what to delete, one decision per repository and group ("merged", "squash-merged"). Every question needs at least two options (for example "delete" and "keep").
  3. For each approval, run exactly the printed command. To delete only some branches, run the same command with only those names.
  4. End with: deleted (count per repo), kept.

Hard rules

  • Delete only branches listed under "Merged into the base" or "Squash-merged". The script verified those: the first group is fully contained in the base; the second has a deleted remote branch and a merged pull request.
  • Branches under "merge NOT verified" get no command on purpose. Never delete them on your own. If the user insists, show git log --oneline <base>..<branch> first so they see what would be lost, and ask again.
  • Never delete the current branch, the base branch, a branch checked out in a worktree, or any remote branch.
  • A deleted branch can be restored from git reflog for a while; mention this once after deleting.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.