What problem does it solve?
Working with Biome's AST/CST source text often leads to subtle bugs: unnecessary string allocations, incorrect trivia handling, broken quote stripping, wrong range offsets, and temporary-borrow compile errors. This Skill guides coding agents to use the correct typed syntax APIs and token-backed text storage instead of ad-hoc string conversions.
Core Features & Use Cases
- Correct Text Accessors: Choose between
text_trimmed(), token_text_trimmed(), text(), and inner_string_text() based on whether trivia and quotes should be included.
- Allocation-Free Substrings: Use
TokenText::slice(), relative_range(), and source_range() to store token-relative ranges without copying strings.
- Embedded-Language Handling: Verify framework-specific value shapes (quoted
HtmlString, text expressions, directive nodes) before extracting attribute values.
- Use Case: While writing a Biome lint rule that compares an HTML attribute value to a known string, use
inner_string_text() to strip quotes correctly and compare borrowed text without allocating.
Quick Start
Use the syntax-text-handling skill to extract the quote-stripped value of this HTML attribute node and compare it against a handler name without allocating strings.