Specification Files for Agents A developer reports that writing detailed Markdown specification files and having an LLM generate code from them produces reliable output, using the Qwen 3.8 27B model (Bonsai Ternary 2) for functions such as parse_settings and parse_prompt that return a known struct type. The developer notes code generation takes about half an hour even for short 150-line outputs, that specifications can be reused across models including frontier cloud models, and that an LLM can debug a specification to resolve inconsistencies. The approach shifts maintenance from the actual code to the specifications themselves. Something about AI-based code generation seems lazy or sloppy. After all, "vibe-coding" is often used to convey poor quality. And giving an AI agent short, poorly-reasoned prompts tends to give at best inconsistent results . Recently I started experimenting with writing detailed specification files in Markdown and having an LLM generate the required code. I have found using a single function, like parse settings or parse prompt , along with a known struct type that is returned is a good strategy. Some notes: • I can get reliable output from Qwen 3.8 27B actually Bonsai Ternary 2 . • Code generation takes about half an hour even for short 150-line outputs. • I can switch models for example, using a frontier model in the cloud and the specifications can be reused. • I can just maintain the specifications instead of the actual code, which could be simpler. • It is possible to use an LLM to "debug" a specification and resolve any inconsistencies, which is an important step in this approach.