techdebt — Locate Technical Debt in a Subsystem
Confidence-tiered audit. Disqualifiers are hard filters, not soft considerations — they are what keeps the skill useful rather than noisy.
When to Use
Triggered by /techdebt <subsystem>, by phrases like "find tech debt in X" / "audit Y for smells", as pre-refactor due diligence, or as a sub-agent from /review against a PR's changed files. Requires a concrete target — if the user gives none, ask for one; do not audit the whole repo.
Invocation
/techdebt <subsystem> # all categories, high-confidence only
/techdebt <subsystem> --category A # one category
/techdebt <subsystem> --category A,B # subset
/techdebt <subsystem> --pattern B1 # single pattern
/techdebt <subsystem> --suggestive # also emit suggestive-tier findings
Categories:
- A — Local syntactic (A1–A5). Single-file, fast.
- B — Cross-file structural / corpus similarity (B1–B4). Slowest — agent acts as similarity judge.
- C — Delegation and architectural / graph-level (C1–C5). Uses import graph + churn.
- D — Process debt (D1 Stale Memory Drift, D2 Test-Generation Debt).
- E — Operational debt / extraction seams (E1–E6). High-risk refactor targets: imperative resource managers, async state machines, singletons, module-level registries, contract-surface scatter, bootstrap orchestration. Each E finding is scoped small enough to act on in one session.
Workflow
- Resolve target → concrete file set. Accept directory, glob, or named subsystem (consult repo's
AGENTS.md/ architecture docs if the term is symbolic). Print resolved file count before continuing. - Build inventory in one pass:
- File list with LOC
- Exported symbols per file
- Per-file churn:
git log --since="90 days ago" --pretty=format:"%H" -- <file> | wc -l - Project dependencies: read
package.json(for B3)