Agent skill

Rust Conventions

by Goldziher in Goldziher/ai-rulez

Rust code conventions covering edition 2024, cargo fmt/clippy, Result-based error handling, unsafe discipline, async with tokio, API-guideline naming, trait implementations, benchmarking, and…

MITAuto-check passedBackend & APIs

Install Rust Conventions

skills CLI
$ npx skills add Goldziher/ai-rulez --skill rust-conventions -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Goldziher/ai-rulez rust-conventions --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Goldziher/ai-rulez.git skills-src && mkdir -p .claude/skills && cp -r skills-src/internal/builtins/languages/rust/skills/rust-conventions .claude/skills/rust-conventions && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
rust-conventions
GitHub stars
159
Token cost
~746 tokens
SKILL.md length
317 words
Files
1
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Rust code conventions covering edition 2024, cargo fmt/clippy, Result-based error handling, unsafe discipline, async with tokio, API-guideline naming, trait implementations, benchmarking, and…

  • Tasks that involve API design
  • Calls cargo

What it does

Rust Conventions is an agent skill from Goldziher/ai-rulez. Rust code conventions covering edition 2024, cargo fmt/clippy, Result-based error handling, unsafe discipline, async with tokio, API-guideline naming, trait implementations, benchmarking, and security scanning. Load when writing or reviewing Rust code.

Its SKILL.md is about 750 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering API design. It works with Rust. The repository describes itself as: One source of truth for AI assistant configs: 14 built-in presets (Claude, Cursor, Copilot, Codex, Gemini, Xum, …), full-parity custom presets, and distributable plugin bundles… The licence is MIT.

When your agent uses it

  • Tasks that involve API design

Example prompts

  • “/rust-conventions”

What it can do on your machine

Read from SKILL.md and the folder at commit 2dbd6a4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cargo

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • rust-lang.github.io
    • rust-unofficial.github.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Rust Conventions loads about 746 tokens when it runs. Until then it costs about 67 tokens; SKILL.md has 317 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~67
When it runs · the whole SKILL.md, loaded when a task matches
~746

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Goldziher/ai-rulez at commit 2dbd6a4, republished under its MIT licence (© Goldziher). 317 words, ~746 tokens.

