I usually prompt with very specific architectures, defining classes, functions, and JSON schemas, plus what libraries I want to use, and that seems to work, most of the time.
I generally use AiderDesk with MiniMax M2.5
Step 2, have it write a plan in a file, then iterate on that plan
Download dependency source code and API specs for it to reference
Be specific, you wanted it to use a specific API but then said "use any API like .."
Don't expect a single session to get you there, use many and keep them fresh (the design/plan/status files help)
Read Anthropic knowledge share, it is currently the best and applies in generality
We don't use "LLMs" to generate code, we use "agent harnesses" and "context engineering". Good phrases to start your knowledge deepening
Give your agent good tools and context, then iterate