callgraph

Analyze a function's caller chain and output a Mermaid diagram.

Updated Dec 18, 2021
One-click install
npx skills add https://github.com/isihigameKoudai/utils --skill callgraph
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: callgraph
Source: https://github.com/isihigameKoudai/utils/tree/main/.agents/skills/callgraph
Command: npx skills add https://github.com/isihigameKoudai/utils --skill callgraph

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ripgrep, python, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a visual representation of the caller chain for a specified function, allowing users to understand the impact of changes on various entry points.

Core Features & Use Cases

  • Caller Chain Visualization: Shows the chain of functions that call a given target function.
  • Layer Analysis: Categorizes functions into layers (Entry, Usecase, Domain, Repository, Adapter, Helper) based on file paths and naming conventions.
  • Mermaid Diagrams: Outputs the caller chain as a Mermaid diagram, including paths and line numbers.

Quick Start

Analyze the caller chain for the function 'getBaseRepository' using the 'callgraph' skill.

Frequently Asked Questions about callgraph

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I visualize the caller chain of a function in a codebase?

You can visualize a function caller chain by running this Skill, which uses ripgrep to trace calls and generates a Mermaid diagram with file paths and line numbers.

What is function caller chain visualization used for in code analysis?

Function caller chain visualization maps the hierarchy of functions that invoke a target, helping you understand the impact of code changes on various entry points.

Do I need ripgrep and Python installed to generate Mermaid caller diagrams?

Yes, you need ripgrep and Python installed to execute caller chain analysis and generate Mermaid diagrams. Language-specific servers are also utilized if available.

Can I categorize functions into architectural layers when analyzing a caller chain?

Yes, you can categorize functions into Entry, Usecase, Domain, Repository, Adapter, and Helper layers during caller chain analysis based on file paths and naming conventions.

Does the generated Mermaid diagram include file paths and line numbers for function calls?

Yes, the generated Mermaid diagram includes file paths and line numbers, allowing you to precisely locate each function call within the visualized caller chain.