Rust Best Practices
farm-fe/farm
Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.
A skill your agent uses whenever writing or editing Rust //, ///, or //!
$ npx skills add biomejs/biome --skill doc-comments -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install biomejs/biome doc-comments --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/biomejs/biome.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/doc-comments .claude/skills/doc-comments && 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 "doc-comments" agent skill from https://github.com/biomejs/biome/tree/main/.agents/skills/doc-comments into .claude/skills/doc-comments/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "doc-comments", 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/biomejs/biome/tree/main/.agents/skills/doc-commentsType 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 biomejs/biome --skill doc-comments -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install biomejs/biome doc-comments --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/biomejs/biome.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/doc-comments .agents/skills/doc-comments && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "doc-comments" agent skill from https://github.com/biomejs/biome/tree/main/.agents/skills/doc-comments into .agents/skills/doc-comments/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "doc-comments", 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 biomejs/biome --skill doc-comments -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install biomejs/biome doc-comments --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/biomejs/biome.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/doc-comments .cursor/skills/doc-comments && 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 "doc-comments" agent skill from https://github.com/biomejs/biome/tree/main/.agents/skills/doc-comments into .cursor/skills/doc-comments/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "doc-comments", 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/biomejs/biome.git --path .agents/skills/doc-comments--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 biomejs/biome --skill doc-comments -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install biomejs/biome doc-comments --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/biomejs/biome.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/doc-comments .gemini/skills/doc-comments && 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 "doc-comments" agent skill from https://github.com/biomejs/biome/tree/main/.agents/skills/doc-comments into .gemini/skills/doc-comments/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "doc-comments", 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 biomejs/biome doc-commentsInstalls 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 biomejs/biome --skill doc-comments -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/biomejs/biome.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/doc-comments .github/skills/doc-comments && 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 "doc-comments" agent skill from https://github.com/biomejs/biome/tree/main/.agents/skills/doc-comments into .github/skills/doc-comments/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "doc-comments", 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 biomejs/biome --skill doc-comments -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install biomejs/biome doc-comments --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/biomejs/biome.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/doc-comments .opencode/skills/doc-comments && 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 "doc-comments" agent skill from https://github.com/biomejs/biome/tree/main/.agents/skills/doc-comments into .opencode/skills/doc-comments/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "doc-comments", 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.
doc-commentsA skill your agent uses whenever writing or editing Rust //, ///, or //!
Doc Comments is an agent skill from biomejs/biome, published by the product's own GitHub organization. Use this skill whenever writing or editing Rust //, ///, or //! comments in Biome, including contributor documentation and rustdoc exposed to users through configuration schemas, CLI help, workspace or daemon APIs, and lint or assist declarations. For lint or assist rustdoc, also load lint-rule-development. Do not use for formatter handling of comments in user code.
Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts. Compatibility notes: Designed for coding agents working on the Biome codebase (github.com/biomejs/biome).
It sits in Development, covering Linting and formatting. It works with Rust. The repository describes itself as: A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP. The licence is Apache-2.0.
6 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit c870caa. It shows what the files ask for, not the result of running them.
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.
No scripts in the folder and no shell commands in SKILL.md (its code samples are rust).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
biomejs.devdiataxis.frFrom 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.
Designed for coding agents working on the Biome codebase (github.com/biomejs/biome).
From compatibility in the SKILL.md frontmatter.
Doc Comments loads about 3k tokens when it runs. Until then it costs about 97 tokens; SKILL.md has 1,395 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 biomejs/biome at commit c870caa, republished under its Apache-2.0 licence (© biomejs). 1,395 words, ~2,991 tokens.
.claude/skills/doc-comments/SKILL.md (or your agent's skills folder).Rust syntax does not determine a comment's audience. Some comments explain the implementation to Biome contributors. Others are published for Biome users or client authors. Before editing a comment, trace where it is consumed by checking nearby derives, attributes, macros, generators, generated artifacts, and help snapshots.
| Source context | Reader and destination |
|---|---|
Ordinary implementation //, internal item rustdoc, and most module docs | Biome contributors reading the Rust source or rustdoc |
Rustdoc on configuration types that derive JsonSchema, including their fields | Biome users reading configuration descriptions from the JSON Schema |
Rustdoc consumed by Bpaf, including command variants, arguments, and configuration fields | Biome users reading CLI help |
Daemon-facing Workspace methods and their serialized request and response types | Authors of daemon clients and users of generated backend bindings |
Rustdoc inside declare_lint_rule! or the assist macro declare_source_rule! | Biome users reading rule or assist documentation on the website |
A file can mix audiences. For example,
workspace.rs contains
contributor-facing module docs and user-facing daemon contracts, while
FormatterConfiguration
has user-facing field docs and contributor-facing methods.
A comment can also feed multiple destinations. Write for the least specialized
reader, use only formatting supported by every destination, and inspect the
rendered output. Neither /// nor pub proves who the reader is; follow the
text to its destination.
Write for a contributor who knows Rust but has no access to this conversation, the pull request, the issue, or the diff. Describe the code at HEAD. Never narrate change history or address a reviewer.
Write for an intelligent adult who may be using Biome or the documented feature for the first time. Do not require knowledge of Rust, Biome internals, advanced knowledge of the target language's idioms or terminology, or unstated ecosystem concepts.
Use an ELI18 register: beginner-friendly, technically complete, and never
childish. Prefer the most familiar accurate term. In JavaScript documentation,
for example, prefer variable to binding when both are correct. If the
distinction matters, define it on first use: "a binding (a name introduced by
code, such as a variable, parameter, or import)." Do not assume client authors
know Biome's Rust implementation.
Follow the Biome philosophy:
Use public names, such as files.includes, --write, or openFile, with the
spelling shown in the destination. Do not leak a Rust identifier merely because
it is convenient for the implementation.
| Kind | Job |
|---|---|
//! module docs | Explain why a module exists, its core concepts, how its pieces relate, and durable design rationale. |
/// item docs | Describe the item's contract for its actual audience. Contributor contracts cover behavior, inputs and outputs, invariants, panics, and errors; end-user contracts describe public behavior. |
// inline comments | Explain constraints, workarounds, non-obvious coupling, or why the obvious implementation is wrong. These normally target contributors. |
Ask what the intended reader can recover from the surface they see. Contributors
can inspect names, types, and control flow; improve the code or delete comments
that only restate them. End users may see only a help entry, editor hover,
generated API, or rule page, so retain the self-contained behavior summary even
when the Rust name appears descriptive. Keep item contracts in ///; put
implementation rationale beside the code as //, not in user-facing docs.
Start with a short, plain-language sentence that says what the item does. Add only relevant details: when to use it, prerequisites, accepted values and units, default or omission behavior, interactions, side effects, persistence, results, limitations, failures, and recovery. Use an example when prose leaves the result ambiguous.
Write in the present tense and active voice, with one main idea per sentence. Use familiar, concrete words; explain necessary terms in the same paragraph. Avoid vague pronouns, unexplained acronyms, idioms, and dismissive words such as "obviously", "simply", or "just". Proofread grammar and terminology.
Use the reader's interface in examples: configuration snippets, shell commands, or the public binding or wire format, not Rust for a non-Rust surface. Introduce what each example demonstrates and its expected result.
| Surface | Include |
|---|---|
| Configuration | The setting's effect, public key, default or omission behavior, accepted range or units, and relevant interactions. |
| CLI help | The action and scope, prerequisites, implications or conflicts, output, and exit behavior. Keep the first sentence useful on its own. |
| Shared configuration and CLI rustdoc | A first paragraph complete in both contexts, using only links or formatting verified in every renderer. |
| Workspace and daemon APIs | The public client contract: required prior state, state changes and persistence, interpretation of fields such as versions and positions, result meaning, and recoverable failures. Use public API concepts rather than Rust concepts such as borrowing, Option, or implementation structs. |
| Lint rules and assist actions | End-user website content. Also load lint-rule-development for required structure, examples, and option documentation; its content requirements take precedence. |
Write documentation for a human reader, not as a translation of the implementation.
None, Unknown, or an indeterminate result.Add an example when the signature cannot clearly show a relationship such as overload selection, argument mapping, import traversal, fallback behavior, or an otherwise ambiguous result. Introduce what the example demonstrates and its expected result. Keep it minimal and self-contained.
Module docs should describe a durable concept or design reason, not list items that will become stale. If there is no durable concept to explain, use a brief one-line description.
Narrating the next line. Delete these on sight:
// Increment the generation counter
generation += 1;Change-history narration. Rewrite as present-tense rationale:
// BAD: We now intern types instead of cloning them.
// GOOD: Interning avoids cloning these types on every lookup.Reviewer-addressed justification. Move the argument to the pull request:
// BAD: This correctly handles the overload case from the bug report.
// GOOD: Overloads are matched by arity before parameter types, so a
// partial-arity call cannot select the wrong candidate.Restated contributor rustdoc. A doc comment that only rewords the item name adds nothing for a contributor:
// BAD:
/// Handles type inference.
fn infer_types(...)
// GOOD:
/// Infers the type of `expr` in `module`, returning `TypeData::Unknown`
/// when the expression references an unresolved import.
fn infer_types(...)A self-contained summary can still be necessary in CLI help or an editor hover.
Implementation language in end-user documentation. Describe public behavior, not its Rust representation:
// BAD:
/// Stores an `Option<IndentStyle>` consumed by the formatter.
// GOOD:
/// Uses tabs or spaces for indentation. Defaults to tabs.Replace phrases such as "returns Some", "sets this enum variant", or "the
struct contains" with the result the user observes.
Vague hedging. Name the cases and reasons or remove the sentence. Avoid "some cases", "various reasons", "handles edge cases", and "etc."
Ad-hoc section banners (// ----- helpers -----, // ==== TYPES ====).
Use the region comment pattern below instead.
Long files group related items with paired region markers:
// #region FILE-LEVEL METHODS
...
// #endregionThis is an established convention across the codebase (biome_service,
biome_module_graph, biome_rowan, the parsers). The Workspace trait in
crates/biome_service/src/workspace.rs
uses it to group its methods. Editors fold on these markers; they exist for
navigation, not documentation.
// #region with // #endregion.impl, or trait block.Read only the comments in the diff, without the implementation:
Delete redundant contributor comments, but retain descriptions required by a user-facing surface.
© biomejs, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .agents/skills/doc-comments of biomejs/biome.
Open the folder on GitHubat commit c870caa
Doc Comments 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 |
|---|---|---|---|---|---|---|
| Doc Comments this skillbiomejs/biome | 26k | — | ~3k | Automated safety check: Pass | Apache-2.0 | |
| Rust Best Practicesfarm-fe/farm | 5.6k | 3 repos | ~1.1k | Automated safety check: Pass | MIT | |
| Rust Hygiene Audittsz-org/tsz | 577 | — | ~1.5k | Automated safety check: Pass | Apache-2.0 | |
| Releasexin2017338/lynx-proxy | 502 | — | ~1.1k | Automated safety check: Pass | MIT | |
| Flowmark Markdown Formatterjlevy/repren | 374 | — | ~631 | Automated safety check: Pass | MIT | |
| Rsigmatimescale/rsigma | 159 | — | ~1.2k | Automated safety check: Pass | MIT |
farm-fe/farm
Guide for writing idiomatic Rust code 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.
xin2017338/lynx-proxy
Publish a new release version of Lynx Proxy. An agent skill from xin2017338/lynx-proxy.
jlevy/repren
Formats Markdown with the Flowmark auto-formatter for typographic cleanup and semantic line breaks, and helps adopt it across a repository.
timescale/rsigma
Use the rsigma CLI and MCP server: engine eval, engine daemon, rule lint, rule draft, rule tune, rule backtest, backend convert, mcp serve.
Dicklesworthstone/meta_skill
Build terminal UIs with Charmbracelet (Bubble Tea, Lip Gloss, Gum).
biomejs/biome
A skill your agent uses when a Biome change may affect users and you must decide whether it needs a changeset, choose the release level, or create and edit .changeset/.md release-note text.
biomejs/biome
A skill your agent uses when biome migrate eslint must preserve configurable ESLint rule options through source-option models, Biome conversions, typed rule variants, and migration fixtures.
biomejs/biome
A skill your agent uses whenever implementing or debugging Biome formatter behavior, IR composition, node rules, layout selection, source-comment handling, verbatim formatting, idempotency, internal…
biomejs/biome
A skill your agent uses when creating or modifying Biome lint rules or assists, including analyzer queries, semantic bindings, rule state, code actions, fix safety, options, registration, and…
biomejs/biome
A skill your agent uses when implementing or modifying Biome parser behavior, including .ungram grammars, lexers, token sources, parse rules, separated lists, error recovery, and parser fixtures.
biomejs/biome
A skill your agent uses when promoting one or more Biome lint rules from nursery to stable groups, including promotion plans from GitHub issues, metadata changes, rule renames, generated…
Works with
Categories
A skill your agent uses whenever writing or editing Rust //, ///, or //! Doc Comments is an agent skill from biomejs/biome, published by the product's own GitHub organization. Use this skill whenever writing or editing Rust //, ///, or //!
Doc Comments fits situations like: editing Rust //; formatter handling of comments in user code.
Run `npx skills add biomejs/biome --skill doc-comments -a claude-code`. Or copy the skill folder (.agents/skills/doc-comments in biomejs/biome) into .claude/skills/doc-comments in your project. Claude Code loads it when a task matches its description.
Run `npx skills add biomejs/biome --skill doc-comments -a codex`. Or copy the skill folder (.agents/skills/doc-comments in biomejs/biome) into .agents/skills/doc-comments 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 biomejs/biome --skill doc-comments -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/doc-comments, .gemini/skills/doc-comments, .github/skills/doc-comments and .opencode/skills/doc-comments in your project.
SKILL.md names no scripts, command-line tools or credentials: Doc Comments is instructions for the agent only. Compatibility (from SKILL.md): Designed for coding agents working on the Biome codebase (github.com/biomejs/biome)..
SKILL.md names 2 domains. As links in the text: biomejs.dev and diataxis.fr. 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.
Doc Comments is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Doc Comments: Rust Best Practices (farm-fe/farm, 5.6k stars), Rust Hygiene Audit (tsz-org/tsz, 577 stars), Release (xin2017338/lynx-proxy, 502 stars) and Flowmark Markdown Formatter (jlevy/repren, 374 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
biomejs (a GitHub organization, an official publisher) maintains it in biomejs/biome, which has 25,910 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on October 8, 2026.
Source: biomejs/biome on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.