·refactor
</>

refactor

外科手术式代码重构可在不改变行为的情况下提高可维护性。涵盖提取函数、重命名变量、分解上帝函数、提高类型安全性、消除代码异味以及应用设计模式。比 repo-rebuilder 不那么剧烈;用于逐步改进。

9安装·0热度·@ansteorra

安装

$npx skills add https://github.com/ansteorra/kmp --skill refactor

如何安装 refactor

通过命令行快速安装 refactor AI 技能到你的开发环境

  1. 打开终端: 打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等)
  2. 运行安装命令: 复制并运行以下命令:npx skills add https://github.com/ansteorra/kmp --skill refactor
  3. 验证安装: 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code、Cursor 或 OpenClaw 中使用

来源:ansteorra/kmp。

SKILL.md

查看原文

Improve code structure and readability without changing external behavior. Refactoring is gradual evolution, not revolution. Use this for improving existing code, not rewriting from scratch.

| Extract Method | Turn code fragment into method | | Extract Class | Move behavior to new class | | Extract Interface | Create interface from implementation | | Inline Method | Move method body back to caller | | Inline Class | Move class behavior to caller | | Pull Up Method | Move method to superclass | | Push Down Method | Move method to subclass |

| Rename Method/Variable | Improve clarity | | Introduce Parameter Object | Group related parameters | | Replace Conditional with Polymorphism | Use polymorphism instead of switch/if | | Replace Magic Number with Constant | Named constants | | Decompose Conditional | Break complex conditions | | Consolidate Conditional | Combine duplicate conditions |

可引用信息

为搜索与 AI 引用准备的稳定字段与命令。

安装命令
npx skills add https://github.com/ansteorra/kmp --skill refactor
分类
</>开发工具
认证
收录时间
2026-02-22
更新时间
2026-03-10

Browse more skills from ansteorra/kmp

快速解答

什么是 refactor?

外科手术式代码重构可在不改变行为的情况下提高可维护性。涵盖提取函数、重命名变量、分解上帝函数、提高类型安全性、消除代码异味以及应用设计模式。比 repo-rebuilder 不那么剧烈;用于逐步改进。 来源:ansteorra/kmp。

如何安装 refactor?

打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/ansteorra/kmp --skill refactor 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code、Cursor 或 OpenClaw 中使用

这个 Skill 的源码在哪?

https://github.com/ansteorra/kmp

详情

分类
</>开发工具
来源
skills.sh
收录时间
2026-02-22