rust-dev

A set of working rules for developing Rust projects, including how to choose the right runtime guidance, inspect repository conventions, and handle errors and dependencies.

In plain words
What is it for?
Creating or reviewing Rust code, fixing compilation problems, managing Cargo dependencies, and working in Rust workspaces while following formatting, lint, and error-handling rules.
Why use it?
It gives coding agents a consistent process for making Rust changes and checking the project's existing rules before editing code. It also prevents them from silently using an unsuitable workflow.

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/onsails/skills/rust-dev
Any agent
npx skills add onsails/skills --skill rust-dev
Clone the repo
git clone --depth 1 https://github.com/onsails/skills

Made for: Claude Code, Codex.

Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,161 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.00057 $0.01161
Opus 5 $0.00028 $0.00580
Sonnet 5 $0.00011 $0.00232
Haiku 4.5 $0.00006 $0.00116

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

Security

Grade A, and why

rust-dev 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 2d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/check_crate_version.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

rust-dev/skills/rust-dev/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 Development

Runtime dispatch

Detect the runtime once, before the workflow:

  • Claude Code (Agent, AskUserQuestion, and Skill tools available) → read runtime-claude.md.
  • OMP (task and ask tools available, with skill://… readable through read) → read skill://rust-dev/runtime-omp.md.
  • Any other tool surface → stop and report that this skill has no dispatch table for the runtime.

The selected file is a prompt asset, not a role declaration. Its implementation and review labels name the exact runtime subagent arguments. If a named agent is unavailable, stop before delegation: never substitute the generic task or general-purpose agent and never implement delegated work inline.

Workflow

For any non-trivial Rust change:

  1. Discover project guidelines — Read CLAUDE.md, AGENTS.md (in repo root and .claude/, .cursor/, .codex/ subdirs), rustfmt.toml, clippy.toml, .clippy.toml, deny.toml, and [workspace.lints] / [lints] sections in Cargo.toml. These rules apply in addition to Core Rules below.

  2. Implement — Delegate through the runtime dispatch table's implementation entry. It rediscovers guidelines, implements, then verifies its own work with cargo clippy --workspace --tests -- -D warnings and cargo test --workspace before reporting done.

  3. Review — Delegate through the dispatch table's review entry after implementation completes. This is mandatory, not optional. Convert findings into TODOs: critical/warning → fix; suggestions → triage.

  4. Fix issues one by one — Delegate each fix through the implementation entry. Do not batch unrelated fixes into one delegation.

  5. Final build — Run cargo build --workspace directly.

Core Rules

  1. Edition 2024: Always edition = "2024" in Cargo.toml
  2. FAIL FAST: Every error MUST propagate with ? or return Err. Logging is NOT handling. See error-handling.md
  3. Dependency versions: Use x.x format (e.g., serde = "1.0"). Find latest with python3 scripts/check_crate_version.py <crate>
  4. Workspace architecture: Root Cargo.toml defines workspace only. Separate crates for lib/cli/client
  5. Error types: thiserror (with backtrace) for libraries, anyhow for binaries/tests
  6. CLI-first config: Never bypass CLI args. Use from_cli_args(), never Default that reads env
  7. No env::set_var in tests: Pass config through function parameters
  8. Async: Use tokio consistently
  9. Visibility: Private (default) > pub(crate) > pub
  10. No magic numbers: Use const or CLI args

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. 2d ago First seen · 88 lines · 57 tokens per session scan A 0882bae23b5b

Subscribe to this mod's changes

rust-dev is a skill published in the GitHub repository onsails/skills (43 stars, last pushed 7d ago), licensed MIT. It adds 57 tokens to every session and 1,161 once invoked, about $0.0003 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-30.