| name | doc-writer |
| description | Write and maintain bilingual (English + Chinese) documentation for the Relax project. Use when user asks to create, update, or translate documentation pages. Ensures format correctness (VitePress, sidebar config, bilingual parity) and content correctness (matches actual codebase, no fabricated features). |
Documentation Writer
Write bilingual VitePress documentation for the Relax project, ensuring both format correctness and content correctness.
Three Inviolable Rules
- Bilingual requirement โ EVERY documentation page MUST be created in BOTH English (
docs/guide/) AND Chinese (docs/zh/guide/) simultaneously. Never create only one language version. Both versions must have identical structure and content coverage.
- Format correctness โ every doc page must exist in both
docs/guide/ (English) and docs/zh/guide/ (Chinese), be registered in docs/.vitepress/config.mts sidebar, and follow the established Markdown conventions.
- Content correctness โ every API, class, function, config option, and CLI flag mentioned in the doc must be verified against the current source code. Never invent features, never describe removed/renamed APIs, never guess parameter names.
Workflow
Step 0: Check if this is a draft document
IMPORTANT: If the user is working on a document in docs/draft/, this skill should NOT be invoked unless the user explicitly says they want to "publish" or "release" the draft.
- Documents in
docs/draft/ are temporary/work-in-progress documents
- Users can freely create, edit, and iterate on drafts without triggering this skill's strict bilingual and verification requirements
- Only when the user explicitly requests to publish/release a draft (e.g., "publish this draft", "move this to the official docs", "release the draft documentation") should you proceed with the full workflow below
If the current task involves a draft document and the user has NOT requested publication, politely decline and suggest they can continue working on the draft freely, or ask if they want to publish it.
Step 1: Determine scope
Ask (or infer from user request):
- Topic: which module or feature to document (e.g., "checkpoint engine", "notification system")
- Category: where it belongs in the sidebar (
Getting Started, Core Concepts, Advanced, Development, or Examples)
- Filename: kebab-case, e.g.,
checkpoint-engine.md
Step 2: Verify content against source code
Before writing a single line of documentation, read the actual source code for the feature being documented. Required steps:
- Identify relevant source files โ search
relax/, transfer_queue/, examples/ for the module.
- Read public APIs โ list all classes, functions, and their actual signatures (parameter names, types, defaults).
- Read config/arguments โ check
relax/utils/arguments.py or the relevant argument parser for CLI flags.
- Check imports โ verify that import paths shown in code examples are correct (e.g.,
from relax.metrics import MetricsClient).
- Check existing docs โ read any related existing docs to avoid contradictions.
Critical: If the source code differs from what the user describes, trust the source code and note the discrepancy.
Step 3: Write BOTH English and Chinese docs
CRITICAL: You MUST create BOTH language versions in the same session. Never create only one version.
CRITICAL: ASCII art diagrams (box-drawing characters โโโโ forming rectangular boxes) must ALWAYS use English text, even in Chinese docs. Never translate text inside box-drawing diagrams to Chinese.
Step 3a: Write English doc
Create docs/guide/<filename>.md (or docs/examples/<filename>.md, docs/api/<filename>.md depending on category).
Follow the doc template in references/doc-template.md.
Key rules:
- Title is an H1 (
#) matching the feature name
- Use standard section order: Overview โ Architecture (if applicable) โ Features โ Quick Start โ Configuration โ API Reference โ Usage Examples โ Best Practices โ Troubleshooting โ Next Steps
- Not every section is required โ omit sections that don't apply
- Code examples must use real import paths and real function signatures from Step 2
- Architecture diagrams use ASCII art (box drawing characters:
โ โ โ โ โ โ โผ โฒ โบ โ)
- Use VitePress containers:
::: tip, ::: warning, ::: danger
- Cross-reference other docs with relative links:
[Architecture](./architecture.md)
- End with "Next Steps" linking to 2-3 related docs
Step 3b: Write Chinese doc (MANDATORY)
Immediately after creating the English doc, create the Chinese counterpart at docs/zh/guide/<filename>.md (or corresponding zh/ path).
Translation rules:
- Translate ALL prose text to Chinese
- Keep code blocks, CLI commands, variable names, class names unchanged
- Translate code comments inside code blocks to Chinese
- Keep technical terms that are widely used in English as-is (e.g., "Ray Serve", "TensorBoard", "checkpoint") โ no forced translation
- Section headers must be natural Chinese (e.g., "Overview" โ "ๆฆ่ฟฐ", "Quick Start" โ "ๅฟซ้ๅผๅง", "Configuration" โ "้
็ฝฎ", "Best Practices" โ "ๆไฝณๅฎ่ทต", "Troubleshooting" โ "ๆ
้ๆ้ค", "Next Steps" โ "ไธไธๆญฅ")
- Chinese doc must cover the exact same sections and content as the English doc โ no missing sections, no extra sections
Verification: Before proceeding to Step 4, confirm that BOTH docs/guide/<filename>.md AND docs/zh/guide/<filename>.md have been created.
Step 4: Register in VitePress config
Edit docs/.vitepress/config.mts:
- Add to the English sidebar under the correct group
- Add to the Chinese sidebar under the corresponding Chinese group
- Both entries must use correct
link paths (/guide/<filename> and /zh/guide/<filename>)
English sidebar group mapping:
| Category | Sidebar group text |
|---|
| Getting Started | Getting Started |
| Core Concepts | Core Concepts |
| Advanced | Advanced |
| Development | Development |
| Examples | (separate /examples/ sidebar) |
| API | (separate /api/ sidebar) |
Chinese sidebar group mapping:
| Category | Sidebar group text |
|---|
| Getting Started | ๅฟซ้ๅผๅง |
| Core Concepts | ๆ ธๅฟๆฆๅฟต |
| Advanced | ่ฟ้ถๆๅ |
| Development | ๅผๅๆๅ |
| Examples | (separate /zh/examples/ sidebar) |
| API | (separate /zh/api/ sidebar) |
Step 5: Verify
After creating both docs and updating config:
- Verify both language versions exist โ confirm BOTH
docs/guide/<filename>.md AND docs/zh/guide/<filename>.md have been created. If only one exists, immediately create the missing version.
- Cross-check code examples โ re-read the source files and confirm every import path, class name, and function signature in the doc matches the code.
- Check bilingual parity โ confirm both docs have the same sections in the same order, with identical content coverage.
- Check sidebar config โ confirm both English and Chinese entries are added to
config.mts.
- Check internal links โ any
[text](./other-doc.md) references must point to docs that actually exist.
- Check repository paths โ scan the doc for every file/directory path that references the repo (e.g.,
relax/utils/health_system.py, scripts/models/qwen3-4B.sh). For each path, verify the file or directory actually exists. Remove or correct any stale/wrong paths.
Content Verification Checklist
When writing docs, verify each of these against the source code:
If you cannot verify something (e.g., the code is ambiguous or the feature is partially implemented), explicitly mark it in the doc with a ::: warning block.
Project Structure Reference
docs/
โโโ .vitepress/
โ โโโ config.mts # Sidebar & nav config (MUST update for new pages)
โโโ guide/ # English guides
โโโ zh/guide/ # Chinese guides (mirror of guide/)
โโโ api/ # English API docs
โโโ zh/api/ # Chinese API docs
โโโ examples/ # English example docs
โโโ zh/examples/ # Chinese example docs
โโโ index.md / zh/index.md # Home pages
Source code locations for verification:
relax/ # Core framework
โโโ core/ # Controller & service base classes
โโโ components/ # Ray Serve deployments (actor, critic, rollout, genrm)
โโโ engine/ # Rollout, rewards, filters, router
โโโ backends/ # Megatron, SGLang, FSDP backends
โโโ distributed/ # Ray actor utilities, checkpoint service
โโโ entrypoints/ # Training entry scripts (train.py)
โโโ utils/ # Utilities (arguments, metrics, logging, etc.)
transfer_queue/ # Data transfer queue system
examples/ # User-level examples (deepeyes, OPD, etc.)
scripts/ # Launch scripts
configs/ # Runtime env config (env.yaml)
Section Header Translation Reference
| English | Chinese |
|---|
| Overview | ๆฆ่ฟฐ |
| Architecture | ๆถๆ |
| Features | ๅ่ฝ็นๆง |
| Quick Start | ๅฟซ้ๅผๅง |
| Configuration | ้
็ฝฎ |
| API Reference | API ๅ่ |
| Usage / Usage Examples | ไฝฟ็จๆนๆณ / ไฝฟ็จ็คบไพ |
| Best Practices | ๆไฝณๅฎ่ทต |
| Troubleshooting | ๆ
้ๆ้ค |
| Next Steps | ไธไธๆญฅ |
| Installation | ๅฎ่ฃ
|
| Components | ็ปไปถ |
| Monitoring | ็ๆง |
| Examples | ็คบไพ |
| Design Goals | ่ฎพ่ฎก็ฎๆ |
| State Management | ็ถๆ็ฎก็ |
| Recovery Strategies | ๆขๅค็ญ็ฅ |
References
references/doc-template.md โ Standard doc page template (English + Chinese)
references/content-verification-guide.md โ Detailed guide on verifying doc content against source code