Hacker News new | ask | show | jobs
by ramses0 4 days ago
I took my initial janky `AGENTS.md`, asked it to begin authoring an `AGENTS.rfc` (expanded prose with justifications, etc which I then reviewed and rewrote in my own voice with justifications and rationales) and then condense it back down to an `AGENTS.md`.

    0.  Introduction (AGENTS.rfc)

    This file is designed for the humans working on the project, in
    collaboration with an AI agent.  Regularly ask the AI agent to
    summarize this file to your typical `AGENTS.md`, but collaborate
    with the agent and work to modify `AGENTS.rfc` when composing
    new rules or guidance.

    It is written in an RFC-style format (but slightly modernized)
    which should trigger the right type of tone and processing for
    both humans and agents.
...and here's some "answerless prompts" which you can use your big human brain to imagine the AI responses: "review agents.rfc and explain some of the benefits of it compared to only having agents.md"; "calculate prompt and context impact estimation between the RFC and the raw *.md"

Basically, the `*.rfc` has the justifications + rationales: AGENTS.md says don't mock in-repo code. The RFC explains that mocks reimplement behavior, so when real code changes, the test stays green against the stale mock — "worse than no test, because it creates false confidence."

...however the `AGENTS.md` just has the directive(s) "Don't mock in-repo code, ask before mocking, only mock external boundaries, ..."

So on every context turn the agent is getting an abbreviated (low-token) mandate "don't mock by default", but if it starts going off track I say: "Penance! Read AGENTS.rfc, contrast against your proposed code, go fix it, and then propose updates to AGENTS.rfc and AGENTS.md so you don't do it again..."

The rules decay without the "why", and maintaining the "why" gives better guidance. Good rules can take up "too much context" (especially earlier, before 1M context windows...) and most of the time our busy-bee coding assistants don't really need the rationales (unless you're collaborating to update or understand the rules that caused the incident).

1 comments

Claude recommends having the rationale in the AGENTS.md as well.
In my case it's ~3-4x token burn (6kb vs 24kb) which I can _conditionally_ invoke . Maybe with huge context windows and token caching it's all "fine" nowadays, but if you think about it as an employee handbook and then the safety posters on the wall like "don't stick your fingers in the machines (b/c they'll get chopped off); always wear your PPE (or you'll get injured); ...", you can definitely tune/tone-down ("pre-compile") what gets sent to the LLM but still re-vivify the complete rationale if needed.

Again... this was really effective ~6-9 months ago, but the pace, capacity, and capabilities are increasing so quickly this is probable just another "bitter lesson" moment.