rust-doc-comment-generator

Generate idiomatic Rustdoc comments for structs, enums, traits, and functions.

1.5k|243|Updated Dec 13, 2023
One-click install
npx skills add https://github.com/mxsm/rocketmq-rust --skill rust-doc-comment-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-doc-comment-generator
Source: https://github.com/mxsm/rocketmq-rust/tree/main/.agents/skills/rust-doc-comment-generator
Command: npx skills add https://github.com/mxsm/rocketmq-rust --skill rust-doc-comment-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill turns incomplete or low-quality Rust comments into clear, idiomatic Rustdoc that matches official documentation conventions and is ready for production use.

Core Features & Use Cases

  • Rustdoc Generation: Writes /// and //! documentation for public items, modules, traits, impl blocks, functions, and unsafe APIs.
  • Convention Compliance: Aligns comments with Rust API Guidelines, Rustdoc guidance, and professional style expectations.
  • Safety and Behavior Clarity: Documents blocking behavior, async behavior, error cases, panics, and safety requirements when they are relevant.
  • Use Case: Use this Skill to clean up a Rust crate before release by rewriting ad hoc comments into consistent API documentation without changing code semantics.

Quick Start

Rewrite the Rust comments in my source file into idiomatic Rustdoc while preserving the existing behavior and identifiers.

Frequently Asked Questions about rust-doc-comment-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate idiomatic Rustdoc comments for my crate before release?

To generate idiomatic Rustdoc comments, you can rewrite ad hoc notes into production-grade documentation that aligns with Rust API Guidelines and Rustdoc conventions without changing code semantics.

What is the best way to document unsafe Rust code blocks and safety requirements?

The best way to document unsafe Rust code is to generate Rustdoc-compliant safety notes that explicitly state safety requirements and blocking behavior while preserving the original code semantics.

How do I add module level documentation comments in Rust?

You can add module-level documentation by generating `//!` comments for modules alongside `///` documentation for structs, enums, traits, and functions, ensuring full Rustdoc convention compliance.

Can I rewrite existing Rust comments without altering the code behavior?

Yes, you can rewrite existing Rust comments into consistent API documentation while strictly preserving code semantics, identifiers, and the original blocking or async behavior details.

Does Rustdoc documentation generation cover async functions and error cases?

Yes, Rustdoc generation covers async functions by documenting async behavior, error cases, and panics, ensuring that all relevant behavioral details are clearly captured for production use.