[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EKHAQYNTG51681MX5A20K3":3,"skill-same:01M7EKHAQYNTG51681MX5A20K3":68},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":13,"repositoryHtmlUrl":25,"repositoryHomepageUrl":6,"ownerHtmlUrl":26,"ownerBlogUrl":27,"ownerDescription":28,"updatedAt":29,"install":30,"resources":43},"01M7EKHAQYNTG51681MX5A20K3","tree-sitter-context-indexing",null,"raillen\u002Fdaisy-code-editor","raillen","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F50306048?v=4","01M7EKBDVVBSPF21PBPVJYMNYR","Raillen Santos","01M7EKBDWD12A1K9N9Y638FGX9",0,"MIT","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftree-sitter-context-indexing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"# Tree-Sitter Context Indexing\n\n## Purpose\nBuild and query language-agnostic code-context indexes with tree-sitter grammars: pinned multi-language parsing, node and capture extraction via declarative queries, byte-range chunking for agent context windows, and incremental re-parsing that reuses unchanged subtrees for fast index refreshes.\n\n## Use when\n- An agent needs structural context such as function, class, import, or call nodes across many languages from one uniform engine.\n- tree-sitter CLI 0.24 or newer with pinned grammar revisions is available for each target language.\n- Files change frequently and re-parsing must cost proportional to the edit, not the file size.\n- Retrieved chunks must align to syntactic boundaries instead of arbitrary line windows.\n\n## Do not use when\n- Semantic resolution such as overloads, trait dispatch, or type inference is required; tree-sitter parses syntax only and a compiler engine skill must be used instead.\n- Only one language is indexed and its native compiler API already provides richer symbols at acceptable cost.\n- Grammar quality for the target language is poor and would silently mislabel core constructs.\n\n## Required context\n- Target languages with pinned grammar revisions, for example tree-sitter-python at v0.23.4 and tree-sitter-typescript at v0.23.2.\n- Checked-in query files in `.scm` format declaring the captures the index consumes.\n- Chunking policy: maximum bytes per chunk, which node types may split, and overlap rules.\n- Token budget for a single query answer: at most 40 chunks and 12000 tokens of emitted context.\n\n## Procedure\n1. **Pin grammars and verify parses**: lock each grammar revision in the spec, then run `tree-sitter parse --quiet` over a 50-file sample per language. Reject any grammar producing ERROR nodes on more than 1% of sampled files.\n2. **Declare extraction queries**: write one `.scm` file per language capturing definitions, references, and imports, for example `(function_definition name: (identifier) @function.def)` with `#match?` and `#eq?` predicates narrowing overloads. Store queries under version control beside the spec.\n3. **Parse incrementally**: keep the previous syntax tree per file and call the incremental entry point with the old tree plus the byte-range edit, so unchanged subtrees are reused. Measure that a one-line edit re-parses in under 15 ms on a 2000-line file.\n4. **Chunk by syntax**: emit one chunk per top-level definition node, splitting oversized bodies at nested definition boundaries and carrying the enclosing signature line as header. Never emit a chunk that starts or ends mid-expression.\n5. **Serve ranked queries**: expose `nodes --capture function.def --name 'route_*'`, `imports --file \u003Cpath>`, and `chunks --symbol \u003Cname>` ranked by exact capture-name match, then same-file proximity, then import-distance hops, then recency, truncating at the 40-chunk and 12000-token caps.\n6. **Verify against goldens**: run `scripts\u002Fverify.sh`, assert parse throughput above 2 MB per second per language and 100% capture recall on the golden node set before declaring the index usable.\n\n## Decision rules\n- **Pinned grammars only**: floating grammar revisions are forbidden; a grammar bump is a spec change with re-verified recall.\n- **Queries are code**: `.scm` files are reviewed, versioned artifacts; inline ad-hoc query strings in index code are forbidden.\n- **ERROR nodes are data**: files with parse errors are indexed with an error flag and excluded from recall claims, never silently counted as clean.\n- **Syntax bounds respected**: no chunk may cross an expression boundary; oversized nodes split at nested definitions or are truncated with a marker.\n- **Throughput floor enforced**: any language parsing below 2 MB per second is profiled and fixed or dropped from the index scope.\n\n## Evidence required\n- Index specification following `templates\u002Ftree-sitter-context-indexing-spec.md` with pinned grammars and query inventory.\n- Per-language ERROR-node rates on the 50-file samples and parse throughput measurements.\n- Golden capture-recall log with measured query p95 latency.\n- Passing execution log from `scripts\u002Fverify.sh`.\n\n## Output contract\n- Pinned multi-language parser set with verified `.scm` extraction queries.\n- Syntax-aligned chunk index queryable by capture, name, imports, and symbol.\n- Parse quality and recall report proving the index meets its targets.\n\n## Stop conditions\n- Capture recall reaches 100% on goldens with query p95 under 200 ms on a warm index.\n- Incremental re-parse of a one-line edit completes in under 15 ms on reference files.\n- Token budget exhausted.\n- Blocked on external dependency.\n\n## Escalation rules\n- Escalate to the language owner if a required grammar misparses core constructs above the 1% ERROR threshold with no upstream fix available.\n- Escalate to the lead architect if chunk-window requirements conflict with syntactic boundaries, so truncation policy can be decided explicitly.\n",{},"main","2e465213b972294984c8c9515a47f811e4b358da",".agents\u002Fskills\u002Ftree-sitter-context-indexing","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor","https:\u002F\u002Fgithub.com\u002Fraillen","https:\u002F\u002Fraillen.com","\u003C\u003CMarketing & IT>>\r\n\r\n@poppy-team\r\n@wasd-lat ","2026-10-16 09:17:52",{"source":7,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add raillen\u002Fdaisy-code-editor --skill tree-sitter-context-indexing",{"tool":36,"command":37},"bunx","bunx skills add raillen\u002Fdaisy-code-editor --skill tree-sitter-context-indexing",{"tool":39,"command":40},"pnpm","pnpm dlx skills add raillen\u002Fdaisy-code-editor --skill tree-sitter-context-indexing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftree-sitter-context-indexing\u002FSKILL.md",true,[44,50,54,58,64],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"checks\u002Ftree-sitter-context-indexing-checklist.md","REFERENCE","参考文档",1628,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftree-sitter-context-indexing\u002Fchecks\u002Ftree-sitter-context-indexing-checklist.md",{"path":51,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":52,"sourceHtmlUrl":53},"manifest.json",2139,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftree-sitter-context-indexing\u002Fmanifest.json",{"path":55,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Ftree-sitter-context-indexing-guide.md",2543,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftree-sitter-context-indexing\u002Freferences\u002Ftree-sitter-context-indexing-guide.md",{"path":59,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":62,"sourceHtmlUrl":63},"scripts\u002Fverify.sh","SCRIPT","脚本",4474,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftree-sitter-context-indexing\u002Fscripts\u002Fverify.sh",{"path":65,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":66,"sourceHtmlUrl":67},"templates\u002Ftree-sitter-context-indexing-spec.md",2204,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftree-sitter-context-indexing\u002Ftemplates\u002Ftree-sitter-context-indexing-spec.md",[69,75,81,88,95,102],{"skillNo":70,"name":71,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":18},"01M7EKQYSDAX3SGSCRF873Z8E2","zoom-reflow","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fzoom-reflow\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":18},"01M7EKQX0MWJNQD482GGZPGES4","wireframe-styleguide","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fwireframe-styleguide\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":18},"01M7EKQS57FS6JYE6KWW6X5ADJ","visual-regression","Pixel-by-pixel snapshot testing, Playwright integration, dynamic content masking, deterministic font rendering, and cross-browser CI gates","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fvisual-regression\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":18},"01M7EKQMFR7651NVH100P5781Z","ui-implementation","Component-driven UI implementation, multi-state matrix (default, hover, focus-visible, active, disabled, loading, empty, error), DTCG design tokens, responsive layout contracts, and accessibility tree mapping.","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fui-implementation\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":18},"01M7EKQG3NVX6DPCYS6Q4PA71V","tui-editor-engine","Text buffer and editing semantics for a terminal code editor — index conversion, transaction-first editing, multi-cursor invariants, undo grouping, and large-file behaviour.","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftui-editor-engine\u002FSKILL.md",[],[],{"skillNo":103,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":18},"01M7EKQEJ993JGC72FE2KFY3ZZ","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftree-sitter-context-indexing\u002FSKILL.md",[],[]]