Skip to main content
skill CX Codex

rust-development · laurigates — Claude Code skill: what it does, how to install

A Rust development skill covering Cargo, ownership, async code, and Tokio. It fits coding tasks that mention Rust or its core tooling.

MIT 108 installs ★ 60 updated 2026-11-16

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add laurigates/claude-plugins --skill rust-development -a claude-code
Open on GitHub

What rust-development does

This skill gives an agent working knowledge for Rust development. It can guide module and trait design, ownership and borrowing, lifetimes, type-safe error handling, async/await, and memory-aware abstractions. Its ecosystem coverage includes Cargo, Tokio, Serde, Rayon, and common Rust testing tools.

The reference material covers build and test workflows, Clippy checks, rustfmt, dependency audits, profiling, fuzzing, Miri, and cross-compilation. It also lists patterns for Result<T, E>, Option<T>, smart pointers, interior mutability, and Pin/Unpin. The skill is automatic rather than manually invoked, with triggers around Rust, cargo, ownership, lifetimes, and async programming.

For CI, the guidance recommends pinning the compiler in a root rust-toolchain.toml and letting Renovate update it. That choice affects how new compiler lints arrive in the project.

What it helps with

  • design Rust modules and trait hierarchies
  • untangle ownership, borrowing, and lifetime errors
  • build async services with Tokio
  • run Clippy and rustfmt checks
  • set up tests, benchmarks, and dependency audits

Example prompts for the agent

  • Review this Rust code and fix the ownership and lifetime issues.
  • Set up a project workflow with cargo clippy, cargo fmt, and cargo test.
  • Suggest a module layout for a Rust library that uses Tokio and Serde.

How to install rust-development

1Skills CLI (Vercel)

npx skills add laurigates/claude-plugins --skill rust-development -a claude-code

2Manually: put the files in place

~/.claude/skills/rust-development/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/rust-development/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about rust-development

How do I install rust-development in Claude Code?

Run npx skills add laurigates/claude-plugins --skill rust-development -a claude-code, then check ~/.claude/skills/rust-development/SKILL.md.

What does rust-development do?

It helps an agent work on Rust code, including ownership, memory safety, async programming, error handling, testing, and Cargo workflows.

Which Rust tools does the skill cover?

It covers Cargo, Rustc, Clippy, Rustfmt, and rust-analyzer, with additional guidance for Tokio, Serde, Rayon, Miri, and cargo-fuzz.

Source text

SKILL.md · MIT
---
created: 2025-12-16
modified: 2026-11-14
reviewed: 2026-04-25
name: rust-development
description: Rust development — cargo, clippy, rustfmt, async, Tokio, Serde, memory safety. Use when mentioning Rust, cargo, ownership, lifetimes, fearless concurrency, or async programming.
user-invocable: false
allowed-tools: Glob, Grep, Read, Bash(cargo build *), Bash(cargo run *), Bash(cargo test *), Bash(cargo bench *), Bash(cargo clippy *), Bash(cargo fmt *), Bash(cargo fix *), Bash(cargo add *), Bash(cargo update *), Bash(cargo audit *), Bash(cargo deny *), Bash(cargo new *), Bash(cargo init *), Bash(cargo doc *), Edit, Write, TodoWrite, WebFetch, WebSearch
---

# Rust Development

Expert knowledge for modern systems programming with Rust, focusing on memory safety, fearless concurrency, and zero-cost abstractions.

## When to Use This Skill

| Use this skill when... | Use sibling skill instead when... |
|---|---|
| Writing Rust code, ownership, lifetimes, async/await | Configuring lint rules in detail -- use `clippy-advanced` |
| Choosing crates from the ecosystem (Tokio, Serde) | Detecting unused dependencies -- use `cargo-machete` |
| Designing module structure or trait hierarchies | Running tests with parallel isolation -- use `cargo-nextest` |
| Learning idiomatic Rust patterns and edition features | Generating coverage reports -- use `cargo-llvm-cov` |

## Core Expertise

**Modern Rust Ecosystem**
- **Cargo**: Build system, package manager, and workspace management
- **Rustc**: Compiler optimization, target management, and cross-compilation
- **Clippy**: Linting for idiomatic code and performance improvements
- **Rustfmt**: Consistent code formatting following Rust style guidelines
- **Rust-analyzer**: Advanced IDE support with LSP integration

