Official agent skill

Type Inference

by biomejs in biomejs/biome

A skill your agent uses when working on Biome's Salsa-backed JavaScript and TypeScript inference, including type-aware lint rules, raw collection or inferred representations, analyzer requests…

OfficialApache-2.0Auto-check passedDevelopment

Install Type Inference

skills CLI
$ npx skills add biomejs/biome --skill type-inference -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install biomejs/biome type-inference --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/biomejs/biome.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/type-inference .claude/skills/type-inference && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
type-inference
GitHub stars
26k
Token cost
~2.6k tokens
SKILL.md length
1,113 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses when working on Biome's Salsa-backed JavaScript and TypeScript inference, including type-aware lint rules, raw collection or inferred representations, analyzer requests…

  • Works in 5 steps: Declare domains: &[RuleDomain::Types] in… → Use Typed as the rule query. → Call an existing inference method on… → …
  • Working on Biomes Salsa-backed JavaScript and TypeScript inference
  • SKILL.md covers Scope, Read the Relevant Guide, Mental Model and Choose the Narrowest Boundary, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Type Inference is an agent skill from biomejs/biome, published by the product's own GitHub organization. Use this skill when working on Biome's Salsa-backed JavaScript and TypeScript inference, including type-aware lint rules, raw collection or inferred representations, analyzer requests, tracked queries, import or cycle resolution, profiling, and Salsa invalidation tests. Do not use for standalone CSS/HTML module-graph data unrelated to JS/TS inference or for ordinary semantic binding analysis.

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts. Compatibility notes: Designed for coding agents working on the Biome codebase (github.com/biomejs/biome).

It sits in Development, covering Linting and formatting. It works with JavaScript and TypeScript. The repository describes itself as: A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP. The licence is Apache-2.0.

When your agent uses it

  • Working on Biomes Salsa-backed JavaScript and TypeScript inference
  • Including type-aware lint rules
  • Inferred representations
  • Analyzer requests

Example prompts

  • “/type-inference”

Requirements

  • Compatibility (from SKILL.md): Designed for coding agents working on the Biome codebase (github.com/biomejs/biome).

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Declare domains: &[RuleDomain::Types] in rule metadata.
  2. Use Typed as the rule query.
  3. Call an existing inference method on RuleContext, backed by TypedService.
  4. Inspect the returned InferredType through its bounded helpers.
  5. Handle classifications explicitly as Match, NoMatch, or Indeterminate.

What it can do on your machine

Read from SKILL.md and the folder at commit c870caa. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for coding agents working on the Biome codebase (github.com/biomejs/biome).

    From compatibility in the SKILL.md frontmatter.

Context cost

Type Inference loads about 2.6k tokens when it runs. Until then it costs about 103 tokens; SKILL.md has 1,113 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~103
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from biomejs/biome at commit c870caa, republished under its Apache-2.0 licence (© biomejs). 1,113 words, ~2,592 tokens.

