Skip to content
Tech News
← Back to articles

My agent.md to improve LLM-assisted code quality

read original more articles
Why This Matters

This article highlights the evolving role of agent.md in enhancing the quality and consistency of code generated by large language models (LLMs). By allowing developers to fine-tune coding style preferences, it significantly reduces repetitive instructions and improves the reliability of AI-assisted coding, which is crucial for integrating AI into professional development workflows.

Key Takeaways

Aug 21, 2026

My agent.md to improve LLM-assisted code quality

The first time I tried to use an LLM to speed up coding was in mid-2025. I was not impressed. I was working on libadbmdns back then, an mDNS implementation in Rust. The code produced would not even compile.

I revisited LLMs in January 2026. This time it worked better. Not only did it write a complex indexed-binary heap class, it was able to pinpoint an obscure bug in the polling crate due to the Windows IOCP implementation.

However, the code quality was abysmal. It was spaghetti code with no comments and no structure. It was cool but not realistic to work with LLMs if the speed gain was lost to cleaning up the code until it met the production-level bar.

Iterating and repeating myself over and over again

In March 2026, I tried to use agentic IDEs like Antigravity and VS Code's Claude Code plugin. I was now able to "iterate" over the "staged" code. I found myself reviewing the code of an infinitely patient junior CS major with suggestions like "don't use magic numbers", "add a short comment here to explain yourself", or "use short function names".

The code quality improved dramatically. It was very close to what I would have produced "by hand" but it was tedious. I ended up repeating myself over and over again in each new session.

Agent.md to the rescue

When a coding session starts, the coding harness loads a file named agent.md and injects it into the prompt. This is the perfect location to super fine-tune coding style preferences. When I found myself repeating the same suggestion to improve the code, I added it in there.

... continue reading