/rust:project-setupfrom rust
Sets up, assesses, or improves Rust projects for idiomatic safe code, maintainability, strict linting, Cargo workspace/feature design, MSRV/edition management, testing/CI, unsafe/FFI boundaries, documentation, crates.io packaging, and release hygiene.
Ships in rust. 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.
Read when SKILL.md points to them.
Set up, assess, and improve Rust projects using current official Rust, Cargo, Clippy, rustfmt, rustdoc, crates.io, and RustSec guidance. Optimize for code that is easy to understand, difficult to misuse, explicit about unsafe proof obligations, and practical to test and publish.
See ATTRIBUTION.md. Keep detailed recipes in the references and load only the domains that apply.
State the mode before acting:
| User intent | Mode | Default behavior |
|---|---|---|
| “Create/set up/configure this Rust project” | Implement | Edit the requested project, then run proportionate checks |
| “Assess/review our Rust setup or maintainability” | Assess | Report evidence-backed baseline states; do not edit |
| “Advise/design/give me a checklist” | Advice | Explain an adapted setup or workflow; do not edit or perform external mutations |
| “Make this code more idiomatic/maintainable” | Refactor | Preserve behavior, public API, MSRV, features, and target support unless the user authorizes a change |
| “Prepare this crate for publishing/release” | Release preparation | Inspect and dry-run packaging; never perform an external publish, tag, push, owner change, or release without explicit authorization |
When the request combines modes, apply each boundary separately. Read-only assessment does not authorize cleanup edits merely because they are easy.
This skill assesses preventive controls and maintainability, not whether code is sound or exploitable.
| This skill | A future proof-gated safety review |
|---|---|
| Asks whether applicable project controls meet a baseline | Proves a concrete soundness, concurrency, or security defect |
| Reports Met / Gap / Not applicable / Needs verification | Requires a reproducer, dynamic trace, or complete invariant/data-flow proof |
| Prioritizes Essential / Recommended / Optional | Prioritizes demonstrated impact and reachability |
| May recommend Miri, fuzzing, sanitizers, and narrower unsafe | Uses their results as evidence for a specific defect |
unsafe is not automatically a defect. Conversely, safe Rust can panic, deadlock, leak,
exhaust resources, mishandle data, or violate application invariants. Keep those facts
separate from compiler-enforced memory and thread safety.
no_std, embedded, WASM, async service, and unpublished workspace helper have different
baselines.[workspace.lints] is ineffective for
a member that does not opt in. A CI command without the relevant packages, targets, or
features does not cover them.rust-version, edition, resolver, dependency selection,
lint availability, and CI against the declared floor. A contributor toolchain file is
not proof that the MSRV works. Resolver 3 prefers compatible dependencies but does not
enforce MSRV, and mixed-MSRV members can affect the shared resolution.pedantic
with narrow exceptions, and cherry-pick restriction lints. Never enable the whole
restriction or nursery groups as a generic best practice.allow attributes either.clone, Arc, mutex, generic, lifetime, trait,
newtype, builder, or async function is neither good nor bad without the actual ownership,
concurrency, and API need.cargo package, cargo publish --dry-run, and archive
inspection are preparation. cargo publish and registry ownership changes are external,
durable actions requiring explicit user intent.Use these only in Assess mode.
| State | Meaning |
|---|---|
| Met | Effective implementation is evidenced in manifests, source, CI, or observed local behavior |
| Gap | The control applies and evidence shows it is absent, disabled, or materially incomplete |
| Not applicable | The project lacks the surface, with a concrete reason |
| Needs verification | The control applies, but a required fact cannot be established safely |
| Priority | Use when |
|---|---|
| Essential | A foundational contract or release boundary is missing: undeclared/testless MSRV promise, publishable private crate, unaudited broad unsafe surface, package contents exposing secrets, or CI that does not build the supported product |
| Recommended | Clear maintainability or reliability value: workspace lint inheritance, feature matrix, doctests, Miri for exercised unsafe code, package dry runs, or structured public errors |
| Optional | Context-dependent maturity: broader fuzzing, extra target checks, stricter curated lints, deeper supply-chain policy, or automated release ergonomics |
Priority is not defect severity.
AGENTS.md, CLAUDE.md, contribution, release, and security policy.Read references/project-and-workspace.md and
establish:
*-sys/FFI, examples,
benchmarks, fuzz/xtask/internal helpers;rust-version, contributor
toolchain, effective .cargo/config.toml and invocation directory, lockfile policy,
supported targets, std/no_std, and async runtime;State unresolved assumptions.
Read references/baseline-and-reporting.md.
| Detected surface or task | Load |
|---|---|
| Always | baseline-and-reporting.md, project-and-workspace.md |
| Lints, formatting, tests, CI, MSRV verification, Miri/fuzz/sanitizers | linting-testing-and-ci.md |
| Code/API maintainability, errors, ownership, unsafe/FFI, docs | idiomatic-safe-rust.md |
| Publishable crate, package contents, SemVer, docs.rs, release/auth/ownership | publishing-and-release.md |
Use the current stable Rust/Cargo documentation as the default baseline, adapted to the declared MSRV and supported targets. Use the Rust API Guidelines as recommendations, not mandates; current Cargo/rustdoc behavior wins where older guidance conflicts.
Prefer static evidence first:
rust-toolchain.toml, rustfmt/Clippy config, workspace inheritance;Then run safe local checks proportionate to the mode and project. Do not blindly paste a universal command block: adapt package, target, feature, platform, MSRV, and network flags. Treat grep hits and clean tool runs as evidence for executed coverage, not proof of absence.
For Met and Gap, record file:line and effective behavior. Phrase Needs verification as
one concrete question with a safe verification method.
publishing-and-release.md; stop before external mutation unless explicitly requested.For implementation/refactoring, lead with the resulting behavior, files changed, checks run, and any remaining compatibility or release decision.
For assessment, use:
## Rust Project Baseline Review: <scope>
**Profile:** <roles, workspace, targets, MSRV/edition, features, unsafe/FFI, publishing>
**Baseline:** Current official Rust/Cargo guidance adapted to <MSRV/targets>
**Assumptions:** <unresolved facts>
### Coverage Summary
| Domain | Met | Gap | Needs verification | Not applicable |
| --- | ---: | ---: | ---: | ---: |
### Essential Gaps
#### [RUST-001] <control> — Gap
- **Applicability:** Why it applies.
- **Evidence:** `file:line` and effective behavior.
- **Recommendation:** Minimal concrete change.
- **Tradeoffs:** MSRV, compatibility, compile time, contributor or release impact.
- **Source:** Primary official guidance.
### Recommended Gaps
### Optional Improvements
### Needs Verification
### Controls Already Met
### Not Applicable
### Remediation Roadmap
If all examined controls are Met, name the profile and coverage; do not imply that tools proved soundness or that unexamined feature/target combinations passed.
Prefer primary sources in this order:
When offline, use these pinned references and explicitly mark version-sensitive facts as not re-verified. Do not use popularity lists or blog folklore as normative guidance.
| File | Covers |
|---|---|
references/baseline-and-reporting.md | Applicability, evidence, states/priorities, false positives, reporting |
references/project-and-workspace.md | Cargo/project structure, workspaces, toolchains, MSRV/edition/resolver, features, lockfiles, build-time code |
references/linting-testing-and-ci.md | Strict usable rustc/Clippy/rustfmt policy, testing matrix, CI, Miri, fuzzing, sanitizers |
references/idiomatic-safe-rust.md | Ownership/API design, types/invariants, errors/panics, unsafe/FFI, concurrency, docs, maintainability gotchas |
references/publishing-and-release.md | crates.io metadata/package contents, SemVer, docs.rs, dry runs, trusted publishing, ownership, dependencies |
Treat documented MSRV, target, feature, unsafe, dependency, and release policies as input, not automatic exemptions. Record intentional tradeoffs and narrow lint exceptions with their rationale so future work does not reopen them without new evidence.
ATTRIBUTION.md (opens in a new tab)agents/openai.yaml (opens in a new tab)references/baseline-and-reporting.md (opens in a new tab)references/idiomatic-safe-rust.md (opens in a new tab)references/linting-testing-and-ci.md (opens in a new tab)references/project-and-workspace.md (opens in a new tab)references/publishing-and-release.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub photostructure/coding-skills --plugin rustOther plugins' skills for the same job