Repository navigation
[doc] Add rst-to-myst conversion skill - #64135
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new Claude skill file, SKILL.md, which provides comprehensive guidelines and a verification script for converting Ray documentation from reStructuredText (.rst) to MyST Markdown (.md). The review feedback suggests improving the robustness of the Python verification script's regex patterns to better detect residual RST constructs, such as supporting additional underline characters and handling double underscores in external links.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| for i, ln in enumerate(t.splitlines(), 1): | ||
| if ln.lstrip().startswith('```'): infence = not infence; continue | ||
| if infence: continue | ||
| for pat in (r':(ref|doc):`', r'^\.\. ', r'`[^`]*<[^>]*>`_', r'[^:]::\s*$', r'^(=+|~+)\s*$'): |
There was a problem hiding this comment.
The verification script's regex patterns have a few gaps that can be improved for robustness:
- Support for other underline characters: The original regex
r'^(=+|~+)\s*$'only checks for=and~underlines. However,-,^, and*are also very common RST underline characters (with-explicitly mentioned in the mapping table on line 100). Usingr'^([=-~^+*#])\1+\s*$'matches any repeating sequence of these characters (at least 2), which is much more robust and avoids false positives on single bullet points. - Handling
::on its own line: The originalr'[^:]::\s*$'requires a non-colon character before::, meaning it fails to match a line that consists solely of::. Changing it tor'(?:^|[^:])::\s*$'fixes this. - Handling double underscores in external links: RST external links can end with
_or__(as shown in the mapping table on line 103). Changing the suffix to_+ensures both are matched. - Using hex escapes for backticks: Using
\x60instead of literal backticks in the regexes makes the script cleaner and avoids any potential issues with markdown/JSON parsing of backticks.
| for pat in (r':(ref|doc):`', r'^\.\. ', r'`[^`]*<[^>]*>`_', r'[^:]::\s*$', r'^(=+|~+)\s*$'): | |
| for pat in (r':(ref|doc):\x60', r'^\.\. ', r'\x60[^\x60]*<[^>]*>\x60_+', r'(?:^|[^:])::\s*$', r'^([=-~^+*#])\1+\s*$'): |
6f11682 to
6a5fb7d
Compare
## Why
Ray is migrating doc/source/ pages from reStructuredText to MyST Markdown
(MyST is the standard for new pages; a lint check rejects newly-added
`.rst`). Many pages remain. The conversion has a handful of constructs
that silently break the `fail_on_warning` build or drop doctest coverage
if mishandled, and re-discovering them each time is error-prone.
## What
Add a user-invocable `rst-to-myst` skill under `doc/.claude/skills/` that
captures the conversion playbook learned migrating the `ray-contribute/`
guides:
- the RST→MyST directive mapping table;
- five build-breaking hard rules — label preservation, `{doc}` vs bare
cross-extension links, heading levels by order-of-appearance, doctest
literal-vs-executed, and the `doc/BUILD.bazel` doctest exclude entries;
- construct-by-construct notes, a reference-update checklist, reusable
static-check snippets, and the build + doctest verification steps.
The skill is discovered when working in `doc/`.
Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
6a5fb7d to
35e00cf
Compare
…vement to MyST (#64136) ## Description Convert the final three contributor-facing **Developer Guides** pages in `doc/source/ray-contribute/` from reStructuredText to MyST Markdown, completing the section's migration to MyST (the declared standard for new pages). These are the hub/entry pages — the most coupled in the section. Pages converted: - `getting-involved` — the contributor hub - `development` — building Ray from source - `involvement` — the community-links partial included by `getting-involved` **Faithful format conversion only — no content restructuring.** Notable handling: - **`development`** — the sphinx-design `.. tab-set::` / `.. tab-item::` and two `.. dropdown::` blocks become colon-fence directives (`::::{tab-set}` / `:::{tab-item}` / `:::{dropdown}`) so the nested code fences compose cleanly. All 8 cross-reference labels are preserved (`building-ray`, `fork-ray-repo`, `prepare-venv`, `python-develop`, `python-develop-uninstall`, `build-distributable-wheel`, `build-ray-image`, `full-source-build`) — referenced internally and from `getting-involved`. - **`getting-involved`** — its two `.. testcode::` blocks (the canonical pydoc examples) become `{testcode}`; the page stays excluded from the doctest rule, so its `doc/BUILD.bazel` exclude entry is updated `.rst` → `.md`. The `.. include::` of `involvement` becomes `{include} involvement.md`, and the shared `_includes/_latest_contribution_doc.rst` banner stays an include via `{include}` with `:parser: rst`. The `getting-involved` label is preserved. - **`involvement`** — a content partial (no frontmatter); its named-reference links are inlined, which also removes the duplicate `on GitHub` target it shared with `getting-involved`. Companion **`.claude/`** updates point at the new `.md` paths (root `CLAUDE.md`, the `lint` and `rebuild` skills, the python-guidelines rule). Toctree entries are extensionless and unchanged; `.html` redirect targets are unaffected. **One forced rendering change:** the lettered sub-list (a/b/c) under "Fork the Ray repository" becomes a numbered sub-list (1/2/3), since MyST/CommonMark has no alpha-enumerated lists. ## Related issues None. ## Additional information Verified locally: frontmatter parses; backtick and `:::` colon fences balance (60/60 and 10/10); all 9 labels present; `{testcode}`/`{toctree}`/`{include}`/`{tab-set}`/`{tab-item}`/`{dropdown}` counts are exact; no residual RST outside fences; and the blockquote-wrapped code, the Windows nested numbered list, and the python-develop column-0 code-block list all render correctly via markdown-it. The RtD preview build is the authoritative check for the sphinx-design directives and cross-references. Completes the `ray-contribute/` RST→MyST migration (Tier A #64100, Tier B #64111, Tier C #64115, plus the `rst-to-myst` skill #64135). **Cross-reference fixes** (flagged by the initial RtD build): `docs.md`'s link to the renamed `getting-involved` is now extensionless, and `getting-involved`'s two intra-page section links use MyST `#anchor` fragments — the original `.html#anchor` form isn't resolved by MyST and emits `myst.xref_missing`. Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
## Description
Add a user-invocable `rst-to-myst` skill under `doc/.claude/skills/`
that captures the playbook for converting Ray documentation pages from
reStructuredText to MyST Markdown.
MyST is the standard for new doc pages (a lint check rejects newly-added
`.rst`), and many `doc/source/` pages still need conversion. The
conversion has a handful of constructs that silently break the
`fail_on_warning` Sphinx build or drop doctest coverage if mishandled —
this skill encodes them so each conversion is consistent and safe.
Distilled from migrating the `ray-contribute/` developer guides.
Contents:
- **RST→MyST mapping table** for every construct.
- **Five build-breaking hard rules**: preserve label names exactly;
`.md`→`.rst` whole-doc links must use `` {doc}`…` ``; heading levels
follow RST's order-of-first-appearance (not the underline character);
the doctest literal-vs-executed split; and rewrite `doc/BUILD.bazel`
doctest exclude entries `.rst`→`.md` in the same PR.
- Construct-by-construct notes, a reference-update checklist (what
changes vs what's a no-op), reusable static-check snippets, build +
doctest verification, and the verified Ray-specific facts (`default_role
= "code"`, `linkify` off, `colon_fence` on, the doctest glob,
vale/prettier scope).
The skill is `user-invocable` and is discovered when working in `doc/`.
## Related issues
None.
## Additional information
Validated that the SKILL.md frontmatter parses and its fenced examples
are balanced. The skill lives outside `doc/source/`, so it isn't part of
the Sphinx build.
Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
…vement to MyST (ray-project#64136) ## Description Convert the final three contributor-facing **Developer Guides** pages in `doc/source/ray-contribute/` from reStructuredText to MyST Markdown, completing the section's migration to MyST (the declared standard for new pages). These are the hub/entry pages — the most coupled in the section. Pages converted: - `getting-involved` — the contributor hub - `development` — building Ray from source - `involvement` — the community-links partial included by `getting-involved` **Faithful format conversion only — no content restructuring.** Notable handling: - **`development`** — the sphinx-design `.. tab-set::` / `.. tab-item::` and two `.. dropdown::` blocks become colon-fence directives (`::::{tab-set}` / `:::{tab-item}` / `:::{dropdown}`) so the nested code fences compose cleanly. All 8 cross-reference labels are preserved (`building-ray`, `fork-ray-repo`, `prepare-venv`, `python-develop`, `python-develop-uninstall`, `build-distributable-wheel`, `build-ray-image`, `full-source-build`) — referenced internally and from `getting-involved`. - **`getting-involved`** — its two `.. testcode::` blocks (the canonical pydoc examples) become `{testcode}`; the page stays excluded from the doctest rule, so its `doc/BUILD.bazel` exclude entry is updated `.rst` → `.md`. The `.. include::` of `involvement` becomes `{include} involvement.md`, and the shared `_includes/_latest_contribution_doc.rst` banner stays an include via `{include}` with `:parser: rst`. The `getting-involved` label is preserved. - **`involvement`** — a content partial (no frontmatter); its named-reference links are inlined, which also removes the duplicate `on GitHub` target it shared with `getting-involved`. Companion **`.claude/`** updates point at the new `.md` paths (root `CLAUDE.md`, the `lint` and `rebuild` skills, the python-guidelines rule). Toctree entries are extensionless and unchanged; `.html` redirect targets are unaffected. **One forced rendering change:** the lettered sub-list (a/b/c) under "Fork the Ray repository" becomes a numbered sub-list (1/2/3), since MyST/CommonMark has no alpha-enumerated lists. ## Related issues None. ## Additional information Verified locally: frontmatter parses; backtick and `:::` colon fences balance (60/60 and 10/10); all 9 labels present; `{testcode}`/`{toctree}`/`{include}`/`{tab-set}`/`{tab-item}`/`{dropdown}` counts are exact; no residual RST outside fences; and the blockquote-wrapped code, the Windows nested numbered list, and the python-develop column-0 code-block list all render correctly via markdown-it. The RtD preview build is the authoritative check for the sphinx-design directives and cross-references. Completes the `ray-contribute/` RST→MyST migration (Tier A ray-project#64100, Tier B ray-project#64111, Tier C ray-project#64115, plus the `rst-to-myst` skill ray-project#64135). **Cross-reference fixes** (flagged by the initial RtD build): `docs.md`'s link to the renamed `getting-involved` is now extensionless, and `getting-involved`'s two intra-page section links use MyST `#anchor` fragments — the original `.html#anchor` form isn't resolved by MyST and emits `myst.xref_missing`. Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
## Why The Ray docs build with `fail_on_warning: true`, so any single Sphinx warning fails the build. The expensive part of a docs change is usually not the edit — it's *locating* the warning, a manual, token-heavy chain (one RST→MyST conversion tier took three ~6-minute Read the Docs cycles just to find the failure). These failures are a small, classifiable set with mechanical, canonical fixes. ## What Adds `sphinx-fix`, a deterministic, read-only Claude Code skill under `doc/.claude/skills/` that turns a Sphinx warning stream into a severity-ordered list of findings, each with its canonical fix: - **`rules.yaml`** — the canonical category/signature → cause → fix table (10 seed rules plus known-benign suppressions). It is the single source the `rst-to-myst` skill now points at for the shared MyST link classes. - **`sphinx_fix.py`** — a stdlib-only engine (prefers PyYAML, falls back to a bundled parser so it runs anywhere) that parses the warning stream (a Read the Docs log, a local build, or pasted text), classifies each warning, detects a hard-broken build first, triages by severity tier (fatal → structural → plain), segregates suppressed classes, and lists every unclassified warning so the table can grow from real misses. v0 is human-in-the-loop: it proposes fixes and never edits files. - **`SKILL.md`** — when and how to use it, the severity-tier iterate loop, applying fixes, and the unclassified→follow-up feedback loop. - **Tests** — eight fixtures plus golden files, run via `python doc/.claude/skills/sphinx-fix/sphinx_fix.py --selftest` (which also cross-checks the fallback parser against PyYAML). The new files live under `doc/.claude/skills/` and do not participate in the Sphinx build or doctest (those globs start at `doc/source/`). Verified end-to-end against a real Read the Docs build log. ## Notes for reviewers - **Stacked on #64135** (the `rst-to-myst` skill, which introduces `doc/.claude/skills/`). This draft's diff includes that PR until it merges; I'll rebase onto `master` for a clean diff and mark ready then. - Kept as a draft until #64135 lands. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
## Why The Ray docs build with `fail_on_warning: true`, so any single Sphinx warning fails the build. The expensive part of a docs change is usually not the edit — it's *locating* the warning, a manual, token-heavy chain (one RST→MyST conversion tier took three ~6-minute Read the Docs cycles just to find the failure). These failures are a small, classifiable set with mechanical, canonical fixes. ## What Adds `sphinx-fix`, a deterministic, read-only Claude Code skill under `doc/.claude/skills/` that turns a Sphinx warning stream into a severity-ordered list of findings, each with its canonical fix: - **`rules.yaml`** — the canonical category/signature → cause → fix table (10 seed rules plus known-benign suppressions). It is the single source the `rst-to-myst` skill now points at for the shared MyST link classes. - **`sphinx_fix.py`** — a stdlib-only engine (prefers PyYAML, falls back to a bundled parser so it runs anywhere) that parses the warning stream (a Read the Docs log, a local build, or pasted text), classifies each warning, detects a hard-broken build first, triages by severity tier (fatal → structural → plain), segregates suppressed classes, and lists every unclassified warning so the table can grow from real misses. v0 is human-in-the-loop: it proposes fixes and never edits files. - **`SKILL.md`** — when and how to use it, the severity-tier iterate loop, applying fixes, and the unclassified→follow-up feedback loop. - **Tests** — eight fixtures plus golden files, run via `python doc/.claude/skills/sphinx-fix/sphinx_fix.py --selftest` (which also cross-checks the fallback parser against PyYAML). The new files live under `doc/.claude/skills/` and do not participate in the Sphinx build or doctest (those globs start at `doc/source/`). Verified end-to-end against a real Read the Docs build log. ## Notes for reviewers - **Stacked on #64135** (the `rst-to-myst` skill, which introduces `doc/.claude/skills/`). This draft's diff includes that PR until it merges; I'll rebase onto `master` for a clean diff and mark ready then. - Kept as a draft until #64135 lands. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]> Signed-off-by: elliot-barn <[email protected]>
## Description
Add a user-invocable `rst-to-myst` skill under `doc/.claude/skills/`
that captures the playbook for converting Ray documentation pages from
reStructuredText to MyST Markdown.
MyST is the standard for new doc pages (a lint check rejects newly-added
`.rst`), and many `doc/source/` pages still need conversion. The
conversion has a handful of constructs that silently break the
`fail_on_warning` Sphinx build or drop doctest coverage if mishandled —
this skill encodes them so each conversion is consistent and safe.
Distilled from migrating the `ray-contribute/` developer guides.
Contents:
- **RST→MyST mapping table** for every construct.
- **Five build-breaking hard rules**: preserve label names exactly;
`.md`→`.rst` whole-doc links must use `` {doc}`…` ``; heading levels
follow RST's order-of-first-appearance (not the underline character);
the doctest literal-vs-executed split; and rewrite `doc/BUILD.bazel`
doctest exclude entries `.rst`→`.md` in the same PR.
- Construct-by-construct notes, a reference-update checklist (what
changes vs what's a no-op), reusable static-check snippets, build +
doctest verification, and the verified Ray-specific facts (`default_role
= "code"`, `linkify` off, `colon_fence` on, the doctest glob,
vale/prettier scope).
The skill is `user-invocable` and is discovered when working in `doc/`.
## Related issues
None.
## Additional information
Validated that the SKILL.md frontmatter parses and its fenced examples
are balanced. The skill lives outside `doc/source/`, so it isn't part of
the Sphinx build.
Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: 400Ping <[email protected]>
…vement to MyST (ray-project#64136) ## Description Convert the final three contributor-facing **Developer Guides** pages in `doc/source/ray-contribute/` from reStructuredText to MyST Markdown, completing the section's migration to MyST (the declared standard for new pages). These are the hub/entry pages — the most coupled in the section. Pages converted: - `getting-involved` — the contributor hub - `development` — building Ray from source - `involvement` — the community-links partial included by `getting-involved` **Faithful format conversion only — no content restructuring.** Notable handling: - **`development`** — the sphinx-design `.. tab-set::` / `.. tab-item::` and two `.. dropdown::` blocks become colon-fence directives (`::::{tab-set}` / `:::{tab-item}` / `:::{dropdown}`) so the nested code fences compose cleanly. All 8 cross-reference labels are preserved (`building-ray`, `fork-ray-repo`, `prepare-venv`, `python-develop`, `python-develop-uninstall`, `build-distributable-wheel`, `build-ray-image`, `full-source-build`) — referenced internally and from `getting-involved`. - **`getting-involved`** — its two `.. testcode::` blocks (the canonical pydoc examples) become `{testcode}`; the page stays excluded from the doctest rule, so its `doc/BUILD.bazel` exclude entry is updated `.rst` → `.md`. The `.. include::` of `involvement` becomes `{include} involvement.md`, and the shared `_includes/_latest_contribution_doc.rst` banner stays an include via `{include}` with `:parser: rst`. The `getting-involved` label is preserved. - **`involvement`** — a content partial (no frontmatter); its named-reference links are inlined, which also removes the duplicate `on GitHub` target it shared with `getting-involved`. Companion **`.claude/`** updates point at the new `.md` paths (root `CLAUDE.md`, the `lint` and `rebuild` skills, the python-guidelines rule). Toctree entries are extensionless and unchanged; `.html` redirect targets are unaffected. **One forced rendering change:** the lettered sub-list (a/b/c) under "Fork the Ray repository" becomes a numbered sub-list (1/2/3), since MyST/CommonMark has no alpha-enumerated lists. ## Related issues None. ## Additional information Verified locally: frontmatter parses; backtick and `:::` colon fences balance (60/60 and 10/10); all 9 labels present; `{testcode}`/`{toctree}`/`{include}`/`{tab-set}`/`{tab-item}`/`{dropdown}` counts are exact; no residual RST outside fences; and the blockquote-wrapped code, the Windows nested numbered list, and the python-develop column-0 code-block list all render correctly via markdown-it. The RtD preview build is the authoritative check for the sphinx-design directives and cross-references. Completes the `ray-contribute/` RST→MyST migration (Tier A ray-project#64100, Tier B ray-project#64111, Tier C ray-project#64115, plus the `rst-to-myst` skill ray-project#64135). **Cross-reference fixes** (flagged by the initial RtD build): `docs.md`'s link to the renamed `getting-involved` is now extensionless, and `getting-involved`'s two intra-page section links use MyST `#anchor` fragments — the original `.html#anchor` form isn't resolved by MyST and emits `myst.xref_missing`. Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]> Signed-off-by: 400Ping <[email protected]>
…t#64147) ## Why The Ray docs build with `fail_on_warning: true`, so any single Sphinx warning fails the build. The expensive part of a docs change is usually not the edit — it's *locating* the warning, a manual, token-heavy chain (one RST→MyST conversion tier took three ~6-minute Read the Docs cycles just to find the failure). These failures are a small, classifiable set with mechanical, canonical fixes. ## What Adds `sphinx-fix`, a deterministic, read-only Claude Code skill under `doc/.claude/skills/` that turns a Sphinx warning stream into a severity-ordered list of findings, each with its canonical fix: - **`rules.yaml`** — the canonical category/signature → cause → fix table (10 seed rules plus known-benign suppressions). It is the single source the `rst-to-myst` skill now points at for the shared MyST link classes. - **`sphinx_fix.py`** — a stdlib-only engine (prefers PyYAML, falls back to a bundled parser so it runs anywhere) that parses the warning stream (a Read the Docs log, a local build, or pasted text), classifies each warning, detects a hard-broken build first, triages by severity tier (fatal → structural → plain), segregates suppressed classes, and lists every unclassified warning so the table can grow from real misses. v0 is human-in-the-loop: it proposes fixes and never edits files. - **`SKILL.md`** — when and how to use it, the severity-tier iterate loop, applying fixes, and the unclassified→follow-up feedback loop. - **Tests** — eight fixtures plus golden files, run via `python doc/.claude/skills/sphinx-fix/sphinx_fix.py --selftest` (which also cross-checks the fallback parser against PyYAML). The new files live under `doc/.claude/skills/` and do not participate in the Sphinx build or doctest (those globs start at `doc/source/`). Verified end-to-end against a real Read the Docs build log. ## Notes for reviewers - **Stacked on ray-project#64135** (the `rst-to-myst` skill, which introduces `doc/.claude/skills/`). This draft's diff includes that PR until it merges; I'll rebase onto `master` for a clean diff and mark ready then. - Kept as a draft until ray-project#64135 lands. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]> Signed-off-by: 400Ping <[email protected]>
Description
Add a user-invocable
rst-to-mystskill underdoc/.claude/skills/that captures the playbook for converting Ray documentation pages from reStructuredText to MyST Markdown.MyST is the standard for new doc pages (a lint check rejects newly-added
.rst), and manydoc/source/pages still need conversion. The conversion has a handful of constructs that silently break thefail_on_warningSphinx build or drop doctest coverage if mishandled — this skill encodes them so each conversion is consistent and safe. Distilled from migrating theray-contribute/developer guides.Contents:
.md→.rstwhole-doc links must use{doc}`…`; heading levels follow RST's order-of-first-appearance (not the underline character); the doctest literal-vs-executed split; and rewritedoc/BUILD.bazeldoctest exclude entries.rst→.mdin the same PR.default_role = "code",linkifyoff,colon_fenceon, the doctest glob, vale/prettier scope).The skill is
user-invocableand is discovered when working indoc/.Related issues
None.
Additional information
Validated that the SKILL.md frontmatter parses and its fenced examples are balanced. The skill lives outside
doc/source/, so it isn't part of the Sphinx build.