# Specification Files for Agents

> Source: <https://www.dotnetperls.com/2026_9_22_specification-files-agents>
> Published: 2026-09-22 07:00:00+00:00

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.
