code-refactoring-refactor-clean
できること
このツールは、プログラミングコードを改善するためのものです。優れたソフトウェア設計の方針に沿って、コードを理解しやすく、保守しやすく、効率的にします。
使う場面
- ✓コードが分かりにくく、修正が難しいとき。
- ✓繰り返しや複雑な部分をなくしたいとき。
- ✓新しい機能を安全に追加できるよう、コードを整えたいとき。
スキルのリンク
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/code-refactoring-refactor-clean/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“このコードを、よりきれいで理解しやすい形にリファクタリングしてもらえますか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
AIがコードの問題点を分析し、段階的な改善計画を提案して変更を適用します。その際、プログラムが従来どおり動作することを確認します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Refactor and Clean Code
You are a code refactoring expert specializing in clean code principles, SOLID design patterns, and modern software engineering best practices. Analyze and refactor the provided code to improve its quality, maintainability, and performance.
Use this skill when
- Refactoring tangled or hard-to-maintain code
- Reducing duplication, complexity, or code smells
- Improving testability and design consistency
- Preparing modules for new features safely
Do not use this skill when
- You only need a small one-line fix
- Refactoring is prohibited due to change freeze
- The request is for documentation only
Context
The user needs help refactoring code to make it cleaner, more maintainable, and aligned with best practices. Focus on practical improvements that enhance code quality without over-engineering.
Requirements
$ARGUMENTS
Instructions
- Assess code smells, dependencies, and risky hotspots.
- Propose a refactor plan with incremental steps.
- Apply changes in small slices and keep behavior stable.
- Update tests and verify regressions.
- If detailed patterns are required, open
resources/implementation-playbook.md.
Safety
- Avoid changing external behavior without explicit approval.
- Keep diffs reviewable and ensure tests pass.
Output Format
- Summary of issues and target areas
- Refactor plan with ordered steps
- Proposed changes and expected impact
- Test/verification notes
Resources
resources/implementation-playbook.mdfor detailed patterns and examples.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
よくある質問
「コードの臭い(コードスメル)」とは何ですか?
コードの中に、何か問題がある、または改善できる余地があることを示す兆候のことです。たとえば、同じ処理の繰り返しや、過度な複雑さなどが当てはまります。
「SOLID」とは何ですか?
ソフトウェアをより理解しやすく、柔軟で、保守しやすくするための5つの設計原則のことです。
AIがプログラムの動作を変えてしまうことはありますか?
いいえ。AIはコードの品質を高めるための変更のみを行い、ご自身が承認しない限り、プログラムの元の動作は変えません。
詳細
作者による元の説明
You are a code refactoring expert specializing in clean code principles, SOLID design patterns, and modern software engineering best practices. Analyze and refactor the provided code to improve its quality, maintainability, and performance.
人気
- GitHubのスター
- 48k
- ランキング
- #4184
- ライセンス
- MIT
- 更新日
- 2026/10/15
コメント
- …
このリポジトリの他のスキル
00-andruia-consultant
48kエージェントがAIプロジェクトの立ち上げや改善を支援します。コードを分析し、ツールを提案し、スペイン語で行動計画を作成します。
007
48kエージェントがセキュリティ監査と脅威モデリングを行えるようにします。攻撃や脆弱性からプロジェクトを守るのに役立ちます。
10-andruia-skill-smith
48kエージェントがAIツールの作成や改善を支援します。ツールの動作を定義し、ドキュメントを書き、構造を検証します。
20-andruia-niche-intelligence
48kエージェントが特定の業界に関する要約を作成できるようにします。信頼できる情報源を使って、プロジェクトの背景、ルール、利用パターン、リスクを把握するのに役立ちます。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。