rust-standards

rust-standards is a skill for Claude Code, Codex from kimgoetzke/coding-agent-configs. It costs 17 tokens per session (957 once invoked), scanned A, original, MIT.

A set of guidelines for writing idiomatic Rust, a programming language focused on speed and memory safety. It covers naming, data types, strings, errors, and tests.

In plain words
What is it for?
Use it while writing or reviewing Rust code, especially when choosing names, handling borrowed and owned data, designing types, and adding unit or integration tests.
Why use it?
It helps keep Rust code consistent with common conventions and avoids mistakes such as unnecessary allocations, unclear ownership, and unsafe error handling.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/kimgoetzke/coding-agent-configs/rust-standards
Any agent
npx skills add kimgoetzke/coding-agent-configs --skill rust-standards
Clone the repo
git clone --depth 1 https://github.com/kimgoetzke/coding-agent-configs

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/kimgoetzke/coding-agent-configs/rust-standards.svg)](https://agentmods.dev/skills/kimgoetzke/coding-agent-configs/rust-standards)
Your own site
<a href="https://agentmods.dev/skills/kimgoetzke/coding-agent-configs/rust-standards"><img src="https://agentmods.dev/badge/skills/kimgoetzke/coding-agent-configs/rust-standards.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 957 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00017 $0.00957
Opus 5 $0.00009 $0.00478
Sonnet 5 $0.00003 $0.00191
Haiku 4.5 $0.00002 $0.00096

Measured 4d ago against content hash e55adb2fc420, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rust-standards 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 4d 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/rust-standards/SKILL.md · 98 lines

How it starts

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

Testing

  • Unit tests in #[cfg(test)] modules within each source file
  • Integration tests in tests/ directory

Naming

  • No get_ prefix: fn name() not fn get_name()
  • Iterator convention: iter() / iter_mut() / into_iter()
  • Conversion naming: as_ (cheap &), to_ (expensive), into_ (ownership)
  • Static var prefix: G_CONFIG for static, no prefix for const

Data Types

  • Use newtypes: struct Email(String) for domain semantics
  • Prefer slice patterns: if let [first, .., last] = slice
  • Pre-allocate: Vec::with_capacity(), String::with_capacity()
  • Avoid Vec abuse: use arrays for fixed sizes

Strings

  • Prefer &str over String in function parameters
  • Use String for ownership: return String when transferring ownership
  • Prefer bytes: s.bytes() over s.chars() when ASCII
  • Use Cow<str> when you might need to modify borrowed data
  • Use format! over string concatenation with +
  • Avoid nested iteration: contains() on string is O(n*m)

Error Handling

  • Use ? for all fallible operations
  • unwrap() in tests only, never production
  • expect() only for provably impossible states; the message must justify why it can't fail e.g. expect("regex is valid: validated at compile time")
  • unwrap_or / unwrap_or_else / unwrap_or_default for deliberate fallbacks
  • Assertions for invariants: assert! at function entry

Memory

  • Meaningful lifetimes: 'src, 'ctx not just 'a
  • try_borrow() for RefCell to avoid panic
  • Shadowing for transformation: let x = x.parse()?

Concurrency

  • Identify lock ordering to prevent deadlocks
  • Atomics for primitives, not Mutex for bool/usize
  • Choose memory order carefully: Relaxed/Acquire/Release/SeqCst

Async

  • Sync for CPU-bound; async is for I/O
  • Don't hold locks across await: use scoped guards

Macros

  • Avoid unless necessary: prefer functions/generics
  • Follow Rust syntax: macro input should look like Rust

Deprecated → Better

  • lazy_static!std::sync::OnceLock (since 1.70)
  • once_cell::Lazystd::sync::LazyLock (since 1.80)
  • std::sync::mpsccrossbeam::channel only if you need multi-consumer or better performance under contention; std::sync::mpsc is fine for most use cases
  • failure/error-chainthiserror/anyhow
  • try!()? operator (since 2018)

Read the full file on GitHub · 98 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. 4d ago First seen · 98 lines · 17 tokens per session scan A e55adb2fc420

Subscribe to this mod's changes

rust-standards is a skill published in the GitHub repository kimgoetzke/coding-agent-configs (2 stars, last pushed 15d ago), licensed MIT. It adds 17 tokens to every session and 957 once invoked, about $0.0001 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

codebase-memory

Use the codebase knowledge graph for structural code queries. Triggers on: explore the codebase, understand the architecture, what functions exist, show me the structure, who calls this function, what does X call, trace the call chain, find callers of, show dependencies, impact analysis, dead code, unused functions…

narumiruna/pi-extensions · 98 tokens

using-pi-subagents

Operate pi-subagents jobs safely, including direct-work decisions, least-privilege tool selection, thinking-level selection, delegation, bidirectional messaging, parallel starts, timeout selection, waiting, cancellation, result handling, verification, and writer isolation.

narumiruna/pi-extensions · 54 tokens

skill-creator

Create or update Agent Skills (SKILL.md plus optional scripts, references, or assets). Use when someone asks to design a new Agent Skill, refine an existing one, or structure skills for Pi discovery, packaging, or other Agent Skills-compatible clients.

tmustier/pi-extensions · 54 tokens

pi-ralph-wiggum

Long-running iterative development loops with pacing control and verifiable progress. Use when tasks require multiple iterations, many discrete steps, or periodic reflection with clear checkpoints; avoid for simple one-shot tasks or quick fixes.

tmustier/pi-extensions · 49 tokens

rust-engineer

Acquire expert Rust developer specialisation in rust systems programming, memory safety, and zero-cost abstractions. Masters ownership patterns, async programming, and performance optimisation for mission-critical applications.

sammcj/agentic-coding · 39 tokens

accordion-context-folding

Read this skill if you see {# FOLDED} markers in your context (e.g. {#3f9a2c FOLDED}), or if earlier parts of your context look summarized. Accordion is a desktop tool that may compact older context blocks to keep you under a token budget. The unfold tool restores a folded block (open from your next turn); the recall…

a-Fig/Accordion · 102 tokens