Official agent skill

Syntax Text Handling

by biomejs in biomejs/biome

A skill your agent uses when extracting or storing Biome AST/CST source text, working with any SyntaxNode, SyntaxToken, TokenText, quoted strings, token-relative ranges, or embedded-language…

OfficialApache-2.0Auto-check passedDevelopment

Install Syntax Text Handling

skills CLI
$ npx skills add biomejs/biome --skill syntax-text-handling -a claude-code

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

GitHub CLI
$ gh skill install biomejs/biome syntax-text-handling --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/syntax-text-handling .claude/skills/syntax-text-handling && 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
syntax-text-handling
GitHub stars
26k
Token cost
~1.4k tokens
SKILL.md length
571 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses when extracting or storing Biome AST/CST source text, working with any SyntaxNode, SyntaxToken, TokenText, quoted strings, token-relative ranges, or embedded-language…

  • Storing Biome AST/CST source text
  • SKILL.md covers Inspect Before Implementing, Text Accessors, Quoted Strings and Store Substrings Without…, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Working with any SyntaxNode

What it does

Syntax Text Handling is an agent skill from biomejs/biome, published by the product's own GitHub organization. Use this skill when extracting or storing Biome AST/CST source text, working with any SyntaxNode, SyntaxToken, TokenText, quoted strings, token-relative ranges, or embedded-language attribute values, or diagnosing trivia, allocation, range, and temporary-borrow problems. Do not use for parser implementation or formatter comment placement.

Its SKILL.md is about 1.4k 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. 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

  • Storing Biome AST/CST source text
  • Working with any SyntaxNode
  • Token-relative ranges
  • Embedded-language attribute values

Example prompts

  • “/syntax-text-handling”

Requirements

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

What it can do on your machine

Read from SKILL.md and the folder at commit 4d056a5. 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 (its code samples are rust).

    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

Syntax Text Handling loads about 1.4k tokens when it runs. Until then it costs about 92 tokens; SKILL.md has 571 words of instructions outside code blocks.

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

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 4d056a5, republished under its Apache-2.0 licence (© biomejs). 571 words, ~1,422 tokens.

