biome-developer
This skill guides developers working on Biome's codebase through essential patterns and pitfalls. It covers AST and syntax node navigation, efficient string extraction without allocation, and handling embedded languages across frameworks like Vue and Svelte. Use it to write cleaner, more maintainable code and avoid costly mistakes when extending Biome's parser, analyzer, and formatter.
biome-developer teaches patterns for working on Biome's codebase, covering AST navigation, string handling, and embedded language support.
AI-generated summary based on this skill's SKILL.md
Install
biomejs/biome/biome-developer · repository language: Rust
git clone https://github.com/biomejs/biome
cp -r biome/.claude/skills/biome-developer ~/.claude/skills/biome-developernpx skillfed install biomejs/biome/biome-developerFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What are biome development best practices?
biome-developer emphasizes learning biome-specific patterns to avoid common mistakes. Key practices include: using `TokenText` for zero-copy string access instead of allocating new strings, leveraging syntax node hierarchy for efficient AST navigation, and understanding the parser crate's `quick_test` utilities for validation. Follow Rust best practices with clippy compliance, use let chains and collapsible if patterns for readability, and test embedded language support thoroughly before merging changes to the codebase.
How do you work with biome AST and syntax nodes?
biome-developer teaches AST navigation by understanding syntax node hierarchy and parent-child relationships. Access nodes through their typed interfaces, navigate using parent and sibling methods, and manipulate syntax carefully to avoid borrow checker issues with temporary values. Use `inner_string_text` for trimmed content and `text_trimmed` appropriately based on context. Master these patterns to write robust code that traverses and transforms Biome's abstract syntax trees reliably.
What's the best approach to biome string extraction and text handling?
biome-developer prioritizes efficient string extraction without unnecessary allocation. Use `TokenText` for zero-copy access to token content, avoiding heap allocation when possible. Understand the distinction between `inner_string_text` and `text_trimmed` methods to extract exactly what you need. Store token relative ranges rather than duplicating strings, and be mindful of borrow checker constraints when working with temporary values. This approach keeps memory usage low and performance high.
How do you implement support for embedded languages correctly?
biome-developer covers embedded language support for Vue, Svelte, Astro, and similar frameworks. Handle directives properly, parse HTML attributes accurately, and test embedded language scenarios before deployment. Understand how Biome's parser integrates different language contexts, manage token boundaries across language transitions, and validate that your implementation doesn't break existing embedded language support. Use the workspace path dependencies in cargo to test changes across Biome's modular codebase.
What common gotchas should you avoid in biome development?
biome-developer highlights avoiding costly mistakes: don't allocate strings unnecessarily when `TokenText` suffices, watch for borrow checker issues with temporary values in syntax node manipulation, and be careful with token relative range storage to prevent offset errors. Test embedded language support thoroughly, validate directive handling across frameworks, and use quick_test utilities during development. Following these patterns prevents regressions and keeps your contributions maintainable.
How do you extract CSS class names using biome?
biome-developer guides CSS class name extraction by understanding HTML attribute parsing and token text handling. Navigate the syntax tree to locate class attributes, use `TokenText` to access their values without allocation, and parse the space-separated class list efficiently. Handle edge cases like quoted values and whitespace trimming. Test your extraction logic with the parser crate's quick_test utilities to ensure accuracy across different HTML contexts and embedded language scenarios.
SKILL.md
rendered from the published skill — quoted content, verbatim
Purpose
This skill provides general development best practices, common gotchas, and Biome-specific patterns that apply across different areas of the codebase. Use this as a reference when you encounter unfamiliar APIs or need to avoid common mistakes.
Prerequisites
- Basic familiarity with Rust
- Understanding of Biome's architecture (parser, analyzer, formatter)
- Development environment set up (see CONTRIBUTING.md)
Common Gotchas and Best Practices
Working with AST and Syntax Nodes
DO:
- Use parser crate's quick_test to inspect AST structure before implementing
- Understand the node hierarchy and parent-child relationships
- Check both general cases AND specific types (e.g., Vue has both VueDirective and VueV*ShorthandDirective)
- Verify your solution works for all relevant
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 1 file
.claude/skills/biome-developer/SKILL.md