rust-professional-usage

Enforce Rust coding standards for ownership, errors, safety, and concurrency.

4|Updated May 16, 2026
One-click install
npx skills add https://github.com/machenjie/rd-skills --skill rust-professional-usage
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-professional-usage
Source: https://github.com/machenjie/rd-skills/tree/main/src/foundation/capabilities/rust-professional-usage
Command: npx skills add https://github.com/machenjie/rd-skills --skill rust-professional-usage

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It prevents professional Rust mistakes—like unsafe without a written contract, panic/unwrap in library code, weak error modeling, and concurrency or async runtime errors—that otherwise surface as security risks, production incidents, and performance regressions.

Core Features & Use Cases

  • Ownership, lifetimes, and borrowing discipline: encourages borrow-first design and deliberate use of cloning (including when Arc/Cow is appropriate).
  • Typed error handling and panic boundaries: standardizes Result<T, E> with library-appropriate typed errors (thiserror) and application-level ergonomics (anyhow) while avoiding panic in libraries.
  • Safety and concurrency guardrails: requires documented // SAFETY: invariants for unsafe, enforces singular async runtime choice, and stresses lock-scope rules to avoid deadlocks or await-in-lock patterns.
  • Professional review checklist: provides review baselines across toolchain, formatting, linting, auditing, testing (including loom/miri where relevant), and performance measurement.

Quick Start

Use the rust-professional-usage skill to review or refactor your Rust change by asking an AI to check ownership/lifetimes, ensure typed Result error modeling, verify unsafe blocks have explicit // SAFETY: contracts, confirm tokio runtime singularity, and flag any unwrap/expect/panic usage in library code.

Frequently Asked Questions about rust-professional-usage

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

FAQPage Schema
How do I review Rust code for unsafe invariants and ownership discipline?

Standardize Rust error handling by using Result<T, E> with thiserror for library-appropriate typed errors and anyhow for application-level ergonomics. Avoid unwrap and panic in library code to prevent production incidents.

What is the best way to manage async tokio runtime and concurrency in Rust?

Manage async tokio runtime by enforcing a singular runtime choice and strict lock-scope rules to avoid await-in-lock patterns. This concurrency-safe approach prevents deadlocks and runtime errors in Rust services.

Why does my Rust library panic in production, and how can I prevent it?

Your Rust library panics in production due to unwrap or expect usage in library code. Prevent production incidents by standardizing typed Result boundaries and establishing panic boundaries for application-level handling.

Does this Rust review checklist apply to WASM and CLI performance-sensitive modules?

Yes, this Rust review checklist applies to WASM, CLI, systems, and performance-sensitive modules. It verifies toolchain, formatting, linting, auditing, and testing using loom or miri where relevant to ensure reliability.