Download SKILL.mdSave it as .claude/skills/rust-conventions/SKILL.md (or your agent's skills folder).
name
rust-conventions
description
Rust code conventions covering edition 2024, cargo fmt/clippy, Result-based error handling, unsafe discipline, async with tokio, API-guideline naming, trait implementations, benchmarking, and security scanning. Load when writing or reviewing Rust code.
  • Rust 2024 edition, cargo fmt + clippy -D warnings, zero warnings policy.
  • Result<T, E> with a derive-based error crate (e.g., thiserror) for library errors, a context-adding error crate (e.g., anyhow) for applications. ? for propagation — never .unwrap() in library code.
  • Minimize unsafe — every block needs // SAFETY: comment explaining invariants.
  • Prefer &str over String in params, Cow<'_, str> for conditional ownership, Arc for shared ownership.
  • impl Trait in argument position for static dispatch, dyn Trait for dynamic dispatch when heterogeneous collections needed.
  • Small, focused modules. Use pub(crate) for internal visibility. Workspace inheritance for multi-crate repos.
  • #[cfg(test)] for unit tests, tests/ for integration, a coverage tool (e.g., cargo-llvm-cov) for coverage.
  • Benchmarking: a statistical benchmark harness (e.g., criterion) for microbenchmarks, profile with a flamegraph tool (e.g., cargo flamegraph).
  • Async: tokio runtime, 'static + Send + Sync bounds, tokio::spawn for concurrency.
  • Security: cargo audit for CVE scanning, cargo deny for license and advisory policies.
  • Dependencies: pin versions, commit Cargo.lock, prefer well-maintained crates.
  • Structured logging (spans and events, e.g., the tracing crate) — not println!.
  • API naming: follow as_/to_/into_ conventions for conversions, iter()/iter_mut()/into_iter() for iterators. Getters are field() not get_field(). See Rust API Guidelines.
  • Eagerly implement common traits: Clone, Debug, Default, Eq, PartialEq, Hash, Send, Sync. Use From/AsRef/AsMut for conversions, FromIterator/Extend for collections.
  • Type safety: newtypes for static distinctions, builder pattern for complex construction, bitflags over enums for flag sets. Avoid bool params — use custom types or enums.
  • Constructors: new() as static inherent methods. No out-parameters. Only smart pointers implement Deref/DerefMut.
  • API flexibility: minimize parameter assumptions via generics, make traits object-safe when trait objects may be useful. Let callers decide where to copy and place data.
  • Rustdoc: all public items have doc examples using ? (not unwrap). Document errors, panics, and safety invariants. Hyperlink related items.
  • Future-proofing: seal traits to prevent downstream implementations, keep struct fields private, don't duplicate derived trait bounds on structs. See Rust Design Patterns.
  • Anti-patterns: unwrap(), unguarded unsafe, panics in libraries, Vec/HashMap across FFI.

© Goldziher, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in internal/builtins/languages/rust/skills/rust-conventions of Goldziher/ai-rulez.

Open the folder on GitHubat commit 2dbd6a4

Compare with similar skills

Rust Conventions next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Rust Conventions compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Rust Conventions this skillGoldziher/ai-rulez159—~746Automated safety check: PassMIT
Rust SkillsJMBeresford/retrom2.1k1 repos~9.5kAutomated safety check: PassMIT
Rust Skillsnoh-rs/nohrs156—~5.3kAutomated safety check: PassMIT
API Designaxone-protocol/contracts123—~1.1kAutomated safety check: PassBSD-3-Clause
Rust Best Practicesmajiayu000/spellbook287—~955Automated safety check: PassMIT
Rust Trait API Designhashgraph-online/awesome-codex-plugins1.3k—~929Automated safety check: PassMIT

Similar skills

  • Rust Skills

    JMBeresford/retrom

    Comprehensive Rust coding guidelines with 265 rules across 26 categories.

    2.1k GitHub starsUsed in 1 repo~9.5k tokens
    DevelopmentAuto-check passed
  • Rust Skills

    noh-rs/nohrs

    Comprehensive Rust coding guidelines with 179 rules across 14 categories.

    156 GitHub stars~5.3k tokensUpdated 7 days ago
    DevelopmentAuto-check passed
  • API Design

    axone-protocol/contracts

    Best practices for designing CosmWasm smart contract APIs. An agent skill from axone-protocol/contracts.

    123 GitHub stars~1.1k tokensUpdated 13 days ago
    Backend & APIsAuto-check passed
  • Rust Best Practices

    majiayu000/spellbook

    A skill your agent uses when writing, modifying, or reviewing Rust code.

    287 GitHub stars~955 tokensUpdated today
    Backend & APIsAuto-check passed
  • Rust Trait API Design

    hashgraph-online/awesome-codex-plugins

    Design and review Rust trait APIs, generic bounds, dispatch models, and conversion contracts for clear public interfaces.

    1.3k GitHub stars~929 tokensUpdated today
    Backend & APIsAuto-check passed
  • Performance

    static-web-server/static-web-server

    Optimize or review performance for the Static Web Server (SWS) project — profiling, bottlenecks, resource usage, compression, and caching

    2.4k GitHub stars~3.1k tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from Goldziher/ai-rulez

All 11 skills in this repo
  • AI Rulez

    Goldziher/ai-rulez

    Manage AI assistant governance rules across 52 harnesses (Claude Code, Cursor, Codex, Copilot, Gemini CLI, OpenCode, Devin, and more) using ai-rulez.

    159 GitHub stars~3.1k tokensUpdated today
    Auto-check passed
  • Code Quality Standards

    Goldziher/ai-rulez

    Concrete code-quality thresholds and anti-patterns: 120-char lines, max 20 cyclomatic complexity, max 4 nesting levels, max 50 lines per function, no magic numbers, no global state, composition over…

    159 GitHub stars~486 tokensUpdated today
    Auto-check passed
  • Testing Conventions

    Goldziher/ai-rulez

    How to write a good test: behaviour-describing names (shouldreturnerrorwheninputisempty, givenwhenthen), exact-value assertions over truthiness, snapshot and property-based testing…

    159 GitHub stars~473 tokensUpdated today
    Auto-check passed
  • Vite Plus Conventions

    Goldziher/ai-rulez

    vite+ unified TypeScript toolchain conventions: the vp CLI for package/node management, oxlint/oxfmt, type-aware linting, vitest, rolldown/tsdown bundling, task caching, and migration.

    159 GitHub stars~567 tokensUpdated today
    Auto-check passed
  • Bindings

    Goldziher/ai-rulez

    Cross-language binding architecture rules: bindings as minimal glue, canonical API surface ordering (core, ABI, language), per-language test suites in CI, generated-code discipline, and error/async…

    159 GitHub stars~265 tokensUpdated today
    Auto-check passed
  • Cgo Bindings

    Goldziher/ai-rulez

    cgo conventions for linking Go to a C or Rust static library: import "C" directives, type/string conversion, CString memory management, thread safety, and Go pointer pinning.

    159 GitHub stars~371 tokensUpdated today
    Auto-check passed

Works with

Questions about Rust Conventions

What does Rust Conventions do?

Rust code conventions covering edition 2024, cargo fmt/clippy, Result-based error handling, unsafe discipline, async with tokio, API-guideline naming, trait implementations, benchmarking, and…. Rust Conventions is an agent skill from Goldziher/ai-rulez. Rust code conventions covering edition 2024, cargo fmt/clippy, Result-based error handling, unsafe discipline, async with tokio, API-guideline naming, trait implementations, benchmarking, and security scanning.

When should I use Rust Conventions?

Rust Conventions fits situations like: tasks that involve API design.

How do I install Rust Conventions in Claude Code?

Run `npx skills add Goldziher/ai-rulez --skill rust-conventions -a claude-code`. Or copy the skill folder (internal/builtins/languages/rust/skills/rust-conventions in Goldziher/ai-rulez) into .claude/skills/rust-conventions in your project. Claude Code loads it when a task matches its description.

How do I install Rust Conventions in Codex?

Run `npx skills add Goldziher/ai-rulez --skill rust-conventions -a codex`. Or copy the skill folder (internal/builtins/languages/rust/skills/rust-conventions in Goldziher/ai-rulez) into .agents/skills/rust-conventions in your project. Codex loads it when a task matches its description.

Can I use Rust Conventions in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Goldziher/ai-rulez --skill rust-conventions -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/rust-conventions, .gemini/skills/rust-conventions, .github/skills/rust-conventions and .opencode/skills/rust-conventions in your project.

What does Rust Conventions need to run?

Going by SKILL.md and its folder, Rust Conventions needs the command-line tools its instructions call (cargo).

Does Rust Conventions access the network?

SKILL.md names 2 domains. As links in the text: rust-lang.github.io and rust-unofficial.github.io. This is read from the text; nothing was executed.

Is Rust Conventions safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Rust Conventions use?

Rust Conventions is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Rust Conventions use?

About 746 tokens (SKILL.md is roughly 3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Rust Conventions?

Skills that share tags, products or a category with Rust Conventions: Rust Skills (JMBeresford/retrom, 2.1k stars), Rust Skills (noh-rs/nohrs, 156 stars), API Design (axone-protocol/contracts, 123 stars) and Rust Best Practices (majiayu000/spellbook, 287 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Rust Conventions?

Goldziher (a GitHub user) maintains it in Goldziher/ai-rulez, which has 159 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on October 9, 2026.

Source: Goldziher/ai-rulez on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.