Rust Best Practices
scott-fryxell/brayness
Idiomatic Rust guide based on Apollo GraphQL's best practices handbook.
Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.
$ npx skills add farm-fe/farm --skill rust-best-practices -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install farm-fe/farm rust-best-practices --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/farm-fe/farm.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/rust-best-practices .claude/skills/rust-best-practices && rm -rf skills-srcUse ~/.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/
Install the "rust-best-practices" agent skill from https://github.com/farm-fe/farm/tree/main/.agents/skills/rust-best-practices into .claude/skills/rust-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "rust-best-practices", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/farm-fe/farm/tree/main/.agents/skills/rust-best-practicesType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add farm-fe/farm --skill rust-best-practices -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install farm-fe/farm rust-best-practices --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/farm-fe/farm.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/rust-best-practices .agents/skills/rust-best-practices && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "rust-best-practices" agent skill from https://github.com/farm-fe/farm/tree/main/.agents/skills/rust-best-practices into .agents/skills/rust-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "rust-best-practices", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add farm-fe/farm --skill rust-best-practices -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install farm-fe/farm rust-best-practices --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/farm-fe/farm.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/rust-best-practices .cursor/skills/rust-best-practices && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "rust-best-practices" agent skill from https://github.com/farm-fe/farm/tree/main/.agents/skills/rust-best-practices into .cursor/skills/rust-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "rust-best-practices", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/farm-fe/farm.git --path .agents/skills/rust-best-practices--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add farm-fe/farm --skill rust-best-practices -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install farm-fe/farm rust-best-practices --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/farm-fe/farm.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/rust-best-practices .gemini/skills/rust-best-practices && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "rust-best-practices" agent skill from https://github.com/farm-fe/farm/tree/main/.agents/skills/rust-best-practices into .gemini/skills/rust-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "rust-best-practices", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install farm-fe/farm rust-best-practicesInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add farm-fe/farm --skill rust-best-practices -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/farm-fe/farm.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/rust-best-practices .github/skills/rust-best-practices && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "rust-best-practices" agent skill from https://github.com/farm-fe/farm/tree/main/.agents/skills/rust-best-practices into .github/skills/rust-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "rust-best-practices", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add farm-fe/farm --skill rust-best-practices -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install farm-fe/farm rust-best-practices --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/farm-fe/farm.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/rust-best-practices .opencode/skills/rust-best-practices && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "rust-best-practices" agent skill from https://github.com/farm-fe/farm/tree/main/.agents/skills/rust-best-practices into .opencode/skills/rust-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "rust-best-practices", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
rust-best-practicesGuide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.
Rust Best Practices is an agent skill from farm-fe/farm. Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook. Use this skill when: (1) writing new Rust code or functions, (2) reviewing or refactoring existing Rust code, (3) deciding between borrowing vs cloning or ownership patterns, (4) implementing error handling with Result types, (5) optimizing Rust code for performance, (6) writing tests or documentation for Rust projects.
Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 10 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: Extremely fast Vite-compatible web build tool written in Rust. The licence is MIT.
Read from SKILL.md and the folder at commit 2000ef8. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
Bash(cargo:*)Bash(rustc:*)Bash(rustfmt:*)Bash(clippy:*)ReadWriteEditGlobGrepFrom allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
cargoFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
github.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Rust 1.70+, Cargo
From compatibility in the SKILL.md frontmatter.
Rust Best Practices loads about 1.1k tokens when it runs, and up to ~23k if it reads all its reference files. Until then it costs about 108 tokens; SKILL.md has 391 words of instructions outside code blocks.
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.
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.
The full file from farm-fe/farm at commit 2000ef8, republished under its MIT licence (© farm-fe). 391 words, ~1,085 tokens.
.claude/skills/rust-best-practices/SKILL.md (or your agent's skills folder). This skill also uses 9 other files; get the full folder from GitHub.Apply these guidelines when writing or reviewing Rust code. Based on Apollo GraphQL's Rust Best Practices Handbook.
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:
&T over .clone() unless ownership transfer is required&str over String, &[T] over Vec<T> in function parametersCopy types (≤24 bytes) can be passed by valueCow<'_, T> when ownership is ambiguousResult<T, E> for fallible operations; avoid panic! in productionunwrap()/expect() outside teststhiserror for library errors, anyhow for binaries only? operator over match chains for error propagation--release flagcargo clippy -- -D clippy::perf for performance hints.iter() instead of .into_iter() for Copy types.collect() callsRun regularly: cargo clippy --all-targets --all-features --locked -- -D warnings
Key lints to watch:
redundant_clone - unnecessary cloninglarge_enum_variant - oversized variants (consider boxing)needless_collect - premature collectionUse #[expect(clippy::lint)] over #[allow(...)] with justification comment.
process_should_return_error_when_input_empty()///) for public API examplescargo insta for snapshot testing generated outputdyn Trait only when heterogeneous collections are neededEncode valid states in the type system to catch invalid operations at compile time:
struct Connection<State> { /* ... */ _state: PhantomData<State> }
struct Disconnected;
struct Connected;
impl Connection<Connected> {
fn send(&self, data: &[u8]) { /* only connected can send */ }
}// comments explain why (safety, workarounds, design rationale)/// doc comments explain what and how for public APIsTODO needs a linked issue: // TODO(#42): ...#![deny(missing_docs)] for libraries© farm-fe, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 9 other files (references) in .agents/skills/rust-best-practices of farm-fe/farm.
Open the folder on GitHubat commit 2000ef8
We found 5 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 3 other GitHub owners. This page covers the copy in farm-fe/farm, which our catalogue first saw on October 7, 2026.
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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Rust Best Practices this skillfarm-fe/farm | 5.6k | 3 repos | ~1.1k | Automated safety check: Pass | MIT | |
| Rust Best Practicesscott-fryxell/brayness | 125 | — | ~888 | Automated safety check: Pass | MIT | |
| Rust Hygiene Audittsz-org/tsz | 577 | — | ~1.5k | Automated safety check: Pass | Apache-2.0 | |
| Rust SkillsJMBeresford/retrom | 2.1k | 1 repos | ~9.5k | Automated safety check: Pass | MIT | |
| Rust Skillsnoh-rs/nohrs | 156 | — | ~5.3k | Automated safety check: Pass | MIT | |
| Migrate Core Code to Submodulestinyhumansai/openhuman | 42k | — | ~2.6k | Automated safety check: Pass | GPL-3.0 |
scott-fryxell/brayness
Idiomatic Rust guide based on Apollo GraphQL's best practices handbook.
tsz-org/tsz
Run a deep DRY + code-hygiene audit of the Rust workspace and turn the findings into verified, deduplicated, hierarchical GitHub tech-debt issues.
JMBeresford/retrom
Comprehensive Rust coding guidelines with 265 rules across 26 categories.
noh-rs/nohrs
Comprehensive Rust coding guidelines with 179 rules across 14 categories.
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.
rtk-ai/rtk
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.
farm-fe/farm
A skill your agent uses when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions
farm-fe/farm
A skill your agent uses when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for…
farm-fe/farm
A skill your agent uses when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and…
farm-fe/farm
A skill your agent uses when completing tasks, implementing major features, or before merging to verify work meets requirements
farm-fe/farm
A skill your agent uses when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any…
farm-fe/farm
A universal self-improving agent that learns from ALL skill experiences.
Works with
Categories
Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook. Rust Best Practices is an agent skill from farm-fe/farm. Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.
Rust Best Practices fits situations like: writing new Rust code; refactoring existing Rust code; deciding between borrowing vs cloning; ownership patterns.
Run `npx skills add farm-fe/farm --skill rust-best-practices -a claude-code`. Or copy the skill folder (.agents/skills/rust-best-practices in farm-fe/farm) into .claude/skills/rust-best-practices in your project. Claude Code loads it when a task matches its description.
Run `npx skills add farm-fe/farm --skill rust-best-practices -a codex`. Or copy the skill folder (.agents/skills/rust-best-practices in farm-fe/farm) into .agents/skills/rust-best-practices in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add farm-fe/farm --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.
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.
SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.
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.
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.
About 1.1k tokens (SKILL.md is roughly 4.3k 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 22k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Rust Best Practices: Rust Best Practices (scott-fryxell/brayness, 125 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.
farm-fe (a GitHub organization) maintains it in farm-fe/farm, which has 5,595 GitHub stars. The repository holds 20 skills in this directory. The repository was last updated on September 22, 2026.
Source: farm-fe/farm on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.