本文へスキップ
Skillpedia
一般的なプログラミング8.1k · #12568

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がスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/repowise-dev/repowise/blob/main/plugins/claude-code/skills/dead-code-cleanup/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

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 importers
  • kind="unused_export" — public symbols nobody uses
  • kind="zombie_package" — monorepo packages with no consumers
  • directory="src/old/" — limit to a specific directory
  • tier="high" — only high-confidence findings (>= 0.8)
  • min_confidence=0.7 — raise the floor (default is 0.5) for a release-ready cleanup
  • group_by="directory" or group_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

  1. Confirm with the user. Present the file/symbol name, confidence score, and why Repowise thinks it's dead.
  2. Call get_risk(targets=["path/to/file"]) to double-check dependents.
  3. Recently-modified "dead" code is more likely a false positive — flag this if the finding has recent git activity.

Safe deletion order

  1. Unreachable files first (whole file removal, cleanest)
  2. Unused internal symbols next
  3. 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

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル