Implements reusable Rust library crates: public API design, module visibility, error types, feature flags, documentation, tests, and Cargo validation. Use for new crates, API refactors, or crate-boundary cleanup.
Ships in rust-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Implement reusable Rust library behavior with a small public API, clear module visibility, and tests at the boundary users actually call.
The practical goal is a crate that is easy to use from downstream code, easy to test inside the repository, and honest about compatibility, features, and errors.
Use repo-local Rust files, checked-out dependency sources, Dash MCP or Dash HTTP for installed Rust and Cargo docsets, and then official Rust and Cargo documentation when Dash/local coverage is missing or stale:
Use the repository's existing API style before introducing a new pattern.
Cargo.tomlsrc/lib.rssrc/tests/lib.rsPrefer private modules with explicit public re-exports:
mod parser;
pub use parser::{ParseError, parse_document};
Use pub(crate) for shared internal behavior that crosses modules inside one crate. Avoid pub just to make tests easy; use unit tests in the module for private behavior and integration tests for public behavior.
Split modules when a file starts owning unrelated jobs such as parsing, validation, rendering, and I/O.
Use Cargo features for real optional behavior:
std versus no_stdDo not add feature flags for uncertain future work. Every feature should have tests or at least a documented validation path.
Use unit tests for private transformations and edge cases.
Use integration tests under tests/ when the public API should be exercised like a downstream caller:
use my_crate::parse_document;
#[test]
fn parses_empty_document() {
let document = parse_document("").unwrap();
assert!(document.items().is_empty());
}
Use doctests when examples in public documentation should stay compiling and accurate.
Choose the narrowest command that proves the change:
cargo test -p package-name
cargo test -p package-name --doc
cargo clippy -p package-name --all-targets --all-features
cargo fmt --check
For publishable crates, defer packaging details to rust:package-workflow.
Return:
Library surface: public types, functions, modules, features, and errors changed.Caller impact: who uses the API and what becomes easier or safer.Visibility: what is public, pub(crate), or private and why.Tests: unit, integration, doctest, or feature coverage added or recommended.Validation: exact Cargo commands run or skipped with the concrete reason.Next skill: usually rust:testing-workflow, rust:tooling-style-workflow, or rust:package-workflow.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
8 skills in this plugin
/bootstrap-cargo-projectBootstrap or guide a reproducible Rust Cargo project with explicit package or workspace shape, cargo new or cargo init usage, edition and MSRV checks, rust-toolchain handling, test layout, and initial validation commands. Use after the Rust project shape is settled or when adding a new Cargo package to an existing repository./build-cli-projectImplement Rust command-line tools after the project shape is chosen, including argument parsing boundaries, command dispatch, stdin/stdout/stderr behavior, exit codes, configuration input, error messages, tests, and Cargo validation. Use for Rust CLI feature work, CLI refactors, or new binary crate implementation.//rust-skills:build-library-cratefrom rust-skills
npx claudepluginhub gaelic-ghost/socket --plugin rust-skillsOther plugins' skills for the same job