{
  "id": 2875911,
  "title": "My agent.md to improve LLM-assisted code quality",
  "url": "https://urgent.news/2026/08/23/my-agent-md-to-improve-llm-assisted-code-quality",
  "topic": "ai",
  "section": "AI",
  "published": "2026-08-23T17:59:52.000Z",
  "source": {
    "name": "Hacker News",
    "slug": "hacker-news",
    "url": "https://fabiensanglard.net/agent.md/index.html"
  },
  "original_language": "en",
  "account": "In mid-2025, the reporter first attempted to utilize an LLM for coding, but was not satisfied with the results. The code produced did not even compile when working on libadbmdns, a Rust implementation of mDNS. In January 2026, the reporter revisited LLMs with better success. The model not only wrote a complex indexed-binary heap class but also identified an obscure bug in the polling crate due to the Windows IOCP implementation. However, the code quality was poor, with no comments or structure, making it challenging to use LLMs for production-level work.\n\nIn March 2026, the reporter tried agentic IDEs like Antigravity and VS Code's Claude Code plugin. This allowed for iterative coding, and the reporter found themselves reviewing the code with suggestions such as avoiding magic numbers, adding comments, and using short function names. The code quality improved significantly, but the process was tedious, as the reporter had to repeat suggestions in each new session.\n\nTo fine-tune coding style preferences, the reporter placed a file named agent.md in the root of a project. This allowed the coding harness to load the file and inject it into the prompt. The reporter shared their version of agent.md as a starting point. Although this trick improved the generated code, LLMs still hallucinate and cannot be fully trusted, requiring constant verification and iteration. The reporter still focuses on architecture and design rather than code style. The phenomenon of context dilution or attention dilution, where LLMs pay less attention to instructions in the middle of the context, can be minimized by asking the agent to update agent.md instead of opening an editor each time a new rule is added.",
  "summary": null,
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}