My agent.md to improve LLM-assisted code quality

Fabien Sanglard shares his journey from being unimpressed by LLM-generated code in 2025 to finding a workflow that works in 2026. The key was creating an agent.md file that injects coding style preferences into every session, eliminating the need to repeat himself. His rules cover everything from naming and comments to commit messages and architectural boundaries. He also discusses the 'Lost in the Middle' problem and offers practical tips like starting fresh sessions per feature and asking the agent to reload agent.md when quality drops.

While this 'trick' has considerably improved the code generated, this is not a magic bullet that lets me avoid reading the code.

More from this day

2026-08-23