--- name: refactoring description: "Explicitly preserve behavior while improving structure; identify unnecessary abstraction and avoid scope creep." --- # Refactoring Skill Explicitly preserve behavior while improving structure; identify unnecessary abstraction and avoid scope creep. ## Principles ### Preserve Behavior - Run tests before and after - Make incremental changes - Verify at each step ### Improve Structure - Reduce duplication - Clarify intent - Improve modularity ### Avoid Scope Creep - One refactoring at a time - No new features - No style-only changes in same commit ### Identify Unnecessary Abstraction - Remove unused interfaces - Inline single-use functions - Flatten deep hierarchies ### Run tools - Use refactoring tools like formatters/linters when available