What problem does it solve?
Refactoring existing code without sufficient test coverage often leads to undetected regressions, broken functionality, and hours of debugging to identify what changed during the modification process.
Core Features & Use Cases
- Pre-refactor coverage check: Scans for existing tests targeting code marked for refactoring, and assesses coverage levels for all public methods and edge cases.
- Test quality validation: Flags low-value tests that verify implementation details instead of observable behavior, ensuring tests will actually catch regressions.
- Characterization test guidance: Directs creation of missing tests to lock in current code behavior before any refactoring work begins, eliminating the risk of accidental functional changes.
- Use case: If you are planning to refactor a legacy user authentication module in your iOS app, this skill first verifies you have tests covering all login success, failure, and edge cases, and helps you create missing tests if needed before you make any changes.
Quick Start
Use the tdd-refactor-guard skill to verify test coverage for the PaymentProcessor class before you refactor its refund handling logic.