lint-rule-development

Guides creation of Biome lint rules and assists with queries, diagnostics, actions, and fixtures.

Updated Sep 5, 2026
One-click install
npx skills add https://github.com/pohlai88/afenda-xforge-v5 --skill lint-rule-development-pohlai88
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lint-rule-development
Source: https://github.com/pohlai88/afenda-xforge-v5/tree/main/.agents/skills/lint-rule-development
Command: npx skills add https://github.com/pohlai88/afenda-xforge-v5 --skill lint-rule-development-pohlai88

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing a new Biome lint rule or assist requires navigating analyzer queries, semantic models, diagnostic design, fix safety, options, codegen, and fixture testing, and mistakes in any of these areas produce incorrect or unsafe rules. ## Core Features & Use Cases - Rule Scaffolding and Workflow: Provides the just new-*-lintrule and new-*-assistrule commands, nursery placement policy, and changeset targeting for new rules and assists. - Query, State, and Diagnostic Guidance: Explains how to choose between Ast, Semantic, service, and type-inference queries, keep State allocation-free, and structure messages, advice, and code actions. - Testing and Documentation: Covers fixture and snapshot testing, fix-safety verification, rule options with merge behavior, and end-user rustdoc conventions. - Use Case: A contributor adding a new JavaScript lint rule to Biome follows the workflow to scaffold the rule, implement a semantic query that handles global shadowing, add a safe autofix, write fixtures, and run just gen-rules and focused tests. ## Quick Start Ask the agent to scaffold and implement a new Biome lint rule named useMyRule following this skill's workflow.

Frequently Asked Questions about lint-rule-development

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

FAQPage Schema
How do I create a new Biome lint rule?

Run the scaffolding recipe for the target language, such as `just new-js-lintrule useMyRule`, then implement the query, diagnostic, and optional action. New rules start in the nursery group as patch changes targeting the main branch.

How do I choose between Ast and Semantic queries in Biome analyzer rules?

Use Ast<Node> for syntax-local checks and Semantic<Node> only when bindings, references, scopes, or globals are required. Reserve service queries and type inference for facts those cheaper queries cannot answer.

When should a Biome rule fix be marked Safe versus Unsafe?

Set FixKind::Safe only when no reachable input changes program behavior after the fix. If safety depends on assumptions the rule cannot prove, mark the fix Unsafe and test that it preserves syntax, comments, and semantics.

How are Biome rule options configured and tested?

Define options in the rule's file under crates/biome_rule_options/src, ensure defaults preserve existing behavior, and cover each behavior with fixture directories containing options.json. Run `just gen-rules` and `just gen-configuration` to update registrations.

What is the difference between a Biome lint rule and an assist?

Assists are scaffolded with `new-*-assistrule` recipes and live under src/assist/source/ without lint groups or nursery policy. A new assist is a user-facing feature requiring a minor changeset targeting the next branch.