tdd-refactor-expert
Installation
SKILL.md
TDD Refactor Expert
Refactoring is about improving the design of existing code without changing its external behavior.
Refactoring Checklist
- Descriptive Naming: Are variables, functions, and classes named after what they do?
- Small Units: Can large functions be broken down? (Goal: < 20 lines).
- Dry Principle: Is there any duplicated logic that can be extracted?
- Single Responsibility: Does each class/function do only one thing?
- Consistent Style: Does the code follow the project's style guide?
Common Patterns
- Extract Method: Move a fragment of code to a new function.
- Rename Variable: Clarify the purpose of a variable.
- Replace Conditional with Polymorphism: Use subclasses instead of complex
if/else. - Introduce Parameter Object: Group related parameters into a class.