Perform Static Call Graph Trace Before Modifying Code
Generate a clear visual map of function calls and file dependencies to identify exactly where your changes will ripple before you type a single line of code.
Agent prompt for Claude and ChatGPT
Prompt
mkdir -p .agents/skills/perform-static-call-graph-trace-before-modifying-code && curl -sL "https://prompts-gpt.com/prompts/perform-static-call-graph-trace-before-modifying-code/raw" -o .agents/skills/perform-static-call-graph-trace-before-modifying-code/SKILL.md---
name: perform-static-call-graph-trace-before-modifying-code
description: "Generate a clear visual map of function calls and file dependencies to identify exactly where your changes will ripple before you type a single line of code."
---
# Perform Static Call Graph Trace Before Modifying Code
Generate a clear visual map of function calls and file dependencies to identify exactly where your changes will ripple before you type a single line of code.
## Prompt
```
You are a senior software architect. Before we modify any code in this repository, perform a static call-graph trace for the specific function or class I will identify. Follow these rules: 1. Trace the execution path across all affected files. 2. For every step, list the file path, the function name, and the specific variables being passed. 3. Visualize the flow using a text-based hierarchy. 4. Identify potential side effects or breaking changes in downstream dependencies. 5. Do not suggest code changes yet; only provide the structural analysis. Please start by asking me: 1. What is the entry point function or class method? 2. What is the specific goal of the modification you are planning? This analysis is not a substitute for running a debugger or unit tests; always verify changes in a local dev environment. Wait for my answers before proceeding.
```
## Usage Notes
Use this in Cursor or Claude to understand complex codebases before refactoring. Paste the prompt, answer the two questions, and verify the generated map against your IDE's actual file structure. Works best in Cursor Chat or Composer.
You are a senior software architect. Before we modify any code in this repository, perform a static call-graph trace for the specific function or class I will identify. Follow these rules: 1. Trace the execution path across all affected files. 2. For every step, list the file path, the function name, and the specific variables being passed. 3. Visualize the flow using a text-based hierarchy. 4. Identify potential side effects or breaking changes in downstream dependencies. 5. Do not suggest code changes yet; only provide the structural analysis. Please start by asking me: 1. What is the entry point function or class method? 2. What is the specific goal of the modification you are planning? This analysis is not a substitute for running a debugger or unit tests; always verify changes in a local dev environment. Wait for my answers before proceeding.Example output
Tips and common edits
Why this works
- Forces a structural view before implementation.
- Requires explicit variable tracking across files.
- Identifies downstream dependency risks early.
Use this in Cursor or Claude to understand complex codebases before refactoring. Paste the prompt, answer the two questions, and verify the generated map against your IDE's actual file structure. Works best in Cursor Chat or Composer.
Common edits
- Add a rule to list specific line numbers for each function call.
- Ask the model to include a list of relevant unit tests to check after the change.
Reuse it: Use in a workflowAdapt in the builder
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
More like this
Trace an execution path from entry to database
Map out the complete end-to-end execution path of a single user request across layers in an unfamiliar codebase.
Decompose Framework Migrations into Subagent Work Batches
You get a structured task graph that maps migration steps into isolated, low-risk subagent work batches with defined file boundaries and interface contracts.
Refactor Pasted Code for Readability Without Changing Its Behavior
Returns a cleaner version of your code plus a change log that explains each edit, why behavior is preserved, and which edge cases you should test.
Plan an incremental refactor for legacy code
Break down monolith or fragile legacy modules into safe, testable milestones using branch-by-abstraction patterns.
Decompose monolithic automation into modular subflows
Restructure overly complex, branched automations into clean parent-child workflows. Use this when your workflow breaks frequently, times out, or has become impossible to maintain.
Compare Three Feature Architectures Against Module Boundaries
Get a scored trade-off matrix comparing three feature architectures by file touchpoints, coupling risks, and rollback cost before running Cursor Composer.
- Automated Dead Code Cleanup Plan for Codex Repositories
- Deconstruct Monolithic Pull Requests into Atomic Commit Stacks
- Generate Reproducible Bug Fix Specs for Coding Agents
- Generate Scoped Cursor Rules for Project Architecture
- Refactor Nested Procedural Code into Pure Pipelines
- Sync Test Factories and Fixtures with Database Migrations