Agent skill

Rust Best Practices

by scott-fryxell in scott-fryxell/brayness

Idiomatic Rust guide based on Apollo GraphQL's best practices handbook.

MITAuto-check passedDevelopment

Install Rust Best Practices

skills CLI
$ npx skills add scott-fryxell/brayness --skill rust-best-practices -a claude-code

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

GitHub CLI
$ gh skill install scott-fryxell/brayness 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/scott-fryxell/brayness.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/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
125
Token cost
~888 tokens
SKILL.md length
358 words
Files
6 (incl. references)
Skills in repo
27
Repo updated
First seen
Licence
MIT

At a glance

Idiomatic Rust guide based on Apollo GraphQL's best practices handbook.

  • Refactoring Rust - ownership and borrowing decisions
  • SKILL.md covers Best Practices Reference and Quick Reference
  • Calls cargo
  • Result error handling

What it does

Rust Best Practices is an agent skill from scott-fryxell/brayness. Idiomatic Rust guide based on Apollo GraphQL's best practices handbook. Use when writing, reviewing, or refactoring Rust - ownership and borrowing decisions, Result error handling, performance, clippy, and tests.

Its SKILL.md is about 890 tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `references/chapter_01.md`, `references/chapter_02.md` and `references/chapter_03.md`). Compatibility notes: Rust 1.70+, Cargo

It sits in Development, covering Refactoring, Linting and formatting and Error handling. It works with Rust and Apollo GraphQL. The repository describes itself as: A harness for the anxious digital mind. A safe place for creatives to keep their creative soul while exploring digital skills. The licence is MIT.

When your agent uses it

  • Refactoring Rust - ownership and borrowing decisions
  • Result error handling

Example prompts

  • “/rust-best-practices”

Requirements

  • Compatibility (from SKILL.md): Rust 1.70+, Cargo
  • 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 71f10e2. 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

    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):

    • github.com

    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

    Rust 1.70+, Cargo

    From compatibility in the SKILL.md frontmatter.

Context cost

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

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

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 scott-fryxell/brayness at commit 71f10e2, republished under its MIT licence (© scott-fryxell). 358 words, ~888 tokens.

Download SKILL.mdSave it as .claude/skills/rust-best-practices/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
rust-best-practices
description
Idiomatic Rust guide based on Apollo GraphQL's best practices handbook. Use when writing, reviewing, or refactoring Rust - ownership and borrowing decisions, Result error handling, performance, clippy, and tests.
allowed-tools
Bash(cargo:*), Bash(rustc:*), Bash(rustfmt:*), Bash(clippy:*), Read, Write, Edit, Glob, Grep
compatibility
Rust 1.70+, Cargo
license
MIT
metadata.author
apollographql
metadata.version
1.1.0

Rust Best Practices

Apply these guidelines when writing or reviewing Rust code. Based on Apollo GraphQL's Rust Best Practices Handbook.

Best Practices Reference

Before reviewing, familiarize yourself with Apollo's Rust best practices. Read ALL relevant chapters in the same turn in parallel. Reference these files when providing feedback:

Trimmed to the chapters that apply here. The only Rust in this workspace is work/realness/tracer, a ~300-line WASM cdylib with no threads, no unsafe, no trait objects, and no published rustdoc API. Apollo's chapters 6-9 (generics and dispatch, type state, comments vs documentation, pointers and Send/Sync) were dropped as inapplicable. Pull them from the upstream handbook if a future crate needs them.

Quick Reference

Borrowing & Ownership
  • Prefer &T over .clone() unless ownership transfer is required
  • Use &str over String, &[T] over Vec<T> in function parameters
  • Small Copy types (24 bytes or less) can be passed by value
  • Use Cow<'_, T> when ownership is ambiguous
Show full SKILL.md (142 more words)Show less
Error Handling
  • Return Result<T, E> for fallible operations; avoid panic! in production
  • Never use unwrap()/expect() outside tests
  • Use thiserror for library errors, anyhow for binaries only
  • Prefer ? operator over match chains for error propagation
Performance
  • Always benchmark with --release flag
  • Run cargo clippy -- -D clippy::perf for performance hints
  • Avoid cloning in loops; use .iter() instead of .into_iter() for Copy types
  • Prefer iterators over manual loops; avoid intermediate .collect() calls
Linting

Run regularly: cargo clippy --all-targets --all-features --locked -- -D warnings

Key lints to watch:

  • redundant_clone - unnecessary cloning
  • large_enum_variant - oversized variants (consider boxing)
  • needless_collect - premature collection

Use #[expect(clippy::lint)] over #[allow(...)] with justification comment.

