Rust Documentation Standards
Install this skill
npx skills add RediSearch/RediSearchWorks across Claude Code, Cursor, Codex, Copilot & Antigravity
What this skill does
- •Validates intra-documentation link usage for all Rust symbols
- •Enforces 'why-over-how' documentation philosophy
- •Automates the transition from fragile line-range references to code-attached comments
- •Standardizes constant referencing via link-based notation
- •Manages private intra-doc link exceptions through compiler-friendly directives
When to use it
- ✓When drafting initial API documentation for a public Rust crate
- ✓During code reviews to identify poorly documented logic or duplicate explanations
- ✓When refactoring large codebases where documentation references often break
- ✓While documenting internal modules that rely on complex constant definitions
When not to use it
- ✕If your project does not use Rust or cargo-based documentation tools
- ✕When writing non-technical README files that do not require symbol linking
How to invoke it
Example prompts that trigger this skill:
- “Apply the rust-docs-guidelines to the current module.”
- “Review my documentation for compliance with rust-docs-guidelines.”
- “Rewrite this function comment to follow rust-docs-guidelines.”
- “Identify any duplicate explanations in this file using rust-docs-guidelines.”
- “Fix my documentation links to comply with the rust-docs-guidelines project standards.”
Example workflow
- Analyze the target module to identify existing documentation.
- Refactor verbose comments to focus on the reasoning behind the implementation.
- Replace hard-coded constant values with intra-doc links.
- Audit the file for redundant explanations and consolidate them.
- Add #[allow(rustdoc::private_intra_doc_links)] where necessary for internal linking.
- Verify that no references to specific line numbers remain.
Prerequisites
- –A Rust project using cargo
- –rustdoc environment
Pitfalls & limitations
- !Over-linking can lead to verbose documentation if not handled carefully
- !Private intra-doc links require explicit allow-directives which can clutter the codebase if overused
FAQ
How it compares
Generic prompts often result in inconsistent or verbose comments, whereas this skill enforces specific structural rules that ensure compatibility with automated tools and long-term maintainability.
Source & trust
From the source: “# Rust Docs Guidelines 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 (typ…”
View the full SKILL.md source
# Rust Docs Guidelines 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.
Quoted from RediSearch/RediSearch for reference — see the original for the authoritative, latest version.
📄 Full skill instructions — original source: RediSearch/RediSearch
How to Use This Skill Unit
Option A: Project-Specific (Recommended)
- Click "Download" above
- In your project, create the directory:
.agent/skills/rust-docs-guidelines/ - Save the file as
SKILL.md - The agent will automatically discover the skill based on its description.
Option B: Global Installation (All Agents)
Save the file to these locations to make it available across all projects:
- Claude Code:
~/.claude/skills/RediSearch/RediSearch/rust-docs-guidelines/SKILL.md - Cursor:
~/.cursor/skills/RediSearch/RediSearch/rust-docs-guidelines/SKILL.md - Antigravity:
~/.gemini/antigravity/skills/RediSearch/RediSearch/rust-docs-guidelines/SKILL.md
🚀 Install with CLI:npx skills add RediSearch/RediSearch