跳到正文
cccskills
免费在 GitHub 公开

tree-sitting

Symbol-level navigation of a local checkout using tree-sitter ASTs. Answers where a symbol is defined, what lines it spans, which symbols a file exposes, what a directory holds, and where a name is referenced — every answer carries exact line ranges to feed straight into a scoped read. Use for "where is X defined", "who calls X", "find the function/class named", "what's in this file", "give me the line range for", "show me the source of", "list the symbols in", or before editing a file you have not read. Each invocation auto-scans and is self-contained. Not for first-encounter repo orientation (use exploring-codebases), for what a codebase DOES rather than what it contains (featuring), for binding-resolved Python caller sets (searching-codebases), or for literal text and regex matching (plain ripgrep).

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(38)

  • SKILL.md3.1 KB
  • CHANGELOG.md4.7 KB
  • parsers/libtree_sitter_c.dylib1.2 MB
  • parsers/libtree_sitter_c.so612.8 KB
  • parsers/libtree_sitter_go.dylib483.5 KB
  • parsers/libtree_sitter_go.so232.4 KB
  • parsers/libtree_sitter_html.dylib98.5 KB
  • parsers/libtree_sitter_html.so33.1 KB
  • parsers/libtree_sitter_java.dylib868.8 KB
  • parsers/libtree_sitter_java.so423.6 KB
  • parsers/libtree_sitter_javascript.dylib853.7 KB
  • parsers/libtree_sitter_javascript.so425.5 KB
  • parsers/libtree_sitter_markdown.dylib776.4 KB
  • parsers/libtree_sitter_markdown.so363.5 KB
  • parsers/libtree_sitter_mojo.dylib1.3 MB
  • parsers/libtree_sitter_mojo.so681.1 KB
  • parsers/libtree_sitter_python.dylib933.6 KB
  • parsers/libtree_sitter_python.so473.1 KB
  • parsers/libtree_sitter_ruby.dylib4.1 MB
  • parsers/libtree_sitter_ruby.so2.0 MB
  • parsers/libtree_sitter_rust.dylib2.2 MB
  • parsers/libtree_sitter_rust.so1.1 MB
  • parsers/libtree_sitter_tsx.dylib2.8 MB
  • parsers/libtree_sitter_tsx.so1.4 MB
  • parsers/libtree_sitter_typescript.dylib2.7 MB
  • parsers/libtree_sitter_typescript.so1.4 MB
  • README.md1.4 KB
  • scripts/build_grammars.py3.9 KB
  • scripts/engine.py76.8 KB
  • scripts/server.py6.6 KB
  • scripts/treesit.py14.6 KB
  • tests/test_cache_fingerprint.py11.5 KB
  • tests/test_cache_lazy_source.py10.3 KB
  • tests/test_cache_lifecycle.py30.3 KB
  • tests/test_cache_roundtrip.py18.9 KB
  • tests/test_cli_cache.py14.5 KB
  • tests/test_engine.py19.0 KB
  • tests/test_grammar_sources.py2.9 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

tree-sitting

Tree-sitter symbol index over a local checkout. Every result carries line ranges, so the next step is a scoped Read.

Setup

