exploring-rust-crates
Generate Rust documentation to understand crate APIs, structure, and usage. Use when exploring Rust code, understanding crate organization, finding functions/types/traits, or needing context about a Rust package in the HASH workspace.
When & Why to Use This Skill
This Claude skill automates the generation and exploration of Rust crate documentation using cargo doc. It helps developers quickly grasp complex API structures, module hierarchies, and code examples within a HASH workspace, significantly accelerating the code discovery process and improving developer productivity.
Use Cases
- Onboarding to new projects: Rapidly generate a comprehensive overview of a Rust crate's architecture and public API surface to understand how different components interact.
- API Reference Lookup: Efficiently find specific function signatures, trait implementations, and type definitions without manually searching through source files.
- Learning Idiomatic Usage: Extract and review code examples from doctest blocks to understand the intended usage patterns of specific Rust packages.
- Dependency Analysis: Explore the module hierarchy and relationships between different crates within a large workspace to better manage code organization.
| name | exploring-rust-crates |
|---|---|
| description | Generate Rust documentation to understand crate APIs, structure, and usage. Use when exploring Rust code, understanding crate organization, finding functions/types/traits, or needing context about a Rust package in the HASH workspace. |
| license | AGPL-3.0 |
| type | domain |
| enforcement | suggest |
| priority | medium |
Exploring Rust Crates
Generate and use Rust documentation to understand crate APIs, structure, and code organization in the HASH workspace.
Generating Documentation
For a Specific Package
cargo doc --no-deps --all-features --package <package-name>
For the Entire Workspace
cargo doc --no-deps --all-features --workspace
Key Flags
--no-deps: Document local code only (faster, less noise)--all-features: Include all feature-gated APIs--package <name>: Target a specific crate--workspace: Document all crates in the workspace--document-private-items: Include internal implementation details
What Generated Docs Provide
- Crate organization - Module hierarchy and component relationships
- Public API surface - All public functions, types, traits, and constants
- Usage examples - Code examples from doctest blocks
- Error documentation - Documented error conditions and handling
- Type relationships - Trait implementations, type aliases, associated types
Viewing Documentation
Docs are generated at:
target/doc/<crate_name>/index.html
Tips
- Generate docs before diving into unfamiliar Rust code
- Cross-reference
# Errorssections for error handling patterns - Look for
# Examplessections for idiomatic usage patterns