rust · mindrally — Claude Code skill: Rust ownership, tokio, errors
Tells the agent how to write Rust: ownership for memory safety, async on tokio, errors via Result and Option.
npx skills add Mindrally/skills --skill rust -a claude-codeWhat rust does
This skill turns the assistant into a Rust hand. It keeps ownership and low-level systems programming in view instead of writing Rust like typed Python. The payload is a single SKILL.md with rules: modular layout, separate files per concern, mod.rs for interfaces, short focused functions.
Async work is built around tokio — the runtime for tasks and I/O, structured concurrency with clean cancellation, tokio::sync::mpsc channels and RwLock for shared state. Async tests go through tokio::test. Error handling splits by intent: Result<T, E> for recoverable failures, Option<T> for optional values, custom error types where they earn their keep, and ? to propagate.
Performance advice stays concrete: stack over heap, references instead of needless cloning, iterators, profiling to find bottlenecks. Testing covers unit tests plus Quickcheck for property-based checks. One thing to know: the skill installs nothing into your project, it only steers the agent, so tokio and quickcheck still go into your own Cargo.toml.
What it helps with
- split a crate into modules instead of one giant file
- write a tokio task with a clean cancellation path
- decide between Result and Option in a signature
- drop needless clones and move data onto the stack
- add property-based tests with Quickcheck
Example prompts for the agent
- Split this crate into modules and move interfaces into mod.rs
- Rewrite this handler on tokio with an mpsc channel and proper cancellation
- Find the unnecessary cloning here and remove it
How to install rust
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill rust -a claude-code2Manually: put the files in place
~/.claude/skills/rust/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/rust/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill rust -a codex2Manually: put the files in place
.agents/skills/rust/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill rust -a cursor2Manually: put the files in place
.cursor/skills/rust/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills rust2Manually: put the files in place
.github/skills/rust/SKILL.md1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill rust -a gemini-cli2Platform CLI
gemini skills install https://github.com/Mindrally/skills --path rustManually: put the files in place
.devin/skills/rust/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Mindrally/skills --skill rust -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about rust
How do I install the rust skill in Claude?
Run npx skills add Mindrally/skills --skill rust -a claude-code. The skill file lands at ~/.claude/skills/rust/SKILL.md.
What does the rust skill do?
It gives the agent rules for Rust work: ownership and memory safety, module layout, async on tokio, error handling and profiling.
Does the skill pull in any dependencies?
No, it is instructions for the agent only. Libraries it mentions, such as tokio and quickcheck, are added to your project's Cargo.toml.
Source text
SKILL.md · Apache-2.0
--- name: rust description: Expert in Rust development with focus on safety, performance, and async programming metadata: maintainer: Mindrally source: https://github.com/Mindrally/skills --- # Rust You are an expert in Rust development with deep knowledge of systems programming, memory safety, and async patterns. ## Core Principles - Write Rust code with a focus on safety and performance - Adhere to the principles of low-level systems programming - Leverage Rust's ownership model for memory safety - Use proper error handling with Result and Option types ## Code Organization - Organize code with modular structure - Use separate files for different concerns (mod.rs for interfaces) - Follow Rust's module system conventions - Keep functions and methods focused and concise ## Async Programming - Utilize "tokio" as the async runtime for handling asynchronous tasks and I/O operations - Leverage structured concurrency with proper task management and clean cancellation paths - Employ `tokio::sync::mpsc` for multi-producer, single-consumer channels - Use `RwLock` for shared state management - Write unit tests using `tokio::test` for async validation ## Error Handling - Use Result<T, E> for recoverable errors - Use Option<T> for optional values - Implement custom error types when beneficial - Propagate errors with the ? operator - Provide meaningful error messages ## Performance - Prefer stack allocation over heap when possible - Use references to avoid unnecessary cloning - Leverage zero-cost abstractions - Profile code to identify bottlenecks - Use iterators for efficient data processing ## Testing - Write comprehensive unit tests - Use Quickcheck for property-based testing - Test async code with appropriate test macros - Implement integration tests for end-to-end validation ## Security - Implement strict access controls - Validate all inputs thoroughly - Conduct regular vulnerability audits - Follow security best practices for data handling
© Mindrally · Apache-2.0 · Mindrally/skills
Similar skills
All skills for Programming languages →rust by other authors comes first.