Needs Python 3.10+ and pip install tree-sitter. On macOS, /usr/bin/python3 is 3.9 and will not work; use a Homebrew or uv Python. Grammars are bundled for Linux x86_64 (parsers/*.so) and macOS (parsers/*.dylib).

If a file's grammar doesn't load, the file is skipped and stderr prints WARNING: no grammar for … with the fix. Resolve that before trusting an empty result. On other platforms, run python3 scripts/build_grammars.py (needs git and cc). It writes to $TREESIT_PARSERS_DIR, or ~/.cache/tree-sitting/parsers/ when that is unset, and grammars there take precedence over the bundle. Installed tree-sitter-<lang> wheels are the last fallback.

Use

scripts/treesit.py in this skill's directory scans the repo on every call (cached on disk; invalidated when files or grammars change), prints a tree overview, then answers the queries. Batch queries so one scan serves them all.

python3 scripts/treesit.py REPO                                   # overview, depth 1
python3 scripts/treesit.py REPO --path=src/core --detail=full     # drill in
python3 scripts/treesit.py REPO --no-tree 'find:Parser*' 'source:parse_input' 'refs:ParseState'
QueryReturns
find:PATTERN[:KIND[:LIMIT]]symbols by name, substring or glob
symbols:FILEevery symbol in a file
source:SYMBOL[:FILE]the symbol's source
refs:SYMBOL[:LIMIT]textual references
imports:FILEa file's imports
dir:PATHdirectory overview

Flags: --depth N (-1 = all), --detail sparse|normal|full, --path DIR, --skip DIRS, --no-tree, --stats, --no-cache, --rebuild-cache. scripts/engine.py exposes CodeCache for use inside one Python process.

Languages: Python, JavaScript, TypeScript/TSX, Go, Rust, Ruby, Java, C, HTML, Markdown (heading outline), Mojo. Other languages get generic extraction if their tree-sitter-<lang> wheel is installed.

Use something else for

  • a repo that isn't on disk: accessing-github-repos
  • what a codebase does: featuring
  • a first look at an unfamiliar repo: exploring-codebases
  • binding-resolved Python callers: searching-codebases --refs
  • literal text or regex: rg

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

GitHub repository access in containerized environments using REST API and credential detection. Use when git clone fails, or when accessing private repos/writing files via API.

中文简介正在准备中。当前显示原文说明。

oaustegard/claude-skills1542026年10月21日 更新

Decide which model, effort level, and cascade shape each subagent gets, and how to keep improvement loops safe (evaluator-as-selector, stop on regression). Routes on measured cost-per-completed-task rather than per-token price, because a tier's token count varies more by task shape than price varies across tiers. Covers per-model effort semantics, the concision lever, cascade preconditions, context handoff, and watching a subagent fan-out live. Use when choosing a subagent's model or effort, when choosing how to escalate a failed attempt, or when asked which model or effort a task should get. Grounded in a 2026-07 calibration, a 2026-08 coding-cost study, a 2026-09 seeded-bug repair battery, a 2026-10 Haiku 5.5 ladder priced per spawn, and a 2026-10 retry-versus-escalation ladder on 295 SWE-bench Verified tasks; Managed Agents API specifics are operational, not calibrated.

中文简介正在准备中。当前显示原文说明。

oaustegard/claude-skills1542026年10月21日 更新

Securely manages API credentials for multiple providers (Anthropic Claude, Google Gemini, GitHub). Use when skills need to access stored API keys for external service invocations.

中文简介正在准备中。当前显示原文说明。

oaustegard/claude-skills1542026年10月21日 更新

Guidance for asking clarifying questions when user requests are ambiguous, have multiple valid approaches, or require critical decisions. Use when implementation choices exist that could significantly affect outcomes.

中文简介正在准备中。当前显示原文说明。

oaustegard/claude-skills1542026年10月21日 更新

Pre-change blast-radius report for a symbol or file. Walks tree-sitting references, augments with a plain-text scan over non-parsed files (configs, plain docs), and clusters affected sites by feature (`_FEATURES.md`) or top-level package. Use when about to refactor, rename, or delete something in a repo you don't own — "what breaks if I change `validateUser`", "who calls this", "is this safe to remove", "where is this used", "blast radius", "impact analysis". This is the CONVERGENT pre-change risk skill — for "what is this repo?" use exploring-codebases; for "where is X?" use searching-codebases.

中文简介正在准备中。当前显示原文说明。

oaustegard/claude-skills1542026年10月21日 更新

Read Bluesky/ATProto without depending on Bluesky's AppView — interactions on a user's posts, thread replies, any repo's records, network-wide backlinks across every lexicon, an account's handle and PDS history, which collections are active network-wide, and layer-by-layer outage diagnosis. Use when bsky.app or the AppView is down or slow, when a Bluesky read returns timeouts or 5xx, when asked who liked/replied/quoted/reposted something, when pulling live Bluesky context cheaply, when reading records straight from a PDS, when asked who references a record or account anywhere on the network, whether an account has changed handle or migrated servers, or which lexicons and non-Bluesky apps are active on atproto. Complements browsing-bluesky, which routes everything through the AppView and fails when it does.

中文简介正在准备中。当前显示原文说明。

oaustegard/claude-skills1542026年10月21日 更新

查看 oaustegard 的全部技能

报告此技能的问题