Rule of three
Also called Three strikes and you refactor
Put up with the first duplicate. When you are about to write the same thing a third time, extract it. By then you have enough examples to see what is really shared.
An agent told to value DRY may extract a shared helper at the second copy, and it won't be around to feel the result. A wrong abstraction is expensive to undo, since each new case bolts on another flag and the helper gets harder to read.
Say it to your agent
“These two functions look alike, but quotes and invoices change for different reasons. Leave them duplicated. If a third case appears, show me all three before extracting anything.”