Installation
npx skills add oakoss/agent-skills --skill rust 38
Installs
Rust
Overview
Rust is a systems programming language focused on safety, concurrency, and performance. The ownership system guarantees memory safety without garbage collection, and the type system enforces thread safety at compile time.
When to use: Systems programming, web services (axum), CLI tools (clap), terminal UIs (ratatui), WebAssembly, performance-critical applications, anything requiring memory safety without runtime overhead.
When NOT to use: Rapid prototyping where compile times matter more than safety, simple scripting tasks, projects where the team has no Rust experience and deadlines are tight.
Quick Reference
| Pattern | API / Tool | Key Points |
|---|---|---|
| Ownership transfer | let b = a; |
a is moved, no longer usable |
| Borrowing | &T / &mut T |
One mutable OR many immutable refs |
| Lifetime annotation | fn f<'a>(x: &'a str) -> &'a str |
Ties output lifetime to input |
| Error propagation | ? operator |
Converts and propagates errors |
| Custom errors | thiserror::Error derive |
Structured error types with Display |
| Ad-hoc errors | anyhow::Result<T> |
Context chaining for applications |
| Async runtime | #[tokio::main] |
Entry point for async programs |
| Spawn task | tokio::spawn(async { }) |
Concurrent async task execution |
| HTTP router | axum::Router::new().route(...) |
Composable routing with extractors |
| Extractors | Json<T>, Path<T>, State<T> |
Type-safe request parsing |
| Serialization | #[derive(Serialize, Deserialize)] |
serde with format-agnostic derives |
| CLI parsing | #[derive(Parser)] |
clap derive API for arg parsing |
| TUI rendering | terminal.draw(|f| { }) |
Immediate-mode ratatui rendering |
| Benchmarking | criterion::Criterion |
Statistical benchmarking framework |
| Dep auditing | cargo deny check |
License, vulnerability, source audit |
| Binary release | cargo dist init |
Cross-platform binary distribution |
| Changelog | release-plz update |
Auto semver bump and changelog |
Common Mistakes
| Mistake | Correct Pattern |
|---|---|
| Returning reference to local variable | Return owned type or use lifetime parameter |
Using unwrap() in library code |
Return Result and let caller decide |
clone() to satisfy borrow checker |
Restructure code to avoid the borrow conflict |
| Blocking in async context | Use tokio::task::spawn_blocking |
| Shared mutable state without sync | Use Arc<Mutex<T>> or channels |
String where &str suffices |
Accept &str in function parameters |
Ignoring must_use warnings |
Handle or explicitly discard with let _ = |
| Large enum variants | Box the large variant to reduce overall size |
async fn in traits without bounds |
Add Send bound or use async-trait crate |
Missing #[tokio::test] on async tests |
Use #[tokio::test] instead of #[test] |
Delegation
- Code exploration: Use
Exploreagent - Architecture review: Use
Taskagent - Code review: Delegate to
code-revieweragent
If the
dockerskill is available, delegate multi-stage container build patterns to it.
If thegithub-actionsskill is available, delegate CI pipeline configuration to it.
If theopenapiskill is available, delegate API specification and code generation to it.
References
- Ownership, borrowing, lifetimes, and type system patterns
- Error handling with Result, Option, thiserror, and anyhow
- Async programming with Tokio runtime and concurrency
- Web APIs and backends with axum, tower, and sqlx
- Terminal user interfaces with ratatui and crossterm
- CLI applications with clap, config, and signal handling
- Testing patterns and criterion benchmarking
- Release pipeline with cargo-deny, cargo-dist, and release-plz
Installs
Security Audit
View Source
oakoss/agent-skills
More from this source
Power your AI Agents with
the best open-source models.
Drop-in OpenAI-compatible API. No data leaves Europe.
Explore Inference APIGLM
GLM 5
$1.00 / $3.20
per M tokens
Kimi
Kimi K2.5
$0.60 / $2.80
per M tokens
MiniMax
MiniMax M2.5
$0.30 / $1.20
per M tokens
Qwen
Qwen3.5 122B
$0.40 / $3.00
per M tokens
How to use this skill
Install rust by running npx skills add oakoss/agent-skills --skill rust in your project directory. Run the install command above in your project directory. The skill file will be downloaded from GitHub and placed in your project.
No configuration needed. Your AI agent (Claude Code, Cursor, Windsurf, etc.) automatically detects installed skills and uses them as context when generating code.
The skill enhances your agent's understanding of rust, helping it follow established patterns, avoid common mistakes, and produce production-ready output.
What you get
Skills are plain-text instruction files — not executable code. They encode expert knowledge about frameworks, languages, or tools that your AI agent reads to improve its output. This means zero runtime overhead, no dependency conflicts, and full transparency: you can read and review every instruction before installing.
Compatibility
This skill works with any AI coding agent that supports the skills.sh format, including Claude Code (Anthropic), Cursor, Windsurf, Cline, Aider, and other tools that read project-level context files. Skills are framework-agnostic at the transport level — the content inside determines which language or framework it applies to.
Chat with 100+ AI Models in one App.
Use Claude, ChatGPT, Gemini alongside with EU-Hosted Models like Deepseek, GLM-5, Kimi K2.5 and many more.