
Grepai Trace Graph
Map recursive call graphs and dependency trees in a codebase before large refactors or architecture reviews.
Install
npx skills add https://github.com/yoanbernabeu/grepai-skills --skill grepai-trace-graphWhat is this skill?
- Runs `grepai trace graph` for full recursive call trees from any entry function
- Depth control via `--depth` from shallow (1) to deep (5+) analysis
- Reports node count and max depth for scope of impact analysis
- ASCII tree output for agents and terminals without a separate viz tool
- Pairs with callee-style tracing for refactoring and flow understanding
Adoption & trust: 573 installs on skills.sh; 17 GitHub stars; 3/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
Recommended Skills
Azure Diagnosticsmicrosoft/azure-skills
Diagnosemattpocock/skills
Systematic Debuggingobra/superpowers
Safe Debuglllllllama/rigorpilot-skills
Mastramastra-ai/skills
Insforge Debuginsforge/agent-skills
Journey fit
Primary fit
Canonical shelf is Build because trace graphs answer “how does this code hang together?” while you are still shaping backend structure and integrations. Backend subphase fits dependency tracing on services, handlers, and data paths rather than UI-only work.
Common Questions / FAQ
Is Grepai Trace Graph safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Grepai Trace Graph
# GrepAI Trace Graph This skill covers using `grepai trace graph` to build complete call graphs showing all dependencies recursively. ## When to Use This Skill - Mapping complete function dependencies - Understanding complex code flows - Impact analysis for major refactoring - Visualizing application architecture ## What is Trace Graph? `grepai trace graph` builds a recursive dependency tree: ``` main ├── initialize │ ├── loadConfig │ │ └── parseYAML │ └── connectDB │ ├── createPool │ └── ping ├── startServer │ ├── registerRoutes │ │ ├── authMiddleware │ │ └── loggingMiddleware │ └── listen └── gracefulShutdown └── closeDB ``` ## Basic Usage ```bash grepai trace graph "FunctionName" ``` ### Example ```bash grepai trace graph "main" ``` Output: ``` 🔍 Call Graph for "main" main ├── initialize │ ├── loadConfig │ └── connectDB ├── startServer │ ├── registerRoutes │ └── listen └── gracefulShutdown └── closeDB Nodes: 9 Max depth: 3 ``` ## Depth Control Limit recursion depth with `--depth`: ```bash # Default depth (2 levels) grepai trace graph "main" # Deeper analysis (3 levels) grepai trace graph "main" --depth 3 # Shallow (1 level, same as callees) grepai trace graph "main" --depth 1 # Very deep (5 levels) grepai trace graph "main" --depth 5 ``` ### Depth Examples **--depth 1** (same as callees): ``` main ├── initialize ├── startServer └── gracefulShutdown ``` **--depth 2** (default): ``` main ├── initialize │ ├── loadConfig │ └── connectDB ├── startServer │ ├── registerRoutes │ └── listen └── gracefulShutdown └── closeDB ``` **--depth 3**: ``` main ├── initialize │ ├── loadConfig │ │ └── parseYAML │ └── connectDB │ ├── createPool │ └── ping ├── startServer │ ├── registerRoutes │ │ ├── authMiddleware │ │ └── loggingMiddleware │ └── listen └── gracefulShutdown └── closeDB ``` ## JSON Output ```bash grepai trace graph "main" --depth 2 --json ``` Output: ```json { "query": "main", "mode": "graph", "depth": 2, "root": { "name": "main", "file": "cmd/main.go", "line": 10, "children": [ { "name": "initialize", "file": "cmd/main.go", "line": 15, "children": [ { "name": "loadConfig", "file": "config/config.go", "line": 20, "children": [] }, { "name": "connectDB", "file": "db/db.go", "line": 30, "children": [] } ] }, { "name": "startServer", "file": "server/server.go", "line": 25, "children": [ { "name": "registerRoutes", "file": "server/routes.go", "line": 10, "children": [] } ] } ] }, "stats": { "nodes": 6, "max_depth": 2 } } ``` ## Compact JSON ```bash grepai trace graph "main" --depth 2 --json --compact ``` Output: ```json { "q": "main", "d": 2, "r": { "n": "main", "c": [ {"n": "initialize", "c": [{"n": "loadConfig"}, {"n": "connectDB"}]}, {"n": "startServer", "c": [{"n": "registerRoutes"}]} ] }, "s": {"nodes": 6, "depth": 2} } ``` ## TOON Output (v0.26.0+) TOON format offers ~50% fewer tokens than JSON: ```bash grepai trace graph "main" --depth 2 --toon ``` > **Note:** `--json` and `--toon` are mutually exclusive. ## Extraction Modes ```bash # Fast mode (regex-based) grepai trace graph "main" --mode fast # Precise mode (tree-sitter AST) grepai trace graph "main" --mode precise ``` ## Use Cases ### Understanding Application Flow ```bash # Map entire application startup grepai trace graph "main" --depth 4 ``` ### Impact Analysis ```bash # What depends on this utility function? grepai tr