RFC: add AGENTS.md - #21924
Conversation
|
Good idea and good content already, thanks for that.
I think claude code is the only tool which insists to not support the https://agents.md/ convention, it seems Google, Github Copilot, Windsurf, OpenAI Codex have implemented it. There is even documentation around this proprietary behavior: https://code.claude.com/docs/en/memory#agents-md Hence I suggest to also create a CLAUDE.md file with the only content
Sounds fine, even if those lines will be part of every prompt context.
I don't have a strong opinion on that.
I didn't find an obvious violation of our (unwritten) project pratices, hence it's such a good idea to finally agree on common accepted practices ;) |
3d1c4b3 to
55fb335
Compare
Added. |
|
Thanks @andriiryzhkov, LGTM. To allow for customization, maybe you could add |
@masterpiga - How will agents behave if this file is mentioned but does not exist? Will they process it correctly and not consider it an error? If everything is fine, I wouldn't add an empty file to the repo because it just looks a bit sloppy. |
|
The last line in |
|
@masterpiga : The core idea is that Is similar multi-layer approach something you can adopt? |
|
Sure, I am adaptable. I thought that it would be nice to have a way to make it easier to integrate specific developer instructions, but if it's controversial just forget about it 👍 |
I don't think it is controversial and it is a right place to discuss it. But I never saw such extensions so far and majority of AI platforms have support for instructions on different levels - project, user, etc. I probably need to check better instructions layering on different platforms and I will come back with more educated opinion and maybe suggestions on that topic. |
As I mentioned before, I don't feel strongly about it, and I wouldn't want you to waste your time on it. It's just that AGENTS.md is the only almost-standard way to instruct agents on a specific project. If I want to use different agents for the same project with a different/additional set of instructions (but the same instructions for all), I have to create N separate instruction files (or N symlinks), one for each agent/platform, and then add them one by one to |
|
@masterpiga Several agents do support per-project personal instructions – Claude Code reads No
@victoryforce – no placeholder needed, the wording is conditional on the file existing. One thing I didn't carry over: you asked for "override, amend or complement", and I've written it as amends, with project conventions still governing – otherwise a local file can switch off the commit rules and a reviewer pays for it. If you have a case where overriding matters, please say so. |
AI-assisted contributions arrive with a recurring set of problems the existing docs do not speak to: commit series where only the final commit compiles, which leaves git bisect useless, and patches written by inferring an API instead of reading the page that documents it. The conventions are not new. They are collected from the Developer's guide, dev-doc/ and the existing history into the file name that most coding assistants read by default. Two wiki corrections are folded in: .clang-format and tools/beautify_style.sh no longer exist, having been removed in 46b054c and b734b01. Related: darktable-org#21881
Claude Code reads CLAUDE.md and does not pick up AGENTS.md on its own. The `@AGENTS.md` import keeps the conventions in one file rather than duplicating them, and a one-line pointer works where a symlink would not, such as checkouts with core.symlinks disabled.
Maintainers now hold a PR until RELEASE_NOTES.md carries an entry for it. Record which changes qualify and which do not, so an agent settles the question while writing the PR rather than at review time.
|
Thanks a lot, @andriiryzhkov, LGTM. The only instruction that I override is how to build and run. I have my own branch-aware local scripts for that, but it's no biggie. |
45a9b50 to
0c37494
Compare
We can add in build section to look to developer's instructions for building and running specific to his setup. Updated |
Per-project personal instructions have no cross-platform home. Agents offer a global user layer and a committed project layer, but nothing scoped to a single checkout, so carrying the same personal rules across several agents means one file per agent, each excluded by hand. AGENTS.md now points at an optional AGENTS.local.md, written as prose rather than an import directive so that agents which do not expand `@` still act on it, and .gitignore carries the file so nobody has to edit their own exclude list.
0c37494 to
3ad39de
Compare
|
@andriiryzhkov A couple of additions that I have in my AGENTS.md and that are not currently covered in this one (wording should be improved so that it is more aligned with the current style):
And in the "Comments" section:
Both are based on actual review comments from previous PRs. Actually, it could make sense to collect a rubric of "do"s and "don't"s by asking an agent to go through a bunch of recent PRs and distill general principles from reviewer comments. I am not requesting any change, I am just thinking out loud :) Thanks a lot for your efforts to tidy up agentic work in the repo 👍 |
|
Right now I'm reading an article that concludes: "Codebase overviews are useless" in AGENTS.md. Also: "Less content, better results". I'll try to understand more and post a link to the research here soon. |
Ok, I'll wait for your feedback, I was about to merge :) |
|
I'm definitely not an expert on this topic (quite the opposite, a newbie), but in trying to figure out how to instruct agents I came across several interesting articles and studies:
I'll quote a few important conclusions from what I read right here: The findings challenged the assumption that more context is always better:
|
|
Reduced instructions size. It should look better now. I'd propose to move on and merge this. I am sure this is not the final version, but we need more testing and feedback. Especially with different AI platforms. |
Related: #21881
This is a first pass at the
AGENTS.mdidea from the bisect RFC. It is meant as a starting point for discussion, not a finished policy – if the consensus is that we don't want this file at all, that's a fine outcome too.Why
We're getting more AI-assisted patches, and they go wrong in the same few ways. The one that hurts most is the bisect problem from #21881: a series where only the last commit builds. The others are familiar – an API inferred from its name instead of read, a claim that something works when it was never run, a diff with half the file reformatted around the actual change.
None of that is addressed anywhere an agent will look. The Developer's guide and
dev-doc/are excellent, but nothing points an assistant at them, andAGENTS.mdin the repo root is the filename most coding tools now read by default. So this is mostly a signpost with the sharp edges called out.What's in it
The rules aren't new – they're collected from the Developer's guide,
dev-doc/and what the history already does. Where I couldn't find a written rule I measured the tree instead of inventing one, which is how the commit-message and comment sections ended up the way they did.Two things in it contradict the wiki, and I think the wiki is wrong:
.clang-formatandtools/beautify_style.shdon't exist any more (removed in 46b054c and b734b01), but the guide still points people at the script.What I'd like feedback on
AGENTS.mdthe right name? Some tools want their own filename; a symlink or a short pointer file could cover those.Fixes #Nin commit messages because the history does it, but if maintainers would rather close issues from the PR only, that should change.Written with AI assistance. Every rule in it was checked against the tree or the history before it went in, but that checking was done by the same assistant, so a second pair of eyes on the specifics would be welcome.