Implement comprehensive error handling for Python code paths to keep services resilient and user-friendly. Use when failures are currently silent or exceptions leak through.
日本語の概要は準備中です。原文の説明を表示しています。
Navigate execution flow from an entry point, mapping call chains, external dependencies, and side effects.
インストール方法を見るインストールする前に、エージェントに与えられる指示の中身を確認できます。
I map execution flow from a given entry point — a file path, function name, or class name — and produce two things:
graph TD call graph showing which functions call which, with external dependencies (APIs, databases, queues, file I/O) styled distinctly. Ambiguous callees, truncation points, and cycles are marked explicitly in the diagram.I trace the call graph depth-first up to 3 levels by default. I work with any programming language — I read the code semantically, so no static analysis tools are required.
Use me when you:
/trace src/payments/checkout.py
→ Full trace from the checkout.py entry point: call chain, all files involved, external dependencies highlighted
/trace AuthService.authenticate
→ Blast-radius map: everything that calls authenticate (callers) and everything it delegates to (callees + side effects)
/trace payments/checkout.py "what external services does this touch?"
→ Focused trace: leads with a direct answer listing all external services, then provides the full trace for context
Extract the entry point from the invocation:
src/payments/checkout.py), a function name (e.g., process_order), or a class name (e.g., AuthService)Search the codebase for the entry point:
<name> not found in the codebase. Check the spelling or provide the file path directly."Starting from the entry point, traverse outbound calls:
[TRUNCATED at depth N] and stop recursing that branch[CYCLE] and stopFor every node in the call graph, classify it as one of:
| Classification | Label | Criteria |
|---|---|---|
| Internal | (no label) | Function/method owned by the project |
| External | [EXTERNAL] | Crosses the codebase boundary: HTTP calls, DB queries, file I/O, message queue publish/consume, event emissions |
| Ambiguous | [AMBIGUOUS] | Callee cannot be statically determined: dynamic dispatch, dependency injection, reflection, eval() |
For External nodes, record: what system it connects to (e.g., "Stripe API", "PostgreSQL", "S3"), the call site (file + line or function), and the protocol/method (HTTP POST, SQL SELECT, etc.).
Identify and list all side effects encountered during the trace:
[CYCLE → <original-node>] marker in the diagram and note it in the Ambiguities section[TRUNCATED] node in the diagram and note it in the Ambiguities section with the path that was cut offIf a focus question was given:
Always produce two parts in this order:
graph TD
entryNode["file.py\nfunction_name()"]
internalNode["other_file.py\ncalled_function()"]
extNode["[EXTERNAL]\nStripe API (HTTP POST)"]:::external
ambigNode["[AMBIGUOUS]\ndynamic_handler()"]:::ambiguous
truncNode["[TRUNCATED at depth 3]"]:::truncated
cycleNode["[CYCLE → entryNode]"]:::cycle
entryNode --> internalNode
entryNode --> extNode
internalNode --> ambigNode
internalNode --> truncNode
entryNode -.-> cycleNode
classDef external fill:#fef3c7,stroke:#d97706,stroke-dasharray: 5 5
classDef ambiguous fill:#fee2e2,stroke:#dc2626,stroke-dasharray: 3 3
classDef truncated fill:#f3f4f6,stroke:#9ca3af
classDef cycle fill:#ede9fe,stroke:#7c3aed
Node label format: "filename.ext\nfunction_name()" — file on the first line, function on the second.
Always include all eight sections. Use "None" for empty sections — never omit a section.
Entry point: function_name() in path/to/file.ext
Call chain: [Prose narrative — describe the flow in plain English. E.g.: "process_order validates the cart via validate_cart, then delegates payment to charge(), which calls the Stripe API synchronously. On success, the order record is persisted to PostgreSQL via the ORM."]
Key files & their roles:
| File | Role |
|---|---|
src/payments/checkout.py | Entry point — orchestrates the order flow |
src/validators.py | Validates cart contents before payment |
src/payment.py | Handles Stripe integration |
External dependencies:
Stripe API — HTTP POST — called from payment.py::charge()PostgreSQL — SQL INSERT — called from checkout.py::process_order() via ORMSide effects:
orders tableAmbiguities & truncations:
[AMBIGUOUS] dynamic_handler() in checkout.py — callee determined at runtime via DI container; cannot be statically resolved[TRUNCATED] notification_service.send() branch cut at depth 3 — may contain additional side effectsNarrative: [One paragraph summarising the full entry-to-exit flow, written for a developer who has never seen this code. Cover: what the function does, the key path through the call graph, what external systems are touched, and any important ambiguities or side effects to be aware of.]
When the entry point is a function or class (not a file), add this additional section to the summary:
Blast radius:
<entry>): [list each caller with file path]<entry> delegates to): [list each callee with file path]<entry> is likely to affect: [caller list]Search the codebase for direct callers of the entry point and include them. This is the pre-refactor scoping view.
When a focus question is provided (e.g., /trace checkout.py "what external services does this touch?"):
Run the full trace as normal — do not skip any step
Before producing output, identify which nodes and edges most directly answer the question:
[EXTERNAL] nodesLead the output with a Focus Answer section:
Focus Answer: [1–3 sentences directly answering the question. E.g.: "This flow touches two external services: the Stripe API (HTTP POST from payment.py::charge()) and PostgreSQL (SQL INSERT from checkout.py::process_order())."]
In the structured summary, list the most relevant items first in their sections (external deps, side effects, etc.) — do not remove other items, just reorder to foreground what the question asks about
In the Mermaid diagram, add a comment above relevant nodes (e.g., %% answers focus question) — the visual structure is not changed, but the comment aids orientation
The focus question narrows attention, not scope. The complete trace is always produced.
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Implement comprehensive error handling for Python code paths to keep services resilient and user-friendly. Use when failures are currently silent or exceptions leak through.
日本語の概要は準備中です。原文の説明を表示しています。
Tabular and numerical data analysis with descriptive statistics and insights. Use when the user provides data, tables, CSVs, or numbers and wants analysis.
日本語の概要は準備中です。原文の説明を表示しています。
Financial factsheet analysis with key metrics extraction and investment rationale
日本語の概要は準備中です。原文の説明を表示しています。
Diagnose and fix CI failures without leaving your editor.
日本語の概要は準備中です。原文の説明を表示しています。
Reproduce ai-repo PR checks locally with Poe and CI scripts, including per-package typecheck and coverage behavior. Use when validating changes before push or when user asks which local commands match CI.
日本語の概要は準備中です。原文の説明を表示しています。
Ask clarifying questions before implementing to ensure Python requirements are understood. Use when a task lacks detail, dependencies are unclear, or multiple interpretations are possible.
日本語の概要は準備中です。原文の説明を表示しています。