Skip to content
cccskills
FreePublished on GitHub

git-cleanup

Clean up local Git branches and remote connections left after pull request reviews. The workflow checks unfinished work, preserves main and the current branch, and requests confirmation before force-deleting branches that have not been merged.

OriginalShow the original description

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.

See how to install

Good for

  • Clean up branches after pull request reviews
  • Remove contributor remotes other than origin
  • Review unmerged branches before deletion
  • Check unfinished work before Git cleanup

Files included (1)

  • SKILL.md1.4 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

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

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Maintain an application's supported language models by checking provider availability, adding models, and keeping documentation, live tests, and model-specific request settings aligned. It also checks provider model identifiers and candidates for the recommended list.

  • Add support for a specific language model
  • Check whether listed models are still available
  • Update provider model identifiers
alibaba/page-agent29.5KUpdated Oct 18, 2026

Evaluate a proposed software change before implementation. It examines project files and official sources, compares options and trade-offs, and builds a concrete plan covering affected systems, effort, risks, and unresolved questions for the user's approval.

  • Discuss a major change before implementation
  • Compare migration or configuration options
  • Estimate affected files and implementation effort
alibaba/page-agent29.5KUpdated Oct 18, 2026

Submit existing local changes as a pull request by reviewing the diff, running project checks, preparing a branch and commit, and pushing to GitHub. It follows contribution rules and preserves template declarations that require human verification.

  • Submit current local changes as a pull request
  • Prepare a branch and commit following project conventions
  • Run project checks before submission
alibaba/page-agent29.5KUpdated Oct 18, 2026

update-changelog

FreeSummary

Update a project's changelog using GitHub releases, git history, and code differences. Select changes that matter to users, match the existing format, and write concise entries for the requested release.

  • Add the latest missing release entry
  • Align changelog text with GitHub Releases
  • Summarize changes between release tags
alibaba/page-agent29.5KUpdated Oct 18, 2026

See all skills by alibaba

Report a problem with this skill