Summary
- Two-pass audit and cleanup for a codebase that has started to congeal — spaghetti code, or "koshary code," where the layers have collapsed: business logic lives in the controller, the same validation sits in five files, and nobody wants to open the 800-line one.
- Pass 1 reports layer collapse, duplication that will drift, functions nobody reads, and dead code as a prioritized list and changes nothing; Pass 2 fixes in a safe order once the user approves.
- Security holes and vulnerable dependencies are covered too, as a later section rather than the headline.
- Use this whenever the user asks to audit, review, or clean up a codebase — and also when they say "this codebase is a mess," "spaghetti code," "technical debt," "this is unmaintainable," "duplicated logic," "dead code," "what's wrong with my code," or ask for a security review.
- Trigger it even when they never use the word "audit."