📦 Simplifyコード
コードの差分をレビューし、明確で安全な簡素化を提案し、低リスクな修正を適用するSkill。
📺 まず動画で見る(YouTube)
▶ 【Claude Code完全入門】誰でも使える/Skills活用法/経営者こそ使うべき ↗
※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。
📜 元の英語説明(参考)
Review a diff for clarity and safe simplifications, then optionally apply low-risk fixes.
🇯🇵 日本人クリエイター向け解説
コードの差分をレビューし、明確で安全な簡素化を提案し、低リスクな修正を適用するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o simplify-code.zip https://jpskill.com/download/3494.zip && unzip -o simplify-code.zip && rm simplify-code.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/3494.zip -OutFile "$d\simplify-code.zip"; Expand-Archive "$d\simplify-code.zip" -DestinationPath $d -Force; ri "$d\simplify-code.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
simplify-code.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
simplify-codeフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-17
- 取得日時
- 2026-05-17
- 同梱ファイル
- 1
💬 こう話しかけるだけ — サンプルプロンプト
- › Simplify Code の使い方を教えて
- › Simplify Code で何ができるか具体例で見せて
- › Simplify Code を初めて使う人向けにステップを案内して
これをClaude Code に貼るだけで、このSkillが自動発動します。
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[スキル名] simplify-code
コードの簡素化
変更されたコードを、再利用性、品質、効率性、および明確性の問題についてレビューします。Codexサブエージェントを使用して並行してレビューし、その後、信頼度が高く、動作を維持する修正のみを任意で適用します。
使用するタイミング
- ユーザーが変更されたコードの簡素化、クリーンアップ、リファクタリング、またはレビューを依頼した場合。
- 範囲を絞った差分に対して、信頼度が高く、動作を維持する改善を行いたい場合。
モード
ユーザーのリクエストからモードを選択してください。
review-only: ユーザーが変更点のレビュー、監査、またはチェックを依頼した場合safe-fixes: ユーザーが変更点の簡素化、クリーンアップ、またはリファクタリングを依頼した場合fix-and-validate:safe-fixesと同じですが、編集後に最小限の関連する検証も実行します
ユーザーが指定しない場合、デフォルトは次のとおりです。
- 「review」、「audit」、「check」の場合は
review-only - 「simplify」、「clean up」、「refactor」の場合は
safe-fixes
ステップ1:スコープと差分コマンドの決定
このスコープの順序を優先します。
- ユーザーによって明示的に指定されたファイルまたはパス
- 現在の git の変更点
- 現在の Codex ターンで以前に編集されたファイル
- ユーザーがレビューを依頼したが差分がない場合にのみ、最近変更された追跡対象ファイル
明確なスコープがない場合は、停止してその旨を簡潔に伝えてください。
git の変更点を使用する場合、リポジトリの状態に基づいて最小限の正しい差分コマンドを決定します。
- ステージされていない作業:
git diff - ステージされた作業:
git diff --cached - ユーザーによって明示的に要求されたブランチまたはコミットの比較: その正確な差分ターゲットを使用します
- ステージされた作業とステージされていない作業が混在している場合: 両方をレビューします
より小さな差分が利用可能な場合でも、git diff HEAD が正しいデフォルトであると仮定しないでください。
標準をレビューしたり修正を適用したりする前に、リポジトリのローカル指示ファイルと、触れる領域に関連するプロジェクトドキュメントを読んでください。最も近い適用可能なガイダンスを優先します。例えば、
AGENTS.md- リポジトリのワークフローに関するドキュメント
- 触れるモジュールのアーキテクチャまたはスタイルに関するドキュメント
これらの指示を使用して、実際の問題と意図的なローカルパターンを区別してください。
ステップ2:4つのレビューサブエージェントを並行して起動する
並行レビューが役立つほどスコープが大きい場合は、Codexサブエージェントを使用します。ごくわずかな差分や非常に小さなファイルの場合は、代わりにローカルでレビューしても構いません。
サブエージェントを起動する際:
- 各サブエージェントに同じスコープを与えます
- 各サブエージェントに、割り当てられたレビューロールのみを検査するように指示します
- 簡潔で構造化された所見のみを求めます
- 各サブエージェントに、ファイル、行またはシンボル、問題、推奨される修正、および信頼度を報告するように求めます
4つのレビューロールを使用します。
サブエージェント1:コード再利用レビュー
変更点について再利用の機会をレビューします。
- 同じ問題をすでに解決している既存のヘルパー、ユーティリティ、または共有抽象化を検索します。
- 変更で導入された重複する関数またはほぼ重複するロジックにフラグを立てます。
- 既存のヘルパーを呼び出すべきインラインロジックにフラグを立て、再実装しないようにします。
推奨されるサブエージェントの役割: 広範なコードベースの検索には explorer、広範な検索よりも強力なレビューパスが有用な場合は reviewer。
サブエージェント2:コード品質レビュー
同じ変更点についてコード品質の問題をレビューします。
- 不要に格納されている冗長な状態、キャッシュされた値、または派生値
- 既存の呼び出しチェーンに新しい引数をスレッド化することによって引き起こされるパラメータの拡散
- 共有抽象化になるべきわずかなバリエーションを伴うコピー&ペースト
- モジュール境界を越えた漏洩する抽象化または所有権の違反
- 既存の型付き契約、列挙型、または定数がすでに存在する、文字列型で表現された値
推奨されるサブエージェントの役割: reviewer
サブエージェント3:効率性レビュー
同じ変更点について効率性の問題をレビューします。
- 繰り返される作業、重複する読み取り、重複するAPI呼び出し、または不要な再計算
- 安全に並行して実行できるはずの逐次的な作業
- 明確な必要性なしに、起動、レンダリング、リクエスト、またはその他のホットパスに追加された新しい作業
- 操作自体を直接試行し、エラーを処理できる場合に、存在の事前チェック
- メモリ増加、クリーンアップの欠如、またはリスナー/サブスクリプションのリーク
- コードがサブセットのみを必要とする場合に、広すぎる読み取りまたはスキャン
推奨されるサブエージェントの役割: reviewer
サブエージェント4:明確性と標準レビュー
同じ変更点について、明確性、ローカル標準、およびバランスをレビューします。
- ローカルプロジェクトの慣習またはモジュールパターンの違反
- 不要な複雑さ、深いネスト、弱い名前、または冗長なコメント
- 可読性を低下させる、過度にコンパクトまたは巧妙なコード
- 別々の懸念事項を1つの不明瞭な単位にまとめる過度の単純化
- デッドコード、デッド抽象化、または価値のない間接参照
推奨されるサブエージェントの役割: reviewer
保守性、正確性、またはコストを実質的に改善する問題のみを報告してください。見た目を変えるためだけにコードをいじくり回さないでください。
ステップ3:所見の集約
すべてのレビューサブエージェントが完了するのを待ってから、その所見をマージします。
所見を次の形式に正規化します。
- ファイルと行、または最も近いシンボル
- カテゴリ: 再利用、品質、効率性、または明確性
- なぜ問題なのか
- 推奨される修正
- 信頼度: 高、中、または低
編集する前に、弱い、重複する、または指示と矛盾する所見を破棄してください。
ステップ4:問題を慎重に修正する
review-only モードでは、所見を報告した後に停止します。
safe-fixes または fix-and-validate モードでは:
- 信頼度が高く、動作を維持する修正のみを適用します
- 製品またはアーキテクチャの判断が必要な主観的なリファクタリングはスキップします
- 意図的であるか、指示に裏付けられているローカルパターンを保持します
- 修正を正しく完了するために小さな隣接する変更が必要な場合を除き、編集はレビュー対象ファイルに限定します
次のような修正を優先します。
- 重複したコードを既存のヘルパーに置き換える
- 冗長な状態やデッドコードを削除する
- 動作を変更せずに制御フローを簡素化する
- 広すぎる操作を絞り込む
- スコープが限定されている場合に、不明瞭なローカル変数の名前を変更する
このスキルの一部として変更をステージ、コミット、またはプッシュしないでください。
ステップ5:必要に応じて検証する
fix-and-validate モードでは、編集後に、触れたスコープに対して最小限の関連する検証を実行します。
例:
- 触れたモジュールに対するターゲットテスト
- 型チェックまたは c
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Simplify Code
Review changed code for reuse, quality, efficiency, and clarity issues. Use Codex sub-agents to review in parallel, then optionally apply only high-confidence, behavior-preserving fixes.
When to Use
- When the user asks to simplify, clean up, refactor, or review changed code.
- When you want high-confidence, behavior-preserving improvements on a scoped diff.
Modes
Choose the mode from the user's request:
review-only: user asks to review, audit, or check the changessafe-fixes: user asks to simplify, clean up, or refactor the changesfix-and-validate: same assafe-fixes, but also run the smallest relevant validation after edits
If the user does not specify, default to:
review-onlyfor "review", "audit", or "check"safe-fixesfor "simplify", "clean up", or "refactor"
Step 1: Determine the Scope and Diff Command
Prefer this scope order:
- Files or paths explicitly named by the user
- Current git changes
- Files edited earlier in the current Codex turn
- Most recently modified tracked files, only if the user asked for a review but there is no diff
If there is no clear scope, stop and say so briefly.
When using git changes, determine the smallest correct diff command based on the repo state:
- unstaged work:
git diff - staged work:
git diff --cached - branch or commit comparison explicitly requested by the user: use that exact diff target
- mixed staged and unstaged work: review both
Do not assume git diff HEAD is the right default when a smaller diff is available.
Before reviewing standards or applying fixes, read the repo's local instruction files and relevant project docs for the touched area. Prefer the closest applicable guidance, such as:
AGENTS.md- repo workflow docs
- architecture or style docs for the touched module
Use those instructions to distinguish real issues from intentional local patterns.
Step 2: Launch Four Review Sub-Agents in Parallel
Use Codex sub-agents when the scope is large enough for parallel review to help. For a tiny diff or one very small file, it is acceptable to review locally instead.
When spawning sub-agents:
- give each sub-agent the same scope
- tell each sub-agent to inspect only its assigned review role
- ask for concise, structured findings only
- ask each sub-agent to report file, line or symbol, problem, recommended fix, and confidence
Use four review roles.
Sub-Agent 1: Code Reuse Review
Review the changes for reuse opportunities:
- Search for existing helpers, utilities, or shared abstractions that already solve the same problem.
- Flag duplicated functions or near-duplicate logic introduced in the change.
- Flag inline logic that should call an existing helper instead of re-implementing it.
Recommended sub-agent role: explorer for broad codebase lookup, or reviewer if a stronger review pass is more useful than wide search.
Sub-Agent 2: Code Quality Review
Review the same changes for code quality issues:
- Redundant state, cached values, or derived values stored unnecessarily
- Parameter sprawl caused by threading new arguments through existing call chains
- Copy-paste with slight variation that should become a shared abstraction
- Leaky abstractions or ownership violations across module boundaries
- Stringly-typed values where existing typed contracts, enums, or constants already exist
Recommended sub-agent role: reviewer
Sub-Agent 3: Efficiency Review
Review the same changes for efficiency issues:
- Repeated work, duplicate reads, duplicate API calls, or unnecessary recomputation
- Sequential work that could safely run concurrently
- New work added to startup, render, request, or other hot paths without clear need
- Pre-checks for existence when the operation itself can be attempted directly and errors handled
- Memory growth, missing cleanup, or listener/subscription leaks
- Overly broad reads or scans when the code only needs a subset
Recommended sub-agent role: reviewer
Sub-Agent 4: Clarity and Standards Review
Review the same changes for clarity, local standards, and balance:
- Violations of local project conventions or module patterns
- Unnecessary complexity, deep nesting, weak names, or redundant comments
- Overly compact or clever code that reduces readability
- Over-simplification that collapses separate concerns into one unclear unit
- Dead code, dead abstractions, or indirection without value
Recommended sub-agent role: reviewer
Only report issues that materially improve maintainability, correctness, or cost. Do not churn code just to make it look different.
Step 3: Aggregate Findings
Wait for all review sub-agents to complete, then merge their findings.
Normalize findings into this shape:
- File and line or nearest symbol
- Category: reuse, quality, efficiency, or clarity
- Why it is a problem
- Recommended fix
- Confidence: high, medium, or low
Discard weak, duplicative, or instruction-conflicting findings before editing.
Step 4: Fix Issues Carefully
In review-only mode, stop after reporting findings.
In safe-fixes or fix-and-validate mode:
- Apply only high-confidence, behavior-preserving fixes
- Skip subjective refactors that need product or architectural judgment
- Preserve local patterns when they are intentional or instruction-backed
- Keep edits scoped to the reviewed files unless a small adjacent change is required to complete the fix correctly
Prefer fixes like:
- replacing duplicated code with an existing helper
- removing redundant state or dead code
- simplifying control flow without changing behavior
- narrowing overly broad operations
- renaming unclear locals when the scope is contained
Do not stage, commit, or push changes as part of this skill.
Step 5: Validate When Required
In fix-and-validate mode, run the smallest relevant validation for the touched scope after edits.
Examples:
- targeted tests for the touched module
- typecheck or compile for the touched target
- formatter or lint check if that is the project's real safety gate
Prefer fast, scoped validation over full-suite runs unless the change breadth justifies more.
If validation is skipped because the user asked not to run it, say so explicitly.
Step 6: Summarize Outcome
Close with a brief result:
- what was reviewed
- what was fixed, if anything
- what was intentionally left alone
- whether validation ran
If the code is already clean for this rubric, say that directly instead of manufacturing edits.
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.