No over-engineering
Keep a refactor tight and scoped to what was asked.
Official basis Avoid overeagerness — only make changes directly requested or clearly necessary. docs ↗
The prompt
Refactor <target>. Only make changes that are directly requested or clearly necessary — no new abstractions, no extra config, and no defensive code for cases that can't actually happen. Why it works
Left unconstrained, a refactor can sprawl into speculative “improvements” you didn’t ask for. The official guidance is to hold the line to what’s requested or clearly needed — this prompt states that boundary up front.
Fill in
<target>— the code to refactor.
Follow-ups
- “If you added anything not strictly required, revert just those parts.”