Track, categorize, and prioritize technical debt across the codebase. Scans for debt indicators, maintains a debt register, and recommends repayment scheduling.
Determine the mode from the argument:
scan — Scan the codebase for tech debt indicatorsadd — Add a new tech debt entry manuallyprioritize — Re-prioritize the existing debt registerreport — Generate a summary report of current debt statusIf no subcommand is provided, output usage and stop. Verdict: FAIL — missing required subcommand.
Search the codebase for debt indicators:
TODO comments (count and categorize)FIXME comments (these are bugs disguised as debt)HACK comments (workarounds that need proper solutions)@deprecated markersCategorize each finding:
Present the findings to the user.
Ask: "May I write these findings to docs/tech-debt-register.md?"
If yes, update the register (append new entries, do not overwrite existing ones). Verdict: COMPLETE — scan findings written to register.
If no, stop here. Verdict: BLOCKED — user declined write.
Prompt for: description, category, affected files, estimated fix effort, impact if left unfixed.
Present the new entry to the user.
Ask: "May I append this entry to docs/tech-debt-register.md?"
If yes, append the entry. Verdict: COMPLETE — entry added to register.
If no, stop here. Verdict: BLOCKED — user declined write.
Read the debt register at docs/tech-debt-register.md.
Score each item by: (impact_if_unfixed × frequency_of_encounter) / fix_effort
Re-sort the register by priority score and recommend which items to include in the next sprint.
Present the re-prioritized register to the user.
Ask: "May I write the re-prioritized register back to docs/tech-debt-register.md?"
If yes, write the updated file. Verdict: COMPLETE — register re-prioritized and saved.
If no, stop here. Verdict: BLOCKED — user declined write.
Read the debt register. Generate summary statistics:
Flag any items that have been in the register for more than 3 sprints.
Output the report to the user. This mode is read-only — no files are written. Verdict: COMPLETE — debt report generated.
/sprint-plan to schedule high-priority debt items into the next sprint./tech-debt report at the start of each sprint to track debt trends over time.## Technical Debt Register
Last updated: [Date]
Total items: [N] | Estimated total effort: [T-shirt sizes summed]
| ID | Category | Description | Files | Effort | Impact | Priority | Added | Sprint |
|----|----------|-------------|-------|--------|--------|----------|-------|--------|
| TD-001 | [Cat] | [Description] | [files] | [S/M/L/XL] | [Low/Med/High/Critical] | [Score] | [Date] | [Sprint to fix or "Backlog"] |