Agent skill

clean-branches

Clean up unnecessary local branches and prune stale remote-tracking branches

dyoshikawa1,265★ · +16/wk · 1 repos on radarProfile →
claude-codeMIT
Install
npx skills add dyoshikawa/rulesync --skill clean-branches --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 2 KB
Bundled scripts: none
Path: .rulesync/skills/clean-branches/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 1,285 · +20 this week
Language: TypeScript
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Clean Branches Clean up unnecessary local branches and prune stale remote-tracking branches. ## Step 1: Inspect Current State Run the following: - `git branch --show-current` - `git branch --format='%(refname:short)'` - `git remote show origin` - `git branch -vv` Identify: - The current branch - The default branch (for example `main` or `master`) - Branches whose upstream has been deleted After identifying the default branch, list branches already merged into it: - `git branch --merged <default-branch>` If you want to use the remote-tracking branch as the source of truth, use: - `git branch --merged origin/<default-branch>` ## Step 2: Refresh Remote State Update remote refs and prune deleted remote branches: ```bash git fetch --prune ``` If needed, also run: ```bash git remote prune origin ``` ## Step 3: Select Branches to Delete Delete only branches that are clearly unnecessary. Safe candidates include: - Local branches already merged into the default branch you identified above - Local branches whose upstream branch is gone and are no longer needed Never delete: - The current branch - The default branch - Branches that are not fully merged unless the user explicitly asks for fo

What's inside
Steps it walks through
  1. Step 1: Inspect Current State
  2. Step 2: Refresh Remote State
  3. Step 3: Select Branches to Delete
  4. Step 4: Delete Branches
  5. Step 5: Report Result
Commands it runs
git fetch --prune
git remote prune origin
git branch -d <branch-name>
git branch -D <branch-name>
More from rulesync
All skills →
About this skill
What does the clean-branches skill do?

Clean up unnecessary local branches and prune stale remote-tracking branches

How do I install it?

Run `npx skills add dyoshikawa/rulesync --skill clean-branches --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From dyoshikawa/rulesync, a repository with 1,285 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going