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 when selecting or running Biome test fixtures, quick tests, `insta` snapshot workflows, expectation comments, orphan checks, or required code generators. Do not use for subsystem implementation design.
$ npx -y skills add biomejs/biome --skill testing-codegen --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/testing-codegenContext preview
The summary Claude sees to decide when to auto-load this skill.
Use this skill when selecting or running Biome test fixtures, quick tests, `insta` snapshot workflows, expectation comments, orphan checks, or required code generators. Do not use for subsystem implementation design.
name: testing-codegen description: Use this skill when selecting or running Biome test fixtures, quick tests, `insta` snapshot workflows, expectation comments, orphan checks, or required code generators. Do not use for subsystem implementation design. compatibility: Designed for coding agents working on the Biome codebase (github.com/biomejs/biome).
Choose the narrowest test that exercises the changed behavior, then broaden only when shared infrastructure or integration risk justifies it.
| Change | Start with | | --- | --- | | Lint rule | `just test-lintrule <ruleName>` | | One crate | `cargo test -p <crate>` or the crate's focused test target | | Parser or formatter investigation | `just qt <package>` | | CLI migration | focused `biome_cli` migration tests | | Documentation code | `just test-doc` |
Use `-- --show-output` or `--nocapture` only when the test's diagnostic output is needed.
Quick tests are scratch space for inspecting CST, formatter IR, or one analyzer query. Persistent behavior belongs in the subsystem's normal fixture directory before finishing.
Run the focused test to produce snapshots, then review every changed section:
cargo insta review
Use `cargo insta accept` or `cargo insta reject` only after inspecting the pending changes. A passing snapshot test proves output matches the checked-in snapshot, not that the snapshot describes correct behavior.
Do not delete suspected orphan snapshots manually. Deletion is safe only after running the complete workspace snapshot suite without package, target, or test filters:
cargo insta test --workspace --unreferenced delete
For a scoped run, use `--unreferenced warn` or `--unreferenced reject`; incomplete test selection cannot prove that a snapshot is orphaned. Inspect every deletion from a complete run.
Place rule fixtures under the language analyzer's current `tests/specs/<group>/<rule>/` hierarchy. The directory group must match the rule declaration.
Use focused source files for parser-dependent cases. Use `.jsonc` arrays when multiple independent script snippets share the same configuration and module semantics are not required. Use `options.json` in a subdirectory when tests need different rule configuration.
The test utilities recognize these marker texts in source comments:
should generate diagnostics should not generate diagnostics
Current enforcement:
Put the marker at the top of a primary fixture. Sidecar files with neutral names do not need a marker unless they are independently analyzed as cases.
Use the parser crate's established `ok/` and `error/` directories. A recovery regression should include valid syntax after the malformed construct to prove the parser resumes at the intended boundary.
Use `just qt <parser-package>` to inspect a CST during development; do not leave the quick test as the only regression coverage.
Use internal specs for behavior introduced or fixed by the change. External Prettier snapshots record comparison results but do not replace focused internal coverage.
The formatter harness performs its idempotency reformat during one test invocation for eligible files. Inspect both formatted output and any IR shown for a mismatch.
| Changed source | Command | | --- | --- | | `.ungram` grammar | `just gen-grammar <lang>` | | Formatter source | `just gen-formatter <lang>` | | Lint rule or assist | `just gen-rules` and `just gen-configuration` | | Bindings needed locally | `just gen-bindings` |
Root `AGENTS.md` is canonical for which artifacts must be committed and which full outputs CI Autofix may provide.
Do not run `just ready` in a dirty working tree: the recipe checks for a clean diff before and after its full verification sequence. Use the focused commands required by the current task, then `just f` and `just l`.
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 whenever implementing or debugging Biome formatter behavior, IR composition, node rules, layout selection, source-comment handling, verbatim…