refactor
Installation
SKILL.md
Refactor
- Identify the target from
$ARGUMENTS, the current diff, latest commit, or recently touched files. - Read the code and tests. Understand what behavior must not change. For risky refactors, run focused tests first.
- Make small behavior-preserving edits: delete, deduplicate, rename, simplify, extract or inline.
- Don't change public interfaces, data shapes, errors, or user-visible output unless the user asks.
- Run relevant checks, wider ones when shared behavior was touched.
- Report what changed, what stayed the same, and checks run.
Rules
- Refactoring is not feature work. Don't expand into unrelated cleanup.
- Don't change behavior to make the refactor easier.
- Keep an abstraction only when it reduces complexity or duplication.