My Solution: A python script that generates code with custom prompts and chaining in following order:
User prompt -> Functional doc -> Technical doc -> Backend code -> Frontend code
Using this approach the script forces the AI to document and save all of its assumptions and code decisions. To increase its accuracy it uses custom prompts and also adds on output of previous steps as context to generate response for next step. Its open source and free available here :- https://github.com/vivek100/oneShotCodeGen
Link to two projects generated via this script: https://github.com/vivek100/oneShotCodeGen/tree/main/example...
PS: This can still make errors, happy to take suggestions on how to improve it.