skills/rust-pro/SKILL.md
Rust ownership, borrowing, lifetimes, error handling, async programming, concurrency patterns, and idiomatic Rust. Use when writing, reviewing, or debugging Rust code.
npx skillsauth add melikhanmutlu/web_ar rust-proInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
"In Rust, the compiler is your strictest code reviewer and your most reliable safety net."
// Transfer ownership
fn process(data: Vec<u8>) { /* owns data, dropped at end */ }
// Borrow immutably
fn analyze(data: &[u8]) -> usize { data.len() }
// Borrow mutably
fn transform(data: &mut Vec<u8>) { data.push(0); }
// Return owned data
fn create() -> Vec<u8> { vec![1, 2, 3] }
// Explicit lifetime: output borrows from input
fn first_word(s: &str) -> &str {
s.split_whitespace().next().unwrap_or("")
}
// Struct holding a reference
struct Parser<'a> {
input: &'a str,
position: usize,
}
// When in doubt, make it owned
// Use String instead of &str in structs unless you have a clear lifetime story
let s: &'static str = "hello";use thiserror::Error;
#[derive(Error, Debug)]
pub enum AppError {
#[error("Database error: {0}")]
Database(#[from] sqlx::Error),
#[error("Not found: {entity} with id {id}")]
NotFound { entity: &'static str, id: String },
#[error("Validation failed: {0}")]
Validation(String),
#[error(transparent)]
Unexpected(#[from] anyhow::Error),
}
thiserror for library error types (structured, typed errors)anyhow for application-level error handling (convenient, context-rich).context("what was being done") from anyhow? operator for propagation; avoid explicit match on every Result// Spawning concurrent tasks
let (a, b) = tokio::join!(fetch_users(), fetch_orders());
// Spawning independent tasks
let handle = tokio::spawn(async move {
process(data).await
});
let result = handle.await?;
// Select first to complete
tokio::select! {
result = operation() => handle_result(result),
_ = tokio::time::sleep(Duration::from_secs(5)) => handle_timeout(),
}
tokio::sync::Mutex if you must hold a lock across awaitstokio::task::spawn_blocking for CPU work#[tokio::main] on main, not manual runtime building, unless you need custom configArc<Mutex<T>> for shared mutable state across threadsArc<RwLock<T>> when reads vastly outnumber writesDashMap for concurrent hashmap without manual locking// mpsc: multiple producers, single consumer
let (tx, mut rx) = tokio::sync::mpsc::channel(100);
// oneshot: single value, single send
let (tx, rx) = tokio::sync::oneshot::channel();
// broadcast: multiple consumers, each gets every message
let (tx, _) = tokio::sync::broadcast::channel(100);
// watch: single producer, multiple consumers, latest value only
let (tx, rx) = tokio::sync::watch::channel(initial_value);
par_iter(), par_chunks() for embarrassingly parallel operations// Prefer this
let names: Vec<String> = users.iter().map(|u| u.name.clone()).collect();
// Over this
let mut names = Vec::new();
for u in &users {
names.push(u.name.clone());
}
struct UserId(u64);impl Trait or where T: Trait) over trait objects (dyn Trait) for performance#[inline] sparingly; let the compiler decide in most casessrc/
main.rs or lib.rs
config.rs
error.rs # Custom error types
models/ # Data structures
handlers/ # Request handlers (for web servers)
services/ # Business logic
db/ # Database access
tests/
integration/ # Integration tests
benches/ # Criterion benchmarks
tools
# AI Marketing Suite — Main Orchestrator You are a comprehensive AI marketing analysis and content generation system for Claude Code. You help entrepreneurs, agency builders, and solopreneurs analyze websites, generate marketing content, audit funnels, create client proposals, and build marketing strategies — all from the command line. ## Command Reference | Command | Description | Output | |---------|-------------|--------| | `/market audit <url>` | Full marketing audit (parallel subagents)
testing
# Social Media Content Calendar & Generation You are the social media engine for `/market social <topic/url>`. You generate a complete 30-day content calendar with platform-specific posts, hooks, hashtags, and a content repurposing strategy. Every post is ready to publish or hand to a social media manager. ## When This Skill Is Invoked The user runs `/market social <topic/url>`. If a URL is provided, fetch the site to understand the brand, audience, and content themes. If a topic is provided,
development
# SEO Content Audit ## Skill Purpose Perform a comprehensive SEO audit of a webpage or website, covering on-page SEO, content quality (E-E-A-T), keyword analysis, technical SEO, and content strategy. This skill combines automated analysis via `scripts/analyze_page.py` with expert-level manual review to produce an actionable SEO audit document. ## When to Use - User provides a URL and asks for SEO analysis, audit, or recommendations - User wants to improve organic search rankings and traffic -
tools
# Marketing Report Generator (Markdown Format) ## Skill Purpose Generate a comprehensive, professionally formatted marketing report in Markdown. This skill compiles data from all previous audit and analysis results into a single, client-ready document with scores, findings, recommendations, and a prioritized action plan with revenue impact estimates. ## When to Use - User wants a full marketing report for a client or their own business - User has completed one or more audit skills and wants a