Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Mindrally/skills --skill rust -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/rust/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/rust/

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.

rust Fandhe-AI This skill hands your agent a local copy of the official Rust docs: the language, Cargo, rustc, unsafe and async. Useful when you are editing a crate or fighting the borrow checker. CX Codex +1 922installs rust-async-patterns Seth Hobson A skill for building and debugging async Rust with Tokio, tasks, channels, streams, and error handling. Use it for concurrent services and async I/O. CX Codex 20,625installs rust-pro Seth Hobson A Claude Code, Codex, and Cursor subagent for modern Rust 1.75+. It handles async Tokio services, complex lifetimes, lock-free concurrency, and systems programming. CX Codex 1,148installs rust-engineer VoltAgent Community Guides Rust 2021 development focusing on memory safety, zero-cost abstractions, and Miri validation. Handy for systems programming, embedded devices, and async services. 262installs rust-async-internals mohitmishra786 Guides the agent through async Rust internals and debugging: the poll model, Pin and Unpin, tokio scheduling, waker leaks. Useful when a task hangs or stalls. CX Codex +1 467installs rust-systems-programming manutej A skill on systems Rust: ownership, borrowing, threads, async, unsafe and performance. Useful when you write low-level code or port C/C++. CX Codex +1 485installs rust-mcp-development official Awesome Copilot Community A GitHub Copilot plugin for building Model Context Protocol servers in Rust with the official rmcp SDK. Useful when you need your own server for AI agents. ★ 40,418repo stars

From the same set168

python-odoo-cursor-rules A rule set for Python and Odoo development: ORM, XML views, module architecture. Useful when the agent writes ERP code. CX Codex +1 790installs android-development A rule set that keeps your coding agent on track with Kotlin and Android: clean architecture, MVI, Material 3. Useful when generated code drifts in style and layering. CX Codex +1 782installs kysely A skill that gives the agent rules for writing Kysely code: schema typing, joins, transactions, type generation. Useful when your project is TypeScript and SQL. CX Codex +1 780installs github-workflow A rule set that tells your agent how to work with GitHub: pull requests, review comments, Actions workflows, issue templates and branch protection. Useful whenever the agent touches a repo. CX Codex +1 780installs aspnet-core Gives your agent a set of ASP.NET Core conventions: controllers, middleware, caching, JWT and validation. Useful when an API is being written or rewritten. CX Codex +1 776installs gsap Tells your agent how to write GSAP animations: transforms over left/top, stagger, timelines, ScrollTrigger. Useful when the UI stutters on weaker hardware. CX Codex +1 769installs c-sharp Tells the agent how to write C#: naming, async, DI, tests, Blazor and Unity. Useful when the project is .NET and you are tired of restating conventions. CX Codex +1 760installs data-analyst A skill that gives your agent ground rules for pandas, numpy, matplotlib and seaborn work: validated inputs, vectorized code, readable charts. CX Codex +1 759installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor