refactoring
Refactoring
Refactoring is the final step of TDD. After mutation testing confirms test strength, assess if refactoring adds value.
When to Refactor
- Always assess after mutation testing confirms test strength
- Only refactor if it improves the code
- Commit working code BEFORE refactoring (critical safety net)
Commit Before Refactoring - WHY
Having a working baseline before refactoring:
- Allows reverting if refactoring breaks things
- Provides safety net for experimentation
- Makes refactoring less risky
- Shows clear separation in git history
Workflow:
More from citypaul/dotfiles
react-testing
React component testing patterns including components, hooks, context, and forms. Covers Vitest Browser Mode with vitest-browser-react (preferred) and @testing-library/react. Use when testing React applications. For general UI testing patterns, see the front-end-testing skill.
13tdd
Test-Driven Development workflow. Use for ALL code changes - features, bug fixes, refactoring. TDD is non-negotiable.
10testing
Testing patterns for behavior-driven tests. Use when writing tests, creating test factories, structuring test files, or deciding what to test. Do NOT use for UI-specific testing (see front-end-testing or react-testing skills).
10mutation-testing
Mutation testing patterns for verifying test effectiveness. Use when analyzing branch code to find weak or missing tests.
10typescript-strict
TypeScript strict mode patterns including schema-first development, branded types, type vs interface guidance, and tsconfig strict flags. Use when writing TypeScript code, defining types or schemas, or reviewing type safety. For immutability and pure function patterns, see the functional skill.
10planning
Planning work in small, known-good increments. Use when starting significant work or breaking down complex tasks.
9