Individual skill
refactor
基于 Martin Fowler 方法论的系统化代码重构 skill。适用于用户请求重构代码、改进代码结构、减少技术债、清理旧代码、消除 code smell 或提升可维护性时。这个 skill 采用分阶段、带研究与计划的安全增量实施方式。
zh/03-skills/refactor/SKILL.md
Source commit 2b530b767495815c7f53534bbb78f76b65c2e4a5
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- Yes
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Network or broad shell
- Last checked
- Nov 9, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 46,833
- Repository last updated
- Nov 3, 2026
- License
- MIT
Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.
- claude-code Repository topic
- guide Repository topic
- tutorial Repository topic
- engineering Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
SKILL.mdcore · 10,861 bytesSKILL.mdcore · 10,861 bytesSKILL.mdcore · 10,861 bytesSKILL.mdcore · 10,861 bytesSKILL.mdcore · 10,861 bytesSKILL.mdcore · 10,861 bytesreferences/code-smells.mddoc · 13,432 bytesreferences/refactoring-catalog.mddoc · 22,807 bytestemplates/refactoring-plan.mddoc · 6,111 bytes
Read excerpt
# 代码重构 Skill
这是一个基于 Martin Fowler《Refactoring: Improving the Design of Existing Code》(第 2 版)的系统化代码重构方法。这个 skill 强调安全、渐进的修改,并由测试提供保障。
> “重构是在不改变软件外部行为的前提下,改进其内部结构的过程。” — Martin Fowler
## 核心原则
1. **保持行为不变**:外部行为必须保持一致
2. **小步前进**:每次只做很小、可测试的改动
3. **测试驱动**:测试是安全网
4. **持续进行**:重构是长期过程,不是一次性任务
5. **协作确认**:每个阶段都需要用户确认