agentleFS
alibabaalibaba/page-agent/.agents/skills/git-cleanup/SKILL.md

git-cleanup

Skill29k starsChanged 5 months agoMITView on GitHub

Clean up local git branches and remotes accumulated from PR reviews. Use when the user asks to clean branches, remove stale remotes, or tidy up the local git state.

4 other projects use a version of this.

Trending

Less talk lately.about the whole repository

Dec 2025: 1 mentionJan 2026: 1 mentionFeb 2026: 0 mentionsMar 2026: 19 mentionsApr 2026: 4 mentionsMay 2026: 7 mentionsJun 2026: 9 mentionsJul 2026: 14 mentionsAug 2026: 1 mentionSep 2026: 3 mentionsOct 2026: 6 mentionsNov 2026: 2 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the alibaba/page-agent repository that our weekly crawl found. There is no adoption data for this file yet.

Most recently taken up by

Who's talking about alibaba/page-agent

The biggest 5 of 67 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 67

Talked about on GitHub, Bluesky and Hacker News (67 times).

On GitHub · 45

40 more on GitHub

On Bluesky · 19

14 more on Bluesky

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run these in parallel:

    line 15
  2. Distinctive:

    NEVER: delete main or the current checked-out branch

    line 62
  3. Distinctive:

    If in doubt, ask

    line 64

“Common” is measured: kept by at least 6 in 10 of the 3 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 Cleanup

Clean local branches (except main and current branch) and non-origin remotes. Useful after reviewing multiple PRs that leave behind tracking branches and contributor remotes.

Workflow

1. Survey

Run these in parallel:

git branch
git remote
git status --short
git stash list

Present a summary of how many branches and remotes will be removed.

2. Safety Checks — Ask Before Proceeding

Stop and ask for confirmation if any of these are true:

  • Current branch is NOT main
  • Working tree has uncommitted changes or stashes
  • Any branch is ahead of its upstream

List unmerged branches separately and let the user decide.

3. Delete Branches

# Safe delete first (fails on unmerged branches)
git branch | grep -v '^\*' | grep -v '^\s*main$' | xargs git branch -d 2>&1

# Force-delete only with explicit user approval
git branch -D <branch>

4. Remove Remotes

git remote | grep -v '^origin$' | xargs -I{} git remote remove {}

5. Confirm

git branch && echo "---" && git remote

Report what was cleaned up.

Key Rules

  • NEVER delete main or the current checked-out branch
  • NEVER force-delete unmerged branches without user confirmation
  • If in doubt, ask

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.