本文へ移動
cccskills
無料GitHub で公開

testing-codegen

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.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md5.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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

ChangeStart with
Lint rulejust test-lintrule <ruleName>
One cratecargo test -p <crate> or the crate's focused test target
Parser or formatter investigationjust qt <package>
CLI migrationfocused biome_cli migration tests
Documentation codejust 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.

Diagnostic Expectation Comments

The test utilities recognize these marker texts in source comments:

should generate diagnostics
should not generate diagnostics

Current enforcement:

  • a filename containing valid but not invalid must contain one of the expectation markers;
  • when either marker is present, actual diagnostics must match it;
  • an invalid or neutral filename without a marker is accepted, but adding the correct marker makes intent explicit;
  • .snap, .json, .jsonc, and .md are exempt from the mandatory valid-file marker check;
  • HTML-family workspace fixtures are checked from raw file content and should use a top-level HTML comment.

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.

Parser Fixtures

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.

Formatter Fixtures

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.

Required Code Generation

Changed sourceCommand
.ungram grammarjust gen-grammar <lang>
Formatter sourcejust gen-formatter <lang>
Lint rule or assistjust gen-rules and just gen-configuration
Bindings needed locallyjust 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.

Completion Checklist

  • A code change has focused persistent coverage.
  • A bug fixture fails without the fix.
  • Snapshot contents were inspected.
  • Expectation comments match fixture intent.
  • Orphan snapshots were pruned through insta.
  • Required generated artifacts are present.
  • Narrow tests pass before broader checks run.

References

  • Main test guide: CONTRIBUTING.md#testing
  • Analyzer guide: crates/biome_analyze/CONTRIBUTING.md
  • Expectation enforcement: crates/biome_test_utils/src/lib.rs
  • Formatter harness: crates/biome_formatter_test/src/spec.rs
  • Generator recipes: justfile

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Use when a user says "add a ty diagnostic", "write this new ty diagnostic", "change a ty error message", "review ty diagnostics", or asks to add, update, or review ty checks, diagnostic messages, subdiagnostics, or concise output behavior.

日本語の概要は準備中です。原文の説明を表示しています。

modem-dev/ossrules602026年9月21日 更新

Use when adding A2UI rendering to any AG-UI-supported framework or custom AG-UI application, scaffolding an AG-UI app that should render A2UI, adapting an AG-UI integration to emit A2UI surfaces, or wiring the AG-UI A2UI middleware/toolkit with a compatible renderer.

日本語の概要は準備中です。原文の説明を表示しています。

modem-dev/ossrules602026年9月21日 更新

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.

日本語の概要は準備中です。原文の説明を表示しています。

modem-dev/ossrules602026年9月21日 更新

Evaluate an open source project's AGENTS.md and produce a corpus entry for the /agents-md directory. Use when adding a project to the directory, refreshing an existing entry, or running a batch of candidate repositories.

日本語の概要は準備中です。原文の説明を表示しています。

modem-dev/ossrules602026年9月21日 更新

Execute Anarlog work immediately while recording issues, decisions, progress, and lessons in Linear. Use for Anarlog repository or Anarlog desktop, web, mobile, and API work, including related worktrees and ANLG issues. Explicit brainstorming stays discussion-first. Do not use for unrelated repositories or meeting-data queries.

日本語の概要は準備中です。原文の説明を表示しています。

modem-dev/ossrules602026年9月21日 更新

Use only for reviewing completed Biome PRs, branches, commit ranges, diffs, or working trees against business logic and requirements. Excludes broad code-quality and process audits, triage, reproduction, and implementation.

日本語の概要は準備中です。原文の説明を表示しています。

modem-dev/ossrules602026年9月21日 更新

modem-dev のスキルをすべて見る

このスキルの問題を報告する