formatter-development
Learn to implement and modify Biome's formatters using its trait-based IR system. This skill covers generating formatter boilerplate, writing FormatNodeRule implementations, managing comments in formatted output, and validating your work against Prettier using snapshot tests and idempotency checks.
formatter-development teaches you to implement formatting rules for Biome syntax nodes using its IR-based infrastructure.
AI-generated summary based on this skill's SKILL.md
Decision gist · record as of 2026-07-27
formatter-development teaches you to implement formatting rules for Biome syntax nodes using its IR-based infrastructure. Learn to implement and modify Biome's formatters using its trait-based IR system. This skill covers generating formatter boilerplate, writing FormatNodeRule implementations, managing comments in formatted output, and validating your work against Prettier using snapshot tests and idempotency checks.
Use it when
- Biome's IR-based formatter infrastructure is the core system that formatter-development uses to transform syntax trees into formatted.
- formatter-development covers handling comments by understanding how Biome's formatter preserves and positions comments within formatted.
Verify before relying
Read SKILL.md below before installing (1 file). Open directory: indexed for reading, not audited.
Install
biomejs/biome/formatter-development · repository language: Rust
Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.
Frequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do you implement formatting rules in Biome?
formatter-development teaches you to implement formatting rules by writing FormatNodeRule trait implementations for syntax nodes. You define how each node type should be formatted using Biome's IR-based formatter infrastructure, which handles indentation, line breaks, and spacing. The skill covers generating formatter boilerplate, managing soft and hard line breaks, and handling grouping to control when content wraps across lines.
What is Biome's IR-based formatter infrastructure?
Biome's IR-based formatter infrastructure is the core system that formatter-development uses to transform syntax trees into formatted output. It uses an intermediate representation (IR) with formatting primitives like soft_line_break, hard_line_break, and grouping constructs. This approach separates formatting logic from output rendering, making it easier to implement consistent rules across different syntax node types.
How do you handle comments in Biome formatter output?
formatter-development covers handling comments by understanding how Biome's formatter preserves and positions comments within formatted output. The skill addresses dangling comments—comments that appear after code on the same line or in ambiguous positions—and shows how to use formatter rules to ensure comments are placed correctly relative to syntax nodes without breaking idempotency or readability.
How can you compare Biome formatting with Prettier?
formatter-development includes using Biome's prettier compare tool to validate your formatter output against Prettier's behavior. This comparison helps identify formatting differences and ensures consistency. The skill teaches snapshot testing and idempotency checks to verify that your formatter produces stable, correct output that matches expected formatting patterns.
What are snapshot tests and idempotency checks in formatter-development?
formatter-development teaches snapshot tests as a way to validate formatter output by comparing it against stored expected results. Idempotency checks ensure that running the formatter twice on the same input produces identical output—a critical property for any formatter. The skill covers writing these tests using quick_test.rs and debugging failures when output changes unexpectedly.
How do you debug and fix formatter idempotency issues?
formatter-development shows how to debug idempotency failures by analyzing formatter output across multiple passes. When the formatter produces different results on subsequent runs, you trace the issue through your FormatNodeRule implementations, checking for inconsistent line break placement, grouping logic, or comment handling. The skill teaches using snapshot tests and comparison tools to identify and fix the root cause.
SKILL.md
Rendered from the published skill. Quoted content, verbatim.
Purpose
Use this skill when implementing or modifying Biome's formatters. It covers the trait-based formatting system, IR generation, comment handling, and testing with Prettier comparison.
Prerequisites
- Install required tools:
just install-tools(includeswasm-bindgen-cliandwasm-opt) - Language-specific crates must exist:
biome_{lang}_syntax,biome_{lang}_formatter - For Prettier comparison: Install
bunand runpnpm installin repo root
Common Workflows
Generate Formatter Boilerplate
For a new language (e.g., HTML):
just gen-formatter html
This generates FormatNodeRule implementations for all syntax nodes.
(truncated - see the full file via the links below)
File tree — 1 file
.claude/skills/formatter-development/SKILL.md
Let your AI agent find skills like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.
wish › “Implement or modify formatting rules for Biome syntax nodes”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
This skill guides developers working on Biome's codebase through essential patterns and pitfalls. It covers AST and syntax node navigation, efficient string extraction without allocation, and handling embedded languages across frameworks like Vue and Svelte. Use it to write cleaner, more maintainable code and avoid costly mistakes when extending Biome's parser, analyzer, and formatter.
testing-codegen guides you through snapshot testing with insta and code generation for the Biome codebase. It covers running tests for specific crates, fast iteration with quick-test workflows, and safely managing snapshots—including pruning orphaned files and reviewing changes interactively. Use this skill when testing lint rules, inspecting AST structure, or regenerating parser and analyzer code.
Biome combines linting and formatting into one Rust-powered tool designed for JavaScript and TypeScript projects. It eliminates the need for separate ESLint and Prettier setups while delivering dramatically faster performance and sensible defaults out of the box.
This skill walks you through converting your JavaScript/TypeScript formatter from Prettier or Biome to Oxfmt, a high-performance alternative. It covers running the built-in automated migration tool, reviewing and adjusting the generated config, and configuring Oxfmt-specific features like import sorting and Tailwind CSS class ordering.
Linter Formatter Init automates code quality setup for JavaScript and TypeScript projects, installing Biome (default) or ESLint + Prettier alongside Vitest testing and Husky pre-commit hooks. The skill configures VS Code integration, generates bun scripts for linting and formatting, and supports monorepo layouts.
Ultracite provides battle-tested linting and formatting presets for JavaScript and TypeScript projects, supporting three backends: Biome (recommended), ESLint with Prettier, and Oxlint with Oxfmt. Initialize with a single command that auto-detects your setup and configures hundreds of rules tailored to your framework and editor.
More skills biome (MIT) · Biome Validator (unlicensed) · parser-development (Apache-2.0) · pull-request (Apache-2.0)