My agent.md to improve LLM-assisted code quality(fabiensanglard.net)
398 points by ibobev 17 days ago | 172 comments
tl;dr: The author shares their `agent.md` file—a set of coding style rules automatically injected into LLM coding sessions—to enforce consistent code quality without repeating instructions each session. The rules cover things like avoiding magic numbers, keeping functions short, using enums over booleans, respecting layered architecture, and writing proper commit messages. They also note context dilution as a limitation, mitigated by starting fresh sessions per feature or asking the agent to reload the file.
HN Discussion:
  • ~Many of these rules should be enforced by linters rather than LLM instructions
  • Rigid rules backfire because LLMs over-apply them and produce non-idiomatic code
  • ~Coding standards belong in a separate file loaded on-demand, not in AGENTS.md polluting context
  • Most of these rules are unnecessary fluff; agent instructions should be learned per-project from experience
  • Context dilution makes large agent.md files potentially ineffective for buried instructions