Standards to follow when writing Rust documentation.
Guidelines
Key concepts should be explained only once. All other documentation should use an intra-documentation link to the first explanation.
Always use an intra-documentation link when mentioning a Rust symbol (type, function, constant, etc.).
Avoid referring to specific lines or line ranges, as they may change over time.
Use line comments if the documentation needs to be attached to a specific code section inside
a function/method body.
Focus on why, not how.
In particular, avoid explaining trivial implementation details in line comments.
Refer to constants using intra-documentation links. Don't hard-code their values in the documentation of other items.
Intra-documentation links to private items are preferable to duplication. Add #[allow(rustdoc::private_intra_doc_links)] where relevant.
1---2name: rust-docs-guidelines3description: Rust Docs Guidelines4---5# Rust Docs Guidelines67Standards to follow when writing Rust documentation.89## Guidelines1011- Key concepts should be explained only once. All other documentation should use an intra-documentation link to the first explanation.12- Always use an intra-documentation link when mentioning a Rust symbol (type, function, constant, etc.).13- Avoid referring to specific lines or line ranges, as they may change over time.14 Use line comments if the documentation needs to be attached to a specific code section inside15 a function/method body.16- Focus on why, not how.17 In particular, avoid explaining trivial implementation details in line comments.18- Refer to constants using intra-documentation links. Don't hard-code their values in the documentation of other items.19- Intra-documentation links to private items are preferable to duplication. Add `#[allow(rustdoc::private_intra_doc_links)]` where relevant.
Run npx skillmds@latest add comeonoliver/rust-docs-guidelines in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Rust Docs Guidelines It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
ComeOnOliver (@comeonoliver) published this skill. Their other Agent Skills are listed on their SkillMD profile.