biome-code-review
Use only for reviewing completed Biome PRs, branches, commit ranges, diffs, or working trees against business logic and requirements. Excludes broad…
Use this skill whenever implementing or debugging Biome formatter behavior, IR composition, node rules, layout selection, source-comment handling, verbatim formatting, idempotency, internal specs, or Prettier comparison. Do not use it for generic snapshot commands or parser
$ npx -y skills add biomejs/biome --skill formatter-development --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/formatter-developmentContext preview
The summary Claude sees to decide when to auto-load this skill.
Use this skill whenever implementing or debugging Biome formatter behavior, IR composition, node rules, layout selection, source-comment handling, verbatim formatting, idempotency, internal specs, or Prettier comparison. Do not use it for generic snapshot commands or parser
name: formatter-development description: Use this skill whenever implementing or debugging Biome formatter behavior, IR composition, node rules, layout selection, source-comment handling, verbatim formatting, idempotency, internal specs, or Prettier comparison. Do not use it for generic snapshot commands or parser changes. compatibility: Designed for coding agents working on the Biome codebase (github.com/biomejs/biome).
Use `crates/biome_formatter/CONTRIBUTING.md` and the language formatter's guide as the canonical architecture references. Inspect neighboring node implementations before selecting IR primitives.
1. Reproduce the behavior with a focused internal formatter spec or `quick_test`. 2. Inspect the node fields, comments, and nearby formatting rules. 3. Implement the smallest layout change using formatter IR. 4. Run focused formatter tests and inspect snapshots. 5. Compare with Prettier when compatibility is relevant. 6. Format and lint before committing.
Formatter output is a structured rewrite of the source tree, not a fresh pretty-printer. Treat every missed node, missed token, unchecked suppression, and untracked replacement as a formatter bug, not as style feedback.
Generated node rules implement `FormatNodeRule`. In `fmt_fields`:
`format_verbatim_*` methods preserve a node's source text. Replace verbatim formatting with structured formatting only when tests cover valid, malformed, and commented forms of the node.
Format, replace, or remove every token. Formatter tests panic when a token is not handled, preventing accidental source loss.
Use `format_replaced` when substituting a token and `format_removed` when removing one.
Format a node through `node.format()` when possible. Its regular rule checks formatter-suppression comments as part of normal formatting.
When a helper formats a node or its tokens outside `FormatNodeRule`, run the formatter tests. If the suppression-check assertion reports a node, call `f.context().comments().mark_suppression_checked(node.syntax())` for that reported node. The assertion shows that the helper bypasses the node's normal suppression check.
Use semantic IR rather than writing whitespace as arbitrary text:
For a distinct formatting concern, use a named type implementing `Format`. A cluster of free functions that pass `&mut Formatter` obscures what has already been written and which layout invariants apply.
Represent multi-way layout with an enum selected once. Recomputing layout at several write sites can produce inconsistent output and idempotency failures.
Leading and trailing comments are generally handled by formatter infrastructure. Explicitly format dangling comments when the node owns a position to which no child can attach them.
Test comments at each structural boundary affected by the change: before the first child, between children, after the last child, and around empty nodes. Dropping or moving a source comment is data loss.
Load `testing-codegen` for snapshot commands and review.
Internal specs should contain the focused source sha
A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.
Repo: biomejs/biome
Use only for reviewing completed Biome PRs, branches, commit ranges, diffs, or working trees against business logic and requirements. Excludes broad…
Use this skill when a Biome change may affect users and you must decide whether it needs a changeset, choose the release level, or create and edit…
Use this skill when designing or implementing Biome user-facing diagnostic presentation or APIs, including messages, advice, markup, details, code frames,…
Use this skill whenever writing or editing Rust `//`, `///`, or `//!` comments in Biome, including comments added incidentally and end-user rustdoc inside…
Use this skill when `biome migrate eslint` must preserve configurable ESLint rule options through source-option models, Biome conversions, typed rule variants,…
Use this skill when creating or modifying Biome lint rules or assists, including analyzer queries, semantic bindings, rule state, code actions, fix safety,…