mdvs: Skill for Claude Code

.claude/skills/rust/SKILL.md

rust is a skill for Claude Code from edochi/mdvs. It costs 32 tokens per session (1,010 once invoked), scanned A, original, MIT.

A set of conventions for writing, reviewing, and changing Rust code. It covers Rust error handling, ownership, types, tests, and common mistakes.

In plain words
What is it for?
Use it when an agent creates, reviews, or modifies Rust code, especially code involving errors, borrowed data, custom types, or tests.
Why use it?
It gives coding agents consistent rules for avoiding unsafe error handling, unnecessary copying, and other Rust-specific problems.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is edochi/mdvs's own configuration. It tells Claude Code how to work on mdvs itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mdvs configures →

Reuse

Borrowing it

Nothing to install: this file belongs to edochi/mdvs. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/edochi/mdvs/main/.claude/skills/rust/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/edochi/mdvs

Made for: Claude Code.

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/edochi/mdvs/rust/github.svg)](https://agentmods.dev/skills/edochi/mdvs/rust)
Your own site
<a href="https://agentmods.dev/skills/edochi/mdvs/rust"><img src="https://agentmods.dev/badge/skills/edochi/mdvs/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/edochi/mdvs/rust"><img src="https://agentmods.dev/badge/skills/edochi/mdvs/rust.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,010 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.00032 $0.01010
Opus 5.5 $0.00013 $0.00404
Sonnet 5.5 $0.00006 $0.00202
Haiku 4.5 $0.00003 $0.00101

Measured 10d ago against content hash 8e047ca4aaf2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 10d 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.

.claude/skills/rust/SKILL.md · 94 lines

How it starts

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

Rust Coding Conventions

Error Handling

  • Return Result<T, E> for fallible operations
  • Use thiserror with #[derive(Error)] for library error enums. Structure: variant name describes the failure, #[error("...")] format string includes diagnostic context (sizes, IDs), use #[from] for transparent wrapping of upstream errors
  • Propagate with ? operator — avoid match chains for error forwarding
  • Never use .unwrap() or .expect() outside of tests
  • anyhow for binary/CLI code where specific error types don't matter; never in library crates

Borrowing & Ownership

  • Prefer &T over .clone() unless ownership transfer is required
  • Use &str over String, &[T] over Vec<T> in function parameters
  • Small Copy types (<=24 bytes) can be passed by value
  • Use Cow<'_, T> when ownership is ambiguous at compile time
  • If you're adding .clone() to satisfy the borrow checker, step back and reconsider the data flow

Type Design

  • Use newtypes for semantic distinction: pub struct UserId(pub Uuid), pub struct Port(pub u16)
  • Derive ordering: Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize — include only what's semantically correct
  • Copy for small value types (IDs, enums). Clone but not Copy for larger types
  • Implement Display manually when the type appears in logs or user-facing output

Documentation Style

  • /// doc comments on all public types, functions, and enum variants — explain what and how
  • // inline comments only to explain why (safety invariants, workarounds, design rationale)
  • Function docs should include format specs when relevant (e.g., wire format, encoding details)
  • Group related constants with // --- Section Name --- separators
  • Every TODO needs a linked issue: // TODO(#42): description
  • No module-level //! doc comments unless the module is a public API entry point

Testing Conventions

  • Tests live inline: #[cfg(test)] mod tests { } at the bottom of each module
  • Test naming: snake_case_description — be descriptive (e.g., buffer_duplicate_insert_ignored)
  • For serialization testing, use round-trip helpers that encode then decode and assert equality
  • #[tokio::test] for async tests — always with timeouts
  • One assertion per test when possible; multiple related assertions are fine if testing one logical behavior
  • Test error conditions explicitly — assert the specific error variant, not just "is error"
  • Use polling with backoff for async assertions, never fixed sleep

Read the full file on GitHub · 94 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. 10d ago First seen · 94 lines · 32 tokens per session scan A 8e047ca4aaf2

Subscribe to this mod's changes

rust is a skill published in the GitHub repository edochi/mdvs (27 stars, last pushed 11d ago), licensed MIT. It adds 32 tokens to every session and 1,010 once invoked, about $0.0001 per session on Opus 5.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-10-05.

Related

Other skills, from other repositories

rust-check

Run cargo check on the current Rust project to find compile errors.

Hmbown/CodeWhale · 15 tokens

dd-code-generation

Use pup CLI for immediate Datadog operations or generate code for integration into applications.

DataDog/pup · 16 tokens

rust-crate-ci

Load before editing any Rust crate in this repo (currently runners/swarm-sandbox-runner). Covers the mandatory local validation gate, common rustfmt/clippy pitfalls, and Windows-specific Rust correctness patterns that CI enforces but are hard to catch locally without a Windows toolchain.

ZaxbyHub/opencode-swarm · 60 tokens

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

pixiv-cli-native

Change or validate pixiv-cli Rust ugoira, cgo/FFI, committed static libraries, vendored dependencies, Linux ABI, and native runner evidence. Use when native sources, library hashes, target toolchains, or encoder behavior change; not for routine Go-only or documentation edits.

FlanChanXwO/pixiv-cli · 64 tokens

codemark

Manage structural code bookmarks that survive refactoring. Use when the user says "remember this", "bookmark this", "save this location", "load my bookmarks", "what do I have bookmarked", "mark this code", "codemark", or when starting a new session and needing to reload context from a previous session. Also use…

DanielCardonaRojas/codemark · 97 tokens