refactor とは?
動作を変更せずに保守性を向上させる外科的コードのリファクタリング。関数の抽出、変数名の変更、神関数の分解、型安全性の向上、コード臭の除去、デザイン パターンの適用について説明します。リポジトリ再構築ツールほど劇的ではありません。段階的な改善に使用します。 ソース: ansteorra/kmp。
動作を変更せずに保守性を向上させる外科的コードのリファクタリング。関数の抽出、変数名の変更、神関数の分解、型安全性の向上、コード臭の除去、デザイン パターンの適用について説明します。リポジトリ再構築ツールほど劇的ではありません。段階的な改善に使用します。
コマンドラインで refactor AI スキルを開発環境にすばやくインストール
ソース: ansteorra/kmp。
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動作を変更せずに保守性を向上させる外科的コードのリファクタリング。関数の抽出、変数名の変更、神関数の分解、型安全性の向上、コード臭の除去、デザイン パターンの適用について説明します。リポジトリ再構築ツールほど劇的ではありません。段階的な改善に使用します。 ソース: ansteorra/kmp。
ターミナルまたはコマンドラインツール(Terminal、iTerm、Windows Terminal など)を開きます このコマンドをコピーして実行します: npx skills add https://github.com/ansteorra/kmp --skill refactor インストール後、スキルは自動的に AI コーディング環境に設定され、Claude Code、Cursor、OpenClaw で使用できるようになります
https://github.com/ansteorra/kmp