61 lines
1.5 KiB
Markdown
61 lines
1.5 KiB
Markdown
---
|
|
description: Trace a feature end-to-end across the codebase - find all files, flows, DB tables, quality issues, and dead code
|
|
argument-hint: <feature name or description>
|
|
allowed-tools: Task, Read, Write, Edit, Glob, Grep, Bash
|
|
---
|
|
|
|
Trace this feature: $ARGUMENTS
|
|
|
|
## Instructions
|
|
|
|
Load the `feature-tracer` skill, then:
|
|
|
|
### 1. Discover Entry Points
|
|
|
|
```bash
|
|
# API handlers (Go)
|
|
grep -rn "[keyword]" --include="*.go" services/*/internal/
|
|
|
|
# Frontend
|
|
grep -rn "[keyword]" --include="*.tsx" --include="*.ts" apps/
|
|
|
|
# Workers
|
|
grep -rn "[keyword]" --include="*.go" workers/*/internal/
|
|
```
|
|
|
|
### 2. Trace Each Path
|
|
|
|
For each entry point:
|
|
1. Read the file
|
|
2. Follow each call (service → repository → external)
|
|
3. Map DB tables touched
|
|
4. Note external dependencies
|
|
|
|
### 3. Assess Quality
|
|
|
|
For each traced file:
|
|
- Has tests? (`ls [file]_test.go` or `ls [file].test.ts`)
|
|
- TODOs? (`grep -n "TODO\|FIXME" [file]`)
|
|
- Dead code? (grep for function callers)
|
|
- Error handling adequate?
|
|
|
|
### 4. Step Back
|
|
|
|
- [ ] Traced both read AND write paths?
|
|
- [ ] Checked error/failure paths?
|
|
- [ ] Verified dead code claims with grep counts?
|
|
|
|
### 5. Output
|
|
|
|
1. **Entry Points Table** - UI, API, Worker with file:line
|
|
2. **Execution Flow** - Visual path diagram
|
|
3. **Database Schema** - Tables touched
|
|
4. **Quality Assessment** - Good / Bad / Ugly / Dead Code
|
|
5. **Uncertainties** - What couldn't be traced
|
|
|
|
## Critical Rules
|
|
|
|
- NEVER mark code as "dead" without grep evidence showing 0 callers
|
|
- ALWAYS include file:line references
|
|
- ALWAYS note what you couldn't trace
|