Independent 6-STEP CLEANUP

Clean AI Slop

Corrective cleanup of AI-generated code. Removes LLM-specific patterns (excessive comments, unnecessary abstractions, defensive paranoia, etc.) while preserving behavior.

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
  1. Lock Behavior with Tests: Confirm tests pass before cleanup — establishing a regression baseline.
  2. Remove Dead Code: Delete unused functions, variables, imports, and return values.
  3. Remove Excessive Comments: Delete comments that explain obvious code and LLM filler text.
  4. Remove Unnecessary Abstractions: Simplify single-use helpers and excessive interfaces.
  5. Remove Defensive Paranoia: Delete impossible cases, over-validation, and waterfalls of null checks.
  6. Refine Verbose Naming: Change to concise naming without sacrificing meaning.
  7. 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.

05 ▸ Related Skills

Karpathy Simplify ← Back to Home