[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6BZ0406XWMBSKWYHGGEANR6":3,"skill-same:01M6BZ0406XWMBSKWYHGGEANR6":80},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":40,"linkOnly":41,"markdownContent":42,"markdownBody":43,"frontMatter":44,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":53,"repositoryHtmlUrl":54,"repositoryHomepageUrl":55,"ownerHtmlUrl":56,"ownerBlogUrl":57,"ownerDescription":58,"updatedAt":59,"install":60,"resources":73},"01M6BZ0406XWMBSKWYHGGEANR6","tree-sitter-language-pack-parsing-source","tree-sitter 源码语法解析","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`.","当用户需要为源文件生成 tree-sitter 语法树时使用——以 s 表达式形式转储或以 JSON 树形式输出。涵盖 `ts-pack parse`、语言自动检测与通过 `--language` 指定语言的对比、标准输入（stdin）输入，以及读取 `has_errors`。","xberg-io\u002Ftree-sitter-language-pack","xberg-io","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F241328462?v=4","01M6BYYMACFMK5WNT338Y71K58","Xberg.io","01M6BYYMEGM63ZCEYZJRTVS9JT",485,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fplugin\u002F.ai-rulez\u002Fskills\u002Ftree-sitter-language-pack-parsing-source\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TKQDF2K4KQS863Q79P4","开发参考","SCENARIO","使用场景",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",[31,32,33,34,35,36,37,38,39],"parsing","language pack","tree sitter","tree sitter language pack parsing source","file","playbook","detection","json","syntax","2026-11-10 10:12:30",false,"---\ntype: Playbook\ntitle: Tree Sitter Language Pack Parsing Source\ndescription: 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`.\nx-ai-rulez:\n  kind: skill\n  id: tree-sitter-language-pack-parsing-source\n  metadata:\n    name: tree-sitter-language-pack-parsing-source\n---\n\n# Parsing source into a syntax tree\n\n`ts-pack parse \u003Cfile>` parses one source file with the matching\ntree-sitter grammar and prints the resulting concrete syntax tree. Use it\nwhen the user wants the tree itself — to inspect node structure, debug a\ngrammar, or feed an s-expression to another tool.\n\n## Quick recipe\n\n```bash\n# S-expression (default) — auto-detects language from the file extension\nts-pack parse src\u002Fmain.rs\n\n# JSON form: { \"language\", \"sexp\", \"has_errors\" }\nts-pack parse src\u002Fmain.rs --format json\n```\n\n## Flag surface\n\n| Flag | Short | Default | Purpose |\n| ---- | ----- | ------- | ------- |\n| `--language \u003Cname>` | `-l` | auto | Override the language (skip extension detection). |\n| `--format \u003Cfmt>` | `-f` | `sexp` | `sexp` or `json`. |\n\nThe parser library for the language downloads on first use and is cached.\n\n## Language detection\n\nThe language is auto-detected from the file extension. Override it when the\nextension is missing, misleading, or you are reading from stdin:\n\n```bash\n# Misleading extension or no extension:\nts-pack parse script --language bash\n\n# stdin (use \"-\" as the file):\ncat snippet.py | ts-pack parse - --language python\n```\n\nstdin cannot be auto-detected by path; always pass `--language` with `-`.\nFor content-based detection without a path, use the SDK\n(`detect_language_from_content`) — see the `tree-sitter-language-pack-detecting-languages` skill.\n\n## Output shapes\n\n### S-expression\n\nA nested `(node_type child ...)` tree. Compact, good for eyeballing\nstructure or piping to a grammar tool.\n\n### JSON\n\n```json\n{\n  \"language\": \"rust\",\n  \"sexp\": \"(source_file (function_item ...))\",\n  \"has_errors\": false\n}\n```\n\nRead `has_errors` to know whether the parse produced any error nodes — a\nfast syntax check. For positioned, per-error detail use\n`ts-pack process \u003Cfile> --diagnostics` (see `tree-sitter-language-pack-extracting-code-structure`).\n\n## Examples\n\n```bash\n# Inspect a TypeScript file's tree\nts-pack parse src\u002Fapp.ts\n\n# Machine-readable, then check for syntax errors with jq\nts-pack parse src\u002Fapp.ts --format json | jq '.has_errors'\n\n# Parse a heredoc as Python\nprintf 'def f():\\n    return 1\\n' | ts-pack parse - -l python\n```\n\n## When to reach for process instead\n\n`parse` gives you the raw tree. If the user wants structured metadata\n(functions, imports, exports, symbols, docstrings) rather than the tree,\nuse `ts-pack process` — see the `tree-sitter-language-pack-extracting-code-structure` skill.\n","# Parsing source into a syntax tree\n\n`ts-pack parse \u003Cfile>` parses one source file with the matching\ntree-sitter grammar and prints the resulting concrete syntax tree. Use it\nwhen the user wants the tree itself — to inspect node structure, debug a\ngrammar, or feed an s-expression to another tool.\n\n## Quick recipe\n\n```bash\n# S-expression (default) — auto-detects language from the file extension\nts-pack parse src\u002Fmain.rs\n\n# JSON form: { \"language\", \"sexp\", \"has_errors\" }\nts-pack parse src\u002Fmain.rs --format json\n```\n\n## Flag surface\n\n| Flag | Short | Default | Purpose |\n| ---- | ----- | ------- | ------- |\n| `--language \u003Cname>` | `-l` | auto | Override the language (skip extension detection). |\n| `--format \u003Cfmt>` | `-f` | `sexp` | `sexp` or `json`. |\n\nThe parser library for the language downloads on first use and is cached.\n\n## Language detection\n\nThe language is auto-detected from the file extension. Override it when the\nextension is missing, misleading, or you are reading from stdin:\n\n```bash\n# Misleading extension or no extension:\nts-pack parse script --language bash\n\n# stdin (use \"-\" as the file):\ncat snippet.py | ts-pack parse - --language python\n```\n\nstdin cannot be auto-detected by path; always pass `--language` with `-`.\nFor content-based detection without a path, use the SDK\n(`detect_language_from_content`) — see the `tree-sitter-language-pack-detecting-languages` skill.\n\n## Output shapes\n\n### S-expression\n\nA nested `(node_type child ...)` tree. Compact, good for eyeballing\nstructure or piping to a grammar tool.\n\n### JSON\n\n```json\n{\n  \"language\": \"rust\",\n  \"sexp\": \"(source_file (function_item ...))\",\n  \"has_errors\": false\n}\n```\n\nRead `has_errors` to know whether the parse produced any error nodes — a\nfast syntax check. For positioned, per-error detail use\n`ts-pack process \u003Cfile> --diagnostics` (see `tree-sitter-language-pack-extracting-code-structure`).\n\n## Examples\n\n```bash\n# Inspect a TypeScript file's tree\nts-pack parse src\u002Fapp.ts\n\n# Machine-readable, then check for syntax errors with jq\nts-pack parse src\u002Fapp.ts --format json | jq '.has_errors'\n\n# Parse a heredoc as Python\nprintf 'def f():\\n    return 1\\n' | ts-pack parse - -l python\n```\n\n## When to reach for process instead\n\n`parse` gives you the raw tree. If the user wants structured metadata\n(functions, imports, exports, symbols, docstrings) rather than the tree,\nuse `ts-pack process` — see the `tree-sitter-language-pack-extracting-code-structure` skill.\n",{"type":45,"title":46,"x-ai-rulez":47,"description":7},"Playbook","Tree Sitter Language Pack Parsing Source",{"id":5,"kind":48,"metadata":49},"skill",{"name":5},"main","c14405493731b34089b4aae085abe5527b5000c7","plugin\u002F.ai-rulez\u002Fskills\u002Ftree-sitter-language-pack-parsing-source",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-15 00:20:30",{"source":9,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add xberg-io\u002Ftree-sitter-language-pack --skill tree-sitter-language-pack-parsing-source",{"tool":66,"command":67},"bunx","bunx skills add xberg-io\u002Ftree-sitter-language-pack --skill tree-sitter-language-pack-parsing-source",{"tool":69,"command":70},"pnpm","pnpm dlx skills add xberg-io\u002Ftree-sitter-language-pack --skill tree-sitter-language-pack-parsing-source","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fplugin\u002F.ai-rulez\u002Fskills\u002Ftree-sitter-language-pack-parsing-source\u002FSKILL.md",true,[74],{"path":75,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":78,"sourceHtmlUrl":79},"index.md","REFERENCE","参考文档",280,"https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fplugin\u002F.ai-rulez\u002Fskills\u002Ftree-sitter-language-pack-parsing-source\u002Findex.md",[81,112,133,147,171,189],{"skillNo":82,"name":83,"nameZh":84,"description":85,"descriptionZh":86,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":87,"categories":88,"keywords":93,"publishedAt":40},"01M6BZ48YBWAZH9X1XZ6QVA5TD","tree-sitter-language-pack","tree-sitter 代码智能解析","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.","使用 tree-sitter 语法从 371 种编程语言中解析并提取代码智能信息。适用于编写解析源代码、提取结构\u002F导入\u002F导出\u002F符号\u002F文档字符串\u002F注释、检测语言、运行语法诊断或为大模型（LLM）生成语法感知分块的代码——支持 Rust、Python、Node.js\u002FTypeScript 或 ts-pack CLI。涵盖安装、CLI 接口、SDK 接口以及解析器缓存管理。","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fskills\u002Ftree-sitter-language-pack\u002FSKILL.md",[89,90],{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":91,"categoryName":92,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8CBEPE1MJTS9ARYEK7J8BH4","代码解析与结构分析",[94,32,33,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111],"tree sitter language pack","tree","language","pack","rust","writing","code","llms","cli","node","parser","typescript","io","structure","chunks","imports","parse","when",{"skillNo":113,"name":114,"nameZh":115,"description":116,"descriptionZh":117,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":118,"categories":119,"keywords":122,"publishedAt":40},"01M6BZ461Q0A0TZJG56G6J5QF0","tree-sitter-language-pack-using-the-mcp-server","tree-sitter MCP 服务使用","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.","当需要通过 tree-sitter-language-pack 的 MCP 服务器工具来解析源代码、提取代码结构或检测语言（而非调用 ts-pack CLI）时使用。涵盖工具接口、自动安装启动器，以及 MCP 相较于 CLI 或 SDK 的优势场景。","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fskills\u002Ftree-sitter-language-pack-using-the-mcp-server\u002FSKILL.md",[120,121],{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":91,"categoryName":92,"taxonomyType":23,"taxonomyTypeDesc":24},[123,124,94,125,126,32,33,95,96,97,100,102,127,128,129,130,107,131,132,111],"tree sitter language pack using the mcp server","MCP","mcp server","server","detecting","extracting","launcher","auto","source","Tools",{"skillNo":134,"name":5,"nameZh":135,"description":7,"descriptionZh":136,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":137,"categories":138,"keywords":141,"publishedAt":40},"01M6BZ437CE3DZQ22GYHMNMMVK","源代码语法树解析","当用户需要为源文件生成 tree-sitter 语法树时使用——以 s-表达式转储或 JSON 树的形式呈现。涵盖 `ts-pack parse`、语言自动检测与 `--language` 的对比、标准输入（stdin）输入以及读取 `has_errors`。","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fskills\u002Ftree-sitter-language-pack-parsing-source\u002FSKILL.md",[139,140],{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":91,"categoryName":92,"taxonomyType":23,"taxonomyTypeDesc":24},[31,34,94,32,33,95,131,96,97,35,38,39,142,143,144,130,145,146,110,111],"for","errors","expression","use","reading",{"skillNo":148,"name":149,"nameZh":150,"description":151,"descriptionZh":152,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":153,"categories":154,"keywords":159,"publishedAt":40},"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`.","当用户需要管理 tree-sitter 解析器缓存时使用——为离线或 CI 运行预取解析器、列出已下载内容、检查某种语言、查找缓存目录或清理缓存。涵盖 `ts-pack download`、`list`、`info`、`cache-dir`、`clean` 和 `init`。","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fskills\u002Ftree-sitter-language-pack-managing-parsers\u002FSKILL.md",[155,156],{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":157,"categoryName":158,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BSTR9G4A4GZ0VB2DFN9490","开发环境与工具链管理",[160,161,94,32,33,95,96,97,162,163,164,165,166,142,167,168,169,145,170,111],"parsers","tree sitter language pack managing parsers","ci","init","prefetch","cache","find","inspect","manage","clean","info",{"skillNo":172,"name":173,"nameZh":174,"description":175,"descriptionZh":176,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":177,"categories":178,"keywords":181,"publishedAt":40},"01M6BZ3Y1E46H4CPXVJD6SB03D","tree-sitter-language-pack-extracting-code-structure","代码结构提取","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.","当用户需要从源文件获取结构化代码元数据时使用——包括函数、类、导入、导出、符号、文档字符串、注释或语法诊断。涵盖 `ts-pack process` 的功能开关、JSON 结果结构以及默认功能集。","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fskills\u002Ftree-sitter-language-pack-extracting-code-structure\u002FSKILL.md",[179,180],{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":91,"categoryName":92,"taxonomyType":23,"taxonomyTypeDesc":24},[182,94,100,32,33,128,107,95,96,97,183,184,185,39,186,187,131,109,188,111],"tree sitter language pack extracting code structure","extracting code structure","code structure","SET","default","flags","result",{"skillNo":190,"name":191,"nameZh":192,"description":193,"descriptionZh":194,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":195,"categories":196,"keywords":199,"publishedAt":40},"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.","当用户想知道某个文件或代码片段属于哪种编程语言时使用。涵盖 `ts-pack parse`\u002F`process` 中的隐式检测、通过 `ts-pack list`\u002F`info` 确认是否支持某种语言，以及用于路径、扩展名和原始内容的 SDK 检测函数。","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fskills\u002Ftree-sitter-language-pack-detecting-languages\u002FSKILL.md",[197,198],{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":91,"categoryName":92,"taxonomyType":23,"taxonomyTypeDesc":24},[200,94,32,33,95,127,96,97,201,35,202,203,204,142,145,205,206,170,110,111],"tree sitter language pack detecting languages","programming language","programming","support","which","functions","with"]