Refactor
also: refactoring, refactored, refactors
Reorganizing code to make it cleaner or easier to work with, without changing what the app does. Users should notice no difference at all.
Restructuring existing code, such as renaming, splitting large functions, or removing duplication, while preserving its external behavior. Good refactors happen in small steps and are checked with tests, so any accidental behavior change gets caught.
Reorganizing a messy kitchen. The pots move to a better cabinet and the spices get labeled, but you still cook the same meals. If dinner tastes different afterward, something went wrong.
Agents love to refactor while fixing something else. That makes the change bigger, harder to review, and more likely to break things. Knowing the word lets you clearly ask for one, or rule one out.
I refactored the payment module into three smaller files. No behavior changed, and all 48 existing tests still pass.
Refactor the booking form into smaller components. Don't change any behavior or styling, and run the existing tests before and after to confirm nothing changed.
Using "refactor" to mean any rewrite or improvement. If behavior changes, like fixing a bug or adding a feature, it isn't a refactor, and it should be reviewed as a behavior change.