**Language Features**
- Rust 2024 edition: RPITIT, async fn in traits, impl Trait improvements
- Const generics and compile-time computation
- Generic associated types (GATs)
- Let-else patterns and if-let chains

## Key Capabilities

**Ownership & Memory Safety**
- Implement ownership patterns with borrowing and lifetimes
- Design zero-copy abstractions and efficient memory layouts
- Apply RAII patterns through Drop trait and smart pointers (Box, Rc, Arc)
- Leverage interior mutability patterns (Cell, RefCell, Mutex, RwLock)
- Use Pin/Unpin for self-referential structures

**Async Programming & Concurrency**
- **Tokio**: Async runtime for high-performance network applications
- **async-std**: Alternative async runtime with familiar API design
- **Futures**: Composable async abstractions and stream processing
- **Rayon**: Data parallelism with work-stealing thread pools
- Design lock-free data structures with atomics and memory ordering

**Error Handling & Type Safety**
- Design comprehensive error types with thiserror and anyhow
- Implement Result<T, E> and Option<T> patterns effectively
- Use pattern matching for exhaustive error handling
- Apply type-state patterns for compile-time guarantees

**Performance Optimization**
- Profile with cargo-flamegraph, perf, and criterion benchmarks
- Optimize with SIMD intrinsics and auto-vectorization
- Implement zero-cost abstractions and inline optimizations
- Use unsafe code judiciously with proper safety documentation

**Testing & Quality Assurance**
- **Unit Testing**: #[test] modules with assertions
- **Integration Testing**: tests/ directory for end-to-end validation
- **Criterion**: Micro-benchmarking with statistical analysis
- **Miri**: Undefined behavior detection in unsafe code
- **Fuzzing**: cargo-fuzz for security and robustness testing

## Essential Commands

```bash
# Project setup
cargo new my-project      # Binary crate
cargo new my-lib --lib    # Library crate
cargo init                # Initialize in existing directory
# From a template repo instead of an empty crate — see the cargo-generate skill
cargo generate --git <template-url> --name my-project

# Development workflow
cargo build                      # Debug build
cargo build --release           # Optimized build
cargo run                       # Build and run
cargo run --release             # Run optimized
cargo test                      # Run all tests
cargo test --lib               # Library tests only
cargo bench                     # Run benchmarks

# Code quality
cargo clippy                    # Lint code
cargo clippy -- -W clippy::pedantic  # Stricter lints
cargo fmt                       # Format code
cargo fmt --check              # Check formatting
cargo fix                       # Auto-fix warnings

# Dependencies
cargo add serde --features derive  # Add dependency
cargo update                       # Update deps
cargo audit                        # Security audit
cargo deny check                   # License/advisory check

# Advanced tools
cargo expand                    # Macro expansion
cargo flamegraph               # Profile with flame graph
cargo doc --open               # Generate and open docs
cargo miri test                # Check for UB

# Cross-compilation
rustup target add wasm32-unknown-unknown
cargo build --target wasm32-unknown-unknown
```

## Best Practices

**Idiomatic Rust Patterns**
```rust
// Use iterators over manual loops
let sum: i32 = numbers.iter().filter(|x| **x > 0).sum();

// Prefer combinators for Option/Result
let value = config.get("key")
    .and_then(|v| v.parse().ok())
    .unwrap_or_default();

// Use pattern matching effectively
match result {
    Ok(value) if value > 0 => process(value),
    Ok(_) => handle_zero(),
    Err(e) => return Err(e.into()),
}

// Let-else for early returns
let Some(config) = load_config() else {
    return Err(ConfigError::NotFound);
};
```

**Project Structure**
```
my-project/
├── Cargo.toml
├── src/
│   ├── lib.rs        # Library root
│   ├── main.rs       # Binary entry point
│   ├── error.rs      # Error types
│   └── modules/
│       └── mod.rs
├── tests/            # Integration tests
├── benches/          # Benchmarks
└── examples/         # Example programs
```

