@intentsolutionsio/code-cleanup
v1.0.0
Published
Comprehensive codebase cleanup across 11 quality dimensions with confidence scoring and build verification gates
Maintainers
Readme
Code Cleanup
Comprehensive codebase cleanup across 11 quality dimensions with confidence scoring, build verification gates, and specialized agents.
Born from a real cleanup session — 25,000 lines removed, 4 bugs caught — packaged into a reusable Claude Code plugin.
Quick Start
# Install
claude /plugin marketplace add jeremylongshore/claude-code-plugins
# Run full cleanup
/cleanup
# Target specific dimensions
/cleanup --dimensions dead,types,security
# Scope to directory
/cleanup src/api/
# Changed files only
/cleanup --changedThe 11 Dimensions
Ordered by risk level (LOW → HIGH):
| # | Dimension | What It Finds | Risk |
|---|-----------|--------------|------|
| 1 | Dead Code | Unused exports, imports, variables, unreachable code | LOW |
| 2 | AI Slop | Low-value AI-generated comments restating obvious code | LOW |
| 3 | Weak Types | any, missing return types, overly broad generics | MED |
| 4 | Security | Hardcoded secrets, weak crypto, injection vectors | MED |
| 5 | Legacy Code | Deprecated APIs, old syntax, unnecessary polyfills | MED |
| 6 | Type Consolidation | Duplicate types, interfaces with 80%+ overlap | MED |
| 7 | Defensive Code | Unnecessary null checks, impossible error handling | MED |
| 8 | Performance | N+1 queries, blocking I/O, bundle bloat | MED |
| 9 | DRY Deduplication | Copy-pasted blocks (>=10 identical lines) | HIGH |
| 10 | Async Patterns | Floating promises, forEach+async, missing await | HIGH |
| 11 | Circular Deps | Module cycles causing init order issues | HIGH |
Safety First
- Never auto-applies high-risk changes — always flags for review
- Confidence scoring on every finding (HIGH/MEDIUM/LOW)
- Build verification gate after each auto-applied dimension
- One-command revert if anything breaks
- Clean git state required before starting
Agents
11 specialized agents, one per dimension:
dead-code-hunter— finds unreachable and unused codeslop-remover— identifies AI-generated comment noiseweak-type-eliminator— strengthens type annotationssecurity-scanner— flags secrets, injection vectors, weak cryptolegacy-code-remover— modernizes deprecated patternstype-consolidator— merges duplicate type definitionsdefensive-code-cleaner— removes unnecessary guardsperformance-optimizer— spots N+1 queries, blocking I/O, bloatdry-deduplicator— detects copy-paste code blocksasync-pattern-fixer— catches floating promises and race conditionscircular-dep-untangler— maps and resolves module cycles
Language Support
Primary: TypeScript, JavaScript, Python Secondary: Go, Rust (via grep patterns) Tool integrations: knip, madge, ruff, jscpd, dependency-cruiser, bandit, vulture
How It Works
- Safety checkpoint — verify clean git state, green tests, record baseline
- Scope determination — full codebase, directory, or changed files
- Dimensional scan — each dimension scans with tools + grep patterns
- Confidence scoring — HIGH (auto-apply), MEDIUM (flag with fix), LOW (flag only)
- Build verification — type check + tests after each auto-applied dimension
- Report generation — summary table, applied changes, flagged items
License
MIT
Author
Jeremy Longshore — Intent Solutions
Contributors
- Jeremy Longshore (@jeremylongshore)