Testing
  • Name tests descriptively: process_should_return_error_when_input_empty()
  • One assertion per test when possible
  • Use doc tests (///) for public API examples
  • Consider cargo insta for snapshot testing generated output
Comments
  • // comments explain why (safety, workarounds, design rationale)
  • Every TODO needs a linked issue: // TODO(#42): ...

© scott-fryxell, 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 5 other files (references) in skills/rust-best-practices of scott-fryxell/brayness.

  • SKILL.md
  • references/chapter_01.md
  • references/chapter_02.md
  • references/chapter_03.md
  • references/chapter_04.md
  • references/chapter_05.md

Open the folder on GitHubat commit 71f10e2

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 skillscott-fryxell/brayness125—~888Automated safety check: PassMIT
Rust Best Practicesfarm-fe/farm5.6k3 repos~1.1kAutomated safety check: PassMIT
Rust Hygiene Audittsz-org/tsz577—~1.5kAutomated safety check: PassApache-2.0
Rust SkillsJMBeresford/retrom2.1k1 repos~9.5kAutomated safety check: PassMIT
Rust Skillsnoh-rs/nohrs156—~5.3kAutomated safety check: PassMIT
Migrate Core Code to Submodulestinyhumansai/openhuman42k—~2.6kAutomated safety check: PassGPL-3.0

Similar skills

  • 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
  • Run a deep DRY + code-hygiene audit of the Rust workspace and turn the findings into verified, deduplicated, hierarchical GitHub tech-debt issues.

    577 GitHub stars~1.5k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • 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 9 days ago
    DevelopmentAuto-check passed
  • 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
  • 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 yesterday
    DevelopmentAuto-check passed

More from scott-fryxell/brayness

All 27 skills in this repo
  • Logo Finder

    scott-fryxell/brayness

    Find and install brand SVG logos via SVGL (https://svgl.app/) and Wikimedia Commons fallbacks into any project's static asset folder.

    125 GitHub stars~1.1k tokensUpdated 13 days ago
    Auto-check passed
  • Test Coverage

    scott-fryxell/brayness

    Write Vitest specs for Vue 3 JavaScript (Vite Plus, happy-dom, @vue/test-utils) and analyze V8 coverage + Fallow health to prioritize test-first refactors.

    125 GitHub stars~1.6k tokensUpdated 13 days ago
    Auto-check passed
  • Flexible Visual System

    scott-fryxell/brayness

    Derive a project's visual rules from its existing tokens, palette, type scale, logo, and icons (Intake), then generate raw SVG vector graphics from those rules as a small composable set (module…

    125 GitHub stars~1.9k tokensUpdated 13 days ago
    Auto-check passed
  • Hyperframes

    scott-fryxell/brayness

    Create video compositions, animations, title cards, overlays, captions, voiceovers, audio-reactive visuals, and scene transitions in HyperFrames HTML.

    125 GitHub stars~3.2k tokensUpdated 13 days ago
    Auto-check passed
  • Motion Systems

    scott-fryxell/brayness

    A skill your agent uses when designing or implementing motion for web interfaces, including CSS transitions and keyframes, linear() easing design, transform strategy (translate/rotate vs…

    125 GitHub stars~1.7k tokensUpdated 13 days ago
    Auto-check passed
  • Vue Inspect

    scott-fryxell/brayness

    Inspect live Vue 3 component state via agent-browser eval - no Devtools extension, no console.log.

    125 GitHub stars~779 tokensUpdated 13 days ago
    Auto-check passed

Categories

Questions about Rust Best Practices

What does Rust Best Practices do?

Idiomatic Rust guide based on Apollo GraphQL's best practices handbook. Rust Best Practices is an agent skill from scott-fryxell/brayness. Idiomatic Rust guide based on Apollo GraphQL's best practices handbook.

When should I use Rust Best Practices?

Rust Best Practices fits situations like: refactoring Rust - ownership and borrowing decisions; result error handling.

How do I install Rust Best Practices in Claude Code?

Run `npx skills add scott-fryxell/brayness --skill rust-best-practices -a claude-code`. Or copy the skill folder (skills/rust-best-practices in scott-fryxell/brayness) 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 scott-fryxell/brayness --skill rust-best-practices -a codex`. Or copy the skill folder (skills/rust-best-practices in scott-fryxell/brayness) 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 scott-fryxell/brayness --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?

Going by SKILL.md and its folder, Rust Best Practices needs the command-line tools its instructions call (cargo). Its frontmatter pre-approves these tools: Bash(cargo:*), Bash(rustc:*), Bash(rustfmt:*), Bash(clippy:*), Read, Write, Edit, Glob, Grep. Compatibility (from SKILL.md): Rust 1.70+, Cargo.

Does Rust Best Practices access the network?

SKILL.md names 1 domain. As links in the text: github.com. 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 888 tokens (SKILL.md is roughly 3.6k 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 13k 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: Rust Best Practices (farm-fe/farm, 5.6k stars), Rust Hygiene Audit (tsz-org/tsz, 577 stars), Rust Skills (JMBeresford/retrom, 2.1k stars) and Rust Skills (noh-rs/nohrs, 156 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?

scott-fryxell (a GitHub user) maintains it in scott-fryxell/brayness, which has 125 GitHub stars. The repository holds 27 skills in this directory. The repository was last updated on September 28, 2026.

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