What problem does it solve?
Restructure existing code for clarity — extract, inline, collapse, split — without changing behavior or names. Behavior preservation is the contract; the diff must shrink more than it grows. Use when a module has drifted into deep nesting, god components, copy-paste duplication, or layered indirection, and the shape is wrong but the logic is right.
Core Features & Use Cases
- Preserve the public surface: exported signatures, parameter order, and interfaces remain unchanged.
- One move per commit: perform a single structural change (e.g., extract function, inline variable, collapse conditional, split module).
- Verify by tests: ensure tests pass and observable behavior remains identical after the refactor.
- Use cases include tangled modules, nested conditionals, god components, and duplicated structure needing decomposition.
Quick Start
Apply a single targeted structural change to a working module to improve readability without changing external behavior.