用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Objective-Arts/lens-dist --skill refactor-scan命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | refactor-scan |
| description | Read-only refactoring analysis. Shows what needs fixing without making changes. |
Analyze code for refactoring opportunities. Read-only — no changes made.
No arguments? Describe this skill and stop. Do not execute.
/refactoring would do| Issue | Threshold | Severity |
|---|---|---|
| Function too long | >30 lines | HIGH |
| File too long | >300 lines | HIGH |
| High complexity | cyclomatic >10 | HIGH |
| Deep nesting | >3 levels | MEDIUM |
| Vague names | data/result/temp/item/info | MEDIUM |
| Duplicate code | repeated blocks | MEDIUM |
| Magic numbers | unlabeled literals | LOW |
| Missing error handling | unhandled paths | MEDIUM |
| God file | multiple concerns | HIGH |
═══════════════════════════════════════════
REFACTOR SCAN: [target]
═══════════════════════════════════════════
Summary: X issues found (Y high, Z medium)
HIGH SEVERITY
[file:line] Function too long (45 lines)
→ Split into: parseInput(), validateData(), formatOutput()
[file:line] File too long (387 lines)
→ Extract: utils.ts, validators.ts
MEDIUM SEVERITY
[file:line] Vague name: "data"
→ Rename to: userPreferences
[file:line] Deep nesting (4 levels)
→ Flatten with early returns
LOW SEVERITY
[file:line] Magic number: 86400
→ Extract: SECONDS_PER_DAY = 86400
AI ANTIPATTERNS
[file:line] Over-abstraction: ConfigFactory used once
→ Inline the factory
═══════════════════════════════════════════
REFACTOR PLAN
═══════════════════════════════════════════
1. Split [file] into focused modules
2. Extract [function] from [large-function]
3. Rename [vague-names] to [clear-names]
4. Flatten nested conditionals in [locations]
Run `/refactoring [target]` to apply these changes.
═══════════════════════════════════════════
/refactoring