plugins/essentials/skills/codebase-cleanup/SKILL.md
Use when the user asks for a comprehensive, codebase-wide quality sweep — phrases like "deep clean the whole repo", "run a full codebase audit", "nuclear cleanup", "deslop everything", or "sweep the entire codebase for quality issues". Dispatches eight subagents covering deduplication, shared types, unused code (knip), circular deps (madge), weak types, defensive try/catch, deprecated paths, and AI slop. Do NOT use for single-file fixes, branch-scoped diffs (use de-slopify instead), or targeted refactors.
npx skillsauth add nicknisi/claude-plugins codebase-cleanupInstall 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.
Dispatch 8 subagents to audit and clean the codebase. Each subagent must: (1) research its domain, (2) write a critical assessment with findings, (3) implement all high-confidence fixes.
cleanup/<YYYY-MM-DD>.node_modules, dist, vendor, lock files, and any paths listed in .gitignore.Some subagents have dependencies. Run in two phases:
Phase 1 (parallel): 1, 2, 5, 6, 7, 8 Phase 2 (parallel, after Phase 1 commits): 3, 4
Dead-code removal (3) runs after dedup (1) and type consolidation (2) to avoid deleting code that is about to be reused. Circular-dep work (4) benefits from type consolidation first.
knip (or language equivalent) to find unused exports, files, and dependencies. Verify each removal with grep across the full repo before deleting.madge --circular (or equivalent) to identify cycles. Refactor to break them; do not paper over with lazy imports.any, unknown, and language equivalents with concrete types. Research correct types from call sites and upstream packages. No casts to suppress errors.cleanup(<task>): <summary>).--no-verify) or force-push.After all subagents complete, produce a single summary with:
tools
Generate a /goal command to execute an ideation project's specs autonomously. Reads the contract, builds a goal prompt with phase ordering and spec paths, copies it to clipboard, and prints it. The user pastes the /goal command to start autonomous execution. Use when the user says 'goal', 'run as goal', 'get goal prompt', 'goal prompt', or wants to execute specs via /goal instead of /ideation:autopilot.
development
Go up a layer of abstraction and map the surrounding architecture. Use when the user is unfamiliar with an area of code, asks "how does this fit in", "what calls this", "give me the big picture", "where am I", "map this out", "I'm lost", "explain this area", or needs to understand how a file, module, or function connects to the rest of the system. Also use when the user says /zoom-out or "zoom out" mid-conversation — even without a specific file reference, orient them based on whatever code is currently in context.
development
Build a throwaway prototype to answer a design question before committing to real implementation. Generates either a runnable terminal app (for state machines, data models, business logic) or several radically different UI variations on one route (for visual/layout decisions). Use when the user wants to prototype, spike, POC, sanity-check a data model, mock up a UI, explore design options, or says "prototype this", "spike this out", "let me play with it", "try a few designs", "sketch this in code", "I want to try something before building it for real", "quick and dirty version", or "validate this approach" — even if they don't use the word "prototype."
development
Comprehensive, codebase-wide quality sweep that dispatches parallel subagents to find and fix structural issues. Covers deduplication, type consolidation, dead code removal, circular dependencies, weak types, defensive try/catch, deprecated paths, and AI slop. Primary support for JS/TS projects (knip, madge, TypeScript types); other languages get grep-based analysis. Use when the user asks to "deep clean the whole repo", "run a full codebase audit", "nuclear cleanup", "deslop everything", or "sweep the entire codebase for quality issues". Do NOT use for single-file fixes, branch-scoped diffs (use de-slopify instead), or targeted refactors.