techdebt
Skill1 starsChanged 3 months agoMITView on GitHub
扫描一个代码仓库,找出重复代码、明显坏味道、未使用文件/依赖、TODO/FIXME 堆积、超大文件,输出按严重度排序的清单。 触发词:技术债、代码坏味道、清理代码、扫描重复代码、找 TODO、tech debt、code smell、重构前的体检
6 other projects use a version of this.
Adopted by
Most recently taken up by
- jh941213/my-cc-harnesstheir own version, first seen Jul 27, 2026
- Lucface/claude-skillstheir own version, first seen Jun 20, 2026
- chenzhen7/akaritheir own version, first seen May 24, 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
- chenzhen7/akari★ 257same name
- 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
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 repository18 other files it gives its agents.
- AI 工具箱Skill
- git-shipSkill
- hfut-inspectorSkill
- image-to-editable-pptxSkill
- qf-english-polishSkill
- skill-integratorSkill
- weekly-reviewSkill
- WorkBuddy 工作原则Skill
- yuketang-harvesterSkill
- 学术研究工具箱Skill
- 安全审查工具箱Skill
- 工程方法论工具箱Skill
- 开发工具箱Skill
- 微信小程序开发套件Skill
- 文档工具箱Skill
- 知识工具箱Skill
- 联网工具箱Skill
- 评审委员会Skill
The file
Files
技术债清理(techdebt)
用途:在重构、交付作品集、交作业前,对仓库做一遍“体检”,把债按严重度列出来,每条都给出文件路径 + 行号 + 为什么是债,方便逐个销账。
适用场景
- 保研作品集 / 课程大作业提交前,想清理冗余代码
- 接手别人的仓库,先摸清哪里最乱
- 周复盘时顺手扫一遍,防止债越积越多
- 配合
git-ship技能,在提交前先做一次轻量体检
执行步骤
先在仓库根目录打开 Git Bash,依次跑下面几条命令。所有命令已避开 node_modules、.git,Windows 路径用正斜杠。
1. 超大文件(单文件 > 400 行)
for ext in py js ts jsx tsx wxml wxss vue go java; do
find . -type f -name "*.$ext" -not -path "*/node_modules/*" -not -path "*/.git/*" \
| while read f; do n=$(wc -l < "$f"); [ "$n" -gt 400 ] && echo "$n $f"; done
done | sort -rn2. TODO / FIXME / HACK / XXX 堆积
rg -n "TODO|FIXME|HACK|XXX|DEPRECATED" --glob "!.git" --glob "!node_modules" \
-g "*.py" -g "*.js" -g "*.ts" -g "*.wxml" -g "*.wxss" -g "*.vue" -g "*.go" -g "*.java"3. 调试残留(上线前必须清掉)
rg -n "print\(|console\.log\(|pdb|debugger|alert\(" --glob "!.git" --glob "!node_modules" \
-g "*.py" -g "*.js" -g "*.ts" -g "*.wxml"4. 重复代码(复制粘贴坏味道)
用 ripgrep 统计完全相同的行,行数出现 ≥ 3 次且非 import/空行的高概率重复:
rg -N --glob "!.git" --glob "!node_modules" -g "*.py" -g "*.js" -g "*.ts" \
-o ".+" | sort | uniq -c | sort -rn | awk '$1>=3{print}'若想精确定位重复块,跑下面这段 Python(直接复制执行):
python - <<'PY'
import os, re, hashlib
SKIP = ("node_modules", ".git", "__pycache__", "dist", "build")
EXT = (".py",".js",".ts",".wxml",".wxss",".vue",".go",".java")
hashes={}
for root,dirs,files in os.walk("."):
dirs[:]=[d for d in dirs if d not in SKIP]
for f in files:
if f.endswith(EXT):
p=os.path.join(root,f)
try: lines=[l.strip() for l in open(p,encoding="utf-8",errors="ignore") if l.strip() and not l.strip().startswith(("import","from","#","//"))]
except: continue
for i in range(len(lines)-4):
blk="\n".join(lines[i:i+5]); h=hashlib.md5(blk.encode()).hexdigest()
hashes.setdefault(h,[]).append((p,i+1))
for h,locs in hashes.items():
if len(locs)>=2:
print("重复块(5行) 出现 %d 次:"%len(locs))
for p,ln in locs: print(" %s:%d"%(p,ln))
PY5. 未使用依赖(Python / Node)
- Python:对比
requirements.txt顶层包名与代码里import的顶层模块,对不上的即为疑似未用依赖。 - Node:
package.json的dependencies与代码里require/import比对;更准的做法跑npx depcheck(需联网安装)。
6. 死文件 / 未跟踪冗余
git status --porcelain | grep "^??" # 从未纳入版本控制的散落文件
rg -l "" --files-without-match "." --glob "!.git" | head # 空文件探测见下
find . -type f -empty -not -path "*/.git/*" # 空文件输出格式
把上面结果汇总成一张表,按严重度排序(高→中→低)。格式固定如下:
| 严重度 | 类型 | 文件路径:行号 | 一句话说明 |
| 高 | 调试残留 | app.py:42 | 残留 print 会泄漏内部状态,上线前必须删 |
| 高 | 超大文件 | utils/helpers.js:1 | 单文件 820 行,应拆分为模块 |
| 中 | TODO 堆积 | api/client.ts:88 | 3 处 TODO 未实现重试逻辑 |
| 中 | 重复代码 | a.py:12 / b.py:30 | 相同 5 行校验逻辑复制两遍 |
| 低 | 未用依赖 | requirements.txt | 装了 requests 但代码未 import |
严重度判定参考:高 = 泄露风险 / 编译或运行隐患 / 明显 bug;中 = 可维护性差但暂不致命;低 = 整洁度问题。
注意事项
- 扫描前先
git pull确保看的是最新代码,避免漏报。 node_modules、dist等产物目录必须排除,否则全是噪音。- 第 6 步的“未使用”只是启发式,删除依赖/文件前务必本地跑一遍测试或启动确认。
- 本技能只负责列出清单,不自动改代码;确认无误后再用
git-ship提交清理结果。 - 微信小程序项目重点看
*.wxml/*.wxss里的重复 wxss 样式块和未使用的utils/*.js。
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.

