rust-conventions

rust-conventions is a skill for Claude Code, Codex from tmj-90/gaffer. It costs 115 tokens per session (2,041 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,041 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.02041
Opus 5.5 $0.00046 $0.00816
Sonnet 5.5 $0.00023 $0.00408
Haiku 4.5 $0.00012 $0.00204

Measured 1mo ago against content hash 3a94bf1a7338, 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 1mo 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 · 119 lines

How it starts

The opening of the file, as written. The whole thing — 119 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: mark_ticket_blocked with the exact command a human should run. 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 · 119 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. 1mo ago Changed · +1 lines 3a94bf1a7338
  2. 2mo ago Changed · +47 lines · +23 tokens per session 5e2184620a14
  3. 2mo 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 (1 stars, last pushed 4d ago), licensed Apache-2.0. It adds 115 tokens to every session and 2,041 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

rust-conventions compared with skills from other repositories

rust-conventions next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
rust-conventionstmj-90/gafferSkill14d agoApache-2.0A115Claude Code, Codex
sota-rustmartinholovsky/SOTA-skillsSkill31yesterdayCC-BY-4.0A228Claude Code
cargo-workflowsVersoXBT/claude-initial-setupSkill46mo agoMITA58Claude Code
error-handling-rustVersoXBT/claude-initial-setupSkill46mo agoMITA62Claude Code
ownership-borrowingVersoXBT/claude-initial-setupSkill46mo agoMITA63Claude Code
rust-expertginkida/rustyhandSkill212mo agoMITA22Claude Code, Codex
yoagentyologdev/yoagentSkill382todayMITA66Claude Code, Codex