formatter-development

Generate Biome formatter boilerplate and implement FormatNodeRule for languages.

Updated Apr 10, 2026
One-click install
npx skills add https://github.com/qdhenry/Foundry-OSS --skill formatter-development-qdhenry
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: formatter-development
Source: https://github.com/qdhenry/Foundry-OSS/tree/main/.agents/skills/formatter-development
Command: npx skills add https://github.com/qdhenry/Foundry-OSS --skill formatter-development-qdhenry

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Biome formatters require a structured workflow to implement, test, and validate new syntax across languages, including handling of traits, IR generation, and robust testing against reference tools.

Core Features & Use Cases

  • Generate formatter boilerplate for a new language (e.g., HTML) to produce FormatNodeRule implementations.
  • Implement FormatNodeRule for individual nodes with examples showing token handling, indentation, and comments.
  • Use IR primitives (space, line breaks, groups, indentation) to craft robust, maintainable formatting logic.
  • Compare formatted output against Prettier to validate consistency across languages like JavaScript, CSS, JSON, and HTML.
  • Extend test suites by adding tests in tests/specs and running cargo test to verify formatting behavior.

Quick Start

Generate a new formatter boilerplate for a language you want to support.

Frequently Asked Questions about formatter-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a Biome formatter for a new language?

Building a Biome formatter involves generating boilerplate for the target language to produce FormatNodeRule implementations, then defining node-specific formatting logic using IR primitives like space, line breaks, groups, and indentation.

What is IR generation in Biome code formatting?

IR generation in Biome code formatting creates intermediate representation primitives like groups, line breaks, and indentation blocks. These primitives enable you to craft robust, maintainable formatting logic that handles tokens and comments.

Can I use Biome formatting to match Prettier output across languages?

Yes, you can compare Biome formatted output against Prettier to validate consistency. This workflow ensures your custom formatter achieves cross-language consistency for JavaScript, CSS, JSON, and HTML.

How do I test Biome formatter behavior in Rust?

To test Biome formatter behavior, you extend test suites by adding test specifications in the tests/specs directory and running cargo test. This workflow verifies that your node-specific formatting rules behave as expected.

Does Biome formatter development support HTML and CSS?

Yes, Biome formatter development supports HTML and CSS. You can apply the trait-based formatting workflow to implement syntax support across multiple languages, including HTML, JavaScript, CSS, and JSON.

What's the best way to handle comments in a Biome formatter?

The best way to handle comments in a Biome formatter is to implement specific comment handling logic within your FormatNodeRule. This ensures comments integrate cleanly with IR-generated line breaks and indentation groups.