code-evolution skill
diffやプルリクエストを分析し、コードの変更が設計品質を維持しているか、あるいは低下させているかを構造的な整合性の観点から評価します。
- GitHubスター
- 18
- ファイル
- 1
- 最終コミット
- 2026年10月8日
- ライセンス
- MIT
- 許可されたツール
- 2
code-evolution skillは何をしますか
code-evolutionはAgent Skillsです。 diffやプルリクエストを分析し、コードの変更が設計品質を維持しているか、あるいは低下させているかを構造的な整合性の観点から評価します。.
skillのSKILL.mdから生成された要約。
code-evolution skill について
プルリクエストのレビューや最近のファイル変更の分析を行う際、このSKILLを使用することで、コードの変更が構造的な整合性を維持しているかを判断できます。このツールは、変更がシステム設計の本来の一部として感じられるか、あるいは一時的なパッチに過ぎないかを判断するための専門的なレンズとして機能します。エージェントがdiffや特定のモジュールのレビューを依頼された際、新機能が技術的負債や不要な複雑さを導入していないかを確認するためにこのツールをロードすべきです。
プロセスでは、厳格な評価フレームワークを適用する前に、ReadおよびGrepツールを使用して対象のコードを調査します。新しい特殊なケースや依存関係といった漸進的な複雑さの特定や、重複を検出するためのリピティション監査に焦点を当てます。一般的な設計上の問題(design smells)をスキャンするツールとは異なり、このSKILLはコードベースの進化の軌跡を具体的にターゲットとしており、理想的なシステム構造に合わせるために即時のリファクタリングが必要かどうかをユーザーが判断できるよう支援します。
エージェントができること
- 1プルリクエストの設計品質の評価プルリクエストをレビューし、変更内容が最初からシステムの一部として設計されているように見えるかを確認します。
- 2コードの重複監査最近の変更によって、抽象化すべき重複したロジックが導入されていないかをチェックします。
skill の SKILL.md から作成されています。すべてのユースケースは、その引用と照合されています。
code-evolution skillのインストール方法
各コマンドはskillフォルダをクライアントのskillsディレクトリにコピーします。読み込むには、クライアントを再起動するか新しいセッションを開始してください。プラグインにcode-evolution skillをインストールする
/plugin marketplace add codybrom/clairvoyance /plugin install clairvoyance@clairvoyance-plugins
Claude Codeにcode-evolution skillをインストールする
~/.claude/skills/code-evolution/SKILL.md
$ npx degit codybrom/clairvoyance/skills/code-evolution ~/.claude/skills/code-evolutionClaude Code (project)にcode-evolution skillをインストールする
.claude/skills/code-evolution/SKILL.md
$ npx degit codybrom/clairvoyance/skills/code-evolution .claude/skills/code-evolutionCodexにcode-evolution skillをインストールする
~/.agents/skills/code-evolution/SKILL.md
$ npx degit codybrom/clairvoyance/skills/code-evolution ~/.agents/skills/code-evolutionGemini CLIにcode-evolution skillをインストールする
~/.gemini/skills/code-evolution/SKILL.md
$ npx degit codybrom/clairvoyance/skills/code-evolution ~/.gemini/skills/code-evolutionClaude.aiにcode-evolution skillをインストールする
npx degit codybrom/clairvoyance/skills/code-evolution code-evolution && zip -r code-evolution.zip code-evolution # claude.ai → Customize → Skills → + → Create skill → Upload a skill → code-evolution.zip
SKILL.md
GitHubで表示Code Evolution Review Lens
When invoked with $ARGUMENTS, focus the analysis on the specified file, module, or pull request. Read the target code first, then apply the checks below.
Evaluate whether code modifications maintain or degrade design quality.
When to Apply
- Reviewing a PR that modifies existing code
- After adding a feature to an existing system
- When code has accumulated patches and feels degraded
- When deciding whether to refactor during a feature change
Core Principles
Technical Debt
Technical debt doesn't come from catastrophic decisions. It comes from hundreds of small, reasonable shortcuts that compound silently until the codebase starts fighting back. Calling it "debt" at all is generous because the financial kind gets repaid.
During Modifications
- Debt in the area being modified → fix it now (context is fresh, fix is cheapest)
- Debt elsewhere affecting the modification → document it, fix if feasible
- Never add to the pile. Each modification should reduce debt, not increase it
Refactoring
Refactoring is not a special event. It is the normal expression of strategic programming applied to existing code. Continuous small improvements, not periodic large refactors.
The "Designed This Way" Standard
"Ideally, when you have finished with each change, the system will have the structure it would have had if you had designed it from the start with that change in mind." — John Ousterhout, A Philosophy of Software Design
The design of a mature system is determined more by changes made during its evolution than by any initial conception. Every modifier either continues toward the original trajectory or bends away.
Three-Question Test
- If someone were designing this system from scratch knowing this requirement, what would it look like?
- Does the modified code match that ideal, or is the change visibly patched on?
- If not, what's the minimum restructuring to close the gap?
The Middle Path
When the ideal refactoring would require touching far more of the codebase than the current task budget allows, the question isn't "can I afford the full redesign?" It's "what's the best I can do within this change's scope?" That question often surfaces an approach nearly as clean as the ideal, achievable within the current diff, that the smallest-change mindset would never find because it anchors on the current code.
The "Smallest Possible Change" Trap
There is no neutral gear. Every change either improves the design or degrades it.
Each minimal change typically introduces a special case, a dependency, or a conditional that doesn't belong. Once, negligible. Across hundreds of modifications over years, this is how well-designed systems become legacy nightmares.
Repetition Audit
After a modification, ask yourself:
- Does the same logic now exist in multiple places?
- Was similar code duplicated instead of abstracted?
- Would a similar change require edits in multiple locations?
Repeated code is a red flag that the right abstraction hasn't been found yet.
Two Strategies
- Extract and call: Works best when the method forms a deep abstraction. If the snippet is two lines but requires five parameters, extraction may add more complexity than it removes.
- Restructure so the code runs once: Sometimes better because it eliminates duplication entirely.
When not to extract: Code that looks identical can represent two independent decisions that happen to be expressed the same way. Merging them creates artificial coupling.
Comment Maintenance
Stale comments are worse than missing comments because they actively mislead. Once readers discover comments can't be trusted, they stop reading them entirely.
Five maintenance rules:
-
Keep comments near the code they describe: proximity is a maintenance mechanism
-
Put comments in code, not commit logs: developers navigate code spatially, not chronologically
-
Document each decision exactly once: duplicated documentation drifts invisibly
-
Check the diffs before committing: verify documentation still matches behavior
-
Prefer higher-level comments: abstract comments that describe what and why survive code changes better than detailed how comments. As Ousterhout writes, "the farther a comment is from the code it describes, the more abstract it should be"
Review Process
- Apply the "designed this way" test: Does the modification look native or bolted-on?
- Check for incremental complexity: Did the change add special cases, dependencies, parameters, or flags?
- Run repetition audit: Did the change introduce or perpetuate duplication?
- Verify comment maintenance: Are all affected comments updated?
- Assess debt trajectory: Is the modification reducing or increasing technical debt?
- Recommend: Specific improvements to make the change feel designed-in
Red flag signals for code evolution are cataloged in red-flags (Repetition, Tactical Momentum).
このスキルのファイル
1code-evolution skillに関する質問
Claude Codeにcode-evolution skillをインストールするには
npx degit codybrom/clairvoyance/skills/code-evolution ~/.claude/skills/code-evolutionを実行してください。Claude Codeは~/.claude/skills(すべてのプロジェクト)または.claude/skills(単一プロジェクト)からskillsを読み込み、説明がタスクに一致する場合にskillを使用します。
code-evolution skillはどのクライアントで使用できますか
Agent Skills形式を読み込むすべてのクライアントで使用できます: Claude Code、Codex、Gemini CLI、claude.ai(ZIPとしてアップロード)。skill内のスクリプトは、クライアントがコード実行を許可した場合にのみ実行されます。
コード変更時に技術的負債をどのように扱いますか?
コンテキストが最新であるうちに、変更対象の領域における負債の解消を推奨します。また、変更に影響を与える他の箇所の負債については、ドキュメント化することを推奨します。
設計品質における「3つの質問テスト」とは何ですか?
このテストでは、新しい要件に基づいてゼロから設計した場合でもシステムが同じ構造になるか、変更後のコードがその理想に合致しているか、そしてその差を埋めるために必要な最小限のリファクタリングは何か、という点を確認します。