Official agent skill

Doc Comments

by biomejs in biomejs/biome

A skill your agent uses whenever writing or editing Rust //, ///, or //!

OfficialApache-2.0Auto-check passedDevelopment

Install Doc Comments

skills CLI
$ npx skills add biomejs/biome --skill doc-comments -a claude-code

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

GitHub CLI
$ gh skill install biomejs/biome doc-comments --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/biomejs/biome.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/doc-comments .claude/skills/doc-comments && 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
doc-comments
GitHub stars
26k
Token cost
~3k tokens
SKILL.md length
1,395 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses whenever writing or editing Rust //, ///, or //!

  • Works in 6 steps: Identify the reader and every destination. → Make each comment understandable without… → Delete contributor comments recoverable… → …
  • Editing Rust //
  • SKILL.md covers Purpose, Identify the Audience, Comment Kinds and Value and Writing End-User Documentation, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

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.

When your agent uses it

  • Editing Rust //
  • Formatter handling of comments in user code

Example prompts

  • “/doc-comments”

Requirements

  • Compatibility (from SKILL.md): Designed for coding agents working on the Biome codebase (github.com/biomejs/biome).

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Identify the reader and every destination.
  2. Make each comment understandable without the conversation, change history,
  3. Delete contributor comments recoverable from the code.
  4. Ensure end-user comments stand alone without Rust, Biome-internal, or
  5. Check public names, examples, terminology, inclusivity, and grammar.
  6. Inspect generated or rendered output when applicable.

What it can do on your machine

Read from SKILL.md and the folder at commit c870caa. 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

    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.

  • Network

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

    • biomejs.dev
    • diataxis.fr

    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

    Designed for coding agents working on the Biome codebase (github.com/biomejs/biome).

    From compatibility in the SKILL.md frontmatter.

Context cost

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.

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

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 biomejs/biome at commit c870caa, republished under its Apache-2.0 licence (© biomejs). 1,395 words, ~2,991 tokens.

