cleanup
Skill1 starsChanged 5 months agoMITView on GitHub
Git branch hygiene - delete merged/closed branch, prune stale refs, sync dependencies
- Installs packages
71 other projects use a version of this.
Adopted by
Most recently taken up by
- udecode/better-convextheir own version, first seen Nov 9, 2026
- fynnhaupt/skillstheir own version, first seen Nov 8, 2026
- VforVal/lumberjacktheir own version, first seen Nov 8, 2026
- LeonardiFranco/skillstheir own version, first seen Nov 8, 2026
- frnkgns/Overgeared-Skillstheir own version, first seen Nov 8, 2026
- Integralist/agent-skillstheir own version, first seen Nov 6, 2026
Used with
Projects with it also use chips, react-query-best-practices 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.
udecodeSkillchips
Run the project's suggested-task ledger, the chips. /chips alone brings this session's open tasks up to date: it applies what the ledger helper says, settles stale and split tasks, cards what can start and reports the board, and /chips all also takes the ship-list tasks and the ones no live session owns, and merges duplicate tasks across the board. Use for /chips, /chips offer, start or drop, \"what chips are open\", \"suggest a task for X\", \"update the chips\", \"clean up the chips\", \"which chips are stale\", \"is this chip still worth doing\", \"merge duplicate chips\", at the last hand-back of a run that offered a task, and whenever pstack would file a tracked issue, a follow-up, a reflect Backlog item or an out-of-band PR.
Also in 3 projects that use this
bibektimilsina00Skillreact-query-best-practices
Audit and fix React Query usage in apps/web — enforce query key factories, signal forwarding, staleTime, and proper mutation patterns. Use when reviewing or fixing server-state code.
Also in 3 projects that use this
bibektimilsina00Skillyou-might-not-need-a-callback
Analyze and fix useCallback anti-patterns in your code
Also in 3 projects that use this
Scylla23Skillredo
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
Aetheria-Labs1Skillplan-page
Plan one storefront page from strategy through final copy, section order, proof, offers, template direction, responsive layout, and production asset requirements. Stops at an approved execution-ready specification.
Also in 3 projects that use this
SocialKit-APISkillvideo-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
- +3 more from bibektimilsina00
Other versions71 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 71
- simstudioai/sim★ 30ksame name
- pipecat-ai/pipecat★ 17ksame name
- udecode/plate★ 17ksame name
- civitai/civitai★ 7.3ksame name
- mampfes/hacs_waste_collection_schedule★ 2.3ksame name
- trycompai/comp★ 2.1ksame name
- udecode/dotai★ 1.2ksame name
- LedgerHQ/ledger-live★ 627same name
- ericboy0224/learn-docker-and-k8s★ 472same name
- udecode/better-convex★ 452same name
61 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository28 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .cursor/rules/agent.mdcCursor rule
- .cursor/rules/coding_style.mdcCursor rule
- .cursor/rules/commit_msg.mdcCursor rule
- .cursor/rules/common.mdcCursor rule
- .cursor/rules/deprecated.mdcCursor rule
- .cursor/rules/github_actions.mdcCursor rule
- .cursor/rules/langfuse.mdcCursor rule
- .cursor/rules/llm.mdcCursor rule
- .cursor/rules/long_run_code.mdcCursor rule
- .cursor/rules/makefile-commands.mdCursor rule
- .cursor/rules/package-management.mdCursor rule
- .cursor/rules/tests.mdcCursor rule
- .cursor/rules/typing.mdcCursor rule
- .cursor/rules/uv.mdcCursor rule
- frontend-design-principlesSkill
- goose-gui-e2eSkill
- local-sandboxSkill
- manage-agent-configSkill
- new-agent-ruleSkill
- onboardingSkill
- push-releaseSkill
- code-qualitySkill
- prek-precommit-hookSkill
- thermo-nuclear-code-quality-reviewSkill
- usageSkill
- waitSkill
- gmail-mcpSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 0 are common, 8 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 61 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 27
If CURRENT_BRANCH is main or master:
- Distinctive: line 37
If output is non-empty:
- Distinctive: line 39
Stop and do not proceed.
- Distinctive: line 48
If merged, proceed to step 5.
- Distinctive: line 50
If not merged, check for closed PRs:
- Distinctive: line 55
If closed (result is non-empty):
- Distinctive: line 59
If neither merged nor closed:
- Very specific: line 60
Check if the branch is merged locally: git branch --merged main | grep -w CURRENT_BRANCH
- Very specific: line 61
If not merged anywhere, warn: "Branch 'CURRENT_BRANCH' does not appear to be merged or closed.
- Very specific: line 74
If branch was MERGED:
- Very specific: line 79
If branch was CLOSED (PR closed without merging):
- Very specific: line 116
If uv.lock exists: uv sync
- Distinctive: line 138
Dirty working tree: Stop immediately and ask user to commit/stash
- Distinctive: line 142
No remote: If git pull fails due to no remote, continue with local operations
“Common” is measured: kept by at least 6 in 10 of the 61 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.
Files
Git Cleanup Skill
Automates git branch hygiene after merging or closing PRs. Safely deletes merged branches (and force-deletes closed/abandoned branches), prunes stale remote tracking refs, syncs dependencies, and runs garbage collection.
Workflow
Execute these steps in order:
1. Check current branch
git branch --show-currentStore the result as CURRENT_BRANCH.
2. Guard against main/master
If CURRENT_BRANCH is main or master:
- Report: "Already on main branch. No branch to clean up."
- Skip to step 7 (pull latest) and continue from there.
3. Check for uncommitted changes
git status --porcelainIf output is non-empty:
- Warn the user: "You have uncommitted changes. Please commit or stash them first."
- Stop and do not proceed.
4. Check if branch is merged or closed
First check for merged PRs:
gh pr list --state merged --head CURRENT_BRANCH --json numberIf merged, proceed to step 5.
If not merged, check for closed PRs:
gh pr list --state closed --head CURRENT_BRANCH --json numberIf closed (result is non-empty):
- Report: "Branch 'CURRENT_BRANCH' has a closed (unmerged) PR. Proceeding with deletion."
- Proceed to step 5 (will use force delete in step 6).
If neither merged nor closed:
- Check if the branch is merged locally:
git branch --merged main | grep -w CURRENT_BRANCH - If not merged anywhere, warn: "Branch 'CURRENT_BRANCH' does not appear to be merged or closed. Use
git branch -Dmanually if you want to force delete." - Stop and do not proceed.
Store whether the branch was MERGED or CLOSED for use in step 6.
5. Switch to main
git checkout main6. Delete the branch
If branch was MERGED:
git branch -d CURRENT_BRANCHIf branch was CLOSED (PR closed without merging):
git branch -D CURRENT_BRANCHReport: "Deleted branch CURRENT_BRANCH." (mention if force-deleted due to closed PR)
7. Pull latest
git pull origin main8. Prune remote tracking refs
git fetch --prune9. Delete stale local branches
Find and delete local branches whose upstream is gone:
git for-each-ref --format '%(refname:short) %(upstream:track)' refs/heads | while read branch track; do
if [ "$track" = "[gone]" ]; then
git branch -d "$branch" 2>/dev/null && echo "Deleted stale branch: $branch"
fi
doneReport any branches deleted.
10. Sync dependencies
Detect package manager and sync:
- If
uv.lockexists:uv sync - Else if
bun.lockbexists:bun install - Else if
package-lock.jsonexists:npm install - Else if
requirements.txtexists:pip install -r requirements.txt - Else: Skip dependency sync
11. Git garbage collection
git gc --prune=now12. Summary
Report completion:
- Branch deleted (if applicable)
- Number of stale branches pruned
- Dependencies synced (which package manager)
- Garbage collection complete
Error Handling
- Dirty working tree: Stop immediately and ask user to commit/stash
- Branch not merged or closed: Warn and stop - never force delete without explicit user request
- Branch closed (not merged): Force delete with
-Dsince branch is abandoned - Already on main: Skip branch deletion, continue with pull/prune/gc
- No remote: If
git pullfails due to no remote, continue with local operations - gh CLI not available: Fall back to
git branch --mergedcheck
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
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.

