Install any skill in seconds. Free to start, no credit card required.
Get Started Free →laolaoshiren/refactor-advisor
重构顾问 - 识别代码坏味道并提供重构方案
Passed 18 of 23 test cases with the skill, and 14 of 23 without it.
and 6 more in the full report
6 fixed12 passed either way3 still failing2 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 6 test cases the skill fixed. Same model, same prompt, with and without the skill.
我们在扫描 `src/legacy/user.ts` 时发现了一个 280 行的类、一个 45 行的方法和一个 3 参数的函数。请问其中是否有任何符合 🔴 严重或 🟡 中等级别规则的代码坏味道?
| Checked | Without skill | With skill |
|---|---|---|
| States that none of the three items meet the threshold for 🔴 severe or 🟡 medium bad smells. | Missed | Passed |
| Notes that class length must exceed 300 lines and method length must exceed 50 lines to trigger severe classifications. | Missed | Passed |
The instructions your model reads when the skill loads.
当用户要求重构代码、优化代码结构、改善代码质量、消除技术债务时激活此技能。
grep/rg 扫描目标目录,识别潜在坏味道按严重程度分类发现的问题:
| 等级 | 含义 | 说明 |
|---|---|---|
| 🔴 严重 | 必须立即修复 | 影响可维护性和稳定性 |
| 🟡 中等 | 建议尽快修复 | 降低代码可读性 |
| 🟢 轻微 | 可择机优化 | 不影响功能但有改进空间 |
按以下维度综合排序:
| 坏味道 | 特征 | 重构手法 | 等级 |
|---|---|---|---|
| 长方法 | 函数超过 50 行 | 提取方法 (Extract Method) | 🔴 |
| 大类 | 类超过 300 行 | 提取类 (Extract Class) | 🔴 |
| 重复代码 | 相似代码块出现 3+ 次 | 提取公共方法 | 🔴 |
| 过长参数 | 函数参数超过 4 个 | 引入参数对象 | 🟡 |
| 嵌套过深 | if/for 嵌套 3+ 层 | 卫语句 (Guard Clause) | 🟡 |
| 魔法数字 | 硬编码的数字 | 提取为常量 | 🟢 |
| 过长链式调用 | a.b.c.d.e | 提取中间变量 | 🟢 |
test cases passed, vs 14 / 23 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.