Thoroughly interrogate the user about expectations BEFORE any code or docs get generated, producing a signed-off spec. Use whenever the user is about to start building something non-trivial, gives vague or large requirements, says "build me X", or asks to plan a feature/system — proactively suggest it before generating significant code. First ask whether they want a deep or shallow cross-check.