Feature Trace Navigator (User Action → Call Graph → Code Walkthrough)
Trace a single feature from UI or API entry through controllers, services, and data layers to produce a call graph and annotated walkthrough.
Prompt Overview
Tips For You
- Provide logs or test names to pinpoint real execution paths. - Include error-handling code to capture alternate flows. - Add a short sample payload used in production.
From Operations TeamNexusAi TechnologyProblem It Solves
Finding the complete path of a feature across layers is error-prone. This produces a reliable call graph and highlights where to probe next.
End-to-End Path Clarity
Shows exactly how data moves through layers.
Actionable Annotations
Each step includes purpose, I/O, and side effects.
Test Gap Finder
Highlights missing or weak tests along the path.
Next-File Guidance
Tells you what to read next and why.
AI Prompt Instructions
Act as a senior full-stack engineer and code cartographer.
Why this task matters:
End-to-end traces reveal how data flows, where side effects occur, and which components are critical for maintenance and testing.
Important boundaries:
- Work only from provided routes, controllers, services, and model snippets.
- If multiple variants exist, prioritize the production path.
User inputs:
- Feature description (e.g., “Create Task” via POST /tasks).
- Relevant files: route handlers, controllers, services, models, middleware.
- Any logs or test names covering this path.
Objectives:
1) Produce a clear call graph from entry to persistence.
2) Annotate key functions with purpose, inputs/outputs, and side effects.
3) Identify risks, missing tests, and observability gaps.
4) Recommend next-file-to-read order.
Analysis workflow:
1) Start at the route; locate controller and service calls.
2) Track data transformations and validation.
3) Note external calls (DB, queue, HTTP) and error handling.
4) Cross-reference existing tests.
5) Summarize performance, reliability, and readability concerns.
Required output format:
- Text call graph (indented list) for copy/paste.
- Annotations per step: purpose, params, output, side effects.
- Missing tests and suggested test cases.
- Next 5 files to review.
Quality controls:
- Include exact function names and file paths.
- Distinguish assertions from guesses; mark guesses clearly.
Verification checklist:
- All layers represented (route → controller → service → model).
- External integrations identified.
Final instruction:
Deliver a trace that a new engineer can follow to implement a bug fix confidently.
Expected Outcome
Call Graph: POST /tasks → routes/tasks.js:createTask → controllers/taskController.js:create → services/taskService.js:createTask → models/task.js:Task.create Annotations: - createTask (route): Validates body schema; forwards to controller - controller.create: Maps DTO, handles try/catch - service.createTask: Enforces business rules, dedups title - Task.create: Persists, returns id Missing Tests: Duplicate title rejection; invalid payload 400. Next Files: middleware/validateBody.js, services/notifications.js
Implementation Journey
Build the trace with Codex
Open Codex. Paste the route, controller, service, and model snippets for the chosen feature. Ask for a call graph and annotated walkthrough using this prompt. Expect a layered trace with function names and paths.
12 minValidate calls in VS Code
Jump to each function in VS Code and confirm parameters, returns, and side effects. Add or correct missing steps (queues, caching, HTTP calls).
10 minConvert to a test checklist
Turn the missing test list into test names in your test runner and create placeholders. Share the trace and checklist in your repo docs to guide the next PR.
8 min
