So I wrote a 180-line Markdown file containing a detailed specification of a parsing function needed in my program. I used a local model (Ternary Bonsai 2) to generate the parse_prompt function (which returns ParsedPromptInfo) in about 30 minutes.
The code was mostly correct, although there were 3 small compile-time errors that I fixed. Now my plan is to maintain the prompt file instead of the Rust code. This means:
• If I want to optimize the code, I could buy tokens and have GPT-6 Astra or Claude Fable follow the prompt from scratch (I could add a note that I want performance optimizations).
• If I want a different feature, I could just change the prompt file and then have a model rewrite the code.
For now, the first iteration from Bonsai was enough for my needs—it was 300-400 lines of Rust. As the entire file is just generated code, I should not maintain it directly—it would be better for me to just maintain the prompt Markdown file.