/thrashr888-agent-kit:rust-developmentfrom thrashr888-agent-kit
Guides Rust development with quality gates (fmt, clippy, test), project structure, error handling patterns, and dependency management.
Ships in thrashr888-agent-kit. 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.
None: SKILL.md is the whole skill.
Development patterns for Rust CLI tools and libraries, based on AllBeads and QDOS workflows.
ALL THREE must pass before commits:
cargo fmt -- --check && cargo clippy -- -D warnings && cargo test
Run frequently during development, not just before commits.
# Fast check (no codegen)
cargo check
# Full build
cargo build
# Release build
cargo build --release
# All tests
cargo test
# Specific test
cargo test test_name
# With output
cargo test -- --nocapture
# Single-threaded (for tests with shared state)
cargo test -- --test-threads=1
# Format code
cargo fmt
# Check formatting without changing
cargo fmt -- --check
# Lint with warnings as errors
cargo clippy -- -D warnings
# Auto-fix clippy suggestions
cargo clippy --fix --allow-dirty
# Debug build
cargo run -- [args]
# Release build
cargo run --release -- [args]
# With specific features
cargo run --features "feature1,feature2" -- [args]
Standard Rust project layout:
project/
├── Cargo.toml # Package manifest
├── Cargo.lock # Dependency lock
├── src/
│ ├── main.rs # Binary entry point
│ ├── lib.rs # Library root (if both bin and lib)
│ └── module/
│ └── mod.rs
├── tests/ # Integration tests
├── benches/ # Benchmarks
└── examples/ # Example binaries
anyhow)use anyhow::{Context, Result};
fn main() -> Result<()> {
let config = load_config()
.context("Failed to load configuration")?;
Ok(())
}
thiserror)use thiserror::Error;
#[derive(Error, Debug)]
pub enum MyError {
#[error("Invalid input: {0}")]
InvalidInput(String),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
}
# Add dependency
cargo add serde --features derive
# Add dev dependency
cargo add --dev tokio-test
# Update dependencies
cargo update
# Check for outdated
cargo outdated # requires cargo-outdated
For multi-crate projects:
# Cargo.toml (workspace root)
[workspace]
members = ["crate1", "crate2"]
resolver = "2"
[workspace.dependencies]
serde = { version = "1.0", features = ["derive"] }
# Build with debug info for profiling
cargo build --release
# Time compilation
cargo build --timings
# Check binary size
cargo bloat --release # requires cargo-bloat
Faster linking times:
# .cargo/config.toml
[target.'cfg(target_os = "linux")']
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
Install: sudo apt install mold or brew install mold
Cache compiler artifacts across builds:
cargo install --locked sccache
export RUSTC_WRAPPER=sccache
# Add to shell profile for persistence
echo 'export RUSTC_WRAPPER=sccache' >> ~/.zshrc
Reduce boilerplate for common derives:
macro_rules! auto_derived {
( $( $item:item )+ ) => {
$(
#[derive(Debug, Clone, PartialEq, Eq)]
$item
)+
};
}
// Usage
auto_derived! {
pub struct User {
id: i64,
name: String,
}
pub struct Config {
host: String,
port: u16,
}
}
Add Serialize, Deserialize to the macro if using serde.
pub struct Config {
host: String,
port: u16,
}
impl Config {
pub fn builder() -> ConfigBuilder {
ConfigBuilder::default()
}
}
#[derive(Default)]
pub struct ConfigBuilder {
host: Option<String>,
port: Option<u16>,
}
impl ConfigBuilder {
pub fn host(mut self, host: impl Into<String>) -> Self {
self.host = Some(host.into());
self
}
pub fn port(mut self, port: u16) -> Self {
self.port = Some(port);
self
}
pub fn build(self) -> Result<Config, &'static str> {
Ok(Config {
host: self.host.ok_or("host required")?,
port: self.port.unwrap_or(8080),
})
}
}
pub struct UserId(pub i64);
pub struct Email(String);
impl Email {
pub fn new(s: impl Into<String>) -> Result<Self, &'static str> {
let s = s.into();
if s.contains('@') {
Ok(Self(s))
} else {
Err("invalid email")
}
}
}
For VS Code with rust-analyzer:
// .vscode/settings.json
{
"rust-analyzer.check.command": "clippy",
"rust-analyzer.cargo.features": "all"
}
DON'T:
.unwrap() in library code (use ? instead)cargo fmt before commitsDO:
Result<T, E> for fallible operations#[must_use] for important return valuesWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (thrashr888/thrashr888-agent-kit) — no native marketplace selected
npx claudepluginhub p/thrashr888-thrashr888-agent-kit21 skills in this plugin
/agent-ready-engineeringMake codebases ready for reliable human and agent work./building-local-ai-appsDesign patterns for local-first AI desktop apps — provider abstraction (Ollama / OpenAI-compatible gateways), RAG retrieval and ingestion hygiene, citation UX that loops back to sources, streaming and scoped cancellation, chat-loop details, and demo-corpus design. Use when building or reviewing a local AI app, a RAG/notebook product, chat UX, or preparing AI product demos. Distilled from Alchemy (a local NotebookLM clone)./copy-reviewReview user-facing copy (websites, release notes, README, in-app strings) for machine-sounding writing, then codify the owner's voice in a repo WRITING.md. Use when asked to check copy for AI-isms, make text "read human", review marketing or landing-page text, fix writing that "sounds like AI", or set up a writing style guide. Not for project documentation structure (plans/specs/RFCs) — that's style-docs./debugging-tauri-appsFind out why a Tauri app crashed, froze, or failed silently — macOS crash reports, the unified log, the debug bridge's error history, panic hooks, and the capture a shipped app needs to have. Use when a Tauri app misbehaves and the terminal shows nothing, or when adding error/crash logging to one./driving-tauri-appsAutomate, inspect, and verify a running Tauri app with tauri-browser — DOM snapshots, ref-based clicks, React-safe fills, screenshots, direct Tauri command invokes, and demo-data seeding. Use when driving a Tauri app for testing, screenshots, demo setup, or end-to-end verification of app changes./github-releasesCreate releases for Rust CLI tools, macOS apps, Python/uv projects, and Next.js apps. Use when asked to release, tag, ship, publish, or deploy any project.