create-crate-api

Generates API reference documentation for Rust crates from source code and examples.

Updated Mar 15, 2026
One-click install
npx skills add https://github.com/mohankumargupta/skills --skill create-crate-api-mohankumargupta
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: create-crate-api
Source: https://github.com/mohankumargupta/skills/tree/main/create-crate-api
Command: npx skills add https://github.com/mohankumargupta/skills --skill create-crate-api-mohankumargupta

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing accurate API documentation for a Rust crate requires manually reading Cargo.toml, lib.rs, every module, and all examples, which is slow and error-prone, especially when crates mix sync and async APIs. ## Core Features & Use Cases - Full source analysis: Reads README.md, Cargo.toml, src/lib.rs, and all sub-modules to catalog public types, traits, methods, error enums, and re-exports. - Sync/async handling: Detects feature flags and maybe-async-style macro crates to correctly document both blocking and async API variants. - Example-driven usage docs: Reads every file under examples/ and produces a structured <device>_api.md with constructors, method signatures, and blocking/async usage snippets. - Use Case: Given an embedded-hal sensor driver crate in artifacts/, generate a complete API reference separating sync and async methods for an ESP32 project. ## Quick Start Create api docs for device bme280 using the crate source in the artifacts directory.

Frequently Asked Questions about create-crate-api

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

FAQPage Schema
How do I generate API documentation for a Rust crate?▼

Place the crate source under artifacts/<crate>/ and provide a <device>_crate.md file naming the crate. The skill reads Cargo.toml, lib.rs, all modules, and examples, then writes a structured <device>_api.md reference.

How to document Rust crates with both sync and async APIs?▼

The skill detects feature flags like async and blocking in Cargo.toml and cfg attributes in source. It documents blocking and async method variants separately, including crates using maybe-async-cfg macro expansion.

Does it support embedded-hal driver crates?▼

Yes, it is designed for embedded-hal drivers. It records which embedded-hal traits each struct implements, notes the embedded-hal version, and pays special attention to ESP32 examples when synthesizing usage sections.

What happens if the crate has no examples directory?▼

If no examples directory exists, the skill writes 'No upstream examples available.' in the Usage examples section and derives usage patterns solely from the source code analysis.

What inputs are required before running this skill?▼

You need a <device>_crate.md file in the working directory specifying the crate name, and the crate source must exist at artifacts/<crate>/. If the crate name cannot be resolved, the skill stops and exits.