tech-debt
它能做什么
这个技能扫描代码库中技术债务的迹象,把每项发现归入一个类别,并保留最重要事项的清单。适合希望规划清理工作的开发者和负责人。
适用场景
- ✓当团队希望扫描代码,查找混乱或有风险区域的迹象的时候。
- ✓当开发者需要手动把已知的债务项添加到登记表中的时候。
- ✓当负责人需要为规划工作提供债务状况和优先级汇总的时候。
技能链接
https://github.com/Donchitos/Claude-Code-Game-Studios/blob/main/.claude/skills/tech-debt/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请扫描代码库中的技术债务,并告诉我应该先修复哪些事项。”
每周 5 个新技能,1 分钟读完。
工作原理
这个技能会在代码中搜索 TODO、FIXME 和 HACK 等标记,标出过长的文件和函数,并把每项发现归入一个债务类别。它会维护一份登记表,并可以重新排序或生成报告。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
!bash "${CLAUDE_SKILL_DIR}/../../hooks/yaml-helper.sh" resolve_config --keys automation,workflow
Tech Debt
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).
Phase 1: Parse Subcommand
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 status
If no subcommand is provided, output usage and stop. Verdict: FAIL — missing required subcommand.
Phase 2A: Scan Mode
Search the code root (resolve per .claude/docs/code-root-resolution.md:
src/, Assets/ or Source/ by engine) for debt indicators:
TODOcomments (count and categorize)FIXMEcomments (these are bugs disguised as debt)HACKcomments (workarounds that need proper solutions)@deprecatedmarkers- Duplicated code blocks (similar patterns in multiple files)
- Files over 500 lines (potential god objects)
- Functions over 50 lines (potential complexity)
Categorize each finding:
- Architecture Debt: Wrong abstractions, missing patterns, coupling issues
- Code Quality Debt: Duplication, complexity, naming, missing types
- Test Debt: Missing tests, flaky tests, untested edge cases
- Documentation Debt: Missing docs, outdated docs, undocumented APIs
- Dependency Debt: Outdated packages, deprecated APIs, version conflicts
- Performance Debt: Known slow paths, unoptimized queries, memory issues
Before presenting anything, establish that there was something to scan.
Count the source files the scan actually covered. If the code root is
unresolved, report NOT ASSESSED — code root unresolved and stop as below. If
that count is zero — the code root is absent, or holds no source files — report:
NOT ASSESSED — no source files to scan. The code root 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, never overwriting it. Match before appending: a
finding with the same file and the same kind of debt as an existing Open entry
updates that entry instead of adding a duplicate. An existing Open entry whose
pattern is no longer in its file is proposed as Resolved [date] — list those and
include them in the same approval. Verdict: COMPLETE — scan findings written to register.
If no, stop here. Verdict: BLOCKED — user declined write.
Phase 2B: Add Mode
Ask the user for the description and affected files (plain text prompts).
Run as a subagent? lead-programmer preloads this skill, and a subagent has
no AskUserQuestion. Return the three questions below (category, effort,
impact) in one reply, each as a short list of its options, and stop: whoever
called you asks the user. Nothing goes into the register until the answers
come back.
Then use AskUserQuestion to collect the category:
- Prompt: "What category does this tech debt belong to?"
- Options:
[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 queries
Then use AskUserQuestion to collect the estimated fix effort:
- Prompt: "What is the estimated effort to fix this item?"
- Options:
[A] S — Small (under 1 day)[B] M — Medium (1–3 days)[C] L — Large (3–7 days)- `[D
常见问题
它查找哪些内容?
它查找 TODO、FIXME 和 HACK 注释、已弃用的标记、重复代码,以及过长的文件或函数。
为什么 FIXME 要区别对待?
FIXME 标记的是已知有问题的代码,因此技能把它视为伪装成债务的缺陷。
我可以自己添加债务项吗?
可以。添加模式允许你手动输入一项债务。
详情
作者的原始描述
Track, categorize and prioritize technical debt across the codebase — scans for debt indicators, maintains a register.
热度
- GitHub 星标
- 33k
- 排名
- #8500
- 许可证
- MIT
- 更新时间
- 2026/10/18
评论
- …