What problem does it solve?
This Skill eliminates the pain of maintaining functional but overly complex, hard-to-read code that slows down development, increases bug risk, and makes onboarding new team members difficult.
Core Features & Use Cases
- Strict Behavior Preservation: Follows 5 core principles to ensure all refactors retain exact original functionality, input/output behavior, error handling, and side effects.
- Project-Aligned Changes: Matches existing codebase conventions for naming, style, and structure to avoid introducing inconsistent patterns during simplification.
- Safe Incremental Workflow: Requires running tests after every small change, scopes refactors to recently modified code by default, and provides clear red flags to avoid common simplification pitfalls.
- Use Case: Use this Skill during code review to clean up nested validation logic and unclear variable names in a newly merged feature, or to refactor time-pressured prototype code into maintainable production-ready code without altering its behavior.
Quick Start
Use the code-simplification skill to refactor the deeply nested conditional logic in src/controllers/user.py to use early returns and descriptive helper function names while ensuring all existing unit tests pass without modification.