agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what…
Use when writing Rust or resolving borrow-checker, lifetime, and trait errors. Covers ownership models, error handling with thiserror and anyhow, async with Tokio, and safe abstractions over unsafe code. Trigger on "borrow checker won't let me", "lifetime may not live long
Claude Code
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill rust --agent claude-code
Codex
$ npx skills add nimadorostkar/Claude-Skills-collection --skill rust -a codex -y
Cursor
$ npx skills add nimadorostkar/Claude-Skills-collection --skill rust -a cursor -y
Gemini CLI
$ npx skills add nimadorostkar/Claude-Skills-collection --skill rust -a gemini-cli -y
GitHub Copilot
$ npx skills add nimadorostkar/Claude-Skills-collection --skill rust -a github-copilot -y
OpenCode
$ npx skills add nimadorostkar/Claude-Skills-collection --skill rust -a opencode -y
Windsurf
$ npx skills add nimadorostkar/Claude-Skills-collection --skill rust -a windsurf -y
name: rust description: Use when writing Rust or resolving borrow-checker, lifetime, and trait errors. Covers ownership models, error handling with thiserror and anyhow, async with Tokio, and safe abstractions over unsafe code. Trigger on "borrow checker won't let me", "lifetime may not live long enough", "thiserror or anyhow", "the trait bound is not satisfied". metadata: category: languages version: 1.0.0 tags: [rust, ownership, lifetimes, tokio, error-handling]
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.
1. **Model ownership first** — Decide who owns each value and how long it lives before writing the signature. 2. **Design the error type** — A library's error enum is public API. Enumerate failure modes explicitly. 3. **Implement** — Start with owned values and clones. Optimize to borrows only where profiling or ergonomics justify it. 4. **Constrain generics late** — Write it concrete, then generalize if a second caller appears. 5. **Gate** — `cargo clippy -- -D warnings`, `cargo fmt --check`, `cargo test`, `cargo deny check`.
**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)
}A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory,…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling,…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.