[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6BZ3VAJEY26GESPCWQ2JSXA":3,"skill-same:01M6BZ3VAJEY26GESPCWQ2JSXA":74},{"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":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":49,"ownerHtmlUrl":50,"ownerBlogUrl":51,"ownerDescription":52,"updatedAt":53,"install":54,"resources":67},"01M6BZ3VAJEY26GESPCWQ2JSXA","tree-sitter-language-pack-detecting-languages",null,"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.","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\u002Fskills\u002Ftree-sitter-language-pack-detecting-languages\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"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:b8687cf31ac8c66a5ecc15c4f11520ff201d8db14467b7528d5120124e9753a4\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:b8687cf31ac8c66a5ecc15c4f11520ff201d8db14467b7528d5120124e9753a4\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","6403d3051157d3808dcdca49aeb0c211742d1d61","skills\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-07 18:08:38",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add xberg-io\u002Ftree-sitter-language-pack --skill tree-sitter-language-pack-detecting-languages",{"tool":60,"command":61},"bunx","bunx skills add xberg-io\u002Ftree-sitter-language-pack --skill tree-sitter-language-pack-detecting-languages",{"tool":63,"command":64},"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\u002Fskills\u002Ftree-sitter-language-pack-detecting-languages\u002FSKILL.md",true,[68],{"path":69,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":72,"sourceHtmlUrl":73},"index.md","REFERENCE","参考文档",571,"https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fskills\u002Ftree-sitter-language-pack-detecting-languages\u002Findex.md",[75,99,123,137,154,169],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":86,"publishedAt":39},"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",[81],{"categoryNo":82,"categoryName":83,"taxonomyType":84,"taxonomyTypeDesc":85},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[19,25,24,23,21,20,87,88,89,90,91,92,93,94,95,96,97,98,37,38],"rust","writing","code","llms","cli","node","parser","typescript","io","structure","chunks","imports",{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":113,"publishedAt":39},"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",[105,110],{"categoryNo":106,"categoryName":107,"taxonomyType":108,"taxonomyTypeDesc":109},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",{"categoryNo":111,"categoryName":112,"taxonomyType":108,"taxonomyTypeDesc":109},"01JBSEEDCAT000000000000023","Skill与智能体开发",[114,115,19,116,117,25,24,23,21,20,89,91,22,118,119,120,96,121,122,38],"tree sitter language pack using the mcp server","MCP","mcp server","server","extracting","launcher","auto","source","Tools",{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":39},"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",[],[130,131,19,25,24,23,121,21,20,27,132,133,32,134,135,120,33,136,37,38],"parsing","tree sitter language pack parsing source","json","syntax","errors","expression","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":39},"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,19,25,24,23,21,20,146,147,148,149,150,32,151,152,153,33,36,38],"parsers","tree sitter language pack managing parsers","ci","init","prefetch","cache","find","inspect","manage","clean",{"skillNo":155,"name":156,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":161,"publishedAt":39},"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.","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fskills\u002Ftree-sitter-language-pack-extracting-code-structure\u002FSKILL.md",[160],{"categoryNo":82,"categoryName":83,"taxonomyType":84,"taxonomyTypeDesc":85},[162,19,89,25,24,118,96,23,21,20,163,164,165,133,166,167,121,98,168,38],"tree sitter language pack extracting code structure","extracting code structure","code structure","SET","default","flags","result",{"skillNo":170,"name":171,"nameZh":6,"description":172,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":173,"categories":174,"keywords":175,"publishedAt":39},"01M6BZ3RW110QT7T8NAKMRRHW6","tree-sitter-language-pack-chunking-for-llms","Use when the user wants to split source code into chunks for an LLM context window without breaking syntax mid-construct. Covers `ts-pack process --chunk-size`, why syntax-aware splits beat fixed-byte splits, picking a size, and the chunk JSON shape.","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Ftree-sitter-language-pack\u002Fblob\u002Fmain\u002Fskills\u002Ftree-sitter-language-pack-chunking-for-llms\u002FSKILL.md",[],[176,19,90,25,24,177,23,32,21,20,178,89,97,179,38,180,133,121,181,182],"tree sitter language pack chunking for llms","chunking","chunk","window","why","source code","context"]