본문으로 건너뛰기
cccskills
무료GitHub에 공개

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`.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

xberg-io/tree-sitter-language-pack스타 478(GitHub 478 + cccskills 0)

실행 점수 미검증

설치 방법 보기

포함된 파일(2)

  • SKILL.md2.9 KB
  • index.md523 B

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

<!-- AI-RULEZ :: GENERATED FILE — DO NOT EDIT Content-Hash: blake3:211a994b629d9e5e530945c00db243d6f0e4a8f78e054dc7c52db4527c90c35f Source-Hash: blake3:f6af1693d7e3d301871730c180582f140a9c6aeee0d040ba3edbfb33b5d38409 Schema-Version: v1 -->

Parsing source into a syntax tree

ts-pack parse <file> parses one source file with the matching tree-sitter grammar and prints the resulting concrete syntax tree. Use it when the user wants the tree itself — to inspect node structure, debug a grammar, or feed an s-expression to another tool.

Quick recipe

# S-expression (default) — auto-detects language from the file extension
ts-pack parse src/main.rs

# JSON form: { "language", "sexp", "has_errors" }
ts-pack parse src/main.rs --format json

Flag surface

FlagShortDefaultPurpose
--language <name>-lautoOverride the language (skip extension detection).
--format <fmt>-fsexpsexp or json.

The parser library for the language downloads on first use and is cached.

Language detection

The language is auto-detected from the file extension. Override it when the extension is missing, misleading, or you are reading from stdin:

# Misleading extension or no extension:
ts-pack parse script --language bash

# stdin (use "-" as the file):
cat snippet.py | ts-pack parse - --language python

stdin cannot be auto-detected by path; always pass --language with -. For content-based detection without a path, use the SDK (detect_language_from_content) — see the tree-sitter-language-pack-detecting-languages skill.

Output shapes

S-expression

A nested (node_type child ...) tree. Compact, good for eyeballing structure or piping to a grammar tool.

JSON

{
  "language": "rust",
  "sexp": "(source_file (function_item ...))",
  "has_errors": false
}

Read has_errors to know whether the parse produced any error nodes — a fast syntax check. For positioned, per-error detail use ts-pack process <file> --diagnostics (see tree-sitter-language-pack-extracting-code-structure).

Examples

# Inspect a TypeScript file's tree
ts-pack parse src/app.ts

# Machine-readable, then check for syntax errors with jq
ts-pack parse src/app.ts --format json | jq '.has_errors'

# Parse a heredoc as Python
printf 'def f():\n    return 1\n' | ts-pack parse - -l python

When to reach for process instead

parse gives you the raw tree. If the user wants structured metadata (functions, imports, exports, symbols, docstrings) rather than the tree, use ts-pack process — see the tree-sitter-language-pack-extracting-code-structure skill.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

api

무료

Use tree-sitter-language-pack api reference documentation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

xberg-io/tree-sitter-language-pack4782026년 10월 26일 업데이트

cli

무료

Use tree-sitter-language-pack cli reference documentation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

xberg-io/tree-sitter-language-pack4782026년 10월 26일 업데이트

mcp

무료

Use tree-sitter-language-pack mcp reference documentation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

xberg-io/tree-sitter-language-pack4782026년 10월 26일 업데이트

Parse and extract code intelligence from 372 programming languages using tree-sitter grammars. Use when writing code that parses source, extracts structure/imports/exports/symbols/docstrings/comments, detects a language, runs syntax diagnostics, or produces syntax-aware chunks for LLMs — in Rust, Python, Node.js/TypeScript, or the ts-pack CLI. Covers installation, the CLI surface, the SDK surface, and parser-cache management.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

xberg-io/tree-sitter-language-pack4782026년 10월 26일 업데이트

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

xberg-io/tree-sitter-language-pack4782026년 10월 26일 업데이트

Use when the user wants to know which programming language a file or snippet is. Covers implicit detection in `ts-pack parse`/`process`, confirming support with `ts-pack list`/`info`, and the SDK detection functions for path, extension, and raw content.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

xberg-io/tree-sitter-language-pack4782026년 10월 26일 업데이트

xberg-io의 스킬 모두 보기

이 스킬의 문제 신고