Guides writing Rust that satisfies the borrow checker, resolves lifetime/trait errors, and models ownership. Covers thiserror/anyhow error handling, async with Tokio, and safe unsafe abstractions.
Ships in languages. 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.
Write Rust that satisfies the borrow checker by design rather than by fighting it. Ownership is a modeling decision made before the code is written, not a compiler obstacle discovered afterward.
unsafe blocks.Rc/Arc.thiserror for libraries, anyhow for binaries.Send/Sync bounds, and cancellation semantics.unsafe, with documented invariants.clippy::pedantic (or a documented allow-list).#[from] conversions.cargo clippy -- -D warnings, cargo fmt --check, cargo test, cargo deny check.clone() in non-hot-path code is not a defect. Premature borrow optimization produces unreadable lifetimes.anyhow::Result and add context at each layer.unwrap() outside tests and main. Use expect("invariant: ...") where the invariant is genuinely proven.impl Trait in argument position for simple bounds; use named generics when the caller must choose the type.unsafe block gets a // SAFETY: comment stating the invariant that makes it sound.#[non_exhaustive] on public enums you may extend.Library error type:
use thiserror::Error;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum StoreError {
#[error("key not found: {0}")]
NotFound(String),
#[error("storage backend unavailable")]
Unavailable(#[source] std::io::Error),
#[error("value for {key} exceeds {limit} bytes")]
TooLarge { key: String, limit: usize },
}
pub fn get(key: &str) -> Result<Vec<u8>, StoreError> {
std::fs::read(key).map_err(|e| match e.kind() {
std::io::ErrorKind::NotFound => StoreError::NotFound(key.to_owned()),
_ => StoreError::Unavailable(e),
})
}
Async with timeout and cancellation:
use tokio::time::{timeout, Duration};
pub async fn fetch_with_deadline(url: &str) -> anyhow::Result<String> {
let body = timeout(Duration::from_secs(5), reqwest::get(url))
.await
.context("request timed out after 5s")?
.context("request failed")?
.text()
.await?;
Ok(body)
}
Arc<Mutex<T>> is a legitimate answer, not a failure. Contention, not the type, is what costs you.async-trait is still needed for trait objects.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/languages:rustfrom languages
npx claudepluginhub nimadorostkar/claude-skills-collection --plugin languages12 skills in this plugin
/cppUse when writing modern C++ (17/20/23). Covers RAII, smart-pointer ownership, move semantics, ranges, concepts, and eliminating undefined behavior with sanitizers. Trigger on "segfault in my c++ code", "should this be a unique_ptr or shared_ptr", "get rid of the raw new and delete", "asan reports heap-use-after-free"./csharp-dotnetUse when building on .NET 8+ with C# 12. Covers nullable reference types, records, async/await correctness, minimal APIs, dependency injection, and EF Core query performance. Trigger on "async deadlock in my asp.net app", "turn on nullable reference types", "ef core is doing n+1 queries", "set up a minimal api in .net 8". Do not use for tuning the database itself — see the database-performance skill./goUse when writing Go services, CLIs, or libraries. Covers idiomatic error wrapping, goroutine and context discipline, interface design, table-driven tests, and the race detector. Trigger on "goroutine leak", "how should i wrap this error in go", "race detector is flagging this", "write table-driven tests for this". Do not use for designing a CLI's flags and exit codes — see the cli-development skill./java-kotlinUse when writing modern Java (17+) or Kotlin on the JVM. Covers records, sealed interfaces, pattern matching, coroutines, null safety, and JVM performance and memory tuning. Trigger on "migrate this off java 8 style", "convert this to kotlin coroutines", "jvm keeps running out of memory", "gc pauses are killing latency". Do not use for Spring wiring, transactions, or JPA — see the spring-boot skill./phpUse when writing PHP 8.2+ or working in Laravel and Symfony codebases. Covers strict types, enums, readonly classes, attributes, PSR standards, and static analysis with PHPStan. Trigger on "add phpstan to this legacy project", "laravel eloquent is too slow", "upgrade this to php 8 enums and readonly", "add strict types everywhere". Do not use for an injection or auth vulnerability audit — see the security-review skill./pythonUse when writing, reviewing, or modernizing Python 3.11+ code. Produces fully type-annotated modules, async I/O, dataclasses and protocols, pytest suites, and a lint/type gate built on ruff and mypy --strict. Trigger on "add type hints to this", "mypy is complaining", "convert this to asyncio", "set up pytest for this project". Do not use for FastAPI app structure — see the fastapi skill; for dataframe work, see the pandas skill.Other plugins' skills for the same job