·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