MCPInstall

rust-documentation

Design, write, build, test, and publish Rust documentation with rustdoc, cargo doc, doctests, intra-doc links, crate-level guides, examples, README synchronization, mdBook, docs.rs metadata, link checking, documentation CI, and the Rust API Guidelines Documentation chapter (C-DOC, C-LINK, C-META, C-EXAMPLE). Use when users ask for Rust API docs, a project book, runnable examples, docs.rs readiness, missing-doc policy, API guideline compliance, documentation architecture, or stale documentation repair.

Installs
102
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/full-stack-skills/rust-skills --skill rust-documentation
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads rust-documentation automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Rust Documentation

Treat documentation as an executable interface. Keep API reference close to code, conceptual and operational guides in an appropriate book or repository document, and examples compiled against the supported API.

Scope and Routing

Use this skill for rustdoc comments, crate and module documentation, doctests, intra-doc links, README generation, mdBook, docs.rs configuration, link checking, spelling, and documentation release gates.

Route general test architecture to rust-testing, public API compatibility to rust-code-review, Cargo metadata and publishing to rust-cargo-build, API shape and trait design decisions to rust-api-design, and non-Rust office document formats to their dedicated document skills. This skill documents what already exists; rust-api-design decides what the API should be.

Workflow

1. Identify readers and documentation surfaces

Inventory public crates, binaries, features, targets, examples, READMEs, books, generated references, and hosted output. Define the audience and owner for each surface:

SurfacePrimary purpose
Crate and module docsEntry path, architecture, feature and platform overview
Item docsContract, errors, panics, safety, examples, complexity
Doctests and examplesExecutable usage and compatibility proof
READMEDiscovery, installation, minimal quick start, support policy
mdBookTutorials, concepts, operations, migration, long-form guides
docs.rsVersioned public API publication

Avoid duplicating the same prose across surfaces without a declared source of truth.

2. Document the contract

For each public API, document only applicable sections:

  • what the item does and important semantics;
  • # Examples with assertions and realistic imports;
  • # Errors for each meaningful failure category;
  • # Panics for reachable panic conditions;
  • # Safety for caller obligations on unsafe APIs;
  • cancellation, blocking, allocation, complexity, platform, feature, and MSRV constraints.

Prefer intra-doc links such as [`Client::send`] over brittle hand-written URLs. Enable broken-link checking at the crate boundary:

#![deny(rustdoc::broken_intra_doc_links)]

Adopt missing_docs deliberately; do not enable it globally before deciding which public compatibility surface requires documentation.

Rust API Guidelines — Documentation Rules

The Rust API Guidelines define five documentation rules (C-DOC, C-DOC-COMMENT, C-META, C-EXAMPLE, C-LINK) that high-quality crates are expected to satisfy. Treat them as the acceptance bar for documentation of any public crate. Full rationale, anti-patterns, and worked examples live in API Guidelines — Documentation; this section is the routing summary.

C-DOC — Document all items

Every public item (function, struct, enum, trait, module, etc.) carries a doc comment. Enforce mechanically with the missing_docs lint:

// src/lib.rs
#![deny(missing_docs)]

Decide the scope deliberately. #![deny(missing_docs)] at the crate root is the strongest policy; if some surfaces (sealed modules, generated code, deliberately unstable APIs) need exemptions, scope the lint with #[allow(missing_docs)] on the smallest possible item and record why.

C-DOC-COMMENT — /// versus //!

  • /// documents the next item (function, struct, field, module declared by name below it).
  • //! documents the current module or crate (placed at the top of a file, or inside a module body).
  • Both render Markdown and support intra-doc links [Foo].

Use //! at the top of src/lib.rs and any module root that needs an overview; use /// for every documented item.

C-META — Crate-level docs must cover essentials

src/lib.rs must open with //! documentation covering:

  • what the crate does and a link to usage examples;
  • how to get started (link to setup/integration docs or a quick start);
  • feature flags and what each enables;
  • Minimum Supported Rust Version (MSRV);
  • license, conventionally dual MIT OR Apache-2.0.

