🛠️
QualityPython

Refactor Advisor

by laolaoshiren

Refactor Advisor is a Quality skill for Claude Code, published by laolaoshiren in claude-code-skills-zh.

786 stars84 forkson laolaoshiren/claude-code-skills-zhAdded 2026/08/23+1% in starsRepository updated 2026/08/23
ai-agentawesome-listclaude-codeclaude-skillsdeveloper-toolsprompt-engineeringskills
Install in seconds
Install Refactor Advisor
Copy Refactor Advisor into your Claude Code skills folder. Run the command in your terminal, or review the source on GitHub before installing.
terminal
npx degit https://github.com/laolaoshiren/claude-code-skills-zh/tree/main/skills/refactor-advisor ~/.claude/skills/refactor-advisor

Requires Node.js. Downloads this skill only — not the rest of the repository — into your Claude Code skills folder.

Without Node.js

git clone https://github.com/laolaoshiren/claude-code-skills-zh.git

Clones the whole repository, then copy the skill’s own directory into your skills folder yourself.

In this catalog

Source file
skills/refactor-advisor/SKILL.md in laolaoshiren/claude-code-skills-zh
Installs to
~/.claude/skills/refactor-advisor
Collection
One of 20 skills cataloged from this repository
Category
Quality1354 skills

What Refactor Advisor does

Refactor Advisor scans code for bad smells, duplication, and structural issues, then suggests prioritized refactoring steps. Use it when improving maintainability, reducing technical debt, or planning safe refactors.

Refactor Advisor is cataloged under Quality on DirSkills. Refactor Advisor comes from a repository tagged ai-agent, awesome-list, claude-code, claude-skills and developer-tools.

Documentation

README

代码重构顾问

触发条件

当用户要求重构代码、优化代码结构、改善代码质量、消除技术债务时激活此技能。

工作流程

第 1 步:扫描代码库

  • 使用 grep/rg 扫描目标目录,识别潜在坏味道
  • 统计文件行数、函数长度、参数数量等指标
  • 查找重复代码块(相似度 > 80%)

第 2 步:分类坏味道

按严重程度分类发现的问题:

等级 含义 说明
🔴 严重 必须立即修复 影响可维护性和稳定性
🟡 中等 建议尽快修复 降低代码可读性
🟢 轻微 可择机优化 不影响功能但有改进空间

第 3 步:优先级排序

按以下维度综合排序:

  1. 影响范围 — 被引用/调用次数越多,优先级越高
  2. 变更频率 — git log 频繁改动的文件优先
  3. 修复成本 — 成本低且收益高的优先处理

第 4 步:输出重构方案

常见坏味道检测

This is the opening of the README. Read the full README on GitHub.

Frequently asked about Refactor Advisor

  • What else does laolaoshiren publish alongside Refactor Advisor?

    Refactor Advisor is one of 20 skills that DirSkills catalogs from laolaoshiren/claude-code-skills-zh, the repository it ships in. Its siblings there include API Tester, Changelog Generator and Chinese Code Reviewer. Each one is a separate skill with its own page in this directory, installs the same way Refactor Advisor does, and is maintained by laolaoshiren in that same repository. The rest of the collection is listed on the laolaoshiren/claude-code-skills-zh page.

  • How does Refactor Advisor compare to other Quality skills?

    Refactor Advisor ranks #991 by stars among the 1354 Quality skills in this catalog. The most-starred ones next to it are Benchmark, Benchmark Optimization Loop and API Design Patterns. DirSkills ranks by the star count of the repository each skill ships in, so that order reflects how popular those repositories are rather than any review of Refactor Advisor against them. Open each page to compare what they document and how they install.

More from laolaoshiren/claude-code-skills-zh

Refactor Advisor is one of 20 skills cataloged on DirSkills from laolaoshiren/claude-code-skills-zh.

See all 20 skills