Download SKILL.mdSave it as .claude/skills/doc-comments/SKILL.md (or your agent's skills folder).
name
doc-comments
description
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.
compatibility
Designed for coding agents working on the Biome codebase (github.com/biomejs/biome).

Purpose

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.

Identify the Audience

Source contextReader and destination
Ordinary implementation //, internal item rustdoc, and most module docsBiome contributors reading the Rust source or rustdoc
Rustdoc on configuration types that derive JsonSchema, including their fieldsBiome users reading configuration descriptions from the JSON Schema
Rustdoc consumed by Bpaf, including command variants, arguments, and configuration fieldsBiome users reading CLI help
Daemon-facing Workspace methods and their serialized request and response typesAuthors 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.

Contributor reader

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.

End-user reader

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:

  • reduce jargon, including target-language idioms, and define necessary terms;
  • set clear expectations by stating relevant defaults, prerequisites, effects, limitations, fallback behavior, and error recovery;
  • be specific, inclusive, and neutral; avoid vague phrases, idioms, and assumptions about the reader;
  • keep CLI text understandable without color or other visual styling.

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.

Comment Kinds and Value

KindJob
//! module docsExplain why a module exists, its core concepts, how its pieces relate, and durable design rationale.
/// item docsDescribe 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 commentsExplain 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.

Writing End-User Documentation

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.

SurfaceInclude
ConfigurationThe setting's effect, public key, default or omission behavior, accepted range or units, and relevant interactions.
CLI helpThe action and scope, prerequisites, implications or conflicts, output, and exit behavior. Keep the first sentence useful on its own.
Shared configuration and CLI rustdocA first paragraph complete in both contexts, using only links or formatting verified in every renderer.
Workspace and daemon APIsThe 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 actionsEnd-user website content. Also load lint-rule-development for required structure, examples, and option documentation; its content requirements take precedence.
Show full SKILL.md (570 more words)Show less

Writing Contributor Documentation

Write documentation for a human reader, not as a translation of the implementation.

  • Start with a plain-language description of what the function returns or accomplishes.
  • Use short or medium-length sentences. Keep one main idea per sentence.
  • Avoid internal jargon. If a technical term is necessary, explain what it means in the same paragraph.
  • Describe business-logic caveats that can surprise callers. Examples include fallback behavior, work limits, ambiguous results, overload ordering, and conditions that return None, Unknown, or an indeterminate result.
  • Do not describe implementation details unless callers need them to understand the behavior.

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.

Banned Patterns

Narrating the next line. Delete these on sight:

rust
// Increment the generation counter
generation += 1;

Change-history narration. Rewrite as present-tense rationale:

rust
// 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:

rust
// 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:

rust
// 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:

rust
// 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.

Region Comments

Long files group related items with paired region markers:

rust
// #region FILE-LEVEL METHODS
...
// #endregion

This 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.

  • Pair every // #region with // #endregion.
  • Name what the group contains. Use a plain label, or anchor the name to a function when the region holds one entry point and its private support code.
  • Use regions only when folding helps in a long file, impl, or trait block.
  • Never use a region name instead of rustdoc on its items.

Editing Existing Code

  • Edit the source comment, not a generated schema, binding, or help snapshot.
  • Preserve accurate details. If behavior changes, correct the specific prose instead of replacing it with generic text.
  • Match nearby density and terminology only for the same audience and destination.
  • Keep the change focused; do not rewrite unrelated comments to impose a voice.

Self-Check Before Finishing

Read only the comments in the diff, without the implementation:

  1. Identify the reader and every destination.
  2. Make each comment understandable without the conversation, change history, reviewer, issue, or diff. Keep issue links only as supplemental context for constraints or tracked workarounds.
  3. Delete contributor comments recoverable from the code.
  4. Ensure end-user comments stand alone without Rust, Biome-internal, or advanced target-language knowledge and state the details needed to predict behavior.
  5. Check public names, examples, terminology, inclusivity, and grammar.
  6. Inspect generated or rendered output when applicable.

Delete redundant contributor comments, but retain descriptions required by a user-facing surface.

References

© 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

Files

Just SKILL.md in .agents/skills/doc-comments of biomejs/biome.

Open the folder on GitHubat commit c870caa

Compare with similar skills

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.

Doc Comments compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Doc Comments this skillbiomejs/biome26k—~3kAutomated safety check: PassApache-2.0
Rust Best Practicesfarm-fe/farm5.6k3 repos~1.1kAutomated safety check: PassMIT
Rust Hygiene Audittsz-org/tsz577—~1.5kAutomated safety check: PassApache-2.0
Releasexin2017338/lynx-proxy502—~1.1kAutomated safety check: PassMIT
Flowmark Markdown Formatterjlevy/repren374—~631Automated safety check: PassMIT
Rsigmatimescale/rsigma159—~1.2kAutomated safety check: PassMIT

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 28 days ago
    DevelopmentAuto-check passed
  • Release

    xin2017338/lynx-proxy

    Publish a new release version of Lynx Proxy. An agent skill from xin2017338/lynx-proxy.

    502 GitHub stars~1.1k tokensUpdated 23 days ago
    DevelopmentAuto-check passed
  • Formats Markdown with the Flowmark auto-formatter for typographic cleanup and semantic line breaks, and helps adopt it across a repository.

    374 GitHub stars~631 tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Rsigma

    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.

    159 GitHub stars~1.2k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Building Glamorous Tuis

    Dicklesworthstone/meta_skill

    Build terminal UIs with Charmbracelet (Bubble Tea, Lip Gloss, Gum).

    205 GitHub stars~3.4k tokensUpdated 3 days ago
    DevelopmentAuto-check passed

More from biomejs/biome

All 12 skills in this repo
  • Changeset

    biomejs/biome

    Official

    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.

    26k GitHub stars~839 tokensUpdated today
    Auto-check passed
  • Official

    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.

    26k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Official

    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…

    26k GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Official

    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…

    26k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Parser Development

    biomejs/biome

    Official

    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.

    26k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Promote Lint Rules

    biomejs/biome

    Official

    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…

    26k GitHub stars~948 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Doc Comments

What does Doc Comments do?

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 //!

When should I use Doc Comments?

Doc Comments fits situations like: editing Rust //; formatter handling of comments in user code.

How do I install Doc Comments in Claude 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.

How do I install Doc Comments in Codex?

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.

Can I use Doc Comments 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 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.

What does Doc Comments need to run?

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

Does Doc Comments access the network?

SKILL.md names 2 domains. As links in the text: biomejs.dev and diataxis.fr. This is read from the text; nothing was executed.

Is Doc Comments 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 Doc Comments use?

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.

How many tokens does Doc Comments use?

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.

What are the alternatives to Doc Comments?

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.

Who maintains Doc Comments?

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.