RU

rust-docs-guidelines

Provides best practices and standards for writing idiomatic, linked Rust documentation.

Install

mkdir -p .claude/skills/rust-docs-guidelines && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/1552" && unzip -o skill.zip -d .claude/skills/rust-docs-guidelines && rm skill.zip

Installs to .claude/skills/rust-docs-guidelines

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Guidelines for writing Rust documentation. Use this when you want to write Rust documentation.
94 chars✓ has a “when” trigger
Beginner

Key capabilities

  • →Enforce intra-documentation links for all symbols
  • →Explain concepts once and link to the original definition
  • →Document the 'why' instead of trivial implementation details
  • →Use line comments for specific code section documentation

How it works

The skill applies a set of standards that prioritize linking to existing definitions and focusing on the rationale behind code decisions rather than the mechanics of the implementation.

Inputs & outputs

You give it
Rust source code with docstrings
You get back
Standardized, maintainable documentation

When to use rust-docs-guidelines

  • →Write idiomatic rustdoc comments
  • →Add intra-documentation links
  • →Improve code documentation quality
  • →Document complex rust functions

About this skill

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.).
  • In a # Safety section, link the word valid to std's pointer-validity rules: write it as [valid] and put this reference definition at the end of the doc block —
    [valid]: https://doc.rust-lang.org/std/ptr/index.html#safety
    
    Only where it means pointer or memory validity — valid UTF-8, a valid enum variant, a valid nul terminator and a by-value struct whose fields must agree keep their plain form, since std's definition says nothing about them. A duration clause such as "must remain valid for the lifetime of the returned iterator" does mean it, so link it as well; the duration it adds is orthogonal to what validity means. A callback parameter is the other way round: std's rules cover accesses through data pointers, not whether an address is callable under a given ABI, so require the signature to be [ABI-compatible] instead and define it as —
    [ABI-compatible]: https://doc.rust-lang.org/std/primitive.fn.html#abi-compatibility
    
    Non-doc // SAFETY: comments keep the plain form too: rustdoc does not render them, so the brackets would stay literal text.
  • 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.

When not to use it

  • →Explaining trivial implementation details
  • →Hard-coding constant values in documentation

Limitations

  • →Requires discipline to avoid explaining 'how' in comments
  • →Depends on the existence of a primary definition for linking

How it compares

It enforces a structured, link-heavy documentation style that prevents duplication and ensures consistency across the codebase.

Compared to similar skills

rust-docs-guidelines side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
rust-docs-guidelines (this skill)77moNo flagsBeginner
documenting-rust-code14moReviewBeginner
write-documentation12moReviewIntermediate
review-rust-docs17moNo flagsBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry