route-test-1770185086/.claude/commands/trace-feature.md
jordan 0f92583dba
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/manual/woodpecker Pipeline was successful
Initialize project from skeleton template
2026-02-04 06:04:48 +00:00

1.5 KiB

description argument-hint allowed-tools
Trace a feature end-to-end across the codebase - find all files, flows, DB tables, quality issues, and dead code <feature name or description> Task, Read, Write, Edit, Glob, Grep, Bash

Trace this feature: $ARGUMENTS

Instructions

Load the feature-tracer skill, then:

1. Discover Entry Points

# 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