[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6BZ39YCNKAQQRHS856QVNWP":3,"skill-same:01M6BZ39YCNKAQQRHS856QVNWP":86},{"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":51,"linkOnly":52,"markdownContent":53,"markdownBody":54,"frontMatter":55,"refName":56,"commitSha":57,"skillDirectory":58,"forksCount":59,"repositoryHtmlUrl":60,"repositoryHomepageUrl":61,"ownerHtmlUrl":62,"ownerBlogUrl":63,"ownerDescription":64,"updatedAt":65,"install":66,"resources":79},"01M6BZ39YCNKAQQRHS856QVNWP","tree-sitter-language-pack-detecting-languages","tree-sitter 编程语言检测","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 检测函数。","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\u002Fskills\u002Ftree-sitter-language-pack-detecting-languages\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,40,41,42,43,44,45,46,47,48,49,50],"tree sitter language pack","pack","language","detecting","tree","tree sitter","language pack","tree sitter language pack detecting languages","file","programming","support","programming language","which","for","use","functions","with","info","parse","when","2026-11-10 10:12:30",false,"---\ndescription: 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.\nname: tree-sitter-language-pack-detecting-languages\n---\n\n\u003C!--\nAI-RULEZ :: GENERATED FILE — DO NOT EDIT\nContent-Hash: blake3:1652855d0d25051247e7728976192ad988833c4913509f8924c67d16628472c6\nSource-Hash: blake3:fbed630db85ed02cff8e3bc8c836d453724480351ecb0896122f193a21670041\nSchema-Version: v1\n-->\n\n# Detecting languages\n\ntree-sitter-language-pack maps a file to one of 371 supported languages.\nDetection works from a file path, a bare extension, or — via the SDK — the\nfile content itself.\n\n## On the CLI: detection is implicit\n\nThere is no standalone `ts-pack detect` command. `parse` and `process`\nauto-detect the language from the file extension and act on it:\n\n```bash\nts-pack parse src\u002Fapp.ts      # detects \"typescript\", parses\nts-pack process app.py        # detects \"python\", extracts\n```\n\nWhen detection fails (no extension, ambiguous, or stdin), pass `--language`:\n\n```bash\ncat snippet | ts-pack parse - --language go\n```\n\nTo check whether a language name is supported and cached without parsing\nanything, use `list` and `info`:\n\n```bash\nts-pack list --filter type      # languages whose name contains \"type\"\nts-pack list --manifest         # every language in the remote manifest\nts-pack info typescript         # is it known? is it downloaded? cache path?\n```\n\n## In the SDK: explicit detection\n\nThe core exposes three detection functions, including content-based\ndetection that the CLI does not surface:\n\n| Function | Detects from |\n| -------- | ------------ |\n| `detect_language_from_path(path)` | Full path (uses the extension). |\n| `detect_language_from_extension(ext)` | A bare extension like `\"rs\"`. |\n| `detect_language_from_content(content)` | Raw source text — no path needed. |\n\nEach returns the language name or null\u002FNone when no grammar matches.\n\n### Python\n\n```python\nfrom tree_sitter_language_pack import (\n    detect_language_from_path,\n    detect_language_from_extension,\n    detect_language_from_content,\n)\n\ndetect_language_from_path(\"src\u002Fapp.py\")      # \"python\"\ndetect_language_from_extension(\"rs\")          # \"rust\"\ndetect_language_from_content(open(\"x\").read())  # from the shebang line, if present\n```\n\n### Node.js \u002F TypeScript\n\n```typescript\nimport { detectLanguageFromPath, detectLanguageFromContent } from \"@xberg-io\u002Ftree-sitter-language-pack\";\n\nconst lang = detectLanguageFromPath(\"src\u002Fapp.ts\") ?? detectLanguageFromContent(source);\n```\n\n## Choosing CLI vs SDK\n\n- Path or extension is enough, one-shot → just run `ts-pack parse`\u002F`process`\n  and let it auto-detect.\n- Only raw content (a pasted snippet, a stream, a file with no extension) →\n  use the SDK's `detect_language_from_content`, then pass the result as\n  `--language` to the CLI if needed.\n\n## When to reach for the other skills\n\nOnce the language is known, hand off to `tree-sitter-language-pack-parsing-source` (syntax tree) or\n`tree-sitter-language-pack-extracting-code-structure` (metadata). To see or prefetch the parser for a\ndetected language, see `tree-sitter-language-pack-managing-parsers`.\n","\u003C!--\nAI-RULEZ :: GENERATED FILE — DO NOT EDIT\nContent-Hash: blake3:1652855d0d25051247e7728976192ad988833c4913509f8924c67d16628472c6\nSource-Hash: blake3:fbed630db85ed02cff8e3bc8c836d453724480351ecb0896122f193a21670041\nSchema-Version: v1\n-->\n\n# Detecting languages\n\ntree-sitter-language-pack maps a file to one of 371 supported languages.\nDetection works from a file path, a bare extension, or — via the SDK — the\nfile content itself.\n\n## On the CLI: detection is implicit\n\nThere is no standalone `ts-pack detect` command. `parse` and `process`\nauto-detect the language from the file extension and act on it:\n\n```bash\nts-pack parse src\u002Fapp.ts      # detects \"typescript\", parses\nts-pack process app.py        # detects \"python\", extracts\n```\n\nWhen detection fails (no extension, ambiguous, or stdin), pass `--language`:\n\n```bash\ncat snippet | ts-pack parse - --language go\n```\n\nTo check whether a language name is supported and cached without parsing\nanything, use `list` and `info`:\n\n```bash\nts-pack list --filter type      # languages whose name contains \"type\"\nts-pack list --manifest         # every language in the remote manifest\nts-pack info typescript         # is it known? is it downloaded? cache path?\n```\n\n## In the SDK: explicit detection\n\nThe core exposes three detection functions, including content-based\ndetection that the CLI does not surface:\n\n| Function | Detects from |\n| -------- | ------------ |\n| `detect_language_from_path(path)` | Full path (uses the extension). |\n| `detect_language_from_extension(ext)` | A bare extension like `\"rs\"`. |\n| `detect_language_from_content(content)` | Raw source text — no path needed. |\n\nEach returns the language name or null\u002FNone when no grammar matches.\n\n### Python\n\n```python\nfrom tree_sitter_language_pack import (\n    detect_language_from_path,\n    detect_language_from_extension,\n    detect_language_from_content,\n)\n\ndetect_language_from_path(\"src\u002Fapp.py\")      # \"python\"\ndetect_language_from_extension(\"rs\")          # \"rust\"\ndetect_language_from_content(open(\"x\").read())  # from the shebang line, if present\n```\n\n### Node.js \u002F TypeScript\n\n```typescript\nimport { detectLanguageFromPath, detectLanguageFromContent } from \"@xberg-io\u002Ftree-sitter-language-pack\";\n\nconst lang = detectLanguageFromPath(\"src\u002Fapp.ts\") ?? detectLanguageFromContent(source);\n```\n\n## Choosing CLI vs SDK\n\n- Path or extension is enough, one-shot → just run `ts-pack parse`\u002F`process`\n  and let it auto-detect.\n- Only raw content (a pasted snippet, a stream, a file with no extension) →\n  use the SDK's `detect_language_from_content`, then pass the result as\n  `--language` to the CLI if needed.\n\n## When to reach for the other skills\n\nOnce the language is known, hand off to `tree-sitter-language-pack-parsing-source` (syntax tree) or\n`tree-sitter-language-pack-extracting-code-structure` (metadata). To see or prefetch the parser for a\ndetected language, see `tree-sitter-language-pack-managing-parsers`.\n",{"name":5,"description":7},"main","bfd035e424e17fad1723429f58ca39f81bba3a6d","plugin\u002Fskills\u002Ftree-sitter-language-pack-detecting-languages",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":67,"prompt":77,"zipAvailable":78},[68,71,74],{"tool":69,"command":70},"npx","npx skills add xberg-io\u002Ftree-sitter-language-pack --skill tree-sitter-language-pack-detecting-languages",{"tool":72,"command":73},"bunx","bunx skills add xberg-io\u002Ftree-sitter-language-pack --skill tree-sitter-language-pack-detecting-languages",{"tool":75,"command":76},"pnpm","pnpm dlx skills add xberg-io\u002Ftree-sitter-language-pack --skill tree-sitter-language-pack-detecting-languages","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Ftree-sitter-language-pack-detecting-languages\u002FSKILL.md",true,[80],{"path":81,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":84,"sourceHtmlUrl":85},"index.md","REFERENCE","参考文档",571,"https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Ftree-sitter-language-pack-detecting-languages\u002Findex.md",[87,112,132,150,173,191],{"skillNo":88,"name":89,"nameZh":90,"description":91,"descriptionZh":92,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":93,"categories":94,"keywords":99,"publishedAt":51},"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",[95,96],{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":97,"categoryName":98,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8CBEPE1MJTS9ARYEK7J8BH4","代码解析与结构分析",[31,37,36,35,33,32,100,101,102,103,104,105,106,107,108,109,110,111,49,50],"rust","writing","code","llms","cli","node","parser","typescript","io","structure","chunks","imports",{"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":51},"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":97,"categoryName":98,"taxonomyType":23,"taxonomyTypeDesc":24},[123,124,31,125,126,37,36,35,33,32,102,104,34,127,128,129,109,130,131,50],"tree sitter language pack using the mcp server","MCP","mcp server","server","extracting","launcher","auto","source","Tools",{"skillNo":133,"name":134,"nameZh":135,"description":136,"descriptionZh":137,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":138,"categories":139,"keywords":142,"publishedAt":51},"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`.","当用户需要为源文件生成 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",[140,141],{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":97,"categoryName":98,"taxonomyType":23,"taxonomyTypeDesc":24},[143,144,31,37,36,35,130,33,32,39,145,146,44,147,148,129,45,149,49,50],"parsing","tree sitter language pack parsing source","json","syntax","errors","expression","reading",{"skillNo":151,"name":152,"nameZh":153,"description":154,"descriptionZh":155,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":156,"categories":157,"keywords":162,"publishedAt":51},"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",[158,159],{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":160,"categoryName":161,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BSTR9G4A4GZ0VB2DFN9490","开发环境与工具链管理",[163,164,31,37,36,35,33,32,165,166,167,168,169,44,170,171,172,45,48,50],"parsers","tree sitter language pack managing parsers","ci","init","prefetch","cache","find","inspect","manage","clean",{"skillNo":174,"name":175,"nameZh":176,"description":177,"descriptionZh":178,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":179,"categories":180,"keywords":183,"publishedAt":51},"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",[181,182],{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":97,"categoryName":98,"taxonomyType":23,"taxonomyTypeDesc":24},[184,31,102,37,36,127,109,35,33,32,185,186,187,146,188,189,130,111,190,50],"tree sitter language pack extracting code structure","extracting code structure","code structure","SET","default","flags","result",{"skillNo":192,"name":5,"nameZh":193,"description":7,"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":51},"01M6BZ3VAJEY26GESPCWQ2JSXA","编程语言检测","当用户想知道某个文件或代码片段属于哪种编程语言时使用。涵盖 `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":97,"categoryName":98,"taxonomyType":23,"taxonomyTypeDesc":24},[38,31,37,36,35,34,33,32,42,39,40,41,43,44,45,46,47,48,49,50]]