Track, categorize and prioritize technical debt across the codebase — scans for debt indicators, maintains a register.
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-tech-debt-685c4c88c0f7 ,按照其中的说明把「tech-debt」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
!bash "${CLAUDE_SKILL_DIR}/../../hooks/yaml-helper.sh" resolve_config --keys automation
Every AskUserQuestion call follows .claude/docs/automation-modes.md
(collaborative asks always · guided major-only · autonomous logs and proceeds;
automation_always_ask categories always prompt).
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:
Before presenting anything, establish that there was something to scan.
Count the source files the scan actually covered. If that count is zero —
no src/ directory, or it holds no source files — report:
NOT ASSESSED — no source files to scan.
src/contains no code, so "no debt indicators found" would be a statement about an empty search, not about the codebase. Run this once implementation is under way.
and stop. Do not write to the register and do not emit a COMPLETE verdict.
The distinction is the whole point of the scan: zero findings over 400 files is a clean codebase; zero findings over zero files is no information at all. Rendering both as "COMPLETE — scan findings written to register" reads as the first. State the denominator whenever findings are reported, including when it is large and the count is genuinely zero.
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.
Ask the user for the description, affected files, and impact if left unfixed (plain text prompts).
Then use AskUserQuestion to collect the category:
[A] Architecture Debt — wrong abstractions, missing patterns, coupling issues[B] Code Quality Debt — duplication, complexity, naming, missing types[C] Test Debt — missing tests, flaky tests, untested edge cases[D] Documentation Debt — missing/outdated docs, undocumented APIs[E] Dependency Debt — outdated packages, deprecated APIs, version conflicts[F] Performance Debt — known slow paths, memory issues, unoptimized queriesThen use AskUserQuestion to collect the estimated fix effort:
[A] S — Small (under 1 day)[B] M — Medium (1–3 days)[C] L — Large (3–7 days)[D] XL — Extra Large (over 1 week)Present the complete 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"] |