/yellow-debt:debt:debt:status [--json]from yellow-debt
Dashboard of current technical debt levels. Use when you want to check debt status, see aggregated metrics, or export debt data.
Ships in yellow-debt. Installing the plugin adds it to Claude Code.
Display a dashboard of current technical debt levels aggregated by status, category, severity, and effort.
--json — Output machine-readable JSON instead of formatted dashboardOmit the '--json' operand on the bash /dev/fd/3 line unless the
command arguments include --json. Stop with an error instead of running the block if
any argument value contains a single quote.
# lib/validate.sh is bash-only: run this block in bash even when the Bash
# tool's shell is zsh (bash reads the script from fd 3, so stdin stays free).
bash /dev/fd/3 '--json' 3<<'__YELLOW_DEBT_BASH__'
set -euo pipefail
# Source shared validation library for extract_frontmatter helper
# shellcheck source=../../lib/validate.sh
. "${CLAUDE_PLUGIN_ROOT}/lib/validate.sh"
# Parse arguments
JSON_OUTPUT=false
while [ $# -gt 0 ]; do
case "$1" in
--json)
JSON_OUTPUT=true
shift
;;
*)
printf 'ERROR: Unknown argument "%s"\n' "$1" >&2
exit 1
;;
esac
done
# Scan todos/debt/ for all todo files with corruption handling
declare -A by_status
declare -A by_category
declare -A by_severity
declare -A by_effort
# Initialize counters
for status in pending ready in-progress deferred complete deleted wont-fix; do
by_status["$status"]=0
done
for category in ai-pattern complexity duplication architecture security-debt; do
by_category["$category"]=0
done
for severity in critical high medium low; do
by_severity["$severity"]=0
done
for effort in quick small medium large; do
by_effort["$effort"]=0
done
# A missing yq must stop the command; the per-file fallbacks below only cover a
# file whose frontmatter will not parse.
command -v yq >/dev/null 2>&1 || {
printf '[status] Error: yq is required but not installed\n' >&2
exit 1
}
# Scan all todo files
TODO_COUNT=0
ERROR_COUNT=0
REPAIR_JSON=""
if [ -d todos/debt ]; then
while IFS= read -r -d '' todo_file; do
# Validate file exists and is readable
if [ ! -f "$todo_file" ] || [ ! -r "$todo_file" ]; then
printf '[status] WARNING: Skipping corrupted file: %s\n' "$todo_file" >&2
ERROR_COUNT=$((ERROR_COUNT + 1))
continue
fi
# Extract metadata using yq on YAML frontmatter only
# NOTE: Todo files are markdown with YAML frontmatter. extract_frontmatter()
# extracts only the YAML section for yq compatibility (kislyuk/yq cannot
# parse mixed markdown+YAML format).
# A file whose frontmatter will not parse is counted as unknown, not fatal
# (set -e would otherwise abort the whole dashboard on one bad file).
STATUS=$(extract_frontmatter "$todo_file" | yq -r '.status // "unknown"' 2>/dev/null) || STATUS=unknown
CATEGORY=$(extract_frontmatter "$todo_file" | yq -r '.category // "unknown"' 2>/dev/null) || CATEGORY=unknown
SEVERITY=$(extract_frontmatter "$todo_file" | yq -r '.severity // "unknown"' 2>/dev/null) || SEVERITY=unknown
EFFORT=$(extract_frontmatter "$todo_file" | yq -r '.effort // "unknown"' 2>/dev/null) || EFFORT=unknown
# Validate and increment status counter
case "$STATUS" in
pending|ready|in-progress|complete|deferred|deleted|wont-fix)
val_status=${by_status["$STATUS"]:-0}
by_status["$STATUS"]=$((val_status + 1))
;;
wont_fix|wontfix|"wont fix")
# Hand-written spelling. The value is frontmatter text: print it only
# through %s, never inside a heredoc.
legacy_base="${todo_file##*/}"
if [[ "$legacy_base" =~ $DEBT_TODO_NAME_RE ]]; then
printf '[status] WARNING: Status "%s" in %s should be wont-fix; the file counts in total_findings but in no by_status bucket. Repair: close todo id %s (name status %s) as wont-fix with the recipe in the debt-conventions skill\n' "$STATUS" "$todo_file" "${legacy_base%%-*}" "${BASH_REMATCH[1]}" >&2
# id (digits) and name status (enum) come from the validated name, so
# they need no JSON escaping.
REPAIR_JSON="${REPAIR_JSON:+$REPAIR_JSON, }{\"id\": \"${legacy_base%%-*}\", \"name_status\": \"${BASH_REMATCH[1]}\"}"
else
printf '[status] WARNING: Status "%s" in %s should be wont-fix, but the file name does not fit the todo pattern; rename it by hand to the -pending- form first\n' "$STATUS" "$todo_file" >&2
fi
ERROR_COUNT=$((ERROR_COUNT + 1))
;;
*)
printf '[status] WARNING: Unknown status "%s" in %s\n' "$STATUS" "$todo_file" >&2
ERROR_COUNT=$((ERROR_COUNT + 1))
;;
esac
# Validate and increment category counter
case "$CATEGORY" in
ai-pattern|complexity|duplication|architecture|security-debt)
val_category=${by_category["$CATEGORY"]:-0}
by_category["$CATEGORY"]=$((val_category + 1))
;;
*)
printf '[status] WARNING: Unknown category "%s" in %s\n' "$CATEGORY" "$todo_file" >&2
;;
esac
# Validate and increment severity counter
case "$SEVERITY" in
critical|high|medium|low)
val_severity=${by_severity["$SEVERITY"]:-0}
by_severity["$SEVERITY"]=$((val_severity + 1))
;;
*)
printf '[status] WARNING: Unknown severity "%s" in %s\n' "$SEVERITY" "$todo_file" >&2
;;
esac
# Validate and increment effort counter
case "$EFFORT" in
quick|small|medium|large)
val_effort=${by_effort["$EFFORT"]:-0}
by_effort["$EFFORT"]=$((val_effort + 1))
;;
*)
printf '[status] WARNING: Unknown effort "%s" in %s\n' "$EFFORT" "$todo_file" >&2
;;
esac
TODO_COUNT=$((TODO_COUNT + 1))
done < <(find todos/debt -name '*.md' -print0 2>/dev/null)
fi
# Calculate estimated remaining effort
# Quick: 0.5hr avg, Small: 1hr avg, Medium: 5hr avg, Large: 20hr avg
if command -v bc >/dev/null 2>&1; then
# Use bc for precise floating-point calculation
EFFORT_HOURS=$(echo "(${by_effort[quick]:-0} * 0.5) + \
(${by_effort[small]:-0} * 1) + \
(${by_effort[medium]:-0} * 5) + \
(${by_effort[large]:-0} * 20)" | bc)
else
# Fallback: integer calculation that ignores quick fixes
printf '[status] WARNING: bc not available, quick fixes ignored in effort calculation\n' >&2
EFFORT_HOURS=$((
${by_effort[small]:-0} * 1 +
${by_effort[medium]:-0} * 5 +
${by_effort[large]:-0} * 20
))
fi
if [ "$JSON_OUTPUT" = true ]; then
# Machine-readable JSON output
cat <<EOF
{
"total_findings": $TODO_COUNT,
"errors": $ERROR_COUNT,
"by_status": {
"pending": ${by_status[pending]},
"ready": ${by_status[ready]},
"in_progress": ${by_status[in-progress]},
"deferred": ${by_status[deferred]},
"complete": ${by_status[complete]},
"deleted": ${by_status[deleted]},
"wont_fix": ${by_status[wont-fix]}
},
"by_category": {
"ai_pattern": ${by_category[ai-pattern]},
"complexity": ${by_category[complexity]},
"duplication": ${by_category[duplication]},
"architecture": ${by_category[architecture]},
"security_debt": ${by_category[security-debt]}
},
"by_severity": {
"critical": ${by_severity[critical]},
"high": ${by_severity[high]},
"medium": ${by_severity[medium]},
"low": ${by_severity[low]}
},
"needs_repair": [$REPAIR_JSON],
"estimated_effort_hours": $EFFORT_HOURS
}
EOF
else
# Human-readable dashboard
cat <<EOF
Technical Debt Dashboard
========================
By Status:
Pending: ${by_status[pending]} findings
Ready: ${by_status[ready]} findings
In Progress: ${by_status[in-progress]} finding
Deferred: ${by_status[deferred]} findings
Complete: ${by_status[complete]} findings (resolved)
Deleted: ${by_status[deleted]} findings (removed)
Won't fix: ${by_status[wont-fix]} findings (closed)
By Category:
Complexity: ${by_category[complexity]}
Duplication: ${by_category[duplication]}
AI Pattern: ${by_category[ai-pattern]}
Architecture: ${by_category[architecture]}
Security Debt: ${by_category[security-debt]}
By Severity:
Critical: ${by_severity[critical]}
High: ${by_severity[high]}
Medium: ${by_severity[medium]}
Low: ${by_severity[low]}
Estimated Remaining Effort: ~${EFFORT_HOURS} hours
Quick fixes: ${by_effort[quick]} items
Small: ${by_effort[small]} items
Medium: ${by_effort[medium]} items
Large: ${by_effort[large]} items
EOF
if [ $ERROR_COUNT -gt 0 ]; then
printf 'WARNING: %d todo file(s) need attention (see warnings above)\n\n' "$ERROR_COUNT"
fi
# Next steps based on current state
if [ "${by_status[pending]}" -gt 0 ]; then
printf 'Next Steps:\n'
printf ' - Run /debt:triage to review %d pending finding(s)\n' "${by_status[pending]}"
elif [ "${by_status[ready]}" -gt 0 ]; then
printf 'Next Steps:\n'
printf ' - Run /debt:fix to remediate %d ready finding(s)\n' "${by_status[ready]}"
elif [ "${by_status[in-progress]}" -gt 0 ]; then
printf 'Next Steps:\n'
printf ' - Complete %d in-progress finding(s)\n' "${by_status[in-progress]}"
else
printf 'No findings are waiting for triage or a fix.\n'
printf 'Run /debt:audit to scan for new technical debt.\n'
fi
fi
__YELLOW_DEBT_BASH__
# View dashboard
$ARGUMENTS
# Export as JSON
$ARGUMENTS --json
Technical Debt Dashboard
========================
By Status:
Pending: 12 findings
Ready: 8 findings
In Progress: 1 finding
Deferred: 3 findings
Complete: 15 findings (resolved)
Deleted: 2 findings (removed)
Won't fix: 4 findings (closed)
By Category:
Complexity: 8 (3 critical, 5 high)
Duplication: 5 (2 high, 3 medium)
AI Patterns: 4 (4 medium)
Architecture: 3 (1 critical, 2 high)
Security: 2 (2 critical)
Estimated Remaining Effort: ~32 hours
Quick fixes: 5 items (~2.5 hrs)
Small: 8 items (~12 hrs)
Medium: 3 items (~15 hrs)
Next Steps:
- Run /debt:triage to review 12 pending finding(s)
{
"total_findings": 23,
"errors": 1,
"by_status": {
"pending": 12,
"ready": 8,
"in_progress": 1,
"deferred": 3,
"complete": 15,
"deleted": 2,
"wont_fix": 4
},
"by_category": {
"ai_pattern": 4,
"complexity": 8,
"duplication": 5,
"architecture": 3,
"security_debt": 2
},
"by_severity": {
"critical": 6,
"high": 10,
"medium": 5,
"low": 2
},
"needs_repair": [{"id": "052", "name_status": "pending"}],
"estimated_effort_hours": 32
}
Corrupted todo files: Skipped with warning, counted in error total Missing
todos/debt/ directory: Shows zeros for all metrics Malformed YAML
frontmatter: Counted as unknown in total_findings, with a warning
Team dashboards: Export as JSON and visualize in monitoring tools Progress tracking: Compare status over time Prioritization: See high-severity items at a glance Effort planning: Use estimated hours for sprint planning
What the command file sets; muted values are Claude Code's defaults
haiku7-day visitors to each command page
6 commands in this plugin
/debt:debt:auditdebt:auditRun comprehensive technical debt audit with parallel scanner agents. Use when you need to assess codebase health, identify AI-generated debt patterns, or scan for technical debt./debt:debt:fixdebt:fixAgent-driven remediation of specific debt findings with human approval. Use when you want to fix a specific technical debt item./debt:debt:setupdebt:setupValidate debt audit prerequisites and optional Linear integration. Use when first installing the plugin or when debt commands fail before scanning begins./debt:debt:syncdebt:syncPush accepted debt findings to Linear as issues. Use when you want to track technical debt in Linear./debt:debt:triagedebt:triageInteractive review and prioritization of pending debt findings. Use when you need to accept, reject, defer, or close as won't fix findings from an audit.Other plugins' commands for the same job
npx claudepluginhub kinginyellows/yellow-plugins --plugin yellow-debt