rust-conventions

rust-conventions is a skill for Claude Code, Codex from tmj-90/gaffer. It costs 115 tokens per session (2,033 once invoked), scanned A, original, Apache-2.0.

A set of conventions for writing Rust, a compiled programming language that checks memory ownership and error handling at compile time. It favours explicit types and errors, careful borrowing, and code that passes the project's formatter and linter.

In plain words
What is it for?
It helps add or change Rust modules, APIs, asynchronous code, data types, error enums, traits, and iterators. It covers ownership, borrowing, `Result` errors, feature flags, runtime choices, `clippy`, and `rustfmt`.
Why use it?
Rust code becomes harder to maintain when it relies on unnecessary copies, unchecked failures, or unsafe operations. Matching the crate's existing patterns lets the compiler help prevent invalid states and resource bugs.

Skill for Claude CodeCodex

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

Good fit It helps add or change Rust modules, APIs, asynchronous code, data types, error enums, traits, and iterators. It covers ownership, borrowing, Result errors, feature flags, runtime choices, clippy, and rustfmt.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tmj-90/gaffer/rust-conventions
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 tmj-90/gaffer --skill rust-conventions
Clone the repo
git clone --depth 1 https://github.com/tmj-90/gaffer

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/tmj-90/gaffer/rust-conventions/github.svg)](https://agentmods.dev/skills/tmj-90/gaffer/rust-conventions)
Your own site
<a href="https://agentmods.dev/skills/tmj-90/gaffer/rust-conventions"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/rust-conventions/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-conventions

Your own site · 80×15
<a href="https://agentmods.dev/skills/tmj-90/gaffer/rust-conventions"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/rust-conventions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 115 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,033 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.00115 $0.02033
Opus 5.5 $0.00046 $0.00813
Sonnet 5.5 $0.00023 $0.00407
Haiku 4.5 $0.00012 $0.00203

Measured 16d ago against content hash 5e2184620a14, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rust-conventions 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 16d 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.

runner/skills/rust-conventions/SKILL.md · 118 lines

How it starts

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

Write idiomatic, safe Rust

Rust rewards code that makes ownership and failure explicit and punishes code that fights the compiler with clones, unwrap and unsafe. For the builder and the reviewer of a Rust diff; the crate's config and existing code win over it.

Procedure

  1. Discover the crate's conventions first. Call search_lore for Rust conventions. Read Cargo.toml (edition, rust-version MSRV, [lints]/[workspace.lints], features), rust-toolchain.toml, clippy.toml, rustfmt.toml, deny.toml, .cargo/config.toml and the CI workflow. Identify the error strategy (thiserror enums in libraries, anyhow at the binary edge, or hand-rolled), the async runtime, and the policy on unsafe (#![forbid(unsafe_code)]?). Copy a sibling module and its tests.
  2. Pin the exact commands from CI, Makefile/justfile or xtask (the run-tests and run-lint skills). Use the defaults below only when the repo defines none; match CI's feature flags.
  3. Write the change with the idioms below, then walk the concurrency section for every task, lock, channel, file and outbound call you touched.
  4. Test each acceptance criterion's own behaviour. One test per AC that fails without your change, plus its error path. If the AC involves shared state or persistence, add a test that spawns N threads or tasks against it and asserts the invariant; use proptest for wide inputs (the property-based-test skill).
  5. Verify, then stop. Done when: cargo fmt --check and clippy are clean at CI's level, tests pass with CI's features, public items are documented, and every AC has a test. Record the output with the record-evidence skill; the runner submits the work.

Commands

  • Format: cargo fmt --all -- --check.
  • Lint: cargo clippy --all-targets --all-features -- -D warnings (or CI's feature set).
  • Test: cargo test --all-features (or cargo nextest run where configured; nextest skips doctests, so also run cargo test --doc); one test: cargo test name -- --exact.
  • Docs: cargo doc --no-deps with RUSTDOCFLAGS="-D warnings" if CI sets it.
  • Dependencies: never cargo add/cargo update; a new or bumped crate is a blocker (the dependency-upgrade skill). cargo deny check where CI runs it.
  • Unsafe: cargo +nightly miri test for code with unsafe, only if the repo uses Miri and the nightly toolchain is already installed.

Read the full file on GitHub · 118 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. 16d ago Changed · +47 lines · +23 tokens per session 5e2184620a14
  2. 19d ago First seen · 71 lines · 92 tokens per session scan A e9782d2cf905

Subscribe to this mod's changes

rust-conventions is a skill published in the GitHub repository tmj-90/gaffer (2 stars, last pushed 17d ago), licensed Apache-2.0. It adds 115 tokens to every session and 2,033 once invoked, about $0.0005 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-09-28.

Related

Other skills, from other repositories

sota-rust

State-of-the-art Rust engineering (2026) for writing and auditing Rust code. Covers idiomatic ownership and API design, error handling and panic policy, unsafe discipline with Miri, async/tokio (cancellation safety, structured concurrency, graceful shutdown), security and supply chain (cargo audit/deny/vet, integer…

martinholovsky/SOTA-skills · 199 tokens

cargo-workflows

Manage Rust projects effectively with Cargo workspaces, features, and tooling. Use when the user sets up Cargo workspaces, configures feature flags, writes build.rs scripts, prepares crates for publishing, or uses cargo clippy, cargo fmt, and other Cargo development tools.

VersoXBT/claude-initial-setup · 58 tokens

error-handling-rust

Implement idiomatic Rust error handling with Result, Option, and the ? operator. Use when the user handles errors in Rust, creates custom error types, uses thiserror or anyhow, implements the From trait for error conversion, or asks about Result/Option patterns and error composition strategies.

VersoXBT/claude-initial-setup · 62 tokens

ownership-borrowing

Master Rust's ownership, borrowing, and lifetime system for memory-safe code. Use when the user encounters borrow checker errors, lifetime annotations, needs smart pointers (Box/Rc/Arc), works with move semantics, or asks about Clone vs Copy, ownership transfer, and reference management in Rust.

VersoXBT/claude-initial-setup · 63 tokens

rust-expert

Rust programming expert for ownership, lifetimes, async/await, traits, and unsafe code.

ginkida/rustyhand · 22 tokens

yoagent

Use when building, extending or upgrading an agent on the yoagent Rust crate. Maps each job (tools, policies, verifiers, budgets, sub-agents, plugins from other ecosystems, retries, structured output, tests) to the yoagent feature for it, with tips, pitfalls and what changed per version.

yologdev/yoagent · 66 tokens