Hacker NewsMonday · August 24, 2026FREE

My agent.md to improve LLM-assisted code quality

llmcodingagent.mdcode-quality

Fabien Sanglard recounts his experience with LLM-assisted coding, starting with a failed attempt in mid-2025 while working on libadbmdns, an mDNS implementation in Rust, where the generated code wouldn't compile. Revisiting in January 2026, he found LLMs could write complex classes and debug obscure issues, but the code quality was poor—spaghetti code with no comments or structure. In March 2026, he tried agentic IDEs like Antigravity and VS Code's Claude Code plugin, which allowed iterative refinement, but he had to repeatedly give the same suggestions, such as avoiding magic numbers and adding comments. To solve this, he created an agent.md file, which the coding harness loads at session start, injecting his style preferences into the prompt. His agent.md includes rules like keeping comments and commit messages concise, avoiding superlatives, using constants for magic numbers, reducing indentation with early returns, keeping function names short, using enums over booleans, adding blank lines between logical blocks, and treating visibility changes as breaking design shifts. He also emphasizes programming to abstraction levels, not touching unrelated code, adhering to layered boundaries, and always using braces for if statements. He provides his agent.md as a starting point, suggesting it can be placed in the project root or symlinked from gemini.md/claude.md.

// why it matters

Developers can use agent.md to encode coding preferences, reducing repetitive instructions and improving LLM-generated code quality.

Sources

Primary · Hacker News
▸ Read original at fabiensanglard.net

Like this? Get the next digest.

My agent.md to improve LLM-assisted code quality — aigest.dev