[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78FC9CYZNXJ0N3AVY4VGPX6":3,"skill-same:01M78FC9CYZNXJ0N3AVY4VGPX6":69},{"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":25,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":28,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M78FC9CYZNXJ0N3AVY4VGPX6","tree-sitter-context-indexing",null,"poppyTM\u002Foride","poppyTM","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F339400917?v=4","01M78F6YNKFR5S5JQR27X9F09Z","Poppy Team","01M78F6YP8ZZTRES9X8Q2ZAD21",1,"MIT","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\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","1cd515630b8ceb57777d466bee4970fe7c2e30e0",".agents\u002Fskills\u002Ftree-sitter-context-indexing",0,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride","https:\u002F\u002Fgithub.com\u002FpoppyTM","https:\u002F\u002Fpoppy.lat","Construímos linguagens de programação e ferramentas para quem lê código com o mesmo cuidado com que escreve.","2026-09-30 10:15:52",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add poppyTM\u002Foride --skill tree-sitter-context-indexing",{"tool":37,"command":38},"bunx","bunx skills add poppyTM\u002Foride --skill tree-sitter-context-indexing",{"tool":40,"command":41},"pnpm","pnpm dlx skills add poppyTM\u002Foride --skill tree-sitter-context-indexing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftree-sitter-context-indexing\u002FSKILL.md",true,[45,51,55,59,65],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"checks\u002Ftree-sitter-context-indexing-checklist.md","REFERENCE","参考文档",1628,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftree-sitter-context-indexing\u002Fchecks\u002Ftree-sitter-context-indexing-checklist.md",{"path":52,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":53,"sourceHtmlUrl":54},"manifest.json",2139,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftree-sitter-context-indexing\u002Fmanifest.json",{"path":56,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Ftree-sitter-context-indexing-guide.md",2543,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftree-sitter-context-indexing\u002Freferences\u002Ftree-sitter-context-indexing-guide.md",{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},"scripts\u002Fverify.sh","SCRIPT","脚本",4474,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftree-sitter-context-indexing\u002Fscripts\u002Fverify.sh",{"path":66,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":67,"sourceHtmlUrl":68},"templates\u002Ftree-sitter-context-indexing-spec.md",2204,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftree-sitter-context-indexing\u002Ftemplates\u002Ftree-sitter-context-indexing-spec.md",[70,76,82,89,96,103],{"skillNo":71,"name":72,"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":73,"categories":74,"keywords":75,"publishedAt":18},"01M78FHQN254KEH0DETXT5JM29","zoom-reflow","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fzoom-reflow\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"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":79,"categories":80,"keywords":81,"publishedAt":18},"01M78FHP1880S695V8GQEE0RXK","wireframe-styleguide","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fwireframe-styleguide\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":18},"01M78FHHYM6AN2H819FABW01DZ","visual-regression","Pixel-by-pixel snapshot testing, Playwright integration, dynamic content masking, deterministic font rendering, and cross-browser CI gates","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fvisual-regression\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":18},"01M78FHE53D8DD0QVRY5C37DA4","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\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fui-implementation\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":18},"01M78FHBJ1KXFF734GFE509TBJ","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\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftui-editor-engine\u002FSKILL.md",[],[],{"skillNo":104,"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":105,"categories":106,"keywords":107,"publishedAt":18},"01M78FH9X6CPJX1H61ZDWTTVW8","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftree-sitter-context-indexing\u002FSKILL.md",[],[]]