What problem does it solve?
This Skill helps you refactor code without breaking behavior by enforcing file size limits, removing duplication, measuring coupling, analyzing Big-O risks, and verifying tests after every change.
Core Features & Use Cases
- Structured refactoring phases: Breaks work into clear phases (size/structure, duplication removal, coupling measurement, Big-O analysis, test verification) to reduce refactor regressions.
- Metric-driven guardrails: Uses targets for CBO, fan-out, SCC cycles, RFC, and cohesion to keep designs maintainable.
- Duplication and complexity checks: Runs duplication-check workflows (including semantic thresholds) and flags O(n^2)+ patterns for performance-safe refactors.
- Use Case: When a module becomes hard to maintain and slow to change, follow the phases to split oversized files, extract shared helpers, fix layer violations, address costly loops, and confirm improvements with tests.
Quick Start
Ask an AI to refactor a target code directory by following the Refactor Skill phases and reporting before/after metrics with tests passing after each change.