Download SKILL.mdSave it as .claude/skills/type-inference/SKILL.md (or your agent's skills folder).
name
type-inference
description
Use this skill when working on Biome's Salsa-backed JavaScript and TypeScript inference, including type-aware lint rules, raw collection or inferred representations, analyzer requests, tracked queries, import or cycle resolution, profiling, and Salsa invalidation tests. Do not use for standalone CSS/HTML module-graph data unrelated to JS/TS inference or for ordinary semantic binding analysis.
compatibility
Designed for coding agents working on the Biome codebase (github.com/biomejs/biome).

Salsa-Backed Type Inference

Scope

Use this skill for JavaScript and TypeScript type inference: raw collection, Salsa-backed inferred values, analyzer requests, tracked queries, and inference-specific tests.

Load the corresponding skill for general lint scaffolding, diagnostics, snapshots, or changesets. CSS and HTML module-graph data is outside this skill unless it directly participates in JavaScript or TypeScript inference.

Read the Relevant Guide

Do not load both architecture guides in full for every inference task. Read the sections matching the boundary being changed:

TaskCanonical guide
Raw and inferred representations, collection, inference layers, handles, normalization, work limitsbiome_js_type_info/CONTRIBUTING.md
Analyzer requests, tracked queries, resolution contexts, widening, profiling, Salsa execution testsbiome_module_graph/CONTRIBUTING.md

Read both guides when changing the architecture across their boundary. Then inspect the implementation files for the specific request, query family, or representation being changed.

Do not use these checked-in files as current examples:

  • crates/biome_js_type_info/src/resolver.rs
  • crates/biome_js_type_info/src/flattening.rs
  • crates/biome_js_type_info/src/type.rs
  • crates/biome_js_type_info/src/conditionals.rs
  • crates/biome_js_type_info/src/helpers.rs
  • crates/biome_module_graph/src/js_module_info/module_resolver.rs

They are not declared by the active crate module trees. Treat them as legacy residue unless the task explicitly concerns removing or migrating them.

Mental Model

Type inference has five layers:

text
syntax and semantic collection
    -> raw module tables
    -> analyzer-facing requests
    -> tracked Salsa queries
    -> resolver helpers

Collection walks one module without database access. It records raw types, expressions, and binding types in JsModuleInfo. A request defines one analyzer-facing result contract. Tracked queries provide memoization and invalidation boundaries. Resolver helpers evaluate references and inferred structures inside those boundaries.

Keep the three type worlds distinct:

WorldMain typesPurpose
Raw collectorTypeData / RawTypeData, TypeReference, RawTypeId, TypeStoreModule-local syntax, declarations, imports, and deferred expressions
Database-backedInferredTypeData<'db>, LocalTypeHandle, GlobalTypeIdInferred values and module ownership in tracked computations
Analyzer-facingInferredType<'db>Conservative, bounded inspection for lint rules

TypeReference belongs to the raw world. A lint rule should not pattern-match raw TypeData when InferredType already provides the required operation.

Inferred data remains owned by the module that declared it. Do not copy another module's inferred payload into the current module, including behind Arc. Preserve ownership through references, module-aware handles, global IDs, and tracked queries.

Choose the Narrowest Boundary

The inference levels are alternatives, not sequential phases:

NeedBoundary
Inspect facts collected in one moduleRaw local tables
Resolve one expression, binding, export, member, argument, or classificationTargeted request and tracked query
Resolve every raw type, expression, and binding in a moduleComplete module inference

A wider boundary is not inherently more correct. Use this decision order when more than one level can answer:

text
inspect raw local information
    -> return when the local result is conclusive
    -> resolve the smallest selected reference
    -> preserve uncertainty or widen only when the contract requires it
    -> use complete-module inference as the last resort

infer_module_types serves contracts that need complete tables. infer_module_types_bottom_up is an untracked external scheduler and must not be called from a new tracked query.

Type-Aware Lint Rules

Type-aware JavaScript rules use the analyzer service rather than database queries directly:

  1. Declare domains: &[RuleDomain::Types] in rule metadata.
  2. Use Typed<N> as the rule query.
  3. Call an existing inference method on RuleContext, backed by TypedService.
  4. Inspect the returned InferredType through its bounded helpers.
  5. Handle classifications explicitly as Match, NoMatch, or Indeterminate.

Start from crates/biome_js_analyze/src/services/typed.rs and search current Typed< consumers. Prefer a classification request when a rule asks one property; do not normalize and traverse a complete type when a narrower classifier answers the question.

Changing Raw Inference

When adding syntax-derived type information:

  1. Define the raw representation in crates/biome_js_type_info/src/type_data.rs.
  2. Collect it in crates/biome_js_type_info/src/local_inference.rs or crates/biome_module_graph/src/js_module_info/collector.rs, preserving unresolved operands as TypeReference values.
  3. Convert it in crates/biome_js_type_info/src/interned_types.rs.
  4. Add evaluation under crates/biome_module_graph/src/db/type_inference/ only when generic raw-to-inferred conversion is insufficient.
  5. Audit raw and inferred matches, traversal, and formatting for the new variant.

Collector snapshots prove the raw structure remains deferred where database resolution is required. Query tests separately prove the inferred result.

Requests and Tracked Queries

Requests live under crates/biome_module_graph/src/type_inference/requests/. Add one for a reusable result contract, not for an individual lint rule. Reuse a current request when output and uncertainty behavior match.

A request defines stable metadata, one canonical execution path, exact source origin, and explicit uncertainty. Compose operations through TypeInferenceRequestContext; analyzer code should not construct low-level query inputs.

Add a tracked query only when its result needs an independent memoization and invalidation boundary. A new query must:

  • return the smallest semantic result its consumer needs;
  • take the database and one Salsa input or interned key;
  • read only dependencies that can affect the result;
  • define missing-input, ambiguity, cycle, and work-budget behavior;
  • preserve Unknown or Indeterminate rather than inventing a definite result;
  • use the current query instrumentation family;
  • have correctness and selective-execution tests.

Interning equal inputs gives them shared identity; it does not memoize query results. Follow the module-graph guide's Request architecture and Adding a tracked query sections for current traits, registration, and test requirements.

Show full SKILL.md (371 more words)Show less

Resolution and Result Semantics

On-demand resolution follows the selected lookup path until the request requires broader work. Normalization resolves reachable handles with bounded traversal; it is not complete-module inference. Namespace expansion and guarded deep-import fallback can widen work substantially and must remain explicit and observable.

Do not conflate these outcomes:

ResultMeaning
NoneThe request has no result under its documented contract
InferredTypeData::UnknownInference produced a type whose structure is undetermined
InferredTypeData::UnknownKeywordSource explicitly uses TypeScript's unknown type
TypeInferenceClassification::IndeterminateInference cannot prove a match or non-match
TypeInferenceClassification::MatchInference conclusively proves the condition
TypeInferenceClassification::NoMatchInference conclusively disproves the condition

Unknown or indeterminate information is not a negative result. Preserve it to avoid false-positive diagnostics. Read the canonical widening, cycle recovery, and result-semantics sections before changing those paths.

ResolutionCtx keeps its cycle set, depth limit, and cache per context. Do not create a context for another module during resolution and recurse through it. Cross a tracked query, a spent import or step budget, or the shared declaration evaluator instead. The module-graph guide's Resolver helpers section lists these boundaries.

Testing and Profiling

Test the narrowest affected boundary:

  • collector tests for raw records and references;
  • request/query tests for results, imports, cycles, and uncertainty;
  • Salsa event tests when dependency or invalidation scope changes;
  • analyzer fixtures for final diagnostic behavior.

For targeted flows, prove unrelated edits reuse the query and consumed inputs recompute it. Assert whole-module inference does not execute unless the request contract or tested fallback requires it.

Use the maintenance profile documented in the module-graph guide when a request resolves more data than expected. Request and query timings are inclusive and must not be added together. Load testing-codegen for snapshot mechanics.

Review Checklist

  • The implementation uses the correct raw, inferred, or analyzer-facing world.
  • The request or query is the narrowest boundary satisfying its contract.
  • Missing data, ambiguity, cycles, and exhausted budgets preserve uncertainty.
  • No ResolutionCtx is created during resolution without a tracked query, a spent budget, or the shared declaration evaluator bounding it.
  • Cross-module inferred data remains owned by its source module.
  • New request contracts are reusable and have stable metadata.
  • New query keys and dependencies are stable Salsa values.
  • Whole-module inference is absent or explicitly justified.
  • Correctness and selective-execution tests cover the changed boundary.

© biomejs, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/type-inference of biomejs/biome.

Open the folder on GitHubat commit c870caa

Compare with similar skills

Type Inference next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Type Inference compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Type Inference this skillbiomejs/biome26k—~2.6kAutomated safety check: PassApache-2.0
Install Anti-Slop Oxlint Rulesdmmulroy/anti-slop5.3k1 repos~2.2kAutomated safety check: PassMIT
Ultraciteagustinusnathaniel/nextarter-tailwind1252 repos~1.2kAutomated safety check: PassMIT
Find Similar Functionsmillionco/react-doctor15k—~1.2kAutomated safety check: PassCustom licence
Code Qualityredis/RedisInsight8.9k—~1.2kAutomated safety check: PassCustom licence
Port Ruleweb-infra-dev/rslint460—~1.7kAutomated safety check: PassMIT

Similar skills

  • Installs, updates or migrates the vendored anti-slop Oxlint plugin in a repository, keeping local rule changes and the plugin's license and provenance files.

    5.3k GitHub starsUsed in 1 repo~2.2k tokens
    DevelopmentAuto-check passed
  • Ultracite

    agustinusnathaniel/nextarter-tailwind

    Ultracite is a zero-config linting and formatting preset for JavaScript/TypeScript projects.

    125 GitHub starsUsed in 2 repos~1.2k tokens
    DevelopmentAuto-check passed
  • Find Similar Functions

    millionco/react-doctor

    Use truffler to find similar or pre-existing JavaScript/TypeScript symbols before implementing new code, especially helpers, utilities, parsers, formatters, scanners, fuzzy matchers, and other…

    15k GitHub stars~1.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Code Quality

    redis/RedisInsight

    Official

    Code-quality standards for RedisInsight: TypeScript strictness, naming conventions (camelCase, PascalCase, UPPERSNAKECASE), linting rules, no any without reason, no !important in styles, and…

    8.9k GitHub stars~1.2k tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • Port Rule

    web-infra-dev/rslint

    Port a new ESLint core or plugin rule to rslint, including explicitly requested batches.

    460 GitHub stars~1.7k tokensUpdated today
    DevelopmentAuto-check passed
  • Migrate Oxlint

    Asvarox/allkaraoke

    Guide for migrating a project from ESLint to Oxlint. An agent skill from Asvarox/allkaraoke.

    261 GitHub starsUsed in 4 repos~2.5k tokens
    DevelopmentAuto-check passed

More from biomejs/biome

All 12 skills in this repo
  • Changeset

    biomejs/biome

    Official

    A skill your agent uses when a Biome change may affect users and you must decide whether it needs a changeset, choose the release level, or create and edit .changeset/.md release-note text.

    26k GitHub stars~839 tokensUpdated today
    Auto-check passed
  • Doc Comments

    biomejs/biome

    Official

    A skill your agent uses whenever writing or editing Rust //, ///, or //!

    26k GitHub stars~3k tokensUpdated today
    Auto-check passed
  • Official

    A skill your agent uses when biome migrate eslint must preserve configurable ESLint rule options through source-option models, Biome conversions, typed rule variants, and migration fixtures.

    26k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Official

    A skill your agent uses whenever implementing or debugging Biome formatter behavior, IR composition, node rules, layout selection, source-comment handling, verbatim formatting, idempotency, internal…

    26k GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Official

    A skill your agent uses when creating or modifying Biome lint rules or assists, including analyzer queries, semantic bindings, rule state, code actions, fix safety, options, registration, and…

    26k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Parser Development

    biomejs/biome

    Official

    A skill your agent uses when implementing or modifying Biome parser behavior, including .ungram grammars, lexers, token sources, parse rules, separated lists, error recovery, and parser fixtures.

    26k GitHub stars~1.2k tokensUpdated today
    Auto-check passed

Categories

Questions about Type Inference

What does Type Inference do?

A skill your agent uses when working on Biome's Salsa-backed JavaScript and TypeScript inference, including type-aware lint rules, raw collection or inferred representations, analyzer requests…. Type Inference is an agent skill from biomejs/biome, published by the product's own GitHub organization. Use this skill when working on Biome's Salsa-backed JavaScript and TypeScript inference, including type-aware lint rules, raw collection or inferred representations, analyzer requests, tracked queries, import or cycle resolution, profiling, and Salsa invalidation tests.

When should I use Type Inference?

Type Inference fits situations like: working on Biomes Salsa-backed JavaScript and TypeScript inference; including type-aware lint rules; inferred representations; analyzer requests.

How do I install Type Inference in Claude Code?

Run `npx skills add biomejs/biome --skill type-inference -a claude-code`. Or copy the skill folder (.agents/skills/type-inference in biomejs/biome) into .claude/skills/type-inference in your project. Claude Code loads it when a task matches its description.

How do I install Type Inference in Codex?

Run `npx skills add biomejs/biome --skill type-inference -a codex`. Or copy the skill folder (.agents/skills/type-inference in biomejs/biome) into .agents/skills/type-inference in your project. Codex loads it when a task matches its description.

Can I use Type Inference in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add biomejs/biome --skill type-inference -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/type-inference, .gemini/skills/type-inference, .github/skills/type-inference and .opencode/skills/type-inference in your project.

What does Type Inference need to run?

SKILL.md names no scripts, command-line tools or credentials: Type Inference is instructions for the agent only. Compatibility (from SKILL.md): Designed for coding agents working on the Biome codebase (github.com/biomejs/biome)..

Does Type Inference access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Type Inference safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Type Inference use?

Type Inference is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Type Inference use?

About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Type Inference?

Skills that share tags, products or a category with Type Inference: Install Anti-Slop Oxlint Rules (dmmulroy/anti-slop, 5.3k stars), Ultracite (agustinusnathaniel/nextarter-tailwind, 125 stars), Find Similar Functions (millionco/react-doctor, 15k stars) and Code Quality (redis/RedisInsight, 8.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Type Inference?

biomejs (a GitHub organization, an official publisher) maintains it in biomejs/biome, which has 25,910 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on October 8, 2026.

Source: biomejs/biome on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.