**Error Handling**
```rust
use thiserror::Error;

#[derive(Error, Debug)]
pub enum AppError {
    #[error("IO error: {0}")]
    Io(#[from] std::io::Error),

    #[error("parse error: {message}")]
    Parse { message: String },

    #[error("not found: {0}")]
    NotFound(String),
}

pub type Result<T> = std::result::Result<T, AppError>;
```

**Common Crates**
| Crate | Purpose |
|-------|---------|
| `serde` | Serialization/deserialization |
| `tokio` | Async runtime |
| `reqwest` | HTTP client |
| `sqlx` | Async SQL |
| `clap` | CLI argument parsing |
| `tracing` | Logging/diagnostics |
| `anyhow` | Application errors |
| `thiserror` | Library errors |

**CI toolchain**: pin the compiler in a root `rust-toolchain.toml` that Renovate bumps, so a new release's lints arrive as a PR; see [clippy-advanced § Pin the toolchain](../clippy-advanced/REFERENCE.md#pin-the-toolchain).

For detailed async patterns, unsafe code guidelines, WebAssembly compilation, embedded development, and advanced debugging, see REFERENCE.md.

© laurigates · MIT · laurigates/claude-plugins

Similar skills

All skills for Programming languages →

rust-development by other authors comes first.

rust-development sammcj rust-development instructs Claude Code to follow Rust best practices by organizing crates into workspaces, trimming public generics, and cutting build times. CX Codex +1 ★ 173repo stars rust_development vuralserhat86 Guides Rust development with conventions for Tokio runtimes, Axum web services, and strict error handling. CX Codex +1 1installs rust-mcp-development official Awesome Copilot Community rust-mcp-development — a GitHub Copilot plugin for building Model Context Protocol servers in Rust with the official rmcp SDK. Useful when you need your own server for AI agents. ★ 41,430repo stars rust-best-practices apollographql rust-best-practices — a skill that feeds your agent Apollo GraphQL's Rust handbook: borrowing vs cloning, Result-based errors, Clippy lints, tests. CX Codex +1 23,400installs rust-async-patterns Seth Hobson rust-async-patterns — a skill for building and debugging async Rust with Tokio, tasks, channels, streams, and error handling. Use it for concurrent services and async I/O. CX Codex +1 20,625installs rust-mcp-server-generator official github rust-mcp-server-generator is a GitHub Copilot skill that creates a Rust MCP server project with the rmcp SDK. It kicks in when a server needs defined tools, transport, prompts, or resources. CX Codex +1 9,181installs rust-testing affaan-m rust-testing — a skill for writing Rust tests: unit, integration, async, property-based, mocks and coverage. Useful when the project runs on TDD. CX Codex +1 8,400installs

From the same set27

The whole set →
justfile-expert justfile-expert is a Claude Code skill for designing Just recipes, parameters, dependencies, and modules. It supports adding project commands and task automation. CX Codex +1 162installs git-commit-workflow The git-commit-workflow Claude Code skill defines commit-message and staging rules. It helps split related edits into focused commits and review staged changes. CX Codex +1 161installs binary-analysis binary-analysis guides your coding agent in inspecting unknown binaries, running hex dumps, and extracting embedded artifacts. CX Codex +1 146installs shell-expert shell-expert is a Claude Code skill for writing Bash, zsh, and POSIX scripts and composing command-line automation. It activates for shell pipelines and portable scripting tasks. CX Codex +1 141installs clippy-advanced clippy-advanced guides Clippy setup for Rust projects: custom lints, clippy.toml thresholds, suppression rules, and CI check commands. CX Codex +1 107installs playwright-testing The playwright-testing skill guides Playwright E2E work for web apps, including browser coverage, mobile viewports, API checks, and visual snapshots. CX Codex +1 106installs api-testing api-testing — a skill for writing REST and GraphQL API tests with Supertest (TypeScript) and httpx/pytest (Python). Validates status codes, response schemas, auth flows, and error handling. CX Codex +1 106installs cargo-nextest This Claude Code skill runs and filters Rust tests with cargo-nextest. It comes into play for test runs, CI setup, and investigations into slow or flaky tests. CX Codex +1 101installs

Project sponsors

Companies that keep this analytics open