From tree-sitter-language-pack
Detects programming languages from file paths, extensions, or content using tree-sitter-language-pack CLI and SDK.
How this skill is triggered — by the user, by Claude, or both
Slash command
/tree-sitter-language-pack:detecting-languagesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
tree-sitter-language-pack maps a file to one of 306 supported languages.
tree-sitter-language-pack maps a file to one of 306 supported languages. Detection works from a file path, a bare extension, or — via the SDK — the file content itself.
There is no standalone ts-pack detect command. parse and process
auto-detect the language from the file extension and act on it:
ts-pack parse src/app.ts # detects "typescript", parses
ts-pack process app.py # detects "python", extracts
When detection fails (no extension, ambiguous, or stdin), pass --language:
cat snippet | ts-pack parse - --language go
To check whether a language name is supported and cached without parsing
anything, use list and info:
ts-pack list --filter type # languages whose name contains "type"
ts-pack list --manifest # every language in the remote manifest
ts-pack info typescript # is it known? is it downloaded? cache path?
The core exposes three detection functions, including content-based detection that the CLI does not surface:
| Function | Detects from |
|---|---|
detect_language_from_path(path) | Full path (uses the extension). |
detect_language_from_extension(ext) | A bare extension like "rs". |
detect_language_from_content(content) | Raw source text — no path needed. |
Each returns the language name or null/None when no grammar matches.
from tree_sitter_language_pack import (
detect_language_from_path,
detect_language_from_extension,
detect_language_from_content,
)
detect_language_from_path("src/app.py") # "python"
detect_language_from_extension("rs") # "rust"
detect_language_from_content(open("x").read()) # best-effort from text
import { detectLanguageFromPath, detectLanguageFromContent } from "@kreuzberg/tree-sitter-language-pack";
const lang = detectLanguageFromPath("src/app.ts") ?? detectLanguageFromContent(source);
ts-pack parse/process
and let it auto-detect.detect_language_from_content, then pass the result as
--language to the CLI if needed.Once the language is known, hand off to parsing-source (syntax tree) or
extracting-code-structure (metadata). To see or prefetch the parser for a
detected language, see managing-parsers.
npx claudepluginhub xberg-io/plugins --plugin tree-sitter-language-packProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.