logoalt Hacker News

ramses0 • today at 3:06 PM • 1 reply • view on HN

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).


Replies

D2OQZG8l5BI1S06 • today at 4:00 PM

Claude recommends having the rationale in the AGENTS.md as well.

➕ show 1 reply