Generated code does roughly what you asked, but you can't tell from reading it which decisions were deliberate and which the model just guessed. Specs are where those decisions go so they don't end up living only in the generated source.
Ossature is an open-source harness for spec-driven code generation. Write specs, validate, audit, review the build plan, and generate code with full control at every step.