rust

rust is a skill for Claude Code, Codex from heyAyushh/stacc. It costs 36 tokens per session (967 once invoked), scanned A, original, MIT.

A concise set of Rust practices for code structure, error handling, unsafe blocks, data structures, command-line tools, and tests.

In plain words
What is it for?
Use it while writing or reviewing Rust code, organizing modules, handling recoverable errors, documenting unsafe code, or defining tests and command-line behavior.
Why use it?
It provides a practical checklist for avoiding fragile code and keeping common Rust decisions consistent.

Skill for Claude CodeCodex

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

Good fit Use it while writing or reviewing Rust code, organizing modules, handling recoverable errors, documenting unsafe code, or defining tests and command-line behavior.

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/heyayushh/stacc/rust"><img src="https://agentmods.dev/badge/skills/heyayushh/stacc/rust.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 967 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.00036 $0.00967
Opus 5 $0.00018 $0.00483
Sonnet 5 $0.00007 $0.00193
Haiku 4.5 $0.00004 $0.00097

Measured 9d ago against content hash 564e3a062d64, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

rust 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 9d 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.

configs/stacks/rust/SKILL.md · 97 lines

How it starts

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

Rust Best Practices

Quick Start

Apply these rules by default when touching Rust:

  1. Organize code by feature/module, not by file type
  2. Keep structs small and focused; split large data into composable types
  3. Prefer Result<T, E> for recoverable errors, avoid panic!
  4. Document every unsafe block with a // SAFETY: rationale
  5. Default to Vec/HashMap; pre-allocate when size is known
  6. For CLIs, expose non-interactive flags, stdin/file input, actionable errors, and example-rich help

Workflow (use this order)

  1. Clarify scope: new module, refactor, or review.
  2. Organize by feature/module; keep type + impls together.
  3. Ensure error handling uses Result (avoid panic! except invariants).
  4. Document unsafe blocks with // SAFETY: and minimal scope.
  5. Choose data structures intentionally and pre-allocate when size is known.
  6. For binaries, define the automation contract: flags, stdin, output format, exit codes, and dry-run behavior.
  7. Add or update tests (unit tests + rustdoc examples for public APIs; CLI help/error tests for binaries).

Review Checklist

  • Module layout is feature-driven and cohesive.
  • Result used for recoverable errors; panic! justified.
  • All unsafe blocks have explicit // SAFETY: rationale.
  • No oversized structs; data is composed cleanly.
  • Collections pre-allocated when size is known.
  • CLI surfaces can run unattended and explain retry commands on usage errors.
  • Tests and doc examples cover edge cases.

Sub-Skills

Load these for focused guidance on specific topics:

Skill When to Use
ownership Ownership/borrow errors (E0382, E0597), lifetime design
error-handling Result vs Option, anyhow vs thiserror, custom error types
concurrency Send/Sync errors, threads vs async, shared state design
zero-cost-abstractions Generics vs dyn Trait, object safety, dispatch choice
type-driven-design Newtypes, type state, PhantomData, invalid states
performance Profiling, allocation reduction, cache, parallelism
agent-friendly-cli Rust binaries, clap command trees, diagnostics/codegen tools
anti-patterns Code review, clone/unwrap overuse, idiomatic rewrites
coding-guidelines Naming, style, modern crate recommendations

Read the full file on GitHub · 97 lines

Files

What ships with it

10 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 97 lines · 36 tokens per session scan A 564e3a062d64

Subscribe to this mod's changes

rust is a skill published in the GitHub repository heyAyushh/stacc (3 stars, last pushed 2mo ago), licensed MIT. It adds 36 tokens to every session and 967 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-09-03.