refactor
Installation
SKILL.md
Summary
Use this skill to perform behavior-preserving refactors that improve structure, readability, and maintainability while keeping external behavior and public APIs stable unless explicitly requested otherwise.
When to use
- The user asks to "refactor", "clean up", "simplify", or "improve" code (file(s), module, or package).
- The codebase shows duplication, unclear names, large functions, or brittle tests and the user requests targeted improvements.
- During code review when a reviewer requests non-functional structural improvements.
- You want to extract helpers, rename for clarity, or consolidate duplicated logic without changing behavior.
When not to use
- When the user asks for new features or behavior changes.
- When public API changes are intended (use a feature/migration workflow instead).
- For speculative, large-scale redesigns without explicit approval or incremental planning.
- When the repository lacks basic tests and the user demands a sweeping, unvetted refactor.