The function-level framing is the right unit of work — asking Copilot or Claude to "build a feature" produces PR-review nightmares, but asking for one tight function with explicit preconditions and examples gets you reviewable output. One prompt pattern I've refined: paste the function signature + 2 input/output examples + one adversarial edge case, and ask for the implementation plus pytest cases in a single turn. Claude especially tends to catch the edge case you'd otherwise miss in review. Do you have a template you lean on for integration-heavy code where side effects are part of the contract?