Rust Patterns

Rust Patterns is a skill for Claude Code, Codex from AmariahAK/atlarix-skills. It costs 2 tokens per session (422 once invoked), scanned A, original, Apache-2.0.

A set of coding guidelines for Rust libraries and services. It covers expected failures, error context, ownership, module structure, feature flags, and tests.

In plain words
What is it for?
Use it when writing or reviewing Rust crates, services, libraries, binaries, and their tests.
Why use it?
It helps distinguish recoverable errors from programming bugs and keeps ownership and module boundaries understandable.

Skill for Claude CodeCodex

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

Good fit Use it when writing or reviewing Rust crates, services, libraries, binaries, and their tests.

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

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 Patterns

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/amariahak/atlarix-skills/rust"><img src="https://agentmods.dev/badge/skills/amariahak/atlarix-skills/rust.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 422 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.00002 $0.00422
Opus 5 $0.00001 $0.00211
Sonnet 5 $0.00000 $0.00084
Haiku 4.5 $0.00000 $0.00042

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

Security

Grade A, and why

Rust Patterns 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 5d 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/SKILL.md · 64 lines

What it actually says

Rust Patterns

When to use this skill

Use this skill when writing Rust crates/services and you want reliable patterns for error handling, module structure, ownership boundaries, and maintainable APIs.

Core patterns

Prefer Result/Option over panics

Panics are for programmer bugs, not expected failures.

Pattern:

  • return Result<T, E> from fallible functions
  • use thiserror/anyhow depending on library vs app

Error context matters

When bubbling errors, add context at boundaries:

  • IO
  • parsing
  • network

Ownership boundaries

Prefer:

  • passing references &T where possible
  • cloning only when it improves clarity or lifetimes become complex

Module layout

Common:

  • src/lib.rs for library
  • src/main.rs for binary
  • src/<module>.rs or src/<module>/mod.rs

Testing

Patterns:

  • unit tests in module files
  • integration tests in tests/
  • avoid relying on global state

Atlarix tool notes

  • Explore: scan Cargo.toml and entry points (main.rs, lib.rs).
  • Build: run cargo test and cargo clippy if configured.
  • Debug: minimize repro; use feature flags intentionally.
  • Review: check error boundaries and public API clarity.

Common mistakes to avoid

  • Using panics for expected failures
  • Exposing internal types publicly without intent
  • Overusing Rc<RefCell<...>> instead of redesigning ownership

Mini-checklist

  • Fallible functions return Result
  • Errors have context
  • Public API is intentional
  • Tests cover error paths
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. 5d ago First seen · 64 lines · 2 tokens per session scan A f424b1e6bf3f

Subscribe to this mod's changes

Rust Patterns is a skill published in the GitHub repository AmariahAK/atlarix-skills (2 stars, last pushed 2d ago), licensed Apache-2.0. It adds 2 tokens to every session and 422 once invoked, about $0.0000 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-09-03.

Related

Other skills, from other repositories

rust-project

Modern Rust project architecture guide for 2025. Use when creating Rust projects (CLI, web services, libraries). Covers workspace structure, error handling, async patterns, and idiomatic Rust best practices.

majiayu000/spellbook · 43 tokens

rust-best-practices

Helps write high-quality, idiomatic Rust code following Microsoft Pragmatic Rust Guidelines. Use when writing, reviewing, optimizing Rust code, or dealing with lifetimes, borrow checker, memory safety, cargo, and async Rust.

majiayu000/spellbook · 51 tokens

rust-programming-expert

Expert-level skill for Rust programming (Rust 2024 / v1.85+). Covers memory safety, async, Axum/SQLx, CLI, and optimization in English and Indonesian.

roedyrustam/vibes-plug · 45 tokens

rust-systems

Rust patterns for CLI tools, backend services, and general application code. Use when working with Rust, Cargo workspaces, axum/tokio services, clap CLIs, async concurrency, or configuring clippy, rustfmt, cargo-nextest, or Cargo.toml.

iliaal/ai-skills · 59 tokens

dcg

Destructive Command Guard - High-performance Rust hook for Claude Code that blocks dangerous commands before execution. SIMD-accelerated, modular pack system, whitelist-first architecture. Essential safety layer for agent workflows.

Dicklesworthstone/destructive_command_guard · 42 tokens

warp

Warp Rust web framework using filters. Covers routing, filters, rejection, WebSocket, and TLS. Use for composable, type-safe Rust APIs. USE WHEN: user mentions "warp", "rust filters", "composable rust api", asks about "warp filters", "warp rejection", "filter composition rust", "rust hyper warp", "warp websocket" DO…

claude-dev-suite/claude-dev-suite · 118 tokens