trace-function
Statically trace what happens when a C++ function is called, including verified call edges, max-depth stack trace, and branch gates.
Skill by enricogolfieri
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/enricogolfieri-trace-function
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/trace-function
What's inside
- Skill name
trace-function- Description
- Statically trace what happens when a C++ function is called, including verified call edges, max-depth stack trace, and branch gates. Use when the user asks to trace a function, inspect how a function is linked in the codebase, or says "Trace what happens when <FUNC> is called."
- License
- Unlicense
- Instructions
- 74 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (3)
- SKILL.md
- cpp_trace_links.cpython-313.pyc · scripts/__pycache__/
- cpp_trace_links.py · scripts/
SKILL.md (first lines)
# Trace Function
## Required Behavior
Trace what happens when `<FUNC>` is called. Don't run anything — read the
source. Output:
1. A mermaid sequenceDiagram from `<FUNC>` down to its leaves. Every arrow
labeled `funcName file:line`. Use solid arrows for calls you verified
in source, dashed (-.->) for any edge you had to guess.
2. A textual stack trace at max depth, top frame first:
#0 funcName() path/file.ext:LINE
#1 caller() path/file.ext:LINE
3. A "branches not taken" list: every if/switch/early-return that gates a
different call path, with file:line.
Rules: cite file:line for every edge. If you can't verify a call from
source, omit it or mark it dashed. Don't suggest running, debugging, or
adding prints.
## Workflow
1. Treat this as a static source-reading task. Do not run tests, binaries, debuggers, servers, repros, or add logging.
2. Use the helper script only to find candidates. Never cite script output as proof.
3. Read the source for each included function, call edge, and branch gate.
4. Prefer omitting uncertain edges. Use dashed `-.->` only when an edge is necessary to explain the trace and clearly mark it as inferred.
5. Stop at leaves where no further project-local direct calls are verified, or where expanding would leave the requested scope.
## Helper Script
Run from the repository root:
```bash
python3 ~/.cursor/skills/trace-function/scripts/cpp_trace_links.py '<FUNC>' --root .
```
Useful options:
```bash
python3 ~/.cursor/skills/trace-function/scripts/cpp_trace_links.py '<FUNC>' --root . --max-depth 4 --json
python3 ~/.cursor/skills/trace-function/scripts/cpp_trace_links.py '<FUNC>' --root src/mongo/db --max-files 2000
```
The script reports candidate definitions, callers, callees, and nearby branch gates in C++ source files. It is regex-based and conservative by design; use it to decide what to read next, not as final evidence.
## Verification Rules
- Every final mermaid edge must cite the call-site source line.
- Every stack frame must cite the defining source line or the verified call-site line, whichever is clearer.
- Every branch not taken must cite the `if`, `switch`, `case`, `default`, ternary, or early-return line that gates an alternate path.
- For overloaded functions, templates, virtual dispatch, callbacks, function pointers, or macros, read enough surrounding code to distinguish candidate matches. If source cannot prove the edge, omit it or make it dashed.
- Keep paths relative to the repository root in final output.
## Output Template
````markdown
```mermaid
sequenceDiagram
participant A as funcA
participant B as funcB
A->>B: funcB src/path/file.cpp:123
```
Textual stack trace:
#0 leafFunc() src/path/file.cpp:456
#1 callerFunc() src/path/file.cpp:123
Branches not taken:
- `condition description` gates `otherFunc()` at `src/path/file.cpp:120`
````From enricogolfieri/workspace-mongo, Unlicense.
More from enricogolfieri/workspace-mongo
- 0.547score
ticket-implement
enricogolfieri
Implement an approved SERVER ticket plan: create branch, code+tests, validate, open a draft PR.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-analyse
enricogolfieri
Analyse PERF tickets and register each new experiment in state.json (patch, comparison links, notes paths).
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-flush
enricogolfieri
Persist durable ticket session truth mid-chat: update state.json and create any memory files needed (context, session notes, experiment notes), indexed from…
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
write-mongo-jstests
enricogolfieri
Write focused MongoDB jstests with explicit mocha cases, small mechanical topology helpers, purposeful comments, robust teardown, and correct ownership.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-plan
enricogolfieri
Start and plan a Jira ticket: load context, summarize scope, evaluate split, and produce an approved plan.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-resume
enricogolfieri
Resume a ticket from durable state and continue from its recorded phase.
SkillBFreshness: B★ 1Claude Code +9 - 0.544score
ticket-shared
enricogolfieri
Shared reference and state_memory.py for ticket-plan, ticket-implement, ticket-analyse, ticket-resume, and ticket-flush.
SkillBFreshness: B★ 1Claude Code +9 - 0.497score
mongo-pr-review
enricogolfieri
Performs deep pull request reviews by quickly explaining code changes and identifying potential bugs grouped by severity (critical, non-critical, nit).
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
distributed-code-flow-diagrams
enricogolfieri
Generate scoped Mermaid diagrams for distributed code flows.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
extract-author-changes
enricogolfieri
Loads context for the current branch's PR-scope changes (merge-base to HEAD), including uncommitted edits, then confirms without summarizing.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
hot-bf-pings
enricogolfieri
Drafts Slack ping messages for hot Build Failures (BFs) from a Jira filter, listing the assignee, the SERVER dependency ticket, the GitHub PR, and a one-line…
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
mongo-failure-investigator
enricogolfieri
Investigates MongoDB test failures from a local log file (./tests.log).
SkillCFreshness: C★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Aug 12, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Unlicense
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from enricogolfieri
- 0.547score
ticket-implement
enricogolfieri
Implement an approved SERVER ticket plan: create branch, code+tests, validate, open a draft PR.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-resume
enricogolfieri
Resume a ticket from durable state and continue from its recorded phase.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-analyse
enricogolfieri
Analyse PERF tickets and register each new experiment in state.json (patch, comparison links, notes paths).
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-flush
enricogolfieri
Persist durable ticket session truth mid-chat: update state.json and create any memory files needed (context, session notes, experiment notes), indexed from…
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-plan
enricogolfieri
Start and plan a Jira ticket: load context, summarize scope, evaluate split, and produce an approved plan.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
write-mongo-jstests
enricogolfieri
Write focused MongoDB jstests with explicit mocha cases, small mechanical topology helpers, purposeful comments, robust teardown, and correct ownership.
SkillBFreshness: B★ 1Claude Code +9
Cite this page
trace-function skill. Agent Mart. https://agentmart.dev/skills/enricogolfieri-trace-function (last updated 2026-10-24)