code-refactoring
Installation
Summary
Refactor code while preserving behavior, improving clarity, and reducing complexity.
- Covers five core refactoring patterns: Extract Method, DRY principle removal, conditional-to-polymorphism conversion, parameter object introduction, and SOLID principle application
- Includes behavior validation workflow with pre-refactoring analysis, post-refactoring testing (unit, type, lint, snapshot), and change documentation
- Provides refactoring checklist covering function length, parameter count, nesting depth, magic numbers, and self-documentation
- Enforces mandatory constraints: write tests first, change one thing at a time, preserve all functional behavior
- Supports multi-agent workflows with role-based verification across orchestration, analysis, and test execution phases
SKILL.md
Code Refactoring
When to use this skill
- Code review: Discovering complex or duplicated code
- Before adding new features: Cleaning up existing code
- After bug fixes: Removing root causes
- Resolving technical debt: Regular refactoring