opentidehq/language-server/tree-sitter
Claude Code and agent skill by opentidehq/language-server
- community
Checking that the SKILL.md file is still in the repository.
Author and bind tree-sitter 0.25.10 grammars for opentide KQL and SPL. Covers grammar.js, vendored parser.c, the tree-sitter CLI pin, Language::from_raw, QueryCursor StreamingIterator, and highlights.scm first-wins. Use when editing grammars/, crates/opentide-syntax, or highlights/queries.
Install
npx vskill@latest install opentidehq/language-server/tree-sitterSKILL.md
The same SKILL.md was published earlier as opentidehq/language-server/tree-sitter.
tree-sitter 0.25
The Rust crate and the CLI are both 0.25.10. CI installs tree-sitter-cli@0.25.10 (npm install --prefix /tmp/ts-cli tree-sitter-cli@0.25.10). scripts/cloud-agent-install.sh installs that same version. A parser generated by any other CLI fails scripts/check-grammars.sh.
Grammars are vendored under grammars/tree-sitter-opentide-{kql,spl,esql,eql,kuery,lucene,falco,cql,yara,exabeam,yaral}/. Only ES|QL has an external scanner (src/scanner.c, nested /* */ comments). crates/opentide-syntax/build.rs compiles src/parser.c, and src/scanner.c when present, with the cc crate. Do not publish these grammars as separate crates and do not depend on a crates.io grammar.
Read references/grammar-workflow.md before editing grammar.js. Read references/query-api.md before calling QueryCursor.
Generate, do not hand-edit
Generated files:
grammars/tree-sitter-opentide-<id>/src/parser.csrc/grammar.jsonsrc/node-types.json- the headers under
src/tree_sitter/
Edit grammar.js only, then run this from the repository root. tree-sitter generate has to see grammar.js, and scripts/check-grammars.sh is not on the path from inside the grammar directory:
check-grammars.sh copies the grammar to a temp directory, runs tree-sitter generate, and diffs parser.c. Commit the regenerated files. A hand-edited parser.c will not match the next generate and will fail CI.
Grammar shape this repo uses
grammar.js starts with /// <reference types="tree-sitter-cli/dsl" /> and module.exports = grammar({...}).
nameisopentide_kqloropentide_spl(underscores). That becomes the C symboltree_sitter_opentide_kql. It is not the LSP language id (kql).extrasare whitespace and$.comment.wordis$.identifier.- Pipelines are
prec.leftsequences ofprimarythenrepeat(seq("|", operator)). - KQL control commands (
.plus a name) are a real production so the engine can emitkql_control_command_unsupported. They are not valid detections. - SPL unknown commands are a production (
unknown_command), not a parse error, sospl_unknown_commandcan be diagnosed. ES|QL does the same foresql_unknown_command. - Case-insensitive keywords: ES|QL uses a regex token aliased to the keyword (
kw(word)) and lists the identifier rules last so an equal-length keyword wins. kuery spells each case variant as a string sowordextraction still works. A regex keyword is not extracted byword. - YARA-L keywords are case-insensitive in any mix. Lexical precedence beats match length in tree-sitter's lexer (a
precedmetakeyword lexesmetadataasmeta), so each keyword is a token rule (_kw_and: token(/[aA][nN][dD]/)) thatkw($, "and")aliases to the lower-case node, and the keywords are areservedset:word: identifierextraction lexes the whole name first, and a reserved word is never an identifier.reservedtakes token rules, not aliases. - EQL keywords are lowercase and listed in
reserved. Lucene reserves upper-caseAND/OR/NOTonly. - A missing token that tree-sitter inserts can be hidden (
MISSINGon an anonymous node).opentide_syntax::first_errorfalls back to the smallest visible node withhas_error, so the engine still reports a parse error. - SQL is not a grammar. Do not add a
selectstatement production "for later". Exabeam'sSELECT…GROUP-BYlayer is not SQL: it is specified as part of exabeam-1.0 and lives in theexabeamgrammar only (docs/EXABEAM.md).
Prefer a JS DSL rule over an external scanner. Adding scanner.c means updating build.rs (compile the extra C file) and check-grammars.sh. Do not add one unless the DSL cannot express the token.
Corpus gate
Every production the engine claims is covered by a fixture under testdata/corpus/<id>/. The first line tags the production:
crates/opentide-syntax/tests/corpus_gate.rs requires those prod:<rule> tags and checks named rules in grammar.json. A new named rule is either added to the required list and given a fixture, or added to the explicit skip set with a reason (structural rules such as expression and source_file are skipped today). docs/LANGUAGE.md gets a row: id, grammar rule, fixture, capture.
A fixture that only lives in a unit-test string does not satisfy the gate.
Highlight queries
highlights/queries/<id>/highlights.scm capture names are a subset of highlights/spec.toml [meta].legend. An unknown capture fails highlight generation.
Order matters. query_captures keeps the earliest pattern for a span, then drops overlaps so semantic tokens never overlap. Specific patterns go before (identifier) @variable. A keyword pattern listed after @variable loses.
; comments in .scm files are query comments, not KQL comments.
Rust binding
opentide-syntax does not use the crates.io LANGUAGE: LanguageFn constant. It calls the generated C symbol and Language::from_raw. That is the supported 0.25 constructor for a raw *const TSLanguage. The pointer must be non-null and point at the static language from tree_sitter_opentide_*. See references/query-api.md for the cast and for StreamingIterator.
Parser::set_language returns Result. Parser::parse returns Option<Tree>. Tree::root_node().has_error() is the parse-error bit. Do not unwrap a parse of user source; surface kql_parse_error / spl_parse_error.
Tests
A grammar change that shifts node kinds must update the .scm file and the engine's node.kind() matches in the same change. Kind strings are the rule names (where_operator), not display names.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/tree-sitter/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/opentidehq/language-server/tree-sitter)