dead-code-cleanup
できること
このスキルは、不要なコードを見つけ、削除できるものを提案する手助けをAIにします。散らかり、バンドルのサイズ、技術的負債を減らしたい開発者向けです。
使う場面
- ✓使われていないコードを削除したい、またはプロジェクトのサイズを減らしたいと頼むとき。
- ✓到達できないファイル、未使用のエクスポート、取り残されたパッケージを見つけたいとき。
- ✓整理を計画していて、確信度で順位付けされた一覧が必要なとき。
スキルのリンク
https://github.com/repowise-dev/repowise/blob/main/plugins/claude-code/skills/dead-code-cleanup/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“このプロジェクトで安全に削除できる不要なコードを見つけ、それぞれが使われていないように見える理由を示してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
スキルは、確信度順に並べられた不要なコードの検出結果をRepowiseに求めます。安全と印された項目だけに削除を提案し、確信度の低い項目は調査すべきものとして示します。何かを削除する前には、あなたの確認を求めます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Dead Code Cleanup with Repowise
Repowise detects dead code through graph analysis — no LLM needed, works even with a template-rendered wiki.
When the user asks about dead/unused code
Call get_dead_code() to get findings sorted by confidence tier. Useful parameters:
safe_only=true— only findings confirmed safe to delete (confidence >= 0.7)kind="unreachable_file"— files with no importerskind="unused_export"— public symbols nobody useskind="zombie_package"— monorepo packages with no consumersdirectory="src/old/"— limit to a specific directorytier="high"— only high-confidence findings (>= 0.8)min_confidence=0.7— raise the floor (default is 0.5) for a release-ready cleanupgroup_by="directory"orgroup_by="owner"— roll up to see where the dead code concentrates and who owns the most of it
How to present findings
- Only suggest deletion for findings with
safe_to_delete: true - For lower-confidence findings, present them as "candidates to investigate" not "things to delete"
- Dynamically-loaded code (plugins, handlers, adapters) may appear as dead code but isn't — Repowise filters common patterns but edge cases exist
Before deleting anything
- Confirm with the user. Present the file/symbol name, confidence score, and why Repowise thinks it's dead.
- Call
get_risk(targets=["path/to/file"])to double-check dependents. - Recently-modified "dead" code is more likely a false positive — flag this if the finding has recent git activity.
Safe deletion order
- Unreachable files first (whole file removal, cleanest)
- Unused internal symbols next
- Unused exports last (highest false-positive risk due to potential dynamic imports)
よくある質問
AIが自分でコードを削除しますか?
いいえ。スキルは、各削除の前にあなたの確認を求めます。
プラグインや動的なコードについて間違えることはありますか?
はい。動的に読み込まれるコードは使われていないように見えることがあるため、スキルは一部の例外的なケースがあることを警告します。
削除する前に何を確認しますか?
まず、削除を勧める前に、リスクチェックを使ってそのファイルへの依存関係を確認します。
詳細
作者による元の説明
Use when the user asks about cleanup, removing unused code, refactoring, reducing bundle size, or identifying dead code in a Repowise-indexed codebase (.repowise/ directory exists). Also activates when discussing technical debt, code hygiene, or repository maintenance.
repo: repowise-dev/repowise
人気
- GitHubのスター
- 8.1k
- ランキング
- #12568
- ライセンス
- AGPL-3.0
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
architectural-decisions
8.1kアーキテクチャを変更する前に、記録された決定と履歴を使って、コードがなぜそのように作られているかを、エージェントが調べるよう支援します。
change-review
8.1kマージの前にプルリクエストや一連の変更を見直し、リスク、影響を受けるファイル、ほかに変えるべきものを示すよう、エージェントを支援します。
code-health
8.1kRepowiseの分析を使って、ファイルごとにコードの健全性を採点し、最もリスクの高いファイルを見つけ、次にリファクタリングするものを選ぶよう、エージェントを支援します。
codebase-exploration
8.1kコードがどう動くか、誰が何を呼ぶか、何がどこに作られているかに答えることで、なじみのないプロジェクトを素早く理解するよう、エージェントを支援します。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。