Rigorous specification doesn't even help, the rigority of a good spec requires too much context for LLMs to adhere to and they will flagrantly violate clear specifications once you have too much detail. The only thing that does work is having specification encoded as tests, because LLMs can fix compile errors in a loop and that deterministic guidance is what they need to keep them on track, but... writing tests is coding. Writing good tests still requires understanding the code and architecture in fine detail.
This is why you see all of these headlines about porting things that already have years of human work as deterministic guidelines and yet absolutely nothing worth using in production is being vibe coded from scratch. Don't let the hype/FOMO get to you, you are not alone, that is just what the people selling you the hype want you to believe.