Lead with intent, not instruction.
Set the target. Let the follower find the steps.
The AI doesn't need to know how to move its pieces. It needs to know where you want to end up. When you tell it 'write me a function that does X', you've already failed, you're scripting the move instead of describing the position. Tell it what the code should do to the user, or how the reader should feel, or what state the system should be in when you're done. The AI will find the steps. You're the one with taste.
Amateurs describe implementations. Leaders describe outcomes. The harder the outcome is to put into words, the more important it is that you try, because the reason you're talking to AI is exactly to get help with the stuff you can't reduce to a mechanical description. If you can describe it mechanically, you can write it yourself.