Humans write the tests. AI writes the implementation. Just write good tests: property based. Or actual formal specification...
Code is the spec, and it's far faster to write the code yourself (if you know what you want to do and how to write code) than try to pass all this context to an LLM in the form of lossy and imprecise human language.