refactoring
Installation
SKILL.md
Refactoring
Refactoring means the observable behaviour is identical afterwards. The moment behaviour changes you are doing something else, and mixing the two is what makes refactors dangerous — a diff that moves 400 lines and alters a condition is unreviewable, and nobody can tell which half broke production.
The one rule: never refactor and change behaviour in the same commit. Everything below exists to make that rule practical.
1. Get a safety net first
You need a way to know you did not break anything. In order of preference: