testing-codegen

Project guidance for testing and generating code in Biome, a code formatter and checker. It explains how to choose focused tests, inspect snapshot changes, check for unused snapshots, and run required generators.

In plain words
What is it for?
Use it when changing Biome lint rules, crates, parsers, formatters, command-line migrations, or documentation tests, and when updating snapshots or checking for orphaned ones.
Why use it?
Large test runs can be slow and snapshot updates can hide incorrect expectations. These instructions help select an appropriate test and require reviewing generated or recorded output before accepting it.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/biomejs/biome/testing-codegen
Any agent
npx skills add biomejs/biome --skill testing-codegen
Clone the repo
git clone --depth 1 https://github.com/biomejs/biome

Made for: Claude Code, Codex.

Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,074 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00045 $0.01074
Opus 5 $0.00023 $0.00537
Sonnet 5 $0.00009 $0.00215
Haiku 4.5 $0.00005 $0.00107

Measured 2d ago against content hash f15a331e9c73, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

testing-codegen scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/testing-codegen/SKILL.md · 112 lines

How it starts

The opening of the file, as written. The whole thing — 112 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Testing and Code Generation

Choose the narrowest test that exercises the changed behavior, then broaden only when shared infrastructure or integration risk justifies it.

Test Selection

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.

Snapshot Workflow

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.

Orphaned Snapshots

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.

Analyzer Fixtures

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.

Read the full file on GitHub · 112 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 112 lines · 45 tokens per session scan A f15a331e9c73

Subscribe to this mod's changes

testing-codegen is a skill published in the GitHub repository biomejs/biome (25,686 stars, last pushed 2d ago), licensed Apache-2.0. It adds 45 tokens to every session and 1,074 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

Biome

Biome 2.x — fast all-in-one web toolchain in Rust. Formats, lints, assists. Replaces Prettier + ESLint.

pledgeandgrow/pledge-skills · 33 tokens

prettier-docs

Prettier 3.9.5 — opinionated code formatter. CLI, API, config, plugins, editor integration, CI.

pledgeandgrow/pledge-skills · 34 tokens

electron-node-upgrade

Guide for performing Node.js version upgrades in the Electron project. Use when working on the roller/node/main branch to fix patch conflicts during e sync --3. Covers the patch application workflow, conflict resolution, analyzing upstream Node.js changes, building, running the Node.js test suite, and proper commit…

electron/electron · 69 tokens

electron-chromium-upgrade

Guide for performing Chromium version upgrades in the Electron project. Use when working on the roller/chromium/main branch to fix patch conflicts during e sync --3. Covers the patch application workflow, conflict resolution, analyzing upstream Chromium changes, and proper commit formatting for patch fixes.

electron/electron · 62 tokens

chrome-release-verify

End-to-end Chrome security backport for an Electron release branch. Given a Chrome Releases blog URL and a branch (e.g. 41-x-y), determines which CVE fixes are missing from the actual synced source, writes the cherry-pick patches locally, validates them with e sync --3 + lint --patches, then pushes a single PR. Use…

electron/electron · 121 tokens

triage-prs

Triage open electron/electron pull requests by CI check status — lists PRs that are green/passing, failing, still pending, or have no checks at all, annotated with their Status on the "PR Triage" project board and with the new-pr label. Can scope to a single named check, e.g. PRs whose "faraday/cage" check is pending.…

electron/electron · 157 tokens