logoalt Hacker News

Schlagbohrer • today at 12:18 PM • 8 replies • view on HN

Can anyone recommend a good AGENTS.md for use with local AI? I have mine but I keep needing to prune it and I never had a tested, open source template to start with so I don't know what I might be missing. Would love to see some tried and tested open source examples.


Replies

bruce343434 • today at 12:39 PM

If you are having a recurring issue with how you AI is developing the project, i.e. pittfalls, then you can put the right way to do it or a workaround in the AGENTS.md

This depends on both the AI model and the Project.

Other than that, most things should probably still go into documentation like README, CONTRIBUTING since a lot of process still generalizes to both humans and AI agents.

You can add a line in AGENTS that it should orient itself with those files before starting anything.

Stay on top of the "project memory" that your agent is building up. Literally prompt it to "dream about the project" so that it can prune stale entries itself and re-derive, re-summarize. I try to keep most project memory entries in traditional documentation, since it's also useful to humans. And putting it in the repo makes it useful across AI providers and accounts.

It's not well established to think about documentation this way. But documentation is instructions. Code is instructions. Code is commonly refactored and technical debt is regularly (hopefully!) reduced in a dedicated maintenance pass. Do the same for documentation.

And this is very unorthodox but: for my personal projects, I put the tickets as markdown in the repository now. They haev a fixed structure that begins with owner, status (approved, ai suggested, draft). I have tickets/todo and tickets/done. This way, tickets are not only version tracked, but also directly accessible to the agent without having to go through some API. As a bonus, it makes migrations to and from various forges very easy.

When you notice that a workflow generalizes across repositories or projects, you should move it out of AGENTS.md and into a SKILL.md

trio8453 • today at 1:41 PM

Start empty and only add stuff you find yourself repeating across sessions.

I think most people overdo it with the AGENTS.md files and skills - if you know that you always have a preference for style-x instead of style-y or always need to explain something specific about your project which for some reason isn't documented elsewhere (why isn't it in your readme or /docs?), then sure, add it there. But for many things you can prompt directly during the session instead of maintaining these md files.

latentsea • today at 12:29 PM

Very specific to your model and your project tbh. Everytime the model changes you need to run ablation studies to even know if what's in there still has value or should be removed.

➕ show 1 reply
ramses0 • today at 3:06 PM

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

➕ show 1 reply
cisrockandroll • today at 1:33 PM

Its literally just a prompt of text.

darkerside • today at 12:25 PM

Wouldn't the best option here be to use the agent itself to generate it while the repo is still new and small?

➕ show 2 replies
arbor-group • today at 2:57 PM

[dead]

gencay-e • today at 3:22 PM

[dead]