rust-best-practices

rust-best-practices is a skill for Claude Code, Codex from bgauryy/octocode. It costs 47 tokens per session (1,158 once invoked), scanned A, original, MIT.

A guide to writing and restructuring Rust code in the Octocode native workspace. It describes crate responsibilities, allowed dependencies, build settings, lint rules, test layout, and the required Rust toolchain.

In plain words
What is it for?
Use it when adding or moving crates, changing Rust implementation code, adjusting build profiles, or reviewing native Rust changes.
Why use it?
It helps changes fit the workspace architecture and pass its compile, dependency, lint, and test checks.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md.

Good fit Use it when adding or moving crates, changing Rust implementation code, adjusting build profiles, or reviewing native Rust changes.

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

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-best-practices

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/bgauryy/octocode/rust-best-practices"><img src="https://agentmods.dev/badge/skills/bgauryy/octocode/rust-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,158 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.00047 $0.01158
Opus 5.5 $0.00019 $0.00463
Sonnet 5.5 $0.00009 $0.00232
Haiku 4.5 $0.00005 $0.00116

Measured today against content hash dddf0a45f143, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rust-best-practices 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 today.

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-dev/rust-best-practices/SKILL.md · 38 lines

How it starts

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

Rust in octocode-native

One Cargo workspace in packages/octocode-native (paths are relative to it): 17 crates, edition 2024, resolver 3, toolchain = MSRV (rust-toolchain.toml). ARCHITECTURE.md owns crate roles; CRATE_EDGES in crates/runtime/tests/architecture_guards.rs enforces the allowed edges. Folders drop the octocode- prefix; crates/runtime is the octocode-native facade. $DEV is the AGENTS.md task runner. Check a change against each section; return the review result. Adding, splitting or moving crates: crate structure; compile time, rebuilds or profiles: build profiles.

Where code goes

  • A tool's behavior lives in its family crate (crates/tool-*), code two tools share in tools-shared (layers: SHARED_LAYERS), the layers below the tools in runtime-base. The facade keeps admission, dispatch and wiring only: every edit below it recompiles it and the CLI.
  • A family never imports or dev-depends on another family. Pass build-wide values (build identity, clocks, config) down as parameters, never globals.
  • crates/io (octocode_io) solely owns cross-crate primitives: atomic writes, locks, env reads, HTTP clients, cancellation, the request budget, retries, bounded reads, notice. Child processes go through the engine's process_env and tools-shared's bounded_process.
  • Add no Result<_, String> at a crate or module boundary; type an existing one when you change its callers anyway.

Lints that fail the build

  • Workspace [lints] (root Cargo.toml) deny dead and unused code, private interfaces and bounds, clippy::all, unwrap, expect, panic!, todo!, dbg! and undocumented unsafe; unreachable_pub and mod_module_files (name.rs plus name/, never mod.rs) warn, and CI denies warnings. Library lib.rs headers also deny prints (use octocode_io::notice) and warn on lossy as casts outside tests (use try_from).
  • Suppress only with #[expect(lint, reason = "…")] on the smallest item. clippy.toml already lets tests unwrap, expect, panic and print.
  • $DEV lint:rust adds production-only bans from clippy-ratchet.toml, each naming its replacement: fixed durations, sleeps and timeouts, truncate, Command::new, reqwest client construction, unbounded fs reads and non-atomic writes. Older findings sit per crate in clippy-baseline.json, which only shrinks. A site that must stay takes the cfg_attr(octocode_clippy_ratchet, expect(…)) from the toml header.

Read the full file on GitHub · 38 lines

Files

What ships with it

2 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. today First seen · 38 lines · 47 tokens per session scan A dddf0a45f143

Subscribe to this mod's changes

rust-best-practices is a skill published in the GitHub repository bgauryy/octocode (971 stars, last pushed today), licensed MIT. It adds 47 tokens to every session and 1,158 once invoked, about $0.0002 per session on Opus 5.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-12-01.

Related

rust-best-practices compared with skills from other repositories

rust-best-practices next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
rust-best-practicesbgauryy/octocodeSkill971todayMITA47Claude Code, Codex
rust-expert-best-practices-code-reviewwispbit-ai/skillsSkill99mo agononeA66Claude Code, Codex
rust-skillsleonardomso/rust-skillsSkill7815d agoMITA56Claude Code, Codex
814-regulations-iso-25010jabrena/plinthSkill470yesterdayApache-2.0A83Claude Code, Codex
121-java-object-oriented-designjabrena/plinthSkill470yesterdayApache-2.0A107Claude Code, Codex
053-design-simple-rulesjabrena/plinthSkill470yesterdayApache-2.0A86Claude Code, Codex
agent-rust-experttravisjneuman/.claudeSkill1152d agoMITA85Claude Code