Run cargo doc --no-deps -p <crate> and check that the crate landing page reads as a self-contained overview, not just a module list.

C-EXAMPLE — Runnable examples with # Examples

Every public item should have a # Examples section. Examples should compile and run as doctests. Pick fence attributes precisely:

  • no attribute — compile and run;
  • ```no_run — compile but skip execution (network, files, hardware);
  • ```ignore — skip entirely, with a documented reason;
  • ```compile_fail — only in proc-macro crates to demonstrate rejected input.

Avoid no_run as a disguise for broken examples; if a workflow needs files or credentials, move it into examples/ and test it as a real target.

C-LINK — Intra-doc links

Use [ItemType] and [ItemType::method] syntax so rustdoc resolves targets and tracks renames. Never hand-write paths to types in the same crate. Enable broken-link enforcement at the crate boundary:

#![deny(rustdoc::broken_intra_doc_links)]

For full examples, anti-patterns, the lint matrix, and the verification commands per rule, read API Guidelines — Documentation.

3. Make examples executable

Use doctests for small public API contracts and examples/ crates for complete workflows. Mark fences precisely:

  • ordinary Rust fences compile and run;
  • no_run compiles code that requires unavailable external effects;
  • compile_fail proves rejected usage without locking full diagnostics;
  • ignore is a last resort with a documented reason.

Run:

cargo test --workspace --doc --all-features
RUSTDOCFLAGS="-D warnings" cargo doc --workspace --all-features --no-deps

Read rustdoc and Doctests when authoring API documentation.

4. Build long-form guides with mdBook

Use mdBook for tutorials, architecture, operations, and migration material that would overload API docs. Keep SUMMARY.md as the explicit navigation contract. Test Rust code samples with mdbook test, build in CI, and check internal plus external links. Read mdBook and Project Guides.

5. Prepare versioned publication

Inspect package metadata, docs.rs target and feature configuration, README links, repository URLs, licenses, examples, and hidden/private APIs. Verify docs using the locked dependency graph and supported MSRV/current stable rather than only the author's machine.

Do not publish, change hosted documentation, or enable external analytics without authorization. Read Documentation Release Quality.

Quality Gates

cargo fmt --all --check
cargo test --workspace --doc --all-features
RUSTDOCFLAGS="-D warnings" cargo doc --workspace --all-features --no-deps
mdbook test path/to/book
mdbook build path/to/book
lychee README.md docs book/src
typos README.md docs book/src src

Run only tools present in the project or approved for installation. Pin non-Rust documentation tools in CI and do not silently rewrite prose during a check-only job.

Completion Criteria

  • Give each audience a clear entry point and avoid conflicting sources of truth.
  • Document public errors, panics, safety, features, targets, and compatibility where applicable.
  • Compile and run representative documentation examples.
  • Reject broken intra-doc and repository links.
  • Build the same feature and target documentation intended for publication.
  • Record skipped external, platform, or hosted verification explicitly.

Resources

  • rustdoc and Doctests
  • mdBook and Project Guides
  • Documentation Release Quality
  • API Guidelines — Documentation
  • Execution Scenarios
  • examples/golden-docs/: a compilable crate with enforced intra-doc links and doctests.

Upstream Sources

Data Privacy

This skill does not collect, store, or transmit user data. Review examples, generated source links, build logs, and hosted analytics for secrets or proprietary paths before publication.

FAQ

What does the rust-documentation skill do?

Design, write, build, test, and publish Rust documentation with rustdoc, cargo doc, doctests, intra-doc links, crate-level guides, examples, README synchronization, mdBook, docs.rs metadata, link checking, documentation CI, and the Rust API Guidelines Documentation chapter (C-DOC, C-LINK, C-META, C-EXAMPLE). Use when users ask for Rust API docs, a project book, runnable examples, docs.rs readiness, missing-doc policy, API guideline compliance, documentation architecture, or stale documentation repair.

How do I install rust-documentation?

Run npx skills add https://github.com/full-stack-skills/rust-skills --skill rust-documentation in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/rust-documentation/ (personal) or .claude/skills/rust-documentation/ (project).

Which AI agents can use rust-documentation?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is rust-documentation safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains rust-documentation?

It is published by full-stack-skills in full-stack-skills/rust-skills. It has 102 recorded installs.

More from full-stack-skills/rust-skills

View all →

rust-testing

full-stack-skills/rust-skills

Design, implement, and validate Rust tests, including unit, integration, doctest, compile-fail, property, fuzz, benchmark, coverage, async, concurrency, process, daemon, IPC, terminal, platform, and hardware-facing test strategies. Use when users ask for Rust test architecture, flaky-test diagnosis, coverage gates, benchmarks, trybuild, cargo-nextest, real-process tests, or failure-path verification.

Testing & QA148 installs

rust-concurrency

full-stack-skills/rust-skills

Open the skill to read its SKILL.md instructions.

Backend & APIs137 installs

rust-style-clippy

full-stack-skills/rust-skills

Open the skill to read its SKILL.md instructions.

Backend & APIs137 installs

rust-performance

full-stack-skills/rust-skills

Open the skill to read its SKILL.md instructions.

Backend & APIs135 installs

rust-code-review

full-stack-skills/rust-skills

Review Rust changes for correctness, memory and thread safety, error semantics, unnecessary allocation or cloning, lock scope, API compatibility, test gaps, documentation, and dependency risk, applying the Rust API Guidelines checklist (C-PANIC, C-UNWRAP, C-TRANSMUTE, C-BOOL, C-NEWTYPE, C-COMMON-TRAITS, C-CONVERT, C-SEALED, C-NON-EXHAUSTIVE). Use when reviewing Rust diffs, pull requests, libraries, unsafe boundaries, or production incidents; report actionable findings by severity before summaries, route automated formatting or lint policy to rust-style-clippy, and route API shape decisions (trait sealing, error taxonomy, newtype design, builder patterns) to rust-api-design.

rust-cargo-build

full-stack-skills/rust-skills

Open the skill to read its SKILL.md instructions.

Backend & APIs123 installs

Popular backend & apis skills

View category →

find-skills

vercel-labs/skills

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

OfficialBackend & APIs4.1M installs

entra-app-registration

microsoft/azure-skills

Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.

OfficialBackend & APIs566.7K installs

This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management" — in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).

Backend & APIs514.8K installs

embedded-captions

heygen-com/hyperframes

Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet anchor rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.

Backend & APIs453.3K installs

entra-agent-id

microsoft/azure-skills

Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant) including the Microsoft Entra SDK for AgentID sidecar. USE FOR: Agent Identity Blueprint, BlueprintPrincipal, agent OAuth, fmipath token exchange, agent OBO, Workload Identity Federation for agents, polyglot agent auth, Microsoft.Identity.Web.AgentIdentities. DO NOT USE FOR: standard Entra app registration (use entra-app-registration), Microsoft Foundry agent authoring (use microsoft-foundry).

OfficialBackend & APIs336.6K installs

neon

neondatabase/agent-skills

Overview of Neon, a complete set of cloud backend primitives around Lakebase Postgres: Auth, Object Storage, Functions, the AI Gateway, and Realtime. Start here to choose Neon for undecided login, files, APIs, and LLM calls, set up the CLI or MCP server, and follow the branch-first workflow. Use when building an app or backend on Neon, or when "Neon" or "Lakebase Postgres" is mentioned. Child skill neon-postgres wins for an existing DATABASEURL, SQL, schema, inspect, or search. Child skill neon-auth wins for login, users, sessions, identity routing, and Managed Better Auth setup. Child skill neon-realtime wins for live queries in reactive apps and agents. Also use for object storage, S3, buckets, serverless functions, function triggers, cron, AI gateway, LLM calls, realtime, logs, Loki, Grafana, observability, postgres, database, backend, Claimable Neon, neon.new, or a no-signup database.

Backend & APIs237.1K installs