From draft
Identifies, categorizes, and prioritizes technical debt across seven dimensions using graph analysis (fan-in × complexity, cycles, blast radius) and marker scanning. Generates remediation plans with effort estimates.
How this skill is triggered — by the user, by Claude, or both
Slash command
/draft:tech-debtThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are conducting a technical debt analysis to catalog, prioritize, and plan remediation of debt across the codebase.
You are conducting a technical debt analysis to catalog, prioritize, and plan remediation of debt across the codebase.
First resolve the bundled helpers:
# Locate Draft's bundled helpers (cwd is the user's project; ${CLAUDE_PLUGIN_ROOT}
# is not exported into skill Bash). See core/shared/tool-resolver.md.
DRAFT_TOOLS="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
When draft/graph/schema.yaml exists, this skill must follow the graph-first lookup contract in core/shared/graph-query.md §Mandatory Lookup Contract. Tech-debt prioritization is fundamentally driven by graph data:
"$DRAFT_TOOLS/hotspot-rank.sh" --repo . — rank candidates by fanIn × complexity to surface high-leverage debt first."$DRAFT_TOOLS/graph-arch.sh" --repo . and run "$DRAFT_TOOLS/cycle-detect.sh" --repo . — flag debt in modules involved in cycles as higher priority."$DRAFT_TOOLS/cycle-detect.sh" --repo . to enumerate dependency cycles — every cycle is a candidate architecture-debt entry."$DRAFT_TOOLS/graph-impact.sh" --repo . --file <path> so the remediation plan includes blast-radius.Filesystem grep (e.g. scan-markers.sh) is still primary for TODO/FIXME marker discovery — markers are source-text, not graph-derived. The graph governs prioritization, the marker scan governs discovery.
See shared red flags — applies to all code-touching skills.
Skill-specific:
Not all shortcuts are debt. Check accepted patterns before flagging.
Before starting, capture the current git state:
git branch --show-current # Current branch name
git rev-parse --short HEAD # Current commit hash
Store this for the report header. All findings are relative to this specific branch/commit.
ls draft/ 2>/dev/null
If draft/ doesn't exist, this skill can still run standalone with reduced context.
Read and follow the base procedure in core/shared/draft-context-loading.md.
/draft:tech-debt — Project-wide scan (default)/draft:tech-debt module <name> — Module-scoped scan/draft:tech-debt category <type> — Filter by category (code, architecture, test, dependency, documentation, infrastructure)/draft:tech-debt <path> — Scan specific directory/file patterndraft/tech-stack.md — Critical: "Accepted Patterns" section. Do NOT flag these as debt.draft/guardrails.md — Learned conventions (skip) and anti-patterns (always flag)draft/.ai-context.md — Module boundaries, invariants, known constraintsdraft/product.md — Business priorities for impact assessmentdraft/workflow.md — Team conventions and toolchain for feasibility assessmentScan the codebase systematically across all seven categories. For each finding, record: location (file:line OR track id for Process Debt), description, evidence, and category.
For TODO/FIXME/HACK/XXX/DEPRECATED markers, prefer the deterministic scan-markers.sh wrapper — it emits JSON [{path,line,marker,text,sha,author,introduced,age_days}] with blame ages already computed. Resolve via the canonical tool resolver (see core/shared/tool-resolver.md):
# Locate Draft's bundled helpers (cwd is the user's project; ${CLAUDE_PLUGIN_ROOT}
# is not exported into skill Bash). See core/shared/tool-resolver.md.
DRAFT_TOOLS="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
[ -x "$DRAFT_TOOLS/scan-markers.sh" ] && bash "$DRAFT_TOOLS/scan-markers.sh" --root .
# Fallback when script unavailable: grep -rn 'TODO\|FIXME\|HACK\|XXX\|DEPRECATED' .
Use the JSON output to prioritise: markers with age_days > 180 are stale and should be promoted to tracked tech debt.
Marker context gate (Ground-Truth Discipline G1): scan-markers.sh produces candidates, not findings. Before promoting a TODO/FIXME/HACK/XXX/DEPRECATED marker to your debt catalog, Read the surrounding 10–20 lines at that file:line. Many markers are justified (intentional deferrals with ownership) or already addressed (the marker rotted, the work shipped). A debt entry whose Evidence is "marker exists" without a Read is a Ground-Truth Red Flag — produce false positives and reviewer churn.
scan-markers.sh above)npm audit, pip audit, etc.)Scan draft/tracks/*/ for design-process gaps. For each track:
spec.md frontmatter classification.criticality. Default to standard if absent.hld.md:
criticality ∈ {standard, high, mission-critical} → flag as Process Debtcritical for mission-critical, high for high, medium for standard/draft:decompose <track> to generate hld.md"hld.md Approvals table:
/draft:upload Step 3.1 logic) and the track has merged commits → flaghigh if criticality ∈ {high, mission-critical}, medium otherwiselld.md:
Complexity: High AND lld.md is missing → flagmedium/draft:decompose <track> --lld"high for high/mission-critical, medium for standardsynced_to_commit is older than the latest merged commit touching files in HLD §Detailed Design → flag as driftmedium/draft:decompose <track> to refresh graph slots; review structural sections; re-circulate if signed"Process Debt findings carry the same Impact/Effort/Risk scoring as other categories. They surface in the remediation plan alongside code/architecture debt.
For each finding, score on three dimensions:
Impact (1-5): How much does this hurt development velocity or production reliability?
Risk (1-5): How likely is this to cause a production incident?
Effort (1-5): How much work to remediate?
Priority = (Impact + Risk) / (6 - Effort)
Higher score = higher priority. This formula naturally favors high-impact, low-effort items ("quick wins") and deprioritizes low-impact, high-effort items.
Organize findings into three actionable tiers:
Items that can be fixed in a single sprint or less. Do these first — they deliver the best return on investment.
For each item:
Items requiring dedicated effort. Create via /draft:new-track or route via /draft:jira (or /draft:plan "tech debt remediation").
For each item:
Track but don't prioritize. Revisit quarterly. These items are real debt but the cost of remediation exceeds the current pain.
MANDATORY: Include YAML frontmatter with git metadata. Follow core/shared/git-report-metadata.md.
Include the report header table immediately after frontmatter:
| Field | Value |
|-------|-------|
| **Branch** | `{LOCAL_BRANCH}` → `{REMOTE/BRANCH}` |
| **Commit** | `{SHORT_SHA}` — {COMMIT_MESSAGE} |
| **Generated** | {ISO_TIMESTAMP} |
| **Synced To** | `{FULL_SHA}` |
Save to: draft/tech-debt-report-<timestamp>.md
Create symlink: draft/tech-debt-report-latest.md
TIMESTAMP=$(date +%Y-%m-%dT%H%M)
# Example: draft/tech-debt-report-2026-03-15T1430.md
ln -sf tech-debt-report-${TIMESTAMP}.md draft/tech-debt-report-latest.md
Report structure:
Every tech-debt report must end with a ## Next Actions section listing the smallest set of follow-ups in execution order. Use this exact shape:
## Next Actions
| # | Action | Owner | Blocker? | Skill / Command |
|---|---|---|---|---|
| 1 | <imperative one-liner> | <team\|TBD> | yes/no | `/draft:<skill> <args>` or `n/a` |
Rules:
Blocker? = yes only for items that will cause an outage on next deploy./draft:new-track for items >1 day of work, /draft:adr for design re-decisions, /draft:implement for surgical cleanups.Before printing the final debt report, internally verify and report:
cycles and impact).grep/find run beyond scan-markers.sh, name the concept it searched for.If draft/graph/schema.yaml does not exist, set Graph files queried: NONE and use justification graph data unavailable.
Emit the canonical footer from core/shared/graph-usage-report.md §Canonical footer. The lint hook scripts/tools/check-graph-usage-report.sh validates the section on save.
/draft:new-track (refactor tracks — scope the debt before planning)/draft:implement (when TODO/FIXME detected at completion)/draft:deep-review (architecture debt findings)/draft:jira (or /draft:plan for remediation tracks) (create remediation tickets from Tier 2 items)/draft:testing-strategy (Test Debt findings inform test planning)core/shared/jira-sync.mdIf no draft context: Run with reduced analysis, note: "Run /draft:init for better debt detection with accepted-pattern filtering"
If tech-stack.md has accepted patterns: Explicitly skip those patterns, note: "Skipped N accepted patterns from tech-stack.md"
If >100 findings: Group by category, show top 20 by priority in the summary, full list in Category Details section
If module scope requested but module not found: List available modules, ask user to confirm
npx claudepluginhub drafthq/draft --plugin draftIdentifies, quantifies, and prioritizes technical debt in codebases across code duplication, complexity, architecture flaws, testing gaps, documentation, and infrastructure. Creates remediation plans.
Systematically identify, classify, and prioritize technical debt in codebases using SQALE model and Fowler's quadrant. Guides static analysis, debt register creation, and ROI-based remediation.
Identifies, categorizes, and prioritizes technical debt across code, architecture, tests, dependencies, docs, and infrastructure. Scores by impact, risk, effort; outputs remediation plans.