Back to Skills

rust-dev

verified

This skill should be used when working with Rust code, reviewing Rust code, managing Rust dependencies, creating Rust projects, or fixing Rust compilation errors. It provides strict coding standards (especially FAIL FAST error handling), workspace architecture guidance, dependency management automation, and common Rust patterns.

View on GitHub

Marketplace

onsails-cc

onsails/cc

Plugin

rust-dev

Repository

onsails/cc
9stars

rust-dev/skills/rust-dev/SKILL.md

Last Verified

January 20, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/onsails/cc/blob/main/rust-dev/skills/rust-dev/SKILL.md -a claude-code --skill rust-dev

Installation paths:

Claude
.claude/skills/rust-dev/
Powered by add-skill CLI

Instructions

# Rust Development

## Overview

This skill enables writing correct, idiomatic Rust code following strict standards and best practices. It enforces FAIL FAST error handling, manages dependencies properly, provides workspace templates, and offers solutions to common Rust patterns and pitfalls.

## When to Use This Skill

Activate this skill for:

- Adding or updating Rust dependencies
- Creating new Rust projects or workspaces
- Writing or modifying Rust code
- Fixing compilation errors, borrow checker issues, or lifetime problems
- Implementing error handling
- Setting up async/await patterns
- Configuring CLI applications
- Organizing tests and configuration
- Splitting large modules or reorganizing file structure

## Core Standards

**Critical principles to follow in ALL Rust code:**

1. **Edition 2024**: Always use `edition = "2024"` in Cargo.toml
2. **FAIL FAST Error Handling**: NEVER swallow errors - always propagate with `?` or explicit return
3. **Dependency Versioning**: Use `x.x` format (e.g., `serde = "1.0"`)
4. **Workspace Architecture**: Use workspace with single-responsibility crates
5. **Error Types**: thiserror (with backtrace) for libraries, anyhow for binaries/tests
6. **CLI-First Configuration**: Never bypass CLI argument parsing
7. **No env::set_var in Tests**: Pass config through function parameters
8. **Async Runtime**: Use tokio consistently

See `references/standards.md` for complete details on all standards.

## Dependency Management

### Adding Dependencies

When adding a dependency:

1. **Find the latest version** using the bundled script:
   ```bash
   python3 scripts/check_crate_version.py <crate-name>
   ```

2. **Use the x.x version format** from the script output:
   ```toml
   serde = "1.0"
   ```

3. **For workspace projects**, add to `[workspace.dependencies]` in root Cargo.toml:
   ```toml
   [workspace.dependencies]
   serde = { version = "1.0", features = ["derive"] }
   ```

4. **In member crates**, reference workspace dependenc

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
11110 chars