rust

rust is a skill for Claude Code, Codex from nimadorostkar/Claude-Skills-collection. It costs 42 tokens per session (977 once invoked), scanned A, original, MIT.

A Rust coding guide for libraries, services, and command-line tools. It explains ownership, borrowing, lifetimes, traits, error handling, asynchronous code, and safe use of unsafe code.

In plain words
What is it for?
Use it to build Rust software, fix borrow-checker or lifetime problems, design errors, write Tokio-based async code, and review unsafe blocks.
Why use it?
It helps resolve compiler errors and design code that is memory-safe, predictable, and easier to maintain.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to build Rust software, fix borrow-checker or lifetime problems, design errors, write Tokio-based async code, and review unsafe blocks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nimadorostkar/claude-skills-collection/rust
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add nimadorostkar/Claude-Skills-collection --skill rust
Clone the repo
git clone --depth 1 https://github.com/nimadorostkar/Claude-Skills-collection

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rust

README.md
[![agentmods](https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/rust/github.svg)](https://agentmods.dev/skills/nimadorostkar/claude-skills-collection/rust)
Your own site
<a href="https://agentmods.dev/skills/nimadorostkar/claude-skills-collection/rust"><img src="https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/rust/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rust

Your own site · 80×15
<a href="https://agentmods.dev/skills/nimadorostkar/claude-skills-collection/rust"><img src="https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/rust.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 977 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00042 $0.00977
Opus 5 $0.00021 $0.00489
Sonnet 5 $0.00008 $0.00195
Haiku 4.5 $0.00004 $0.00098

Measured 8d ago against content hash bc65541b2eda, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

rust scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/languages/rust/SKILL.md · 110 lines

How it starts

The opening of the file, as written. The whole thing — 110 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Rust

Purpose

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.

When to Use

  • Building Rust libraries, services, or CLI tools.
  • Resolving lifetime, borrow, or trait-bound errors.
  • Designing error types for a library versus an application.
  • Writing async Rust with Tokio.
  • Auditing or minimizing unsafe blocks.

Capabilities

  • Ownership and borrowing design: when to clone, when to borrow, when to use Rc/Arc.
  • Error modeling: thiserror for libraries, anyhow for binaries.
  • Trait design, generic bounds, and trait objects.
  • Async runtimes, Send/Sync bounds, and cancellation semantics.
  • Safe encapsulation of unsafe, with documented invariants.

Inputs

  • Crate or module source.
  • Edition and MSRV.
  • Whether the artifact is a library (stable public API) or a binary.

Outputs

  • Code that compiles with zero warnings under clippy::pedantic (or a documented allow-list).
  • Explicit error enums with #[from] conversions.
  • Tests including compile-fail tests for API misuse where warranted.

Workflow

  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. Gatecargo clippy -- -D warnings, cargo fmt --check, cargo test, cargo deny check.

Best Practices

  • A clone() in non-hot-path code is not a defect. Premature borrow optimization produces unreadable lifetimes.
  • Libraries return concrete error enums; binaries use anyhow::Result and add context at each layer.
  • Never unwrap() outside tests and main. Use expect("invariant: ...") where the invariant is genuinely proven.
  • Prefer impl Trait in argument position for simple bounds; use named generics when the caller must choose the type.
  • Every unsafe block gets a // SAFETY: comment stating the invariant that makes it sound.
  • Use #[non_exhaustive] on public enums you may extend.

Read the full file on GitHub · 110 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 110 lines · 42 tokens per session scan A bc65541b2eda

Subscribe to this mod's changes

rust is a skill published in the GitHub repository nimadorostkar/Claude-Skills-collection (26 stars, last pushed 24d ago), licensed MIT. It adds 42 tokens to every session and 977 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

pinocchio-development

Comprehensive guide for building high-performance Solana programs using Pinocchio - the zero-dependency, zero-copy framework. Covers account validation, CPI patterns, optimization techniques, and migration from Anchor.

sendaifun/skills · 44 tokens

neo-rust

Use this skill when writing, refactoring, debugging, or auditing Rust code. Trigger for .rs files, Cargo projects, ownership/borrowing/lifetime issues, Result/Option error handling, unnecessary clone/performance work, unsafe code review, or modern Rust architecture.

Benknightdark/neo-skills · 58 tokens

rust-api-guidelines

Enforces the official Rust API Guidelines (https://rust-lang.github.io/api-guidelines/) when writing, reviewing, or refactoring Rust library code. Use this skill whenever you are writing new Rust structs, enums, traits, functions, or modules that form a public API — including when designing error types, implementing…

qiao/rust-api-guidelines-skill · 124 tokens

polars

High-performance DataFrame library for Python ETL, analytics, and pandas migration. Use for expression-based data manipulation with lazy query optimization, parallel execution, streaming out-of-core processing, Arrow interoperability, and optional GPU execution.

K-Dense-AI/scientific-agent-skills · 47 tokens

rust-engineer

Writes, reviews, and debugs idiomatic Rust code with memory safety and zero-cost abstractions. Implements ownership patterns, manages lifetimes, designs trait hierarchies, builds async applications with tokio, and structures error handling with Result/Option. Use when building Rust applications, solving ownership or…

Jeffallan/claude-skills · 120 tokens

rust-learner

Learn Rust language features and crate updates. Use when user asks about Rust version changelog, what's new in Rust, crate updates, Cargo.toml dependencies, tokio/serde/axum features, or any Rust ecosystem questions.

actionbook/actionbook · 51 tokens