← ClaudeAtlas

tsa-depslisted

Dependency / import graph analysis. Answer "what does this file import", "what imports this module", "what's the project's import topology", "show me the sitemap" without reading every file's import block. Use when: - "What does file X depend on" / "what imports module Y" - "Is module Z a leaf or a hub in the import graph" - "Show me the project sitemap" (which files glue what together) - "Are there circular imports" - Planning a module extraction: who'd you break Replaces: grep-for-import-statements + manual graph walking (~5k tokens for non-trivial repos) with 1 MCP call (~500 tokens).
aimasteracc/tree-sitter-analyzer · ★ 36 · AI & Automation · score 76
Install: claude install-skill aimasteracc/tree-sitter-analyzer
# tsa-deps — Imports & module topology ## Tool routing | Question | Tool | |-----------------------------------------|-------------------------------| | One file's direct deps | `analyze_dependencies` | | Project-wide import graph (who imports whom) | `codegraph_import_graph` | | Project topology (entry points, hubs) | `codegraph_sitemap` | ## Procedure ### File-level deps ```yaml analyze_dependencies(file_path: "tree_sitter_analyzer/ast_cache.py", mode: "file_deps") # returns: {imports: [...], imported_by: [...], depth: 2} ``` `mode` options: - `summary` — project-wide dependency summary - `file_deps` — one file's graph - `package_deps` — by package, not file ### Import graph (project-level) ```yaml codegraph_import_graph(language: "python", limit: 50) # returns: ranked list of import hubs + leaves ``` Use to find: - **Hubs** (many things import this) — high blast radius if changed - **Leaves** (no one imports this) — possibly dead, or a CLI entry point - **Cycles** — circular imports needing breaking ### Sitemap ```yaml codegraph_sitemap() # returns: {entry_points: [...], hub_modules: [...], leaf_modules: [...]} ``` Useful as a "first look" right after `tsa-landing`. ## CLI equivalents ```bash uv run tree-sitter-analyzer <file> --dependencies file_deps uv run tree-sitter-analyzer --dependencies summary uv run tree-sitter-analyzer --import-graph --language python uv run