techdebt
Skill257 starsChanged 6 months agoMITView on GitHub
清理重复代码、死代码、不规范的变量命名和低质量实现,减少技术债并提高可维护性。Use when user mentions tech debt, duplicate code, cleanup, refactor, dead code, code smell, 或使用 /techdebt 收工检查。
6 other projects use a version of this.
Adopted by
Most recently taken up by
- smiling66652/workbuddy-skill-toolkitstheir own version, first seen Sep 15, 2026
- jh941213/my-cc-harnesstheir own version, first seen Jul 27, 2026
- Lucface/claude-skillstheir own version, first seen Jun 20, 2026
- aromanarguello/roman-skillstheir own version, first seen May 5, 2026
- almax000/claude-skillstheir own version, first seen Apr 19, 2026
- renatorozas/claude-code-configtheir own version, first seen Mar 19, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- jh941213/my-cc-harness★ 126same name
- aromanarguello/roman-skills★ 19same name
- almax000/claude-skills★ 1same name
- Lucface/claude-skills★ 1same name
- renatorozas/claude-code-config★ 1same name
- smiling66652/workbuddy-skill-toolkits★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- debug-by-isolationSkill
- debugSkill
The file
Files
/techdebt
用于每次收工前做一次低风险技术债清理,重点消灭重复代码和明显垃圾代码。
目标
- 优先处理本次修改的代码
- 优先处理“重复实现、可抽取共用逻辑、死代码、无意义分支、低价值注释、不规范的变量命名”
- 保持行为不变,不做需求扩展
- 小步提交,确保每一轮都可验证
执行流程
每次触发本技能时,按以下顺序执行:
- 扫描可疑区域(重复代码 + 死代码 + 命名混乱)
- 选择 1-3 个风险点进行清理(不要一口气大重构)
- 实施最小改动,优先抽公共函数/组件,删除未使用代码,更正不规范的变量命名
- 运行必要校验(至少 lint 或类型检查;能跑测试就跑)
- 输出“本轮还债报告”(见模板)
扫描策略
优先从最近改动文件开始,再扩展到同目录:
- 查重复片段:相似 if/else、复制粘贴的映射转换、重复请求/错误处理
- 查死代码:未使用的导入、函数、状态、常量、分支
- 查坏味道:超长函数、重复字符串字面量、职责混杂、命名不规范(词不达意、拼写错误、格式不统一)
推荐工具顺序:
rg精确搜关键词和重复片段- 若范围较大,用语义搜索定位“相同意图不同实现”
- 仅读取必要文件,避免全仓大扫荡
改动边界(必须遵守)
- 不改变对外行为和接口契约
- 不顺手改 unrelated 文件
- 不引入新的大型抽象层
- 不修改与本次清理无关的配置
- 若发现高风险点,仅记录到“后续债务清单”,不在本轮处理
优先级规则
按以下优先级选择清理项:
- 同文件内重复逻辑(收益高、风险低)
- 同目录下重复逻辑(可提炼工具函数)
- 明确未使用代码(可直接删除)
- 局部变量/函数命名更正(低风险,提升可读性)
- 复杂但高风险的历史包袱(只记录,不强拆)
本轮还债报告模板
每轮结束必须输出:
## Tech Debt Sweep
- 范围:<目录/模块>
- 清理项:
- <改动 1>
- <改动 2>
- 风险评估:<低/中/高,及原因>
- 验证:
- <lint/typecheck/test 命令与结果>
- 后续债务清单:
- <本轮未处理但建议后续处理项>默认口径
- 用户说“收工前清一下”“还技术债”“去重一下”“跑 /techdebt”时自动应用本技能
- 默认执行“低风险、小步、可验证”策略
- 如果仓库本身已存在未提交改动,只在用户当前任务相关范围内操作
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

