rust-coding-guidelines

rust-coding-guidelines is a skill for Claude Code, Codex from heyAyushh/stacc. It costs 44 tokens per session (840 once invoked), scanned A, original, MIT.

A reference of Rust coding conventions for names, data types, strings, memory, errors, concurrency, async code, and library choices.

In plain words
What is it for?
Use it when reviewing code or setting project conventions for naming, conversions, collections, string handling, error propagation, and assertions.
Why use it?
It reduces inconsistent style and helps developers choose idiomatic patterns for common Rust problems.

Skill for Claude CodeCodex

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

Good fit Use it when reviewing code or setting project conventions for naming, conversions, collections, string handling, error propagation, and assertions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/heyayushh/stacc/coding-guidelines
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 coding-guidelines
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-coding-guidelines

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/heyayushh/stacc/coding-guidelines"><img src="https://agentmods.dev/badge/skills/heyayushh/stacc/coding-guidelines.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 840 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.00044 $0.00840
Opus 5 $0.00022 $0.00420
Sonnet 5 $0.00009 $0.00168
Haiku 4.5 $0.00004 $0.00084

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

Security

Grade A, and why

rust-coding-guidelines 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/coding-guidelines/SKILL.md · 106 lines

How it starts

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

Rust Coding Guidelines

Naming (Rust-Specific)

Rule Guideline
No get_ prefix fn name() not fn get_name()
Iterator convention iter() / iter_mut() / into_iter()
Conversion naming as_ (cheap ref), to_ (expensive), into_ (ownership)
Constants SCREAMING_SNAKE_CASE for const/static

Data Types

Rule Guideline
Use newtypes struct Email(String) for domain semantics
Prefer slice patterns if let [first, .., last] = slice
Pre-allocate Vec::with_capacity(), String::with_capacity()
Avoid Vec abuse Use arrays for fixed sizes

Strings

Rule Guideline
Prefer bytes s.bytes() over s.chars() when ASCII
Use Cow<str> When might modify borrowed data
Use write! Over string concatenation with +
Avoid nested iteration contains() on string is O(n·m)

Error Handling

Rule Guideline
Use ? propagation Not try!() macro
expect() over unwrap() When value is guaranteed
Assertions for invariants assert! at function entry

Memory

Rule Guideline
Meaningful lifetimes 'src, 'ctx not just 'a
try_borrow() for RefCell Avoid panic
Shadowing for transformation let x = x.parse()?

Concurrency

Rule Guideline
Identify lock ordering Prevent deadlocks
Atomics for primitives Not Mutex for bool/usize
Choose memory order carefully Relaxed/Acquire/Release/SeqCst

Async

Rule Guideline
Sync threads for CPU-bound Async is for I/O
Don't hold locks across await Use scoped guards

Macros

Rule Guideline
Avoid unless necessary Prefer functions/generics
Follow Rust syntax Macro input should look like Rust

Deprecated → Better

Deprecated Better Since
lazy_static! std::sync::OnceLock Rust 1.70
once_cell::Lazy std::sync::LazyLock Rust 1.80
std::sync::mpsc crossbeam::channel
std::sync::Mutex parking_lot::Mutex
failure/error-chain thiserror/anyhow
try!() ? operator 2018 edition

Read the full file on GitHub · 106 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. 9d ago First seen · 106 lines · 44 tokens per session scan A 51aa2f4b43d3

Subscribe to this mod's changes

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