Scan a codebase for technical debt (AST for Python, patterns for other languages), rank the inventory by cost of delay, WSJF or RICE, and compare snapshots over time. Use when you need a debt inventory with file:line evidence and a fix per item, a ranked sprint plan for debt work, or a health trend to justify debt investment to leadership.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Tech Debt Tracker?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/borghei-tech-debt-tracker)
---
name: tech-debt-tracker
description: >
Scan a codebase for technical debt (AST for Python, patterns for other languages), rank the
inventory by cost of delay, WSJF or RICE, and compare snapshots over time. Use when you need
a debt inventory with file:line evidence and a fix per item, a ranked sprint plan for debt
work, or a health trend to justify debt investment to leadership.
license: MIT + Commons Clause
metadata:
version: 1.1.0
author: borghei
category: engineering
domain: code-quality
tier: POWERFUL
updated: 2026-11-08
tags:
- technical-debt
- code-quality
- refactoring
- ast
- prioritization
---
# Tech Debt Tracker
The agent identifies, scores, prioritizes, and tracks technical debt across codebases using AST parsing, cost-of-delay analysis, and trend dashboards.
## Core Capabilities
- **Detection** — AST parsing (Python) and regex pattern matching (all languages) across six debt categories: code, architecture, test, documentation, dependency, infrastructure.
- **Interest rate** — the number this skill adds: `interest = impact x frequency` (how much the debt slows work each time the code is touched), and `cost of delay = interest x sprints x team multiplier`. Rank by cost of delay over effort; WSJF and RICE are available as alternatives.
- **Data flow** — `debt_scanner.py` produces the inventory, `debt_prioritizer.py` scores and schedules it, `debt_dashboard.py` compares snapshots over time.
## When to Use
- Tracking and quantifying technical debt across a repository.
- Prioritizing refactoring work and calculating cost-of-delay.
- Planning sprint capacity allocation between debt and features.
- Reporting debt health, trends, and investment recommendations to execs.
## Clarify First
Before scanning or reporting, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.
- **Target codebase:** the directory to scan (the subject of the debt inventory).
- **Prioritization framework & team size:** cost-of-delay / WSJF / RICE and headcount (`--framework`, `--team-size`; changes the ranking and sprint allocation).
- **Report audience:** exec dashboard vs engineering inventory (sets the report format and altitude).
Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.
## Tools
| Tool | Purpose | Command |
|------|---------|---------|
| `debt_scanner.py` | Scan a directory; each item has file:line, the quoted source line, the rule and a fix | `python3 scripts/debt_scanner.py <dir> --format json --output scan_results` |
| `debt_prioritizer.py` | Rank an inventory by cost of delay, WSJF or RICE and fill sprints | `python3 scripts/debt_prioritizer.py scan_results.json --framework wsjf --team-size 8` |
| `debt_dashboard.py` | Health, trend and velocity across two or more snapshots | `python3 scripts/debt_dashboard.py scan_jan.json scan_feb.json --period monthly` |
All three take `--format text|json` (default `text`; `--json` is an alias), write progress to stderr and
only write files when you pass `--output`. Unsupported file extensions are skipped and counted in the report.
Runnable on the bundled samples:
```bash
python3 scripts/debt_scanner.py assets/sample_codebase
python3 scripts/debt_prioritizer.py assets/sample_debt_inventory.json --framework cost_of_delay
python3 scripts/debt_dashboard.py assets/historical_debt_2024-01-15.json assets/historical_debt_2024-02-01.json
```
Real output of the first command (excerpt):
```
SUMMARY
Files Scanned: 3
Lines Scanned: 986
Total Debt Items: 61
Health Score: 52.8/100 (heuristic, severity-weighted items per 1,000 lines)
1. [MEDIUM] DEBT-0015 Function 'process_payment' has high complexity: 36
Where: src/payment_processor.py:20
Quote: def process_payment(self, amount, currency, payment_method, ...
Rule: cyclomatic complexity above max_complexity
Fix: Reduce branches to at most 10: replace nested if/elif chains with early returns ...
...
FIX 61 debt items in 3 files
```
## Exit Codes
| Tool | 0 | 1 | 2 |
|------|---|---|---|
| `debt_scanner.py` | no debt signals | one or more debt items | missing directory, no supported source files, bad config |
| `debt_prioritizer.py` | no critical or high items | any critical or high item | unreadable inventory, no items with a `type`, bad numeric option |
| `debt_dashboard.py` | status excellent or good | status fair or poor (any open critical item forces fair) | no usable snapshot |
Exit 1 is a finding, not a crash. In CI, gate on the prioritizer (critical/high only), not on the scanner.
## What the numbers are
- **Scanner health score:** `100 - severity-weighted items per 1,000 lines` (critical 5, high 3, medium 1, low 0.5). A heuristic for comparing scans of the same code over time. An empty or unsupported directory exits 2 instead of scoring 100.
- **Prioritizer effort, impact and interest:** fixed per-type tables inside the script (heuristic estimates, not measurements). Cost of delay is in developer-hours, not currency. The 20% debt share is a rule of thumb; change it with `--debt-share`.
- **Dashboard health:** a heuristic composite of debt density, complexity, test/doc/security ratios. If an inventory has no files-scanned count, density is excluded and reported as unknown. Trends are straight-line extrapolations; fewer than 4 snapshots is indicative only. New vs resolved items are inferred from net counts.
## References
Load the reference that matches the task — keep this file lean and pull detail on demand:
- **[references/methodology.md](references/methodology.md)** — the 7-step workflow, debt-classification table, severity scoring framework, interest-rate/cost-of-delay formulas, prioritization matrix, WSJF, sprint allocation ratios, the debt-item JSON schema, refactoring strategies, and quarterly planning. Read when scoring, prioritizing, or planning.
- **[references/tool-reference.md](references/tool-reference.md)** — full parameter tables, examples, and output-format details for all three scripts plus the troubleshooting table. Read when running the scripts or debugging output.
- **[references/dashboards-and-examples.md](references/dashboards-and-examples.md)** — executive and engineering dashboard layouts, a worked Python-microservice scan example, and the success-criteria bar. Read when generating reports or validating quality.
- **[references/debt-classification-taxonomy.md](references/debt-classification-taxonomy.md)** — comprehensive taxonomy for classifying debt across dimensions with detection heuristics per category. Read when calibrating detection or labeling items.
- **[references/prioritization-framework.md](references/prioritization-framework.md)** — deep prioritization approaches based on business value, risk, effort, and strategic alignment. Read when designing a prioritization rubric.
- **[references/stakeholder-communication-templates.md](references/stakeholder-communication-templates.md)** — templates and guidelines for communicating debt status, impact, and recommendations to different stakeholder groups. Read when reporting to execs or product.
- **[references/quadrant-and-roadmap.md](references/quadrant-and-roadmap.md)** — the technical debt quadrant and the implementation roadmap phases. Read when framing debt for a team new to tracking it.
## Scope & Limitations
**This skill covers:**
- Static detection of code-level, architecture, test, documentation, dependency, and infrastructure debt via AST parsing (Python) and regex pattern matching (all languages).
- Quantitative prioritization of debt items using cost-of-delay, WSJF, and RICE frameworks with configurable team size and sprint capacity.
- Historical trend analysis, health scoring, debt velocity tracking, and executive/engineering dashboard generation from multiple scan snapshots.
- Sprint allocation planning with capacity-aware backlog scheduling and effort estimation by debt type.
**This skill does NOT cover:**
- Runtime performance profiling or production monitoring -- see `engineering/performance-profiler` and `engineering/observability-designer` for those concerns.
- Dependency vulnerability scanning (CVE detection) or software composition analysis -- see `engineering/dependency-auditor` for security-focused dependency review.
- Automated refactoring or code transformation -- the skill identifies and prioritizes debt but does not modify source code.
- Database schema debt, API contract drift, or infrastructure-as-code drift detection -- see `engineering/database-schema-designer`, `engineering/api-design-reviewer`, and `engineering/migration-architect` for those domains.
## Integration Points
| Skill | Use for |
|-------|---------|
| `engineering/dependency-auditor` | CVE and outdated-dependency findings to merge into the inventory |
| `engineering/ci-cd-pipeline-builder` | Gate builds on `summary.health_score` or new critical items |
## Anti-Patterns
### Counting Items Instead of Interest
**Mistake:** Reporting "we have 412 debt items" and prioritising by count per module.
**Why it happens:** Counts are what scanners produce.
**Instead:** Rank by interest: debt in code touched every sprint costs far more than debt in a file nobody opens. Weight by change frequency (for example `git log --since=6.months --name-only`).
### A Debt Sprint Every Quarter
**Mistake:** Saving all debt work for a dedicated cleanup sprint.
**Why it happens:** It is easy to negotiate once.
**Instead:** Reserve a fixed share of every sprint (the prioritizer's allocation) and fix debt where feature work already touches the code.
### Dashboards Without a Decision
**Mistake:** Sending executives a health trend with no ask.
**Why it happens:** The dashboard looks like the deliverable.
**Instead:** Lead with the decision: what to fund, what it unblocks, and what happens to delivery speed if nothing changes.
## Files
| File | Purpose |
|------|---------|
| `scripts/debt_scanner.py` | Codebase scan to a debt inventory with health score |
| `scripts/debt_prioritizer.py` | Cost-of-delay, WSJF or RICE ranking and sprint allocation |
| `scripts/debt_dashboard.py` | Trends, velocity and forecasts across snapshots |
| `assets/sample_codebase/`, `clean_codebase/`, `malformed_codebase/` | Flawed, sound and unusable scanner inputs |
| `assets/sample_debt_inventory.json`, `sound_inventory.json`, `malformed_inventory.json` | Flawed, sound and unusable prioritizer inputs |
| `assets/historical_debt_*.json`, `sound_snapshot_*.json`, `flawed_snapshot_*.json`, `malformed_snapshot.json` | Dashboard inputs; `assets/contract.json` lists every run |
| `expected_outputs/*.json` | Reference outputs for the samples |
| `references/*.md` | Methodology, tool reference, dashboards, taxonomy, prioritization, communication templates, quadrant and roadmap |