Use this skill when creating or modifying Biome lint rules or assists, including analyzer queries, semantic bindings, rule state, code actions, fix safety, options, registration, and end-user rule rustdoc. Also load diagnostics-development for substantial message/advice design and testing-codegen for fixture or snapshot mechanics.
74
91%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Follow the current analyzer architecture in crates/biome_analyze/CONTRIBUTING.md. Read only the sections relevant to the rule rather than loading the entire guide by default.
Scaffolding commands:
just new-js-lintrule useMyRule
just new-css-lintrule useMyRule
just new-json-lintrule useMyRule
just new-graphql-lintrule useMyRuleNew lint rules start in nursery. They are patch changes targeting main, because nursery rules do not follow normal feature versioning. Load changeset for the release entry.
For a new assist, use the language's new-*-assistrule recipe, for example:
just new-js-assistrule useMyAction
just new-json-assistrule useMyActionThe generator places assists under src/assist/source/; they do not use lint groups or the nursery policy. A new assist is a user-facing feature and normally requires a minor changeset targeting next. A bug fix to an existing assist follows normal bug-fix policy. Check justfile for the languages with assist scaffolding.
Choose the least expensive query that answers the rule:
Ast<Node> for syntax-local checks;Semantic<Node> when bindings, references, scopes, or globals are required;The analyzer guide's query and service sections are canonical for available APIs.
run() should decide whether to emit a signal. Keep action-only work in action() so it is not performed for every candidate node.
Prefer ranges, syntax nodes, tokens, and compact enums in State. A String, Box<str>, or collection built from syntax text often indicates avoidable allocation; load syntax-text-handling before owning source text.
For rules matching a global identifier, prove the reference resolves to the global rather than a local shadow. Cover every relevant member of node unions and framework-specific syntax families.
Every diagnostic answers three separate questions:
The message answers the first question. Advice answers the second and, when no action exists, the third. A code action and its label normally answer the third when an automated fix exists.
Load diagnostics-development for message structure, markup, details, advice, categories, and standalone Diagnostic types. Do not duplicate its guidance in the rule implementation.
Build mutations in action(). Set FixKind::Safe only when no reachable input changes behavior. If safety depends on assumptions the rule cannot prove, use Unsafe.
Test that applying the action:
run().Use existing rules with the same mutation shape as API examples.
Add options only for a real semantic mode or established conflicting preference. Do not add speculative flexibility.
Use the rule's generated or existing file under crates/biome_rule_options/src/ as the source of truth. Follow the analyzer guide sections Rule Options, Merge, and Documenting Options for current derives, merge behavior, configuration examples, and rustdoc requirements.
Check these integration points:
type Options;options.json cover each behavior;just gen-rules and just gen-configuration update registrations and configuration.If the source ESLint rule has options that biome migrate eslint should preserve, load eslint-migrate-options.
Rustdoc inside declare_lint_rule! and declare_assist_rule! is end-user website content, not internal API documentation.
### Invalid examples before ### Valid examples.ignore merely to avoid validation.Inspect neighboring rule documentation and the analyzer guide before writing examples.
Load testing-codegen for fixture naming, expectation comments, .jsonc cases, snapshot review, and pruning.
Typical focused commands:
just test-lintrule useMyRule
just gen-rules
just gen-configurationRun just f and just l as required by AGENTS.md.
State avoids unnecessary owned source text.action().crates/biome_analyze/CONTRIBUTING.mdcrates/biome_*_analyze/src/lint/crates/biome_rule_options/src/crates/biome_*_analyze/tests/specs/7d54688
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.