Repository navigation
[doc] Always use contractions, and move docs agent instructions into doc/AGENTS.md - #66639
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the documentation style guides in doc/.claude/rules/prose-style.md and doc/source/ray-contribute/writing-style.md to mandate the use of contractions in all contexts, removing the previous exception for warnings and error messages. The reviewer recommends also updating doc/.cursor/rules/ray-docs-style.mdc to maintain consistency across all AI assistant rules.
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
ronny-anyscale
approved these changes
Oct 1, 2026
dstrodtman
enabled auto-merge (squash)
October 1, 2026 20:00
nadongjun
pushed a commit
to nadongjun/ray
that referenced
this pull request
Oct 6, 2026
…doc/AGENTS.md (ray-project#66639) ## Why are these changes needed? The Ray writing-style guide told authors to use contractions except in warnings and error messages. This PR drops that exception, so the guide and the prose-style agent rule now say to always use contractions. The exception also conflicted with the Vale config. `Google.Contractions` flags the expanded forms in warning bodies too, so authors who followed the guide got Vale findings. Changed files: - `doc/source/ray-contribute/writing-style.md`: the "Use contractions" section. - `doc/AGENTS.md` (new): the agent instructions for `doc/`, moved out of `doc/.claude/CLAUDE.md` so that every agent reads them, plus a short "Prose style" section that points to `writing-style.md`. - `doc/.claude/CLAUDE.md`: now imports `doc/AGENTS.md` with `@../AGENTS.md` and keeps only Claude Code-specific content, the skills list. - `doc/.claude/rules/prose-style.md` and `doc/.cursor/rules/ray-docs-style.mdc`: deleted. - `doc/source/ray-contribute/agent-development.md`: one line documenting `doc/AGENTS.md`. Why the agent files changed: the docs agent guidance was split by tool. `doc/.claude/CLAUDE.md` held the CI routing, PR scope, lockfile, and cross-reference guidance, but only Claude Code loads it, so Cursor users never saw it. The prose rules lived in two summaries of the style guide, one for Claude Code and one for Cursor. Every rule in those summaries is already in `writing-style.md`, and keeping three copies in sync is how the contraction exception survived in more than one place. Now `doc/AGENTS.md` holds everything that isn't tool-specific, Cursor and other agents read it directly, and Claude Code loads it through the import. The moved sections are unchanged. Note for agent-config owners: this adds Ray's first `AGENTS.md` below the repo root, and it makes `doc/` the first directory where `<dir>/.claude/CLAUDE.md` imports a shared `AGENTS.md` instead of holding the instructions itself. The same pattern could apply to the library directories, but this PR only changes `doc/`. It doesn't touch the root `AGENTS.md` contribution policy. ## Related issue number None. ## Checks - Not a duplicate: no open PR touches `writing-style.md`, `prose-style.md`, or the Cursor rules file, and a search for "contractions" in open PRs returned nothing related. - Ran `vale` on `writing-style.md` before and after the change: 67 findings in both, none on the edited lines. `vale` on `agent-development.md` shows no findings on the added line. - Checked that every non-comment line of the old `doc/.claude/CLAUDE.md` appears in the new `doc/AGENTS.md` or `doc/.claude/CLAUDE.md`. No pre-commit hook covers `doc/source/` Markdown. - AI assistance (Claude Code) was used to draft this change. I reviewed every changed line. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
dstrodtman
added a commit
that referenced
this pull request
Oct 7, 2026
…enforced) (#66640) ## Why are these changes needed? Seeds deterministic prose enforcement for Ray Core docs ahead of the style pass, following the pattern from #65239 (KubeRay) and #66236 (RLlib). Every rule is warn-level and **not run in CI yet**. The Vale pre-commit hook is commented out, and when it was on it covered only `doc/source/data/`. Registering the config lets contributors run `vale doc/source/core/` by hand during the style pass. **Stacked on #66605**, which moves `doc/source/ray-core/` to `doc/source/core/`. The path-scoped section is written against the final path, so this PR targets that branch. Retarget to `master` once #66605 merges. Ray Core defines the object vocabulary the rest of the docs reference, so the forms settled here are the ones other libraries inherit. ## What's here - **`.vale/styles/Core/Terms.yml` and `Core/Capitalization.yml`:** case-sensitive `substitution` swaps at `level: warning`, seeded from a prose-only count over `doc/source/core/`. `Terms.yml` holds the swaps that are safe to apply blindly. `Capitalization.yml` holds the ones that lowercase a whole phrase and would drop a heading's or sentence's initial capital, so it has no replace action: - `raylet` lowercase mid-sentence. The source code uses the lowercase form about 8 to 1. The swaps carry a preceding word, such as `the Raylet`, so a sentence that opens with "Raylet" doesn't alert. - `Plasma store`: Plasma keeps its capital as the implementation's name, and "store" stays lowercase. - `object ref` in prose, with `ObjectRef` in code style for the type. - `runtime env` to `runtime environment`. - Title-cased generic nouns, mostly in headings, such as `Placement Group`, `Fault Tolerance`, and `Head Node`. These live in `Capitalization.yml`, with `Raylets` and `Object Ref(s)`. `Ray/Capitalization.yml` already covers `Ray Task`, `Ray Actor`, and similar. - **Accept lists:** - `Core` gains Ray Core mechanism terms (`asyncio`, `Gloo`, `GPUDirect`, `libfabric`, `subreaper`, `retryable`, and others), and `RPC` becomes `RPC(s)?`. - `General` gains cross-cutting technical words and vendor names that other libraries also hit (`backoff`, `serializer`, `protobuf`, `Cython`, `CuPy`, `Gaudi`, `NPU(s)?`, and others). - Casing-only fixes such as `AsyncIO` and `GLOO` rely on the accept list driving `Vale.Terms`, not on a swap, so a token never alerts twice. - **`.vale.ini`:** a `[doc/source/core/**/*.{md,rst}]` section with `Vale, Google, Ray, Core`, mirroring the RLlib block. The KubeRay and RLlib comments also get corrected enforcement steps: enforcing means uncommenting the hook and widening both its `files` pattern and the top-level `exclude` carve-out. - **`writing-style.md`:** a "Writing Ray Core docs" section with a Ray Core terms table. Both Core rules link to it through the `ray-core-docs-style` label. - **Replace actions on the term rules:** `Ray/`, `RLlib/`, `KubeRay/`, and `Core/Terms.yml` set `action: {name: replace}`, so Vale's JSON output carries each swap's replacement text. A tool can then apply the swaps from Vale's own alerts instead of re-implementing Vale's path scoping and code-span handling. Every swap in these four files is a literal that's safe to apply without judgment. A swap that needs a human decision belongs in a rule without the action. No prose under `doc/source/core/` changes here. The style pass that fixes the alerts follows in separate PRs stacked on this one, split by section. ## Duplicate check No open PR adds Ray Core Vale rules. I searched open `ray-project/ray` PRs for `vale core` and for `writing-style.md`. #66639, my own PR, also edits `writing-style.md`, in a different section. Whichever lands second takes a trivial rebase. ## Testing - **Vale 3.12.0 on `doc/source/core/`:** the two Core rules raise 85 alerts, 45 from `Core.Terms` and 40 from `Core.Capitalization`, all of them true positives on review. No position alerts twice across `Vale.Terms`, the Core rules, `Ray.Terms`, and `Ray.Capitalization`. Vale.Spelling drops from 373 to 168. What's left is mostly unbackticked code that the prose pass will fix, not vocabulary. - **Rule check against the new guide table:** linting the table under the Core scope fires on every "Not" form that has a swap or accept entry, and on none of the "Use" forms. - **Other scopes:** alert counts for `doc/source/rllib`, `doc/source/data`, and `doc/source/cluster/kubernetes` stay the same apart from fewer Vale.Spelling hits. `walkthrough` isn't on the accept list, because an entry there would shadow `Google.WordList`'s `walk-through` swap. It now alerts twice in `doc/source/core` and twice in `doc/source/kuberay`. - **Lookbehind check:** a `(?<=...)Raylet` swap key misreported its position and missed the mid-sentence match in Vale 3.12, which is why the file uses explicit preceding-word keys. - **Replace actions don't change the alerts:** with and without the `action` lines, Vale reports the same checks, lines, spans, and messages on `doc/source/core`, `doc/source/rllib`, and `doc/source/cluster/kubernetes`, compared by a stable hash of the full alert list. Every `*.Terms` alert in those areas now carries a `replace` action, and `Core.Capitalization` alerts carry none. - **pre-commit:** passed on the changed files. - **Not run locally:** the Sphinx build. The only `doc/source` change is one new section and label in `writing-style.md`. The RtD preview covers it. Prepared with AI assistance (Claude Code). Draft until the submitter has reviewed every changed line. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
The Ray writing-style guide told authors to use contractions except in warnings and error messages. This PR drops that exception, so the guide and the prose-style agent rule now say to always use contractions.
The exception also conflicted with the Vale config.
Google.Contractionsflags the expanded forms in warning bodies too, so authors who followed the guide got Vale findings.Changed files:
doc/source/ray-contribute/writing-style.md: the "Use contractions" section.doc/AGENTS.md(new): the agent instructions fordoc/, moved out ofdoc/.claude/CLAUDE.mdso that every agent reads them, plus a short "Prose style" section that points towriting-style.md.doc/.claude/CLAUDE.md: now importsdoc/AGENTS.mdwith@../AGENTS.mdand keeps only Claude Code-specific content, the skills list.doc/.claude/rules/prose-style.mdanddoc/.cursor/rules/ray-docs-style.mdc: deleted.doc/source/ray-contribute/agent-development.md: one line documentingdoc/AGENTS.md.Why the agent files changed: the docs agent guidance was split by tool.
doc/.claude/CLAUDE.mdheld the CI routing, PR scope, lockfile, and cross-reference guidance, but only Claude Code loads it, so Cursor users never saw it. The prose rules lived in two summaries of the style guide, one for Claude Code and one for Cursor. Every rule in those summaries is already inwriting-style.md, and keeping three copies in sync is how the contraction exception survived in more than one place. Nowdoc/AGENTS.mdholds everything that isn't tool-specific, Cursor and other agents read it directly, and Claude Code loads it through the import. The moved sections are unchanged.Note for agent-config owners: this adds Ray's first
AGENTS.mdbelow the repo root, and it makesdoc/the first directory where<dir>/.claude/CLAUDE.mdimports a sharedAGENTS.mdinstead of holding the instructions itself. The same pattern could apply to the library directories, but this PR only changesdoc/. It doesn't touch the rootAGENTS.mdcontribution policy.Related issue number
None.
Checks
writing-style.md,prose-style.md, or the Cursor rules file, and a search for "contractions" in open PRs returned nothing related.valeonwriting-style.mdbefore and after the change: 67 findings in both, none on the edited lines.valeonagent-development.mdshows no findings on the added line.doc/.claude/CLAUDE.mdappears in the newdoc/AGENTS.mdordoc/.claude/CLAUDE.md. No pre-commit hook coversdoc/source/Markdown.🤖 Generated with Claude Code