Agent skill

Rust Best Practices

by pedronauck in pedronauck/skills

Write, review, refactor, or optimize Rust, including ownership, errors, Tokio, traits, tests, benchmarks, Clippy, and documentation.

MITAuto-check passedDevelopment

Install Rust Best Practices

skills CLI
$ npx skills add pedronauck/skills --skill rust-best-practices -a claude-code

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

GitHub CLI
$ gh skill install pedronauck/skills rust-best-practices --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/pedronauck/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/mine/rust-best-practices .claude/skills/rust-best-practices && 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-best-practices
GitHub stars
634
Token cost
~973 tokens
SKILL.md length
344 words
Files
11 (incl. references)
Skills in repo
65
Repo updated
First seen
Licence
MIT

At a glance

Write, review, refactor, or optimize Rust, including ownership, errors, Tokio, traits, tests, benchmarks, Clippy, and documentation.

  • Development work in your project
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Rust Best Practices is an agent skill from pedronauck/skills. Write, review, refactor, or optimize Rust, including ownership, errors, Tokio, traits, tests, benchmarks, Clippy, and documentation. Excludes other languages and architecture unrelated to Rust idioms.

Its SKILL.md is about 970 tokens, which your agent loads only when the skill is triggered. The skill folder holds 11 other files, including reference files (for example `references/async-and-concurrency.md`, `references/clippy-and-linting.md` and `references/coding-style.md`). Compatibility notes: Cargo; honor the repository edition, pinned toolchain, and minimum supported Rust version

It sits in Development. It works with Rust. The repository describes itself as: My personal favorite skills. The licence is MIT.

When your agent uses it

  • Development work in your project

Example prompts

  • “/rust-best-practices”

Requirements

  • Compatibility (from SKILL.md): Cargo; honor the repository edition, pinned toolchain, and minimum supported Rust version
  • Pre-approved tools (allowed-tools): Bash(cargo:*), Bash(rustc:*), Bash(rustfmt:*), Bash(clippy:*), Read, Write, Edit, Glob, Grep

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(cargo:*)
    • Bash(rustc:*)
    • Bash(rustfmt:*)
    • Bash(clippy:*)
    • Read
    • Write
    • Edit
    • Glob
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

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

  • Network

    No URLs in SKILL.md.

    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.

  • Compatibility

    Cargo; honor the repository edition, pinned toolchain, and minimum supported Rust version

    From compatibility in the SKILL.md frontmatter.

Context cost

Rust Best Practices loads about 973 tokens when it runs, and up to ~17k if it reads all its reference files. Until then it costs about 55 tokens; SKILL.md has 344 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~55
When it runs · the whole SKILL.md, loaded when a task matches
~973
With references · SKILL.md plus every file in references/, read only if the agent opens them
~17k

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 pedronauck/skills at commit 0422940, republished under its MIT licence (© pedronauck). 344 words, ~973 tokens.

