ast-code-graph
AST & Code Graph Indexing
Overview
Text-based search (grep, ripgrep) finds string matches. AST-based analysis understands structure — it knows the difference between a function definition, a function call, a comment, and a string literal.
Primary tool: ast-grep (sg / ast-grep) — a fast, Rust-based CLI for structural code search, lint, and rewriting. It uses tree-sitter for parsing and supports 20+ languages out of the box.
Core principle: When the question is about code structure, use AST analysis. When the question is about text content, use grep.
Trigger Patterns
Detailed examples of when to trigger this skill:
More from rolandbrecht/agent-skills
systematic-debugging
Trigger this AUTOMATICALLY anytime you encounter a stack trace, test failure, production bug, or unexpected behavior. Do NOT guess the fix or propose code changes before explicitly triggering this skill. This skill mandates a strict data-gathering and hypothesis phase before you are permitted to edit ANY source code.
10self-reflection
Execute this meta-skill ALWAYS at the end of complex tasks, debugging sessions, or when learning a new project codebase quirk. You MUST trigger this skill to codify hard-won lessons into reusable project rules (saving them to project-specific AI instruction files or a new SKILL.md). Do NOT close a complex task without running this skill to ensure future agents don't make the same mistakes you did!
3structural-refactor
>
1