Base120 · Recursion
Auto-Refactor
Systematically improve system structure without changing external behavior
When to use
"Use when a system's structure has degraded but its behavior is correct. Improve the structure (readability, maintainability, performance) without changing the external behavior. Reduces technical debt."
Example
"A function works correctly but is 500 lines long with nested conditionals. Refactoring extracts sub-functions, simplifies conditionals, and renames variables. The function's behavior is unchanged, but its structure is now maintainable."
Common misuse
"Refactoring without tests. If you change the structure and there are no tests to verify behavior is unchanged, you cannot distinguish a structural improvement from a behavioral regression. Test before refactoring."