ast-analyzer_skill
- Python
15
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill bejranonda/llm-autonomous-agent-plugin-for-claude --skill ast-analyzer- SKILL.md21.6 KB
Overview
This skill delivers deep Abstract Syntax Tree (AST) analysis to understand code structure, dependencies, and patterns across multiple languages. It surfaces function/class hierarchies, call graphs, scope and lifetime of variables, dependency maps, pattern and anti-pattern detection, and change impact estimates. Designed for local, privacy-first workflows and integration into CI, dashboards, and automated agents.
How this skill works
The analyzer parses source files into language-aware ASTs (Python, JavaScript/TypeScript, etc.), then walks and traverses those trees to extract structural metadata: definitions, inheritance, calls, imports, scopes, and control-flow constructs. It builds call graphs, dependency graphs, and reports on patterns (singleton, god class, long functions, deep nesting), unused imports, and circular dependencies. Change-impact calculations use call graphs and dependency maps to estimate direct and indirect downstream effects and risk scores.
When to use it
- Before large refactors to identify safe refactoring targets and ripple effects
- During code review or CI to detect anti-patterns, long functions, or security-relevant structures
- When auditing dependencies to find unused, external, internal, or circular imports
- To prioritize tests and identify affected tests after a signature change or deletion
- To generate architecture documentation: class hierarchies, call graphs, and module maps
Best practices
- Run AST analysis incrementally in CI to surface regressions early
- Combine pattern detection with complexity metrics to prioritize fixes (e.g., method count + cyclomatic complexity)
- Use dependency and circular-dependency reports to guide modularization and package boundaries
- Treat impact scores as guidance—verify high-risk findings with targeted tests and code inspection
- Normalize parser settings per language (plugins, JSX/TS support) to avoid false positives
Example use cases
- Identify all direct and indirect callers of a function before renaming or changing its signature
- Detect god classes and long functions to create a prioritized refactor backlog
- Map project-wide imports to find unused or external dependencies for trimming bundle size
- Find circular import chains that cause runtime import errors or brittle module coupling
- Generate class inheritance trees and call graphs for onboarding and architecture docs
FAQ
Core support covers Python and JavaScript/TypeScript; parser plugins allow extending to other languages using appropriate AST parsers.
Can it run safely on private codebases?
Yes. The analyzer is designed for 100% local processing so source never leaves your environment; integrate it into CI or run locally to preserve privacy.