Tree-sitter

Expert skill for creating tree-sitter grammars for incremental parsing and syntax highlighting

509 stars

Best use case

Tree-sitter is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Expert skill for creating tree-sitter grammars for incremental parsing and syntax highlighting

Teams using Tree-sitter should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/tree-sitter/SKILL.md --create-dirs "https://raw.githubusercontent.com/a5c-ai/babysitter/main/library/specializations/programming-languages/skills/tree-sitter/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/tree-sitter/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How Tree-sitter Compares

Feature / AgentTree-sitterStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Expert skill for creating tree-sitter grammars for incremental parsing and syntax highlighting

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Tree-sitter Skill

## Overview

Expert skill for creating tree-sitter grammars for incremental parsing and syntax highlighting.

## Capabilities

- Write tree-sitter grammar.js files
- Handle tree-sitter external scanners
- Design queries for syntax highlighting
- Implement incremental parsing support
- Handle tree-sitter error recovery
- Generate bindings for various languages
- Integrate with editors (VS Code, Neovim, Helix)
- Test grammars with corpus files

## Target Processes

- language-grammar-design.js
- lexer-implementation.js
- parser-development.js
- lsp-server-implementation.js

## Dependencies

- tree-sitter CLI
- tree-sitter crates/npm packages

## Usage Guidelines

1. **Grammar.js**: Follow tree-sitter grammar.js conventions
2. **External Scanners**: Use external scanners for context-sensitive lexing
3. **Queries**: Write highlight.scm and other query files for editor integration
4. **Testing**: Build comprehensive corpus test files
5. **Error Recovery**: Design grammar with error recovery in mind

## Output Schema

```json
{
  "type": "object",
  "properties": {
    "grammarName": { "type": "string" },
    "nodeTypes": {
      "type": "array",
      "items": { "type": "string" }
    },
    "queries": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": ["highlights", "injections", "locals", "tags", "folds"]
      }
    },
    "bindings": {
      "type": "array",
      "items": { "type": "string" }
    },
    "generatedFiles": {
      "type": "array",
      "items": { "type": "string" }
    }
  }
}
```

Related Skills

babysitter

509
from a5c-ai/babysitter

Orchestrate via @babysitter. Use this skill when asked to babysit a run, orchestrate a process or whenever it is called explicitly. (babysit, babysitter, orchestrate, orchestrate a run, workflow, etc.)

behavior-trees

509
from a5c-ai/babysitter

Behavior tree design and implementation skill for game AI. Enables creation of behavior tree structures, custom nodes, decorators, composites, and integration with game engines for NPC and enemy AI systems.

decision-tree-analyzer

509
from a5c-ai/babysitter

Decision tree analysis skill with expected value, risk analysis, and utility theory.

phylogenetics-tree-builder

509
from a5c-ai/babysitter

Phylogenetic analysis skill for constructing evolutionary trees and assessing relationships

dun-bradstreet-data

509
from a5c-ai/babysitter

Dun & Bradstreet data quality and firmographic enrichment

decision-tree-builder

509
from a5c-ai/babysitter

Automated decision tree construction skill for structuring complex decisions with probabilities, payoffs, and expected value calculations

issue-tree-generator

509
from a5c-ai/babysitter

Generate and validate issue trees for structured problem solving with MECE validation

segment-tree-builder

509
from a5c-ai/babysitter

Generate customized segment tree implementations

using-git-worktrees

509
from a5c-ai/babysitter

Use when starting feature work that needs isolation from current workspace or before executing implementation plans.

Worktree Isolation

509
from a5c-ai/babysitter

Manage git worktree lifecycle for safe, isolated parallel development.

process-builder

509
from a5c-ai/babysitter

Scaffold new babysitter process definitions following SDK patterns, proper structure, and best practices. Guides the 3-phase workflow from research to implementation.

Workflow & Productivity

yolo

509
from a5c-ai/babysitter

Run Babysitter autonomously with minimal manual interruption.