s-clean
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCleaning WoW Addons
清理WoW插件
Expert guidance for finding and removing cruft in addon codebases.
针对插件代码库中查找和移除冗余内容的专业指南。
Related Commands
相关命令
- c-clean - Cleanup workflow
- c-review - Full review (includes clean step)
- c-clean - 清理工作流
- c-review - 全面审查(包含清理步骤)
MCP Tools
MCP工具
| Task | MCP Tool |
|---|---|
| Find Dead Code | |
| Find Stale Docs | |
| Filter by Confidence | |
| 任务 | MCP工具 |
|---|---|
| 查找死代码 | |
| 查找过时文档 | |
| 按置信度筛选 | |
Capabilities
功能特性
- Dead Code Detection — Find unused functions, orphaned files, dead exports
- Stale Docs Detection — Find broken links, outdated refs, version drift
- Confidence Levels — Definite (100%), Likely (90%+), Suspicious (70%+)
- 死代码检测 — 查找未使用的函数、孤立文件、失效导出项
- 过时文档检测 — 查找失效链接、过时引用、版本偏差
- 置信度等级 — 确定(100%)、可能(90%+)、可疑(70%+)
Detection Categories
检测类别
Dead Code (addon.deadcode
)
addon.deadcode死代码(addon.deadcode
)
addon.deadcode| Category | Description |
|---|---|
| Functions defined but never called |
| Lua files not in TOC |
| Exported values never used |
| Libraries in Libs/ never used |
| Event handlers for unregistered events |
| Large blocks of commented-out code |
| 类别 | 描述 |
|---|---|
| 已定义但从未被调用的函数 |
| 未在TOC中声明的Lua文件 |
| 已导出但从未被使用的值 |
| Libs/目录下从未被使用的库 |
| 针对未注册事件的事件处理器 |
| 大段被注释掉的代码 |
Stale Docs (docs.stale
)
docs.stale过时文档(docs.stale
)
docs.stale| Category | Description |
|---|---|
| Internal links to non-existent files |
| Mentions of functions/files that don't exist |
| Old version numbers in documentation |
| Docs not updated in many commits |
| 类别 | 描述 |
|---|---|
| 指向不存在文件的内部链接 |
| 提及不存在的函数/文件 |
| 文档中的旧版本号 |
| 多次提交后未更新的文档 |
Workflow
工作流
Quick Cleanup
快速清理
- Run with
addon.deadcodefor high-confidence issues onlyinclude_suspicious=false - Remove identified dead code
- Run to find documentation issues
docs.stale - Fix broken links and update outdated references
- 运行并设置
addon.deadcode,仅处理高置信度问题include_suspicious=false - 移除识别出的死代码
- 运行查找文档问题
docs.stale - 修复失效链接并更新过时引用
Deep Cleanup
深度清理
- Run with all confidence levels
addon.deadcode - Manually verify suspicious findings before removal
- Run with all techniques
docs.stale - Update documentation to match current code
- 运行并包含所有置信度等级
addon.deadcode - 在移除前手动验证可疑结果
- 运行并使用所有检测技术
docs.stale - 更新文档以匹配当前代码
Confidence Interpretation
置信度解读
| Level | Meaning | Action |
|---|---|---|
| Definite | 100% certain (e.g., file not in TOC) | Safe to remove |
| Likely | 90%+ certain (e.g., function never called) | Review briefly, usually safe |
| Suspicious | 70%+ certain (e.g., dynamic code patterns) | Manual verification required |
| 等级 | 含义 | 操作建议 |
|---|---|---|
| 确定 | 100%确定(例如:文件未在TOC中声明) | 可安全移除 |
| 可能 | 90%+确定(例如:函数从未被调用) | 简要审查,通常可安全移除 |
| 可疑 | 70%+确定(例如:动态代码模式) | 需要手动验证 |
Best Practices
最佳实践
- Start with definite issues — These are safe to fix immediately
- Check dynamic patterns — ,
_G,rawgetmay hide usageloadstring - Preserve intentional dead code — Mark with comment if needed
-- KEEP: - Update docs after code changes — Run after refactoring
docs.stale
- 从确定的问题开始 — 这些问题可立即安全修复
- 检查动态模式 — 、
_G、rawget可能会隐藏使用痕迹loadstring - 保留有意保留的死代码 — 如有需要,使用注释标记
-- KEEP: - 代码变更后更新文档 — 重构后运行
docs.stale