Function
A named piece of code you run by writing its name followed by brackets. It lets one idea be written once and used in many places, and it lets a reader take in the name rather than the details.
An agent that hasn't seen the function you already have will happily write a second one. Now one rule lives in two places, and the next fix only reaches one of them. So it pays to ask whether something exists before anything gets added.
Say it to your agent
“Before adding a helper, run rg -n "formatMoney|formatPrice" src/ and tell me what exists. Use it if it fits. If you add a new one, put it in src/lib/money.ts and say why the old one didn't fit.”