Extract & dedupe
Remove duplication without altering behavior.
The prompt
@<file> has repeated logic in <functions>. Extract a shared helper without changing behavior. Keep the public API identical, and run the tests to confirm nothing broke. Why it works
“Without changing behavior” plus “keep the public API identical” defines a pure refactor, so the model consolidates instead of redesigning. Running tests turns “should be fine” into proof.
Fill in
@<file>— where the duplication lives.<functions>— the functions that repeat.
Follow-ups
- “Move the helper to
@<utils>if it’s used elsewhere too.”