refactor
Installation
SKILL.md
Refactor (Behavior-Preserving)
Goal
Improve internal structure without changing observable behavior.
Observable behavior includes outputs, side effects, performance envelopes, error shapes, logging/metrics contracts, and public API compatibility.
Guardrails
- Preserve semantics first; readability second.
- Keep changes small and mechanical; verify after each step.
- Do not mix refactors with feature changes in the same diff.
- Prefer compiler/typechecker + tests as the safety net.
If the code has no tests, start by adding characterization tests around the current behavior (including edge cases and error paths).