Skip to content

[docs] Add AGENTS.md contribution policy; route .claude/CLAUDE.md to it#64419

Open
eicherseiji wants to merge 5 commits into
ray-project:masterfrom
eicherseiji:add-agents-md-anti-slop
Open

[docs] Add AGENTS.md contribution policy; route .claude/CLAUDE.md to it#64419
eicherseiji wants to merge 5 commits into
ray-project:masterfrom
eicherseiji:add-agents-md-anti-slop

Conversation

@eicherseiji

@eicherseiji eicherseiji commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

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.md the single source of truth for agent instructions.

What

Adds a top-level AGENTS.md, modeled on vLLM's AGENTS.md. It establishes a mandatory contribution policy for AI-assisted work:

  • Duplicate-work checks before opening a PR (gh searches against ray-project/ray).
  • No low-value busywork PRs (single typo, lone style tweak, one mutable default, etc.) unless bundled with substantive work or coordinated with maintainers.
  • Accountability: pure code-agent PRs disallowed; a human must understand, test, and defend the change; the PR description must disclose that AI assistance was used, list tests run, and explain why the change is not a duplicate.
  • Fail-closed: if the work is duplicate, trivial, or cannot be defended by a human, do not open a PR.

It also folds the repo overview (layout, default test timeout) into AGENTS.md and routes Claude Code to the same file: .claude/CLAUDE.md is now a one-line @../AGENTS.md import, mirroring 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. The previous inline skill hints are dropped because the /rebuild, /lint, and /fetch-buildkite-logs skills auto-load by relevance; the .claude/ directory (settings, skills, subagents, path-scoped rules, per-library CLAUDE.md) is otherwise unchanged.

The contributing guide surfaces the policy without duplicating it: doc/source/ray-contribute/getting-involved.md gains an "AI-assisted contributions" section that literalincludes the repo-root AGENTS.md. This 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 the fail_on_warning docs 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:

  • AI assistance used. Drafted with Claude Code. The submitter reviewed every line and is accountable for the change end-to-end.
  • Not a duplicate. Ran the policy's duplicate-work check; no other open PR adds an AGENTS.md or an AI-contribution policy:
    gh pr list --repo ray-project/ray --state open --search "AGENTS.md in:title"
    gh pr list --repo ray-project/ray --state open --search "contribution policy AI"
    
    Only this PR matches.
  • Verification.
    • Every in-repo path referenced by AGENTS.md was confirmed to exist. The pre-commit command matches getting-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.
    • Docs build. A warnings-as-errors (-W) Sphinx + MyST build (myst-parser 5.1.0, matching CI) of the new literalinclude against the real AGENTS.md passed clean and embedded the file verbatim. Because literalinclude embeds rather than parses, AGENTS.md's repo-relative links do not resolve on the docs site and so cannot trip fail_on_warning.
    • Context load. A fresh Claude Code session in the repo resolves .claude/CLAUDE.md -> @../AGENTS.md and 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

…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>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread AGENTS.md Outdated
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>
@eicherseiji eicherseiji self-assigned this Jun 29, 2026
@eicherseiji eicherseiji added the go add ONLY when ready to merge, run all tests label Jun 29, 2026
@eicherseiji eicherseiji marked this pull request as ready for review June 29, 2026 20:00
…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>
@eicherseiji eicherseiji changed the title [docs] Add AGENTS.md: contribution policy for AI-assisted PRs [docs] Add AGENTS.md contribution policy; route .claude/CLAUDE.md to it Jun 29, 2026
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>
@ray-gardener ray-gardener Bot added docs An issue or change related to documentation core Issues that should be addressed in Ray Core labels Jun 30, 2026
Comment thread AGENTS.md
@@ -0,0 +1,99 @@
# Agent Instructions for Ray

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Docs build. literalinclude embeds the file verbatim, so AGENTS.md's repo-relative links are not parsed and cannot trip fail_on_warning. A warnings-as-errors build passed clean with the content embedded.
  2. Context load. A fresh Claude Code session in the repo resolves the @../AGENTS.md import 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>
@eicherseiji eicherseiji requested a review from a team as a code owner July 1, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Issues that should be addressed in Ray Core docs An issue or change related to documentation go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants