con un clic
rust-expert
// Expert Rust idiomatique pour développement CLI/système. Ownership, error handling avec anyhow/thiserror, traits, async Tokio, testing. Utiliser pour coder, reviewer ou refactorer du Rust.
// Expert Rust idiomatique pour développement CLI/système. Ownership, error handling avec anyhow/thiserror, traits, async Tokio, testing. Utiliser pour coder, reviewer ou refactorer du Rust.
Build terminal UIs in Rust with Ratatui. Use when creating TUI applications, immediate-mode rendering, high-performance terminal interfaces, or production Rust CLIs.
Analyze Rust codebase for design patterns, idioms, and anti-patterns. Provides detection, suggestion, and evaluation modes for Rust code quality. Keywords: rust, patterns, analysis, idioms, anti-patterns, code-quality
Security audit toolkit for the ccboard project (Rust/Leptos/Axum stack). Use when auditing authentication flows, API endpoints, WASM security, or reviewing Rust code for unsafe usage and memory safety issues.
Optimize web performance for faster loading and better user experience. Use when asked to "speed up my site", "optimize performance", "reduce load time", "fix slow loading", "improve page speed", or "performance audit".
Expert senior en architecture backend pour accompagner le développement (conception, implémentation, review, refactoring). Architecture hexagonale, DDD, SOLID, clean code, tests. Utiliser pour concevoir de nouvelles features, développer du code, reviewer, refactorer, ou résoudre des problèmes architecturaux.
Store a fix, pattern, or context note in Brain knowledge base (~/.ccboard/insights.db). Use when you want to remember a fix, pattern, decision, or context note across sessions.
| name | rust-expert |
| description | Expert Rust idiomatique pour développement CLI/système. Ownership, error handling avec anyhow/thiserror, traits, async Tokio, testing. Utiliser pour coder, reviewer ou refactorer du Rust. |
| allowed-tools | Read, Grep, Glob, Bash |
| effort | medium |
| tags | ["rust","expert","ownership","async","error-handling"] |
Expert in idiomatic Rust 1.75+ development with focus on CLI/system tools, ownership patterns, error handling, traits, async programming, and testing.
&str over String for function parameters&[T]) over Vec<T> when ownership not neededCow<str> for conditionally owned stringsArc<T> and Arc<Mutex<T>> for thread-safe sharinganyhow::Result<T> for applicationsthiserror for custom error types.context("operation description") with ?? operator or expect() with justificationDebug, Clone, Default, Displaydyn Trait) for runtime polymorphismasync fn, tokio::spawn, tokio::select macro (with !)tokio_stream for async iterationgovernor crate for API throttlingtokio::time::sleepclap with derive macrosserde + toml/yaml for structured configindicatif for progress, colored for stylingSIGINT gracefully, cleanup on exit#[cfg(test)] mod tests { use super::*; }tests/#[should_panic] for expected panicsproptest or quickcheckmold or lld for faster linkingsccache for incremental buildscargo build --release with LTOworkspacecargo fmt, cargo clippy, cargo test/// for public APIs, // with ! for modulessrc/main.rs for binaries, src/lib.rs for librariesThis skill includes detailed patterns and checklists:
Patterns:
patterns/error-handling.md - anyhow, thiserror, Result patternspatterns/ownership.md - &str vs String, Cow, Arc, lifetimespatterns/async-patterns.md - Tokio, futures, async traitspatterns/traits-impl.md - Trait implementation organizationpatterns/testing.md - Test organization and assertionspatterns/cli-patterns.md - clap derive, subcommandsChecklists:
checklists/code-review.md - Pre-commit review checklistchecklists/performance.md - Build optimization checklistAnti-Patterns:
anti-patterns/common-mistakes.md - Frequent Rust mistakesanti-patterns/memory-pitfalls.md - Ownership pitfallsExamples:
examples/rtk-patterns.md - Real-world patterns from rtk project✅ Use for:
❌ Don't use for:
--think for architectural analysis--uc token efficiency modeuse anyhow::{Context, Result};
fn process_file(path: &str) -> Result<()> {
let content = std::fs::read_to_string(path)
.context("Failed to read file")?;
Ok(())
}
// Prefer borrowing
fn print_name(name: &str) { println!("{}", name); }
// Conditionally owned
use std::borrow::Cow;
fn maybe_modify(input: &str, modify: bool) -> Cow<str> {
if modify {
Cow::Owned(input.to_uppercase())
} else {
Cow::Borrowed(input)
}
}
#[tokio::main]
async fn main() -> Result<()> {
let result = tokio::time::timeout(
Duration::from_secs(5),
fetch_data()
).await??;
Ok(())
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_calculation() {
assert_eq!(calculate(2, 3), 5);
}
}