Download SKILL.mdSave it as .claude/skills/rust-best-practices/SKILL.md (or your agent's skills folder). This skill also uses 10 other files; get the full folder from GitHub.
name
rust-best-practices
description
Write, review, refactor, or optimize Rust, including ownership, errors, Tokio, traits, tests, benchmarks, Clippy, and documentation. Excludes other languages and architecture unrelated to Rust idioms.
allowed-tools
Bash(cargo:*), Bash(rustc:*), Bash(rustfmt:*), Bash(clippy:*), Read, Write, Edit, Glob, Grep
compatibility
Cargo; honor the repository edition, pinned toolchain, and minimum supported Rust version
license
MIT
metadata.version
2.1.0
metadata.domain
language
metadata.triggers
Rust, Cargo, ownership, borrowing, lifetimes, async Rust, tokio, zero-cost abstractions, memory safety, systems programming, traits, generics, error handling…
metadata.author
Pedro Nauck
metadata.github
https://github.com/pedronauck
metadata.repository
https://github.com/pedronauck/skills

Rust Best Practices

Use the existing crate design, edition, rust-toolchain.toml, and Cargo.toml rust-version (MSRV). Reference examples may use newer features: confirm support before adopting them; do not upgrade the toolchain or add a crate just to follow an example.

Read the reference for the Rust concern being changed. A local edit does not require every category, a new test framework, or a workspace-wide audit.

TopicReferenceLoad When
Coding Stylereferences/coding-style.mdNaming, imports, iterators, comments, string handling, macros
Error Handlingreferences/error-handling.mdResult, Option, ?, thiserror, anyhow, custom errors, async errors
Ownership & Pointersreferences/ownership-and-pointers.mdLifetimes, borrowing, smart pointers, Pin, Cow, interior mutability
Traits & Genericsreferences/traits-and-generics.mdTrait design, dispatch, GATs, sealed traits, type state pattern
Async & Concurrencyreferences/async-and-concurrency.mdTokio, channels, streams, shutdown, runtime config, async traits
Sync Concurrencyreferences/concurrency-sync.mdAtomics, Mutex, RwLock, lock ordering, Send/Sync, memory ordering
Testingreferences/testing.mdUnit/integration/doc tests, snapshot, proptest, mockall, benchmarks, fuzz
Performancereferences/performance.mdProfiling, flamegraph, cloning, stack vs heap, iterators, allocation
Clippy & Lintingreferences/clippy-and-linting.mdClippy config, key lints, workspace setup, #[expect] vs #[allow]
Documentationreferences/documentation.mdDoc comments, rustdoc, doc lints, coverage checklist

Engineering floor

  • Borrow or transfer ownership deliberately; clone when independent ownership is needed. Prefer clear ownership over numeric size rules or avoiding every allocation.
  • Handle fallible operations with Result and preserve useful error context. Reserve panic/assertions for violated programmer invariants; validate external input with recoverable errors.
  • Match error types, dispatch, and dependencies to the existing public contract. thiserror, anyhow, Tokio, and third-party synchronization crates are options, not mandatory additions.
  • Keep lock lifetimes short, maintain lock order, and reason about cancellation, shutdown, and spawned-task ownership. Do not hold a synchronous lock across .await.
  • Treat Send/Sync bounds and atomic orderings as correctness properties. Choose weaker ordering only with a valid synchronization argument; benchmark before performance-driven rewrites.
  • Put behavior tests in the suite that owns the invariant. Add type-level, property, fuzz, snapshot, or benchmark tests when that contract or risk warrants them.
  • Run the repository's required scoped format, lint, and test commands; reuse valid evidence. Full workspace/all-feature runs and documentation coverage rules follow project policy. Check feature combinations actually supported by the crate.

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

Files

SKILL.md and 10 other files (references) in skills/mine/rust-best-practices of pedronauck/skills.

  • SKILL.md
  • references/async-and-concurrency.md
  • references/clippy-and-linting.md
  • references/coding-style.md
  • references/concurrency-sync.md
  • references/documentation.md
  • references/error-handling.md
  • references/ownership-and-pointers.md
  • references/performance.md
  • references/testing.md
  • references/traits-and-generics.md

Open the folder on GitHubat commit 0422940

Compare with similar skills

Rust Best Practices 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 Best Practices compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Rust Best Practices this skillpedronauck/skills634—~973Automated safety check: PassMIT
Migrate Core Code to Submodulestinyhumansai/openhuman42k—~2.6kAutomated safety check: PassGPL-3.0
OpenLogi macOS Permissions TriageAprilNEA/OpenLogi23k—~2.5kAutomated safety check: NotesApache-2.0
Rust Best Practicesfarm-fe/farm5.6k3 repos~1.1kAutomated safety check: PassMIT
RTK Rust Design Patternsrtk-ai/rtk83k—~1.9kAutomated safety check: PassApache-2.0
Release Skillsnexmoe/eve4213 repos~3.3kAutomated safety check: PassNone

Similar skills

  • Migrate Core Code to Submodules

    tinyhumansai/openhuman

    Plans and carries out moving non-host-specific code and its tests from the OpenHuman core into vendored tiny submodule libraries, then releases the submodule and re-pins the host.

    42k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Decides whether an OpenLogi device problem on macOS is a privacy-permission (TCC) problem, using agent log lines, and says which identity needs which grant.

    23k GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check: notes
  • Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.

    5.6k GitHub starsUsed in 3 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Describes seven Rust design patterns for the RTK CLI filter modules, with when to use each, RTK examples, and notes on when a pattern is overkill.

    83k GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Release Skills

    nexmoe/eve

    Universal release workflow. An agent skill from nexmoe/eve.

    421 GitHub starsUsed in 3 repos~3.3k tokens
    DevelopmentAuto-check passed
  • Pnpm Engine

    teambit/bit

    Work on the pnpm Rust engine (@pnpm/napi, the pacquet crates) that bit install runs through.

    18k GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed

More from pedronauck/skills

All 65 skills in this repo
  • Deep Review

    pedronauck/skills

    Review branch diffs, working trees, or PRs in depth with defect, polish and cross-contract coverage.

    634 GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Yc Apply

    pedronauck/skills

    Prepare, review, and package Y Combinator application answers and founder-video notes using the live form and verified founder facts.

    634 GitHub stars~1.3k tokensUpdated 24 days ago
    Auto-check passed
  • Guide technical communication for software developers. An agent skill from pedronauck/skills.

    634 GitHub starsUsed in 3 repos~2.3k tokens
    Auto-check passed
  • Tauri V2

    pedronauck/skills

    Tauri v2+ cross-platform app development with Rust backend. An agent skill from pedronauck/skills.

    634 GitHub starsUsed in 2 repos~4.1k tokens
    Auto-check passed
  • Hormozi Ad Factory

    pedronauck/skills

    Generates 150-750+ ad variations using Alex Hormozi's combinatorial Hook x Meat x CTA framework.

    634 GitHub stars~2.1k tokensUpdated 24 days ago
    Auto-check passed
  • Yt Master

    pedronauck/skills

    Plans and improves YouTube ideas, titles, thumbnail concepts, scripts, retention, channel strategy, and metric-based diagnosis.

    634 GitHub stars~736 tokensUpdated 24 days ago
    Auto-check passed

Works with

Categories

Questions about Rust Best Practices

What does Rust Best Practices do?

Write, review, refactor, or optimize Rust, including ownership, errors, Tokio, traits, tests, benchmarks, Clippy, and documentation. Rust Best Practices is an agent skill from pedronauck/skills. Write, review, refactor, or optimize Rust, including ownership, errors, Tokio, traits, tests, benchmarks, Clippy, and documentation.

When should I use Rust Best Practices?

Rust Best Practices fits situations like: development work in your project.

How do I install Rust Best Practices in Claude Code?

Run `npx skills add pedronauck/skills --skill rust-best-practices -a claude-code`. Or copy the skill folder (skills/mine/rust-best-practices in pedronauck/skills) into .claude/skills/rust-best-practices in your project. Claude Code loads it when a task matches its description.

How do I install Rust Best Practices in Codex?

Run `npx skills add pedronauck/skills --skill rust-best-practices -a codex`. Or copy the skill folder (skills/mine/rust-best-practices in pedronauck/skills) into .agents/skills/rust-best-practices in your project. Codex loads it when a task matches its description.

Can I use Rust Best Practices 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 pedronauck/skills --skill rust-best-practices -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-best-practices, .gemini/skills/rust-best-practices, .github/skills/rust-best-practices and .opencode/skills/rust-best-practices in your project.

What does Rust Best Practices need to run?

SKILL.md names no scripts, command-line tools or credentials: Rust Best Practices is instructions for the agent only. Its frontmatter pre-approves these tools: Bash(cargo:*), Bash(rustc:*), Bash(rustfmt:*), Bash(clippy:*), Read, Write, Edit, Glob, Grep. Compatibility (from SKILL.md): Cargo; honor the repository edition, pinned toolchain, and minimum supported Rust version.

Does Rust Best Practices access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Rust Best Practices 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 Best Practices use?

Rust Best Practices is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Rust Best Practices use?

About 973 tokens (SKILL.md is roughly 3.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 16k tokens, read only when the agent opens those files.

What are the alternatives to Rust Best Practices?

Skills that share tags, products or a category with Rust Best Practices: Migrate Core Code to Submodules (tinyhumansai/openhuman, 42k stars), OpenLogi macOS Permissions Triage (AprilNEA/OpenLogi, 23k stars), Rust Best Practices (farm-fe/farm, 5.6k stars) and RTK Rust Design Patterns (rtk-ai/rtk, 83k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Rust Best Practices?

pedronauck (a GitHub user) maintains it in pedronauck/skills, which has 634 GitHub stars. The repository holds 65 skills in this directory. The repository was last updated on September 14, 2026.

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