plugins/git/skills/cleaning-repos/SKILL.md
Leaves a repo in a pristine state — commits all changes cleanly, prompts about leftover files, clears stale stashes, opens a PR if on a feature branch, cleans up merged branches and stale worktrees, and returns to main. Use when the user says "clean up the repo", "wrap up this branch", "tidy up", or wants to get back to a clean main branch after finishing work.
npx skillsauth add lucasilverentand/skills cleaning-reposInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Get the repo into a clean, shippable state in one pass.
git branch --show-currentgit status --shortgit worktree listgit stash listUse the creating-commits skill to commit all working changes. Route through its decision tree — if changes are mixed concerns, use its multi-commit split or repo cleanup flow to produce line-level clean commits.
After committing, run git status to check for leftover files.
Run git status and look for untracked or ignored files that seem out of place. Categorize them:
.DS_Store, node_modules, *.log) -> add to .gitignore and commitFor ambiguous files, use AskUserQuestion with options per file (or group of similar files):
Keep going until git status shows a clean working tree (or only intentionally skipped files).
Run git stash list. If there are stashes, check each one:
git stash show -p stash@{N}
For each stash, check whether its changes already exist in the current codebase. Compare the stash diff against the current state of the files it touches — if the changes are already present (committed or in the working tree), the stash is stale.
AskUserQuestion:
Only do this if on a branch other than main or master.
Use the creating-prs skill. It handles rebasing onto main, checking for PR templates and contributing guides, and creating the PR.
git worktree prune
Then list remaining worktrees with git worktree list. For any linked worktrees (not the main one) where the branch has been merged or deleted on the remote, remove them:
git worktree remove <path>
If a worktree has uncommitted changes, warn the user and skip it — don't force-remove.
Fetch and prune remote tracking branches:
git fetch --prune
Find local branches that have been merged into main:
git branch --merged main
Delete each merged branch (except main/master and the current branch):
git branch -d <branch>
If a branch isn't merged but its remote counterpart is gone (deleted after PR merge), it's likely safe to delete — but ask the user first with AskUserQuestion listing the branch names and offering to delete or keep each one.
If not already on main (or master):
git checkout main
git pull
Run git garbage collection to clean up dangling objects left behind by branch deletions, rebases, and dropped stashes:
git gc
This repacks objects and removes unreachable ones. Safe to run — it only cleans up what's already orphaned.
Run a final git status, git branch, and git stash list to confirm everything is clean. Report what was done:
development
Cross-platform Apple Human Interface Guidelines: color, typography, layout, materials, motion, accessibility, SF Symbols, branding, plus shared UI elements (activity views, rating indicators, web views, …) and meta sections (components, patterns, technologies). Use when the design topic is platform-agnostic. User says: "iOS color tokens", "SF Symbols", "Apple typography", "dark mode guidance".
development
Guides a full system design from idea to spec — sequences requirements gathering, architecture decomposition, data modeling, API design, and document writing into a coherent workflow with clear handoffs. Use when the user asks to "design a system", "build X from scratch", "architect something end-to-end", "plan a new service", or has a broad design ask that spans multiple concerns. Also use when the user says things like "I need to build X" without specifying which aspect to start with. This is the entry point for any design task that isn't clearly scoped to a single skill (data model only, API only, etc.).
development
Synthesizes build-ready design systems and DESIGN.md files from chat briefs, screenshots, moodboards, videos, URLs, live pages, or local image folders while preserving the target product identity. Use when the user asks to "make a design system from these screenshots", "turn this moodboard into DESIGN.md", "extract the design language from this video", "define the UX vibe and rules from these references", or create cohesive UI rules from visual inspiration.
development
Reviews and critiques an existing or proposed system design — flags single points of failure, missing non-functional requirements, scaling bottlenecks, security gaps, operational blind spots, unjustified tech choices, and places where the design will fall over under load or failure. Produces a structured review with severity-tagged findings, not just vibes. Use when the user asks for a second opinion on an architecture, requests a design review, wants feedback on a proposed system, pastes a design doc, or says things like "review this design", "what's wrong with X", "poke holes in this", or "is this a good architecture".