home / skills / lis186 / sourceatlas / code-flow-tracer

code-flow-tracer skill

/plugin/skills/code-flow-tracer

This skill traces code execution paths and data flow to reveal how a feature works, from inputs to outputs, with call graphs and boundaries.

npx playbooks add skill lis186/sourceatlas --skill code-flow-tracer

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.4 KB
---
name: code-flow-tracer
description: Trace code execution paths and data flow. Use when user asks "how does X work", "what happens when X", "trace the flow of X", "where does data come from", or needs to understand feature implementation.
---

# Code Flow Tracer

## When to Use

Trigger this skill when the user:
- Wants to understand how a feature works end-to-end
- Asks what happens when an action is triggered
- Needs to trace data flow through the system
- Asks "how does X work"
- Asks "what calls X" or "what does X call"

## Instructions

1. Identify the feature, function, or flow the user wants to trace
2. Run `/sourceatlas:flow "<query>"` with a natural language description
3. Returns call graph, boundary detection, and flow visualization

## Query Formats

- Feature flow: `/sourceatlas:flow "user login"`
- Function trace: `/sourceatlas:flow "handleSubmit"`
- Error paths: `/sourceatlas:flow "error handling flow"`
- Data origin: `/sourceatlas:flow "where does userProfile come from"`
- Reverse trace: `/sourceatlas:flow "who calls validateToken"`

## What User Gets

- Call graph visualization (ASCII tree)
- Boundary detection (API, DB, LIB, CLOUD markers)
- Recursion and cycle detection
- Entry points identification
- 11 analysis modes available

## Example Triggers

- "How does the login flow work?"
- "What happens when user clicks submit?"
- "Trace the checkout process"
- "Where does this data come from?"
- "Who calls this function?"

Overview

This skill traces code execution paths and data flow to help you understand how features and functions work end-to-end. It produces call graphs, boundary annotations, and highlights entry points, recursion, and cycles so you can see where data comes from and what triggers each action. Use it to quickly map implementations across a codebase and resolve questions about flow and dependencies.

How this skill works

You provide a natural language target—feature name, function, error path, or a data symbol—and the skill runs an automated flow analysis command against the code index. The output includes an ASCII call tree, boundary markers (API, DB, LIB, CLOUD), recursion/cycle detection, and identified entry points. Multiple analysis modes let you focus on callers, callees, data origins, or full end-to-end paths.

When to use it

  • You want an end-to-end walkthrough of a feature (e.g., login, checkout).
  • You need to know what runs when an event triggers (e.g., button click, webhook).
  • You need to trace where a piece of data originates and how it propagates.
  • You need to find who calls a specific function or what a function calls.
  • You’re debugging an error path and need to map possible execution routes.

Best practices

  • Start with concise natural language queries like "user login" or "who calls validateToken".
  • Include specific identifiers (function names, variable names, endpoints) for precise results.
  • Iterate: run callers-first then switch to callees or data-origin modes to refine the map.
  • Review boundary markers to separate application logic from external systems (DB, API, cloud).
  • Use the recursion and cycle detection output to spot infinite-loop risks or unexpected dependencies.

Example use cases

  • Trace the login flow to find where credentials are validated and where tokens are issued.
  • Map the checkout process to identify payment gateway boundaries and persistence steps.
  • Find the origin of a userProfile object and every transformation applied before rendering.
  • Determine what calls handleSubmit and whether it reaches the database layer.
  • Analyze error handling paths to see which components can receive and surface specific failures.

FAQ

What input format works best?

Short natural language queries or specific function/variable names work best, e.g., "user login" or "validateToken".

Can it show external system interactions?

Yes — boundary detection marks APIs, databases, libraries, and cloud services in the flow output.