Run all 8 cleanup skills in sequence: unused → cycles → dedupe → types → weak-types → defensive → legacy → slop. Each step verifies before the next runs; halts on first failure. Produces one consolidated report. Use when the user asks to clean up the whole codebase, run all cleanup skills, do a full code-quality pass, or sweep the repo. Example queries — "clean up the whole codebase", "run a full code-quality pass", "sweep this repo", "do all the cleanups in order".
Detect and untangle circular dependencies. Runs madge/skott (TS), pycycle (Py), or compiler-only checks (Go/Rust). Auto-fixes leaf-extractable cycles; reports core cycles for human review. Use when the user asks to find circular imports, fix dependency cycles, or untangle module graph. Example queries — "find circular imports", "fix dependency cycles", "untangle our module graph", "why is madge complaining".
Detect duplicated code blocks and refactor to DRY where it reduces complexity. Runs jscpd (multi-language), filters by signal-to-noise, and auto-extracts only token-identical blocks ≥30 LOC. Use when the user asks to deduplicate, DRY up, find copy-paste, or consolidate repeated logic. Example queries — "DRY this up", "find copy-paste in the codebase", "consolidate repeated logic", "where are the duplicated blocks".
Remove pointless try/catch blocks and defensive guards that hide errors or add no value. Preserves catches at true system boundaries (HTTP handlers, CLI entry, message consumers). Use when the user asks to remove try/catch, fix error hiding, clean up defensive code, or stop swallowing errors. Example queries — "remove pointless try/catch", "we're swallowing errors", "stop hiding bugs in catch blocks", "clean up the defensive code".
Find and remove deprecated, legacy, and fallback code paths with zero callers. Verifies callers via repo grep + LSP before deletion. Removes unreachable fallback branches. Use when the user asks to remove deprecated code, clean up legacy paths, drop fallbacks, or simplify code branches. Example queries — "remove the deprecated API", "drop the v1 fallback", "this code is marked legacy, kill it", "simplify these branches".
Strip AI slop, narration comments, restated-code comments, in-motion notes, and stub markers. Preserves comments that explain WHY (workarounds, invariants, surprising behavior). Comment-only changes — never touches code logic. Use when the user asks to remove AI slop, clean up comments, strip narration, or remove unhelpful comments. Example queries — "remove the AI slop", "strip the narration comments", "clean up unhelpful comments", "delete the comments that just restate the code".
Find duplicated or fragmented type/interface definitions across files and consolidate to a shared types module. TypeScript-first; also handles Python dataclasses/TypedDicts and Go structs. Use when the user asks to consolidate types, find duplicate interfaces, or organize type definitions. Example queries — "consolidate our types", "find duplicate interfaces", "this same type is defined in three files", "organize the type definitions".
Detect and delete unused code, exports, files, and dependencies. Runs knip/vulture/staticcheck/cargo-machete appropriate to the language, writes a critical assessment, and auto-applies HIGH-confidence deletions. Use when the user asks to remove dead code, find unused exports, clean up dependencies, or run dead-code analysis. Example queries — "find dead code", "what's unused in this repo", "are there unused npm deps", "kill the cruft".