rust-expert

rust-expert is a skill for Claude Code from Miaoge-Ge/coding-agent-skills. It costs 93 tokens per session (1,143 once invoked), scanned A, original, MIT.

Guidance for writing and reviewing Rust code, a programming language with strict rules for how data is owned, shared, and accessed. It covers borrowing, lifetimes, traits, asynchronous code, errors, smart pointers, and unsafe code.

In plain words
What is it for?
Use it for Rust development, refactoring, API and trait design, asynchronous code, compiler errors, error types, smart pointers, or reviewing unsafe code.
Why use it?
It helps solve borrow-checker, move, lifetime, and thread-safety errors by addressing the underlying data design. It also encourages deliberate choices about cloning, shared state, and error handling.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the rust-expert plugin — 1 skill shipped together

Good fit Use it for Rust development, refactoring, API and trait design, asynchronous code, compiler errors, error types, smart pointers, or reviewing unsafe code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/miaoge-ge/coding-agent-skills/rust-expert
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 Miaoge-Ge/coding-agent-skills --skill rust-expert
Clone the repo
git clone --depth 1 https://github.com/Miaoge-Ge/coding-agent-skills

Made for: Claude Code.

Or install rust-expert, the plugin that ships this one along with the rest of its 1 skill.

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-expert

README.md
[![agentmods](https://agentmods.dev/badge/skills/miaoge-ge/coding-agent-skills/rust-expert/github.svg)](https://agentmods.dev/skills/miaoge-ge/coding-agent-skills/rust-expert)
Your own site
<a href="https://agentmods.dev/skills/miaoge-ge/coding-agent-skills/rust-expert"><img src="https://agentmods.dev/badge/skills/miaoge-ge/coding-agent-skills/rust-expert/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-expert

Your own site · 80×15
<a href="https://agentmods.dev/skills/miaoge-ge/coding-agent-skills/rust-expert"><img src="https://agentmods.dev/badge/skills/miaoge-ge/coding-agent-skills/rust-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,143 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.
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.00093 $0.01143
Opus 5 $0.00046 $0.00571
Sonnet 5 $0.00019 $0.00229
Haiku 4.5 $0.00009 $0.00114

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

Security

Grade A, and why

rust-expert 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 12d 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.

plugins/rust-expert/skills/rust-expert/SKILL.md · 88 lines

How it starts

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

Rust Expert

Fight the design, not the borrow checker — a borrow error is usually a real aliasing/lifetime problem. Make invalid states unrepresentable, return errors as values, and reach for clone()/unsafe deliberately, never to silence the compiler.

When to Use

  • Writing or refactoring Rust.
  • Borrow-checker, lifetime, move/clone, or Send/Sync errors.
  • Designing traits, generics, error types, or APIs.
  • Async (tokio), iterators, smart pointers, or vetting unsafe.

When NOT to Use

  • Other languages → the relevant language skill.
  • High-level system architecture → software-architect.

Core Principles

1. Ownership & borrowing by design

  • Borrow (&T/&mut T) over cloning; clone() is a real cost you choose, not an error silencer.
  • The rule: many &T xor one &mut T. When it fights you, restructure: narrow scopes, split borrows, index-based access, or interior mutability (Cell/RefCell single-thread, Mutex/RwLock multi-thread).
  • Params take &str/&[T]/impl AsRef<_>; store owned String/Vec<T>. Return owned data or borrow tied to an input lifetime.

2. Errors are values

  • Return Result<T, E>; propagate with ?. Avoid unwrap()/expect() outside tests, main, or provably-infallible spots (and then expect() with a reason).
  • Libraries: typed errors with thiserror (impl std::error::Error, use #[from]). Apps: anyhow::Result with .context("…").
  • Option for absence, Result for failure. Don't panic on recoverable conditions.

3. Model with the type system

  • Enums to make illegal states unrepresentable; newtype pattern for domain values and to add trait impls.
  • Generics + trait bounds by default; dyn Trait (boxed) for heterogeneous collections, plugin points, or smaller code size. Derive Debug/Clone/PartialEq where sensible; impl From for conversions so ? composes.

4. Async & concurrency

  • Pick one runtime (usually tokio). Never block the executor — use async I/O; offload CPU/blocking work to spawn_blocking or a thread pool.
  • Share state with Arc<Mutex<T>>/Arc<RwLock<T>>; hold locks for the shortest possible scope and never across .await. Move ownership across tasks via channels.

Read the full file on GitHub · 88 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. 12d ago First seen · 88 lines · 93 tokens per session scan A 1c9f91f930a9

Subscribe to this mod's changes

rust-expert is a skill published in the GitHub repository Miaoge-Ge/coding-agent-skills (6 stars, last pushed 3mo ago), licensed MIT. It adds 93 tokens to every session and 1,143 once invoked, about $0.0005 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-08-31.

Related

Other skills, from other repositories

Agent Browser Automation

Fast Rust-based headless browser automation CLI with Node.js fallback for AI agents, featuring navigation, clicking, typing, snapshots, and structured commands optimized for agent workflows.

PramodDutta/qaskills · 37 tokens

agent-rust-build-resolver

Rust build, compilation, and dependency error resolution specialist. Fixes cargo build errors, borrow checker issues, and Cargo.toml problems with minimal changes. Use when Rust builds fail.

KunanonJ/ai-skills-hub · 43 tokens

agent-rust-reviewer

Expert Rust code reviewer specializing in ownership, lifetimes, error handling, unsafe usage, and idiomatic patterns. Use for all Rust code changes. MUST BE USED for Rust projects.

KunanonJ/ai-skills-hub · 42 tokens

raspberry-pi-rust-embedded

Production-grade embedded Rust guidelines for Raspberry Pi (bare-metal nostd and Linux embedded std/rppal/embedded-hal). Use when developing low-latency hardware control apps, embedded Rust drivers, Linux GPIO/SPI/I2C/UART software, real-time interrupt handlers, and memory-safe hardware abstractions.

hamzabellouch/agent-skills · 72 tokens

tauri-rust-and-frontend-desktop

Architectural patterns, security IPC, performance optimization, native integration, and production best practices for building cross-platform desktop applications using Tauri (v2) and Rust with modern web frontends (React, Svelte, Vue). Use when designing, building, or optimizing Tauri desktop apps.

hamzabellouch/agent-skills · 68 tokens

develop-like-oxide

Develop the way Oxide (the company) does: RFD-driven written decisions, Rust-heavy hardware/software co-design, rigor with urgency, radical transparency. Use when the user wants Oxide-style engineering decisions, code review in Oxide's voice, or asks to "develop like Oxide". Profiled 2026-07-11 from public sources.

marcusrbrown/dev-like · 77 tokens