Download SKILL.mdSave it as .claude/skills/syntax-text-handling/SKILL.md (or your agent's skills folder).
name
syntax-text-handling
description
Use this skill when extracting or storing Biome AST/CST source text, working with any `SyntaxNode`, `SyntaxToken`, `TokenText`, quoted strings, token-relative ranges, or embedded-language attribute values, or diagnosing trivia, allocation, range, and temporary-borrow problems. Do not use for parser implementation or formatter comment placement.
compatibility
Designed for coding agents working on the Biome codebase (github.com/biomejs/biome).

Syntax Text Handling

Use typed syntax APIs and preserve source ownership instead of converting syntax text into strings.

Inspect Before Implementing

Do not infer an AST shape from source spelling. Inspect the parser quick test for the language and search generated node definitions and existing consumers. Load testing-codegen for the current quick-test command.

Check every relevant union member and framework-specific value representation. Similar source syntax may use different typed nodes.

Text Accessors

APIResultUse
SyntaxToken::text_trimmed()&strBorrow token text without leading or trailing trivia
SyntaxToken::token_text_trimmed()TokenTextRetain token-backed text without trivia
SyntaxToken::text()&strExact source text including trivia
SyntaxNode::text_trimmed()node textDiagnostics or display where interior trivia is intentional
inner_string_text(token) free helperTokenTextQuote-stripped token content
HtmlString::inner_string_text()SyntaxResult<TokenText>Quote-stripped content from a typed HTML string node

SyntaxNode::text_trimmed() removes only outer trivia. Whitespace and comments between child tokens remain, so it is not a semantic accessor for a multi-token node. Prefer a typed token, typed accessor, or structural match.

Do not call .to_string(), .to_trimmed_string(), or format! merely to compare syntax text. Borrow a &str or retain a TokenText.

Quoted Strings

Use the syntax crate's inner_string_text() implementation. It handles the language's token representation and returns token-backed text.

rust
let string = value.as_html_string()?;
let inner = string.inner_string_text().ok()?;
let matches_handler = inner.text() == "handler";

Do not strip quotes with byte slicing. Besides allocating or risking invalid boundaries, manual slicing duplicates language-specific behavior already covered by the accessor and its tests.

Store Substrings Without Allocation

TokenText already stores a green token plus a token-relative TextRange. Use its existing APIs instead of adding another token-and-range wrapper:

rust
let word = inner.clone().slice(word_range);
let text = word.text();
let relative_range = word.relative_range();
let source_range = word.source_range(value_token.text_range());

Pass slice() a range relative to the current TokenText; it retains the underlying token and adjusts the selected range. relative_range() returns the resulting range relative to the whole token, while source_range() translates it using the whole token's file range. Build slice ranges from valid byte boundaries in the current text.

Embedded Languages

Verify value shapes per framework and syntax version. For example, an HTML-family attribute may hold a quoted HtmlString, a single text expression, or a framework-specific directive node. Do not handle one shape and assume the others share its accessor or offset rules.

Keep embedded-language parsing concerns separate:

  • parser nodes establish the source shape;
  • syntax helpers extract source-backed text;
  • embedding code translates source ranges and selects the embedding kind;
  • analyzers consume the resulting typed data.

Support legacy syntax only when the task requires it and the current parser represents it.

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

Temporary Borrows

Typed accessors often return owned wrapper nodes whose tokens borrow through that wrapper. Bind intermediate values when a chained expression would drop the owner too early:

rust
let value_node = attribute.value().ok()?;
let string = value_node.as_html_string()?;
let token = string.value_token().ok()?;
let text = token.text_trimmed();

Do not solve a temporary-borrow error by converting to String unless the value genuinely must outlive its syntax tree.

Use Strongly Typed Nodes

Always prefer using specific, strongly typed syntax nodes (like AnyJsExpression, JsCallExpression) over generic, weakly typed syntax nodes (like JsSyntaxNode) in function parameters.

GOOD:

rust
fn is_react_call(node: &JsCallExpression) -> bool { ... }

BAD:

rust
fn is_react_call(node: &JsSyntaxNode) -> bool { ... }

You can use declare_node_union! to define custom sets of nodes.

Review Checklist

  • The code uses a typed node or token rather than matching a multi-token node's rendered text.
  • Token comparisons exclude trivia intentionally.
  • Quote stripping uses the language helper.
  • Stored text remains token-backed when the syntax tree outlives it.
  • Relative ranges are relative to the stored token text, not the file.
  • Absolute offsets account for quotes exactly once.
  • Every relevant framework or union variant is covered or deliberately excluded.
  • No allocation was introduced solely to satisfy borrowing or comparison.

References

  • Token text: crates/biome_rowan/src/token_text.rs
  • Syntax tokens: crates/biome_rowan/src/syntax/token.rs
  • Syntax nodes: crates/biome_rowan/src/syntax/node.rs
  • HTML string helpers: crates/biome_html_syntax/src/string_ext.rs
  • Language-specific syntax extension modules under crates/biome_*_syntax/src/

© 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/syntax-text-handling of biomejs/biome.

Open the folder on GitHubat commit 4d056a5

Compare with similar skills

Syntax Text Handling 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.

Syntax Text Handling compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Syntax Text Handling this skillbiomejs/biome26k—~1.4kAutomated safety check: PassApache-2.0
Minimizing Ty Ecosystem Changesastral-sh/ruff50k—~4.6kAutomated safety check: PassMIT
Install Anti-Slop Oxlint Rulesdmmulroy/anti-slop5.3k—~2.2kAutomated safety check: PassMIT
Babysit PR To Pass CIsgl-project/sglang37k2 repos~3kAutomated safety check: PassApache-2.0
Rust Best Practicesfarm-fe/farm5.6k3 repos~1.1kAutomated safety check: PassMIT
Summarise Ecosystem Resultsastral-sh/ruff50k—~2.2kAutomated safety check: PassMIT

Similar skills

  • Official

    A skill your agent uses when a user says "minimize this ty ecosystem change", "reproduce this ecosystem result", "investigate a primer difference", "investigate a mypyprimer difference"…

    50k GitHub stars~4.6k tokensUpdated today
    DevelopmentAuto-check passed
  • 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 stars~2.2k tokensUpdated 28 days ago
    DevelopmentAuto-check passed
  • Babysit PR To Pass CI

    sgl-project/sglang

    Start and persistently pursue a goal to babysit an SGLang pull request until selected GitHub Actions workflows pass on the latest PR head.

    37k GitHub starsUsed in 2 repos~3k tokens
    DevelopmentAuto-check passed
  • Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.

    5.6k GitHub starsUsed in 3 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Official

    A skill your agent uses when a user says "summarise ecosystem results", "summarize this ty ecosystem report", "what changed in this ecosystem run?", or asks to summarise or summarize ty ecosystem…

    50k GitHub stars~2.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Go Pedantry

    chromedp/chromedp

    This skill should be used when the user is writing Go code and needs guidance on Go-specific pedantry: error wrapping with fmt.Errorf and %w, interface design (accept interfaces return structs)…

    13k GitHub stars~3.7k tokensUpdated 3 days ago
    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 Syntax Text Handling

What does Syntax Text Handling do?

A skill your agent uses when extracting or storing Biome AST/CST source text, working with any SyntaxNode, SyntaxToken, TokenText, quoted strings, token-relative ranges, or embedded-language…. Syntax Text Handling is an agent skill from biomejs/biome, published by the product's own GitHub organization. Use this skill when extracting or storing Biome AST/CST source text, working with any SyntaxNode, SyntaxToken, TokenText, quoted strings, token-relative ranges, or embedded-language attribute values, or diagnosing trivia, allocation, range, and temporary-borrow problems.

When should I use Syntax Text Handling?

Syntax Text Handling fits situations like: storing Biome AST/CST source text; working with any SyntaxNode; token-relative ranges; embedded-language attribute values.

How do I install Syntax Text Handling in Claude Code?

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

How do I install Syntax Text Handling in Codex?

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

Can I use Syntax Text Handling 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 syntax-text-handling -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/syntax-text-handling, .gemini/skills/syntax-text-handling, .github/skills/syntax-text-handling and .opencode/skills/syntax-text-handling in your project.

What does Syntax Text Handling need to run?

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

Does Syntax Text Handling 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 Syntax Text Handling 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 Syntax Text Handling use?

Syntax Text Handling 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 Syntax Text Handling use?

About 1.4k tokens (SKILL.md is roughly 5.7k 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 Syntax Text Handling?

Skills that share tags, products or a category with Syntax Text Handling: Minimizing Ty Ecosystem Changes (astral-sh/ruff, 50k stars), Install Anti-Slop Oxlint Rules (dmmulroy/anti-slop, 5.3k stars), Babysit PR To Pass CI (sgl-project/sglang, 37k stars) and Rust Best Practices (farm-fe/farm, 5.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Syntax Text Handling?

biomejs (a GitHub organization, an official publisher) maintains it in biomejs/biome, which has 25,911 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on October 9, 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.