rust-modern-style

rust-modern-style is a skill for Claude Code, Codex from cq27-dev/rag-rat. It costs 37 tokens per session (1,772 once invoked), scanned A, original, MIT.

Rust coding and review guidance for the rag-rat repository. It defines current Rust style, module and import conventions, persistence contracts, and narrow API design.

In plain words
What is it for?
Use it when writing or reviewing Rust modules, functions, constants, persistence code, imports, and public APIs in rag-rat.
Why use it?
It keeps Rust changes consistent with the project’s supported language edition and makes code ownership, side effects, and interfaces easier to understand.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

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

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-modern-style

README.md
[![agentmods](https://agentmods.dev/badge/skills/cq27-dev/rag-rat/rust-modern-style.svg)](https://agentmods.dev/skills/cq27-dev/rag-rat/rust-modern-style)
Your own site
<a href="https://agentmods.dev/skills/cq27-dev/rag-rat/rust-modern-style"><img src="https://agentmods.dev/badge/skills/cq27-dev/rag-rat/rust-modern-style.svg" alt="Measured on agentmods" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,772 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.1 $0.00037 $0.01772
Opus 5 $0.00018 $0.00886
Sonnet 5 $0.00007 $0.00354
Haiku 4.5 $0.00004 $0.00177

Measured 6d ago against content hash 89906fe55b65, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

rust-modern-style 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 6d 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.

.agents/skills/rust-modern-style/SKILL.md · 163 lines

How it starts

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

Rust Modern Style

Use this skill when writing or reviewing Rust in the rag-rat repository. It complements async-specific guidance; this skill owns the workspace's general Rust, module, persistence, and API conventions.

Baseline

  • Target the Rust 2024 edition and the current workspace rust-version; do not add compatibility shims for older compilers that the workspace does not support.
  • Prefer current stable idioms when they make control flow clearer: let-else, inline format args, matches!, is_some_and, and is_none_or.
  • Modern does not mean clever. Prefer explicit match, if let, and early returns over iterator or combinator chains that hide domain states or side effects.
  • Prefer std::sync::OnceLock or LazyLock over new lazy_static! usage.
  • Use &str and slices at borrowed boundaries instead of &String and &Vec<T>.

Imports

Types, traits, enums, and structs may be imported directly. In a mixed or large import group, bring the module in with {self, ..} and qualify free functions, constants, and macros at the call site. This preserves origin information where the code is read.

// Avoid: callables and constants lose their module identity.
use crate::index::graph_index::{
    KeyVersionStamp, LOGICAL_KEY_VERSION, rebuild_logical_symbols,
};

// Prefer: types are direct; operations and constants retain their origin.
use crate::index::graph_index::{self, KeyVersionStamp};

graph_index::rebuild_logical_symbols(...);
let version = graph_index::LOGICAL_KEY_VERSION;

A small, single-purpose import of one function is fine. Apply this rule when an import list mixes roles or makes bare call sites ambiguous, not mechanically to every use.

Modules And Visibility

  • Treat mod.rs as a curated index: module declarations and intentional pub/pub(crate) re-exports. Put implementation in cohesive sibling files.
  • Split by domain job, not arbitrary line count. Keep helpers private and adjacent to the flow they support.
  • Sibling modules should import through super::, not back through their parent's public re-export.
  • Start private and widen only for a real production caller: private, then pub(super), then pub(crate), and pub only for a genuine public boundary.
  • Never widen production visibility solely for a test; colocate the test or use a test-only seam.

Read the full file on GitHub · 163 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. 6d ago First seen · 163 lines · 37 tokens per session scan A 89906fe55b65

Subscribe to this mod's changes

rust-modern-style is a skill published in the GitHub repository cq27-dev/rag-rat (19 stars, last pushed 7d ago), licensed MIT. It adds 37 tokens to every session and 1,772 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 skills, from other repositories

os-rust-backend

Use when working on a Rust backend that follows the Open Software Network house style — the seven-crate Cargo workspace split (domain / services / persistence / providers / config / api / app) shared by os-accounts and os-platform (fellow). Trigger on: scaffolding a new service in this org ("like os-accounts"…

open-software-network/os-clovy · 246 tokens

rust-code-style

Write idiomatic, well-structured Rust for Wassette — single-responsibility design, anyhow error handling, Arc/Mutex for shared state, and the required formatting and linting with cargo +nightly fmt, cargo clippy, and cargo machete. Use when adding or refactoring Rust code in this repository.

microsoft/wassette · 68 tokens

update-keyboard-shortcuts

Audits and synchronizes keyboard shortcuts across docs/keyboardshortcuts.md, crates/regenerator2000-tui/src/ui/dialogkeyboardshortcut.rs, crates/regenerator2000-tui/src/ui/menu.rs, and the view files (viewdisassembly.rs, viewhexdump.rs, viewcharset.rs, viewbitmap.rs, viewblocks.rs, viewsprites.rs).

ricardoquesada/regenerator2000 · 81 tokens

windows-compat

Audit and harden this Rust repo (code-graph-mcp) for Windows correctness: path-spelling drift between producers, the 32,767-char command-line cap, index-key mismatches, and path predicates that assume one ecosystem's layout. Use whenever touching code that builds, compares, prints, or stores a filesystem path; that…

sdsrss/code-graph-mcp · 165 tokens

architecture-audit

Systematic architecture audit and refactoring methodology for Rust + TypeScript codebases. Use when performing refactoring, cleanup, unification, code review, dead code removal, module reorganization, or tech debt elimination. Ensures no naming confusion, semantic overloading, hidden defaults, duplicate logic, or…

org2AI/ORG2 · 70 tokens

coding

Skill "coding" from ricardoquesada/regenerator2000, covering 6502 disassembler expert skills, core context, technical requirements, 1. 6502 logic and 2. rust performance & safety.

ricardoquesada/regenerator2000 · 0 tokens