[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6BZ1P72SHFAGHAWM0H2G3GV":3,"skill-same:01M6BZ1P72SHFAGHAWM0H2G3GV":79},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":49,"commitSha":50,"skillDirectory":51,"forksCount":52,"repositoryHtmlUrl":53,"repositoryHomepageUrl":54,"ownerHtmlUrl":55,"ownerBlogUrl":56,"ownerDescription":57,"updatedAt":58,"install":59,"resources":72},"01M6BZ1P72SHFAGHAWM0H2G3GV","tree-sitter-language-pack-extracting-code-structure",null,"Use when the user wants structured code metadata from a source file — functions, classes, imports, exports, symbols, docstrings, comments, or syntax diagnostics. Covers `ts-pack process` feature flags, the JSON result shape, and the default feature set.","xberg-io\u002Ftree-sitter-language-pack","xberg-io","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F241328462?v=4","01M6BYYMACFMK5WNT338Y71K58","Xberg.io","01M6BYYMEGM63ZCEYZJRTVS9JT",485,"MIT","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fplugin\u002F.hermes\u002Fplugins\u002Ftree-sitter-language-pack\u002Fskills\u002Ftree-sitter-language-pack-extracting-code-structure\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"tree sitter language pack","code structure","extracting code structure","pack","language","tree","structure","extracting","tree sitter","language pack","code","tree sitter language pack extracting code structure","syntax","SET","default","flags","source","imports","result","when","2026-11-10 10:12:30",false,"---\ndescription: Use when the user wants structured code metadata from a source file — functions, classes, imports, exports, symbols, docstrings, comments, or syntax diagnostics. Covers `ts-pack process` feature flags, the JSON result shape, and the default feature set.\nname: tree-sitter-language-pack-extracting-code-structure\n---\n\n\u003C!--\nAI-RULEZ :: GENERATED FILE — DO NOT EDIT\nContent-Hash: blake3:134c19e688f04cc2315c2ffa5fc4c6a567c9166258bc1cc5b1f19f4acfcbddb7\nSource-Hash: blake3:b8687cf31ac8c66a5ecc15c4f11520ff201d8db14467b7528d5120124e9753a4\nSchema-Version: v1\n-->\n\n# Extracting code structure\n\n`ts-pack process \u003Cfile>` runs the code-intelligence pipeline over a source\nfile and prints JSON. Use it when the user wants *structured metadata* —\n\"list the functions\", \"what does this file import\", \"find the exported\nsymbols\", \"pull the docstrings\" — rather than a raw syntax tree.\n\n## Quick recipe\n\n```bash\n# Default features: structure + imports + exports\nts-pack process src\u002Fapp.ts\n\n# Pick features explicitly (only what you ask for is computed)\nts-pack process src\u002Fapp.ts --structure --imports --symbols --docstrings\n\n# Everything\nts-pack process src\u002Fapp.ts --all\n```\n\nWhen no feature flags are given, `process` defaults to\n`--structure --imports --exports`. Passing any single *extraction* flag\n(`--structure --imports --exports --comments --docstrings --symbols\n--diagnostics`) turns off that default set, so list every feature you want.\n`--chunk-size` and `--language` are modifiers, not extraction flags: they do\nnot disable the defaults (e.g. `--chunk-size 500` alone still emits\nstructure+imports+exports and adds chunks).\n\n## Feature flags\n\n| Flag | Extracts |\n| ---- | -------- |\n| `--structure` | Functions, classes, methods, modules (spans, nesting, visibility). |\n| `--imports` | Import statements and their sources. |\n| `--exports` | Exported symbols and their kinds. |\n| `--comments` | Inline and block comments. |\n| `--docstrings` | Docstrings attached to definitions. |\n| `--symbols` | All identifiers (for search\u002Findexing). |\n| `--diagnostics` | Syntax errors and error nodes with positions. |\n| `--all` | Enable every feature above. |\n| `--chunk-size \u003Cbytes>` | Syntax-aware chunks — see `tree-sitter-language-pack-chunking-for-llms`. |\n| `--language \u003Cname>` (`-l`) | Override language (auto-detected from extension otherwise). |\n\n## Result shape\n\n`process` always prints JSON. Top-level keys:\n\n```json\n{\n  \"language\": \"python\",\n  \"metrics\": { \"total_lines\": 0, \"code_lines\": 0, \"comment_lines\": 0, \"blank_lines\": 0, \"total_bytes\": 0, \"node_count\": 0, \"error_count\": 0, \"max_depth\": 0 },\n  \"structure\": [],\n  \"imports\": [],\n  \"exports\": [],\n  \"comments\": [],\n  \"docstrings\": [],\n  \"symbols\": [],\n  \"diagnostics\": [],\n  \"chunks\": []\n}\n```\n\n`metrics` is populated whenever any processing runs. `chunks` appears only\nwhen `--chunk-size` is set. Empty collections are omitted from the JSON\n(the `skip_serializing_if` wire contract), so absent keys mean \"nothing\nfound\", not an error.\n\n### Structure items\n\nEach `structure` entry has `kind` (a capitalized string —\n`\"Function\"`, `\"Class\"`, `\"Method\"`, `\"Module\"`, `\"Struct\"`, `\"Trait\"`,\n…; language-specific kinds serialize as `{\"Other\": \"\u003Ckind>\"}`), `name`,\n`visibility`, and a nested `span` object with `start_byte`\u002F`end_byte` and\n**zero-indexed** `start_line`\u002F`start_column`\u002F`end_line`\u002F`end_column`.\nNesting is expressed via `children` (e.g. methods inside a class), not a\n`parent` pointer. Optional fields: `decorators`, `doc_comment` (the\nattached doc comment), `signature`, and `body_span`.\n\n## Examples\n\n```bash\n# Function and class names with line numbers\nts-pack process src\u002Fservice.py --structure \\\n  | jq '.structure[] | {kind, name, line: .span.start_line}'\n\n# Import sources only\nts-pack process src\u002Fapp.ts --imports \\\n  | jq '.imports[].source'\n\n# Syntax error count (also available via metrics.error_count)\nts-pack process broken.go --diagnostics \\\n  | jq '.diagnostics | length'\n\n# Build a symbol index across a tree of files\nfor f in $(git ls-files '*.rs'); do\n  ts-pack process \"$f\" --symbols | jq -c --arg f \"$f\" '{file: $f, symbols: .symbols}'\ndone\n```\n\n## SDK equivalent\n\n```python\nfrom tree_sitter_language_pack import process, ProcessConfig\n\n# ProcessConfig is a frozen dataclass — set fields in the constructor.\n# structure\u002Fimports\u002Fexports default to True; add the rest you want.\nconfig = ProcessConfig(\"python\", symbols=True, docstrings=True)\nresult = process(source_code, config)\nfor item in result.structure:                 # ProcessResult is an object, not a dict\n    print(item.kind, item.name, item.span.start_line)\n```\n\nThe SDK also exposes the parsed tree (`get_parser(...)` → `Parser`\u002F`Tree`\u002F\n`Node`) for running your own tree-sitter queries, and a `data_extraction`\nconfig flag that pulls a hierarchical key\u002Fvalue tree from data-format files\n(JSON, YAML, TOML, …) into the result's `data` field — neither is exposed\non the CLI.\n\n## When to reach for parse instead\n\nIf the user wants the raw syntax tree rather than extracted metadata, use\n`ts-pack parse` — see the `tree-sitter-language-pack-parsing-source` skill.\n","\u003C!--\nAI-RULEZ :: GENERATED FILE — DO NOT EDIT\nContent-Hash: blake3:134c19e688f04cc2315c2ffa5fc4c6a567c9166258bc1cc5b1f19f4acfcbddb7\nSource-Hash: blake3:b8687cf31ac8c66a5ecc15c4f11520ff201d8db14467b7528d5120124e9753a4\nSchema-Version: v1\n-->\n\n# Extracting code structure\n\n`ts-pack process \u003Cfile>` runs the code-intelligence pipeline over a source\nfile and prints JSON. Use it when the user wants *structured metadata* —\n\"list the functions\", \"what does this file import\", \"find the exported\nsymbols\", \"pull the docstrings\" — rather than a raw syntax tree.\n\n## Quick recipe\n\n```bash\n# Default features: structure + imports + exports\nts-pack process src\u002Fapp.ts\n\n# Pick features explicitly (only what you ask for is computed)\nts-pack process src\u002Fapp.ts --structure --imports --symbols --docstrings\n\n# Everything\nts-pack process src\u002Fapp.ts --all\n```\n\nWhen no feature flags are given, `process` defaults to\n`--structure --imports --exports`. Passing any single *extraction* flag\n(`--structure --imports --exports --comments --docstrings --symbols\n--diagnostics`) turns off that default set, so list every feature you want.\n`--chunk-size` and `--language` are modifiers, not extraction flags: they do\nnot disable the defaults (e.g. `--chunk-size 500` alone still emits\nstructure+imports+exports and adds chunks).\n\n## Feature flags\n\n| Flag | Extracts |\n| ---- | -------- |\n| `--structure` | Functions, classes, methods, modules (spans, nesting, visibility). |\n| `--imports` | Import statements and their sources. |\n| `--exports` | Exported symbols and their kinds. |\n| `--comments` | Inline and block comments. |\n| `--docstrings` | Docstrings attached to definitions. |\n| `--symbols` | All identifiers (for search\u002Findexing). |\n| `--diagnostics` | Syntax errors and error nodes with positions. |\n| `--all` | Enable every feature above. |\n| `--chunk-size \u003Cbytes>` | Syntax-aware chunks — see `tree-sitter-language-pack-chunking-for-llms`. |\n| `--language \u003Cname>` (`-l`) | Override language (auto-detected from extension otherwise). |\n\n## Result shape\n\n`process` always prints JSON. Top-level keys:\n\n```json\n{\n  \"language\": \"python\",\n  \"metrics\": { \"total_lines\": 0, \"code_lines\": 0, \"comment_lines\": 0, \"blank_lines\": 0, \"total_bytes\": 0, \"node_count\": 0, \"error_count\": 0, \"max_depth\": 0 },\n  \"structure\": [],\n  \"imports\": [],\n  \"exports\": [],\n  \"comments\": [],\n  \"docstrings\": [],\n  \"symbols\": [],\n  \"diagnostics\": [],\n  \"chunks\": []\n}\n```\n\n`metrics` is populated whenever any processing runs. `chunks` appears only\nwhen `--chunk-size` is set. Empty collections are omitted from the JSON\n(the `skip_serializing_if` wire contract), so absent keys mean \"nothing\nfound\", not an error.\n\n### Structure items\n\nEach `structure` entry has `kind` (a capitalized string —\n`\"Function\"`, `\"Class\"`, `\"Method\"`, `\"Module\"`, `\"Struct\"`, `\"Trait\"`,\n…; language-specific kinds serialize as `{\"Other\": \"\u003Ckind>\"}`), `name`,\n`visibility`, and a nested `span` object with `start_byte`\u002F`end_byte` and\n**zero-indexed** `start_line`\u002F`start_column`\u002F`end_line`\u002F`end_column`.\nNesting is expressed via `children` (e.g. methods inside a class), not a\n`parent` pointer. Optional fields: `decorators`, `doc_comment` (the\nattached doc comment), `signature`, and `body_span`.\n\n## Examples\n\n```bash\n# Function and class names with line numbers\nts-pack process src\u002Fservice.py --structure \\\n  | jq '.structure[] | {kind, name, line: .span.start_line}'\n\n# Import sources only\nts-pack process src\u002Fapp.ts --imports \\\n  | jq '.imports[].source'\n\n# Syntax error count (also available via metrics.error_count)\nts-pack process broken.go --diagnostics \\\n  | jq '.diagnostics | length'\n\n# Build a symbol index across a tree of files\nfor f in $(git ls-files '*.rs'); do\n  ts-pack process \"$f\" --symbols | jq -c --arg f \"$f\" '{file: $f, symbols: .symbols}'\ndone\n```\n\n## SDK equivalent\n\n```python\nfrom tree_sitter_language_pack import process, ProcessConfig\n\n# ProcessConfig is a frozen dataclass — set fields in the constructor.\n# structure\u002Fimports\u002Fexports default to True; add the rest you want.\nconfig = ProcessConfig(\"python\", symbols=True, docstrings=True)\nresult = process(source_code, config)\nfor item in result.structure:                 # ProcessResult is an object, not a dict\n    print(item.kind, item.name, item.span.start_line)\n```\n\nThe SDK also exposes the parsed tree (`get_parser(...)` → `Parser`\u002F`Tree`\u002F\n`Node`) for running your own tree-sitter queries, and a `data_extraction`\nconfig flag that pulls a hierarchical key\u002Fvalue tree from data-format files\n(JSON, YAML, TOML, …) into the result's `data` field — neither is exposed\non the CLI.\n\n## When to reach for parse instead\n\nIf the user wants the raw syntax tree rather than extracted metadata, use\n`ts-pack parse` — see the `tree-sitter-language-pack-parsing-source` skill.\n",{"name":5,"description":7},"main","6403d3051157d3808dcdca49aeb0c211742d1d61","plugin\u002F.hermes\u002Fplugins\u002Ftree-sitter-language-pack\u002Fskills\u002Ftree-sitter-language-pack-extracting-code-structure",71,"https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack","https:\u002F\u002Fdocs.tree-sitter-language-pack.xberg.io","https:\u002F\u002Fgithub.com\u002Fxberg-io","https:\u002F\u002Fxberg.io","Open-source content intelligence with a Rust core: documents, web, LLMs and code, with native bindings for every major language.","2026-11-07 18:08:38",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add xberg-io\u002Ftree-sitter-language-pack --skill tree-sitter-language-pack-extracting-code-structure",{"tool":65,"command":66},"bunx","bunx skills add xberg-io\u002Ftree-sitter-language-pack --skill tree-sitter-language-pack-extracting-code-structure",{"tool":68,"command":69},"pnpm","pnpm dlx skills add xberg-io\u002Ftree-sitter-language-pack --skill tree-sitter-language-pack-extracting-code-structure","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fplugin\u002F.hermes\u002Fplugins\u002Ftree-sitter-language-pack\u002Fskills\u002Ftree-sitter-language-pack-extracting-code-structure\u002FSKILL.md",true,[73],{"path":74,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":78},"index.md","REFERENCE","参考文档",579,"https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fplugin\u002F.hermes\u002Fplugins\u002Ftree-sitter-language-pack\u002Fskills\u002Ftree-sitter-language-pack-extracting-code-structure\u002Findex.md",[80,98,121,137,155,161],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":87,"publishedAt":44},"01M6BZ48YBWAZH9X1XZ6QVA5TD","tree-sitter-language-pack","Parse and extract code intelligence from 371 programming languages using tree-sitter grammars. Use when writing code that parses source, extracts structure\u002Fimports\u002Fexports\u002Fsymbols\u002Fdocstrings\u002Fcomments, detects a language, runs syntax diagnostics, or produces syntax-aware chunks for LLMs — in Rust, Python, Node.js\u002FTypeScript, or the ts-pack CLI. Covers installation, the CLI surface, the SDK surface, and parser-cache management.","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fskills\u002Ftree-sitter-language-pack\u002FSKILL.md",[86],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[24,33,32,29,28,27,88,89,34,90,91,92,93,94,95,30,96,41,97,43],"rust","writing","llms","cli","node","parser","typescript","io","chunks","parse",{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":112,"publishedAt":44},"01M6BZ461Q0A0TZJG56G6J5QF0","tree-sitter-language-pack-using-the-mcp-server","Use when parsing source, extracting code structure, or detecting a language through the tree-sitter-language-pack MCP server's tools, rather than shelling out to the ts-pack CLI. Covers the tool surface, the auto-installing launcher, and when MCP beats the CLI or SDK.","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fskills\u002Ftree-sitter-language-pack-using-the-mcp-server\u002FSKILL.md",[104,109],{"categoryNo":105,"categoryName":106,"taxonomyType":107,"taxonomyTypeDesc":108},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",{"categoryNo":110,"categoryName":111,"taxonomyType":107,"taxonomyTypeDesc":108},"01JBSEEDCAT000000000000023","Skill与智能体开发",[113,114,24,115,116,33,32,29,28,27,34,91,117,31,118,119,30,40,120,43],"tree sitter language pack using the mcp server","MCP","mcp server","server","detecting","launcher","auto","Tools",{"skillNo":122,"name":123,"nameZh":6,"description":124,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":44},"01M6BZ437CE3DZQ22GYHMNMMVK","tree-sitter-language-pack-parsing-source","Use when the user wants a tree-sitter syntax tree for a source file — an s-expression dump or JSON tree. Covers `ts-pack parse`, language auto-detection vs `--language`, stdin input, and reading `has_errors`.","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fskills\u002Ftree-sitter-language-pack-parsing-source\u002FSKILL.md",[],[128,129,24,33,32,29,40,28,27,130,131,36,132,133,134,119,135,136,97,43],"parsing","tree sitter language pack parsing source","file","json","for","errors","expression","use","reading",{"skillNo":138,"name":139,"nameZh":6,"description":140,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":141,"categories":142,"keywords":143,"publishedAt":44},"01M6BZ40QMB2C6QF2N09MM15GF","tree-sitter-language-pack-managing-parsers","Use when the user needs to manage the tree-sitter parser cache — prefetch parsers for offline or CI runs, list what is downloaded, inspect a language, find the cache directory, or clean it. Covers `ts-pack download`, `list`, `info`, `cache-dir`, `clean`, and `init`.","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fskills\u002Ftree-sitter-language-pack-managing-parsers\u002FSKILL.md",[],[144,145,24,33,32,29,28,27,146,147,148,149,150,132,151,152,153,135,154,43],"parsers","tree sitter language pack managing parsers","ci","init","prefetch","cache","find","inspect","manage","clean","info",{"skillNo":156,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":157,"categories":158,"keywords":160,"publishedAt":44},"01M6BZ3Y1E46H4CPXVJD6SB03D","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fskills\u002Ftree-sitter-language-pack-extracting-code-structure\u002FSKILL.md",[159],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[35,24,34,33,32,31,30,29,28,27,26,25,37,36,38,39,40,41,42,43],{"skillNo":162,"name":163,"nameZh":6,"description":164,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":165,"categories":166,"keywords":167,"publishedAt":44},"01M6BZ3VAJEY26GESPCWQ2JSXA","tree-sitter-language-pack-detecting-languages","Use when the user wants to know which programming language a file or snippet is. Covers implicit detection in `ts-pack parse`\u002F`process`, confirming support with `ts-pack list`\u002F`info`, and the SDK detection functions for path, extension, and raw content.","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fskills\u002Ftree-sitter-language-pack-detecting-languages\u002FSKILL.md",[],[168,24,33,32,29,117,28,27,169,130,170,171,172,132,135,173,174,154,97,43],"tree sitter language pack detecting languages","programming language","programming","support","which","functions","with"]