[docs] Add AGENTS.md contribution policy; route .claude/CLAUDE.md to it#64419
[docs] Add AGENTS.md contribution policy; route .claude/CLAUDE.md to it#64419eicherseiji wants to merge 5 commits into
Conversation
…ed PRs Add a top-level AGENTS.md modeled on vLLM's, establishing a mandatory contribution policy for AI-assisted PRs to combat low-value and duplicate PR spam: duplicate-work checks, no busywork PRs, human accountability (pure code-agent PRs disallowed, AI assistance disclosed in the PR description), and fail-closed behavior. Defer build/test/lint details to Ray's existing contribute docs to avoid duplication. Reference AGENTS.md from .claude/CLAUDE.md so Claude Code contributors see the policy too. Signed-off-by: Seiji Eicher <seiji@anyscale.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a new policy document AGENTS.md and updates .claude/CLAUDE.md to establish mandatory guidelines for AI-assisted contributions to the Ray repository. The feedback suggests pinning the pre-commit version to 3.5.0 for consistency and removing the --all-files flag from the manual pre-commit run command to prevent extremely slow execution times on this large codebase.
Pin pre-commit==3.5.0 and use `pre-commit run` instead of `pre-commit run --all-files`, matching getting-involved.md. A full --all-files run is slow on a repo Ray's size. Addresses review feedback. Signed-off-by: Seiji Eicher <seiji@anyscale.com>
…UDE.md Move the repo overview (layout, test timeout) into AGENTS.md and replace the duplicated overview in .claude/CLAUDE.md with an `@../AGENTS.md` import plus the Claude Code skill notes (/rebuild, /lint, /fetch-buildkite-logs). Mirrors vLLM's CLAUDE.md -> AGENTS.md pattern. Claude Code does not read AGENTS.md natively, so the import is what bridges both tool families to one file. Signed-off-by: Seiji Eicher <seiji@anyscale.com>
Drop the inline Claude Code skill hints; the /rebuild, /lint, and /fetch-buildkite-logs skills auto-load by relevance, so .claude/CLAUDE.md is now just `@../AGENTS.md`, matching vLLM's CLAUDE.md -> AGENTS.md setup. Signed-off-by: Seiji Eicher <seiji@anyscale.com>
| @@ -0,0 +1,99 @@ | |||
| # Agent Instructions for Ray | |||
There was a problem hiding this comment.
wdyt about amending this info to https://docs.ray.io/en/latest/ray-contribute/getting-involved.html and pointing AGENTS.md ot that? seems like a good idea, but the question it will that work?
There was a problem hiding this comment.
Good call on discoverability. I did it, but pointed the other way: AGENTS.md stays the source of truth and the contributing guide pulls it in.
Direction matters here because AGENTS.md only works when its text is loaded into the agent's context. Native tools like Codex and Cursor read the file directly, and Claude Code loads it through .claude/CLAUDE.md -> @../AGENTS.md. A link to the docs page is not loaded content, so pointing AGENTS.md at the docs would strip the policy from the context of the tools it targets.
So in 7779e74 I added an "AI-assisted contributions" section to getting-involved.md that literalincludes the repo-root AGENTS.md. One source of truth, and the policy now renders on docs.ray.io.
On "will that work?", yes, verified both paths:
- Docs build.
literalincludeembeds the file verbatim, so AGENTS.md's repo-relative links are not parsed and cannot tripfail_on_warning. A warnings-as-errors build passed clean with the content embedded. - Context load. A fresh Claude Code session in the repo resolves the
@../AGENTS.mdimport and loads the policy. It recites the accountability rules verbatim, while an empty directory returns nothing, confirming the import is the source.
Add an "AI-assisted contributions" section to getting-involved.md that literalincludes the repo-root AGENTS.md. Keeps AGENTS.md the single source of truth while making the policy discoverable on docs.ray.io. literalinclude embeds the file verbatim, so AGENTS.md's repo-relative links are not parsed and cannot trip fail_on_warning. Signed-off-by: Seiji Eicher <seiji@anyscale.com>
Why
Ray is a high-traffic repo, and AI-assisted contributions have made low-value and duplicate PRs more common. Each one notifies CODEOWNERS, triggers CI, and consumes maintainer attention. This adds a contribution policy aimed at AI-assisted PRs to reduce that load, and makes
AGENTS.mdthe single source of truth for agent instructions.What
Adds a top-level
AGENTS.md, modeled on vLLM'sAGENTS.md. It establishes a mandatory contribution policy for AI-assisted work:ghsearches againstray-project/ray).It also folds the repo overview (layout, default test timeout) into
AGENTS.mdand routes Claude Code to the same file:.claude/CLAUDE.mdis now a one-line@../AGENTS.mdimport, mirroring vLLM'sCLAUDE.md->AGENTS.mdpattern. Claude Code does not readAGENTS.mdnatively, so the import is what bridges both tool families to one file. The previous inline skill hints are dropped because the/rebuild,/lint, and/fetch-buildkite-logsskills auto-load by relevance; the.claude/directory (settings, skills, subagents, path-scoped rules, per-libraryCLAUDE.md) is otherwise unchanged.The contributing guide surfaces the policy without duplicating it:
doc/source/ray-contribute/getting-involved.mdgains an "AI-assisted contributions" section thatliteralincludes the repo-rootAGENTS.md. This keepsAGENTS.mdthe single source of truth while making the policy discoverable on docs.ray.io.literalincludeembeds the file verbatim, so AGENTS.md's repo-relative links are not parsed and cannot trip thefail_on_warningdocs build.Build/test/lint details remain deferred to Ray's existing contribute docs to avoid duplication.
AI-assisted contribution disclosure
This PR is itself AI-assisted, so it follows the policy it introduces:
AGENTS.mdor an AI-contribution policy:AGENTS.mdwas confirmed to exist. The pre-commit command matchesgetting-involved.md(pre-commit==3.5.0,pre-commit run). pre-commit ran at commit time; the docs markdown matches no code hooks, so all were skipped with no failures.-W) Sphinx + MyST build (myst-parser 5.1.0, matching CI) of the newliteralincludeagainst the realAGENTS.mdpassed clean and embedded the file verbatim. Becauseliteralincludeembeds rather than parses, AGENTS.md's repo-relative links do not resolve on the docs site and so cannot tripfail_on_warning..claude/CLAUDE.md->@../AGENTS.mdand loads the policy: it recites the accountability rules verbatim, while the same probe in an empty directory returns nothing, confirming the import is the source. The import path follows the Claude Code memory docs.Related
vLLM contribution policy: https://github.com/vllm-project/vllm/blob/main/AGENTS.md