01 ▸ Workflow Position
[Generate]
│
▼
┌─────────────────────────────┐
│ Clean AI Slop (ACTIVE) │
│ AI Code Cleanup │
└──────────────┬──────────────┘
│
▼
[DONE]
02 ▸ When to use?
Used after large-scale AI code generation sessions to keep the code clean while preserving behavior.
Key Triggers
- When using commands like
"clean up", "deslop", or "clean AI code"
- Immediately after generating a large amount of AI code to ensure quality
- When you want to remove LLM-specific verbosity before a code review
03 ▸ How it works?
Core Principle: Lock behavior with tests, then clean up 6 types of "smells" in sequential passes. Roll back immediately if any step fails.
6-Step Cleanup Process
- Lock Behavior with Tests: Confirm tests pass before cleanup — establishing a regression baseline.
- Remove Dead Code: Delete unused functions, variables, imports, and return values.
- Remove Excessive Comments: Delete comments that explain obvious code and LLM filler text.
- Remove Unnecessary Abstractions: Simplify single-use helpers and excessive interfaces.
- Remove Defensive Paranoia: Delete impossible cases, over-validation, and waterfalls of null checks.
- Refine Verbose Naming: Change to concise naming without sacrificing meaning.
- Remove LLM Filler Artifacts: Delete self-explanatory comments and excessive docstrings.
04 ▸ Hard Gates
- Never start cleanup before locking behavior with tests.
- Limit work only to files modified by AI to prevent side effects.
- Perform only one smell pass at a time, running tests after each step.