| name | Rust Development |
| description | Complete Rust toolchain with cargo, rustfmt, clippy, and WASM support. Use when writing Rust code, running cargo build/test/clippy, compiling to WASM, or debugging Rust compilation errors. |
Rust Development Skill
Full Rust development environment with stable toolchain, formatters, linters, and WebAssembly compilation.
Capabilities
- Cargo project management (build, run, test)
- Code formatting with rustfmt
- Linting and suggestions with clippy
- LSP support with rust-analyzer
- WebAssembly compilation (wasm32-unknown-unknown)
- Dependency management via Cargo.toml
- Benchmark and documentation generation
- Cross-compilation support
When to Use
- Systems programming
- Performance-critical applications
- WebAssembly modules
- CLI tools development
- Network services
- Embedded programming
When Not To Use
- For WASM graphics with JS interop specifically -- use the wasm-js skill which covers the full WASM+JS architecture
- For CUDA GPU kernel development -- use the cuda skill instead
- For Python-based ML model training -- use the pytorch-ml skill instead
- For general TypeScript/JavaScript development -- standard Claude Code editing suffices
- For Rust WASM build targets already handled by wasm-js -- avoid duplicating configuration
Commands
Project Management
cargo new project-name
cargo init
cargo build
cargo build --release
cargo run
cargo test
cargo bench
cargo doc --open
Quality Tools
cargo fmt
cargo clippy
cargo clippy -- -W clippy::all
cargo check
WebAssembly
cargo build --target wasm32-unknown-unknown --release
wasm-bindgen target/wasm32-unknown-unknown/release/project.wasm --out-dir pkg
Dependencies
cargo add serde
cargo update
cargo tree
Project Structure
project/
├── Cargo.toml # Dependencies and metadata
├── Cargo.lock # Locked versions
├── src/
│ ├── main.rs # Binary entry point
│ └── lib.rs # Library root
├── tests/ # Integration tests
├── benches/ # Benchmarks
└── examples/ # Example code
Cargo.toml Example
[package]
name = "myproject"
version = "0.1.0"
edition = "2021"
[dependencies]
serde = { version = "1.0", features = ["derive"] }
tokio = { version = "1", features = ["full"] }
[dev-dependencies]
criterion = "0.5"
[profile.release]
opt-level = 3
lto = true
Common Patterns
Error Handling
use std::error::Error;
fn main() -> Result<(), Box<dyn Error>> {
let result = risky_operation()?;
Ok(())
}
Async/Await
#[tokio::main]
async fn main() {
let result = async_function().await;
}
Traits
trait Drawable {
fn draw(&self);
}
impl Drawable for Circle {
fn draw(&self) {
println!("Drawing circle");
}
}
Environment
- Toolchain: stable (default)
- Components: rustfmt, clippy, rust-analyzer
- Targets: wasm32-unknown-unknown
- Path: ~/.cargo/bin added to PATH
Related Skills
None currently required. Standard Claude Code tools handle version control and containerisation.
Notes
- Compile times can be significant for large projects
- Use
cargo check for fast iteration
cargo clippy provides excellent suggestions
- WASM builds require wasm-bindgen for JS interop