Agent skill
call-chain
Trace execution paths from entry points through the code knowledge graph. Shows call chains with criticality scores and generates Mermaid flowcharts.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/call-chain
SKILL.md
Call Chain Tracing
Trace execution flows through the codebase using the code knowledge graph.
Prerequisites
This skill requires the gauntlet plugin for graph data. Discover it:
GRAPH_QUERY=$(find ~/.claude/plugins -name "graph_query.py" -path "*/gauntlet/*" 2>/dev/null | head -1)
If gauntlet is not installed: Fall back to static
analysis. Use grep to trace function calls and build
a Mermaid diagram manually from import/call patterns.
Skip graph-specific steps.
If installed but no graph.db: Tell the user to run
/gauntlet-graph build.
Steps
-
Accept target: Get a function name or entry point from the user (or trace all entry points).
-
Run flow tracing (requires gauntlet):
bashpython3 "$GRAPH_QUERY" --action flows --depth 15To filter by entry point:
bashpython3 "$GRAPH_QUERY" --action flows --entry "main"Fallback (no gauntlet): Trace calls with rg (or grep):
bash# Prefer rg (ripgrep) for speed; fall back to grep if command -v rg &>/dev/null; then rg -n "function_name\(" --type py . | head -20 else grep -rn "function_name(" --include="*.py" . | head -20 fiBuild the call tree manually from search results.
-
Display as indented tree:
main() [criticality: 0.72] -> validate_input() -> parse_config() -> process_data() -> db.execute_query() -> cache.store() -> send_response() -
Generate Mermaid flowchart:
mermaidflowchart LR main --> validate_input main --> process_data main --> send_response validate_input --> parse_config process_data --> db.execute_query process_data --> cache.store -
Show criticality breakdown:
- File spread: how many files the flow touches
- Security sensitivity: auth/crypto code in the path
- Test coverage gaps: untested nodes in the flow
Criticality Scoring
| Factor | Weight | Meaning |
|---|---|---|
| File spread | 0.30 | Touches many files |
| Security | 0.25 | Contains auth/crypto code |
| External calls | 0.20 | Unresolved dependencies |
| Test gap | 0.15 | Untested nodes in flow |
| Depth | 0.10 | Deep call chains |
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?