Add AGENTS.md#32749
Conversation
|
We just did something similar to this in TMAP8. It might be helpful to take a look at some of what we put down too! |
|
Pinging @chaibhave @simopier @lin-yang-ly |
|
I should have said in the original PR post that this is modeled after PETSc's I have read the TMAP8 AGENTS.md and there is good content there for sure. There are other things which are not my favorite. The ones I remember off the top of my head:
Those are relatively small things |
|
Job Documentation, step Docs: sync website on 827e110 wanted to post the following: View the site here This comment will be updated on new commits. |
|
Job Coverage, step Generate coverage on 827e110 wanted to post the following: Framework coverageCoverage did not change Modules coverageCoverage did not change Full coverage reportsReports
This comment will be updated on new commits. |
|
Would it be beneficial to add some info on OS-specific behavior? Like conda-related info for macs? |
|
Oh I see you didn't like it, I think it could be still useful. |
|
I suppose we can cutomize it locally on top of the base info here. Was also thinking about the sandbox behavior on mac. |
I don't think we should assume conda, but we could instruct the agent from agents file to begin a session by asking
|
|
Ok in newest commit:
|
|
I think we should make it a goal to get this merged reasonably soon. I think this is one of those things that once it's merged we should get a bunch of follow-on improvements since all of a sudden it will be affecting people's agents' use |
|
I guess I'm trying to motivate collaboration here. We don't want a piece of garbage getting merged, so I won't rush to get this merged |
|
What if instead of AGENTS.md we put a .agents/skills/
I feel like this would be less intrusive then a AGENTS.md file. |
|
I fully support adding skills. That's included in #32497. Perhaps that can fully replace an AGENTS.md (I've symlinked CLAUDE.md to point to AGENTS.md in this PR), but it would lead me to wonder why other OSS projects are introducing these files and why claude itself has asked me in the past to write a |
|
I feel that the claude/agents.md file is better setup by each person individually depending on what they work on in MOOSE most often, but I can see the benefit. I wonder if creating a CONTEXT.md file that a user can point to in their claude/agents.md file would be better. Then it would be more opt in type of thing. |
|
I agree with @maxnezdyur. A lot of the content may be better to add as skills so that agent will load them when needed instead of load agent.md every time as system prompt. Here is an example of claude.md recommended by Andrej Karpathy in his tweet https://github.com/forrestchang/andrej-karpathy-skills/blob/main/CLAUDE.md |
|
That's a great looking file @MengnanLi91.
I hear what you're saying @maxnezdyur. But I want to take steps to ensure that people are submitting code to MOOSE that is reviewable. @nmnobre caught some code that codex wrote (with my signature attached) which was more complicated than it needed to be. As agent use increases (I firmly believe it will), we'll continue to see more agent written code. It would be best for everyone, I firmly believe, if that agent code is standardized as much as possible. And there's no reason it shouldn't be; we write things like style guides that we expect human developers to follow. I think the simple guidelines in the |
|
It would be great if you smarter AI people could add the skills 😄 |
|
The most heavily-AI-written PR I've reviewed so far is libMesh/libmesh#4441, and some of the mistakes there were specific to libMesh or specific to that PR's goals, but others might be worth trying to preempt here:
|
|
Those are all good suggestions and I think I had the framing of some of those things earlier but moved to the simpler AGENTS.md based on the feedback from @maxnezdyur and @MengnanLi91, with the alternative seemingly being to put things into skills. Note that putting a link to the coding style guide in AGENTS.md does not mean in general that the agent will read it. That was the reason that the PETSc team totally changed their agents file to stop using links |
|
I'm seeing the bot delete all the comments on SCM AI-generated PRs. It's moving code around but deleting the comments while doing that. Can we expressively forbid that? |
|
I am also seeing people using AI agents to address reviews and they tag the reviewer in the commit message. So maybe we should have a line in agents.md about that? |
I put the most simplified version I could into 948c941 in https://github.com/roystgnr/moose/tree/agents-32497 I left out any reference to our coding standards; there's no way to get a simple but adequate summary there, and I need to read a bit about SKILL.md philosophy before trying to translate to that. |
|
Job Test, step Results summary on 827e110 wanted to post the following: Framework test summaryCompared against 5b391df in job civet.inl.gov/job/3787211. No added testsRun time changes
Modules test summaryCompared against 5b391df in job civet.inl.gov/job/3787211. No added testsRun time changes
|
|
One more thing Rochi noticed: although Codex would readily add abort statements to failure cases (e.g. default in switch statements), Claude preferred to IMHO we obviously want the former, in devel/dbg modes at the very least even for device code, because at best "return 0" gives you a much later and harder to diagnose failure and at worst you silently get wrong answers, but apparently this is something agents might need instruction for. |
|
My two cents: I think part of this shouldn't be built into AGENTS.md or similar instructions. Why don't we enforce 100% code coverage now that it's so easy for agents to do TDD. Accounting every possible potential pitfall in agent instructions is just too much prompt engineering and hard to maintain in the long run. Now, the real problem is we don't have truly flexible unit testing capability in MOOSE. |
Things like this keeps evolving as LLMs iterate. I agree with you we prefer the former, but on the other hand I'm not sure if it's wise to build this into the agent instructions. |
Do you have an issue where we could build a wish list / reflexion? |
|
Another way of viewing this problem is that the agent instructions are harness around the LLM, not the LLM itself. With that view, we should also be aware of the fact that the agent instructions is one specific type of harness. We should ask this question of "Is AGENTS.md the best type of harness for this?". My personal experience is that in many cases the answer is no. A simple example is our license header enforcement -- the best harness is apparently a pre-commit hook + CI enforcement. |
|
What do you think the best type of harness is for an agent who would like to write 200 lines of code workaround for an issue in a submodule instead of a one line fix in the submodule? The agents instructions is an effective guard against this in my experience. Preventing this at the time of code writing is effective in my opinion. It shouldn't be the job of the reviewer to point this out. I'm a little frustrated at the lack of progress on this pull request. MOOSE maintainers are going to be more and more bombarded with agent assisted PRs over time. If we can limit the number of times a maintainer has to write "there's a lot of code duplication here; why don't you use this method that already does that" or "why'd you delete all these comments" I think that's a very good thing for preventing maintainer burnout and frustration. I don't really care if the initial PR is perfect |
|
I think this is a very fair example of something that belongs in agent instructions. Where I’m still hesitant is calling AGENTS.md the best harness rather than one layer of the harness. For this particular case, we could probably pair AGENTS.md with other mechanisms such as static-analysis and maybe code review agents for detecting unusually large workarounds near existing APIs. I'm not opposed to including this particular guidance. I’m more trying to avoid treating AGENTS.md as the universal solution. You see I didn't reject the PR and request changes. We can move forward and keep improving. |
|
Just waiting on an approval 😄 |
Refs #32497
@idaholab/moose-ccb let's work on this together