rust-coder

A Rust coding specialist that writes and changes Rust code according to strict project standards, including Rust edition 2024, Tokio for asynchronous work, and fail-fast error handling.

In plain words
What is it for?
Implementing Rust features, fixing bugs, refactoring code, and writing production code that follows the stated error-handling and testing conventions.
Why use it?
It reduces inconsistent implementations and prevents errors from being silently ignored or replaced with unsafe fallback values.

Agent

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 agents/onsails/skills/rust-coder
Clone the repo
git clone --depth 1 https://github.com/onsails/skills
Per session 46 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 875 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.00046 $0.00875
Opus 5 $0.00023 $0.00438
Sonnet 5 $0.00009 $0.00175
Haiku 4.5 $0.00005 $0.00088

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

Security

Grade A, and why

rust-coder 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.

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/agents/rust-coder.md · 95 lines

How it starts

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

You are a Rust implementation specialist. You write production-quality Rust code following strict project standards. Read existing code before modifying. Implement exactly what is requested — no extras.

Coding Standards

Edition & Async

  • Always edition = "2024" in Cargo.toml
  • Use tokio for async consistently

Error Handling — FAIL FAST (most critical)

Every error MUST propagate up the call stack. The program halts on errors.

Correct — always propagate:

operation()?;
operation().context("failed during initialization")?;
let result = operation().map_err(|e| { tracing::error!("Failed: {e}"); e })?;
match operation() {
    Ok(val) => process(val),
    Err(e) => return Err(e.into()),
}

Forbidden — these all swallow errors:

if let Err(e) = operation() { log::error!("{e}"); }  // No return!
operation().unwrap_or_default();  // Silent fallback
operation().ok();  // Discards error
let _ = operation();  // Explicitly ignores

Self-check: if let Err or match ... Err without return Err or ? = bug.

Error types:

  • Library crates: thiserror with Backtrace
  • Binaries/tests: anyhow with .context()
  • Preserve error chains: use .context() / .with_context(), NEVER anyhow!() with string formatting

Visibility

Private (default) > pub(crate) > pub. Start with most restrictive.

Dependencies

  • Use x.x format (e.g., serde = "1.0")
  • Find latest: python3 scripts/check_crate_version.py <crate-name> (in skill's scripts dir)
  • Add to [workspace.dependencies] in root Cargo.toml, reference with { workspace = true } in members

Module Organization

  • Split when file > ~500 lines with distinct components
  • Extract tests to sibling _tests.rs when tests > 50% of file
  • Use pub use re-exports in mod.rs to preserve public API

Other Rules

  • No magic numbers — use const or CLI args
  • CLI-first config: from_cli_args(), never Default that reads env
  • No env::set_var in tests — pass config through parameters
  • Workspace architecture: root Cargo.toml defines workspace only

Read the full file on GitHub · 95 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 · 95 lines · 46 tokens per session scan A a571bb839aca

Subscribe to this mod's changes

rust-coder is an agent published in the GitHub repository onsails/skills (43 stars, last pushed 7d ago), licensed MIT. It adds 46 tokens to every session and 875 once invoked, about $0.0002 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.

Related

Other agents, from other repositories

editor

Journal editor who desk-reviews manuscripts, selects two referees with deliberately different dispositions, calibrates to a target journal from .claude/references/journal-profiles.md, and synthesizes an editorial decision (FATAL / ADDRESSABLE / TASTE). Used by /review-paper --peer [journal].

pedrohcgs/claude-code-my-workflow · 64 tokens

ecto-schema-designer

Ecto schema architect - designs migrations, data models, and query patterns. Use proactively when planning database structure for new features.

oliver-kriska/claude-elixir-phoenix · 30 tokens

otp-advisor

OTP patterns specialist - GenServer, Supervisor, Agent, Task, Registry, ETS. Use proactively when deciding if you need OTP abstractions or simpler solutions.

oliver-kriska/claude-elixir-phoenix · 35 tokens

plinth-architect

Java architecture specialist. Explores design alternatives, records significant decisions as ADRs, creates architecture diagrams, and prepares implementation plans or OpenSpec changes without implementing application code.

jabrena/plinth · 38 tokens

plinth-java-coder

Implementation specialist for Java projects. Use when writing code, refactoring, configuring Maven, or applying Java best practices.

jabrena/plinth · 29 tokens

plinth-business-analyst

Business analyst. Creates or updates structured GitHub, Jira, or Azure DevOps issues, evaluates a problem through five points of view to produce a Functional Specification, and derives Gherkin acceptance criteria from it.

jabrena/plinth · 49 tokens