Token导航 LogoToken导航

Agent Skill · 研究检索

dead-code-hunter(死亡代码猎人)

dead-code-hunter 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

dead-code-hunter 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 73,122。

总安装 171周安装 7GitHub Stars 公开资料未说明下载 55核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:dead-code-hunter(死亡代码猎人)
来源仓库:https://github.com/magic5644/skills
仓库路径:skills/dead-code-hunter
安装命令:
npx skills add https://github.com/magic5644/skills --skill dead-code-hunter
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/magic5644/skills --skill dead-code-hunter

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

依赖图遍历的死代码猎人工具,生成带安全评级的分级删除计划。适合重大重构前的代码库净化,降低新成员接入的认知负担。必须配合Graph-It-Live CLI建立反向索引才能发挥最大效能。无--reversedIndex参数时将跳过优化步骤,转为基础扫描模式运行。

dead-code-hunter 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/dead-code-hunter

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/magic5644/skills --skill dead-code-hunter;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

dead-code-hunter 怎么安装?

在终端执行 npx skills add https://github.com/magic5644/skills --skill dead-code-hunter。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

dead-code-hunter 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

dead-code-hunter 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/magic5644/skills --skill dead-code-hunter 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

dead-code-hunter 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

dead-code-hunter 用的人多吗?

公开数据是累计安装 171 次,近一周安装 7 次,下载 55 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

dead-code-hunter 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
dead-code-hunter

死亡代码猎人 · 本页

171—执行命令未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Dead Code Hunter

Systematic scan of the dependency graph to surface orphan symbols and unreferenced files. Produces a ranked, safety-annotated deletion plan powered by Graph-It-Live.

Requires

Graph-It-Live CLI installed and indexed:

npm install -g @magic5644/graph-it-live
graph-it scan

When to Use

  • Before a major refactor — clean up before you restructure
  • After removing a feature — confirm nothing is left dangling
  • Periodic code hygiene pass on a growing codebase
  • Before onboarding a new developer — reduce noise in the codebase

Critical Prerequisite — Reversed Index

Without --reversedIndex=true, every caller/reference lookup returns empty results → guaranteed false positives. get_symbol_callers and find_referencing_files both query the reverse index. If the index was built without it, all symbols will appear orphaned, even live ones. Always build the index with --reversedIndex=true before running this skill.

Scope Caveat

find_unused_symbols operates per-file. There is no single graph-it deadcode --project command (yet). This skill orchestrates multiple tool calls to achieve project-wide coverage. On very large projects (500+ files), prioritize high-risk folders (src/, lib/, core/) rather than scanning everything. For a fully automated single-pass solution, the right approach is a native graph-it deadcode CLI command built into @magic5644/graph-it-live. That would have significantly higher impact than this skill alone, but requires development work on the CLI itself.

Workflow — Step by Step

Step 1 — Build/refresh the index

graph-it scan --reversedIndex=true
--reversedIndex=true is mandatory. It instructs graph-it to build the reverse lookup index (who imports what, who calls what). Without it, Steps 4 and 5 have no data and every symbol will appear uncalled — producing false positives across the entire scan.

Step 2 — Get the list of project files

graph-it tool get_index_status

Parse the output to retrieve the list of indexed source files. Filter out:

  • node_modules/, dist/, build/, .cache/
  • Test files (*.test.*, *.spec.*, __tests__/) — treat separately
  • Type declaration files (*.d.ts)
  • Configuration files (*.config.*, vite.config.*, etc.)

This is your scan target list.


Step 3 — Per-file unused symbol scan

For each file in the scan target list, run:

graph-it tool find_unused_symbols --filePath=<absolutePath>

Collect results into a flat list:

[
  { file: "src/utils/format.ts", symbol: "formatCurrency", kind: "function" },
  { file: "src/services/legacyAuth.ts", symbol: "hashPasswordMD5", kind: "function" },
  ...
]

Step 4 — Confirm with caller lookup (avoid false positives)

find_unused_symbols detects exports not imported by other files in the index. However a symbol may be called dynamically or from outside the indexed workspace (e.g. a published library). For every candidate, confirm with:

graph-it tool get_symbol_callers --filePath=<absolutePath> --symbolName=<symbol> --reversedIndex=true
Passing --reversedIndex=true here ensures the tool queries the reverse call graph. Omitting it falls back to forward-only traversal, which will miss most callers.
  • 0 callers → confirmed dead code candidate
  • 1+ callers → false positive, discard
  • Only test-file callers → flag as "test-only symbol", handle separately

Step 5 — Detect fully orphaned files

A file is a ghost file if:

  1. It has 0 referencing files (nothing imports it)
  2. It is not a known entry point (index, main, cli, server, etc.)

Check with:

graph-it tool find_referencing_files --filePath=<absolutePath> --reversedIndex=true
Without --reversedIndex=true, this tool cannot find reverse references and will incorrectly classify every file as unreferenced.

A ghost file may contain multiple symbols — mark the entire file for deletion rather than symbol-by-symbol.


Step 6 — Rank candidates by deletion safety

Apply this risk classification:

Risk LevelCriteriaAction
Safe0 callers, 0 referencing files, not a public API exportDelete freely
Likely safe0 callers confirmed, file has other live symbolsRemove symbol, keep file
Review firstSymbol is exported from a barrel (index.ts)Check if barrel is consumed externally
Do not deleteDynamic call patterns detected (eval, string-based dispatch)Flag only
Test-onlyOnly called from test filesEvaluate — may be intentional

Output Format

Produce a Deletion Plan in this format:


Dead Code Scan Report

Scanned: <N> files | Candidates found: <M> symbols + <K> ghost files

Ghost Files (entire file can be deleted)
FileLast modifiedReason
src/utils/oldMigration.ts2022-03-110 imports, 0 callers, not an entry point

Suggested command:

# Review first, then:
rm src/utils/oldMigration.ts
Orphan Symbols — Safe to Remove
SymbolFileKindCallers
formatLegacyCurrencysrc/utils/format.tsfunction0
MD5Hashsrc/services/auth.tsfunction0
Orphan Symbols — Review First
SymbolFileRiskNote
createReportsrc/api/index.tsBarrel exportCheck if consumed by external packages
Test-Only Symbols
SymbolFileTest callers
mockPaymentGatewaysrc/mocks/payment.ts3 test files

Recommended Deletion Order

  1. Ghost files first — highest impact, no surgical precision needed
  2. Orphan symbols in non-barrel files — safe, isolated changes
  3. Barrel exports — requires checking external consumers
  4. Test-only symbols — discuss with the team

Safety Checklist Before Deleting

  • Run graph-it tool get_symbol_callers --reversedIndex=true one more time after any refactor that modified imports
  • Check if the project is a published library — unused exports may be part of the public API
  • Check package.json exports field — symbols exported via package entry points are always live
  • Run the test suite after each deletion batch to catch dynamic usage not visible to static analysis
  • Commit in small batches — one file or one symbol group per commit for easy revert

Quick Scan (Single File or Folder)

If you only want to scan one file:

graph-it scan --reversedIndex=true   # rebuild if not already done with the flag
graph-it check src/utils/format.ts
graph-it tool find_unused_symbols --filePath=/abs/path/src/utils/format.ts

If you want a folder, use graph-it summary <folder> to get the file list, then iterate.


Limitations & Future Improvements

  • Dynamic dispatch (obj[methodName](), require(variable)) is invisible to static analysis — always review before deleting
  • Monorepos: scan per package, not at root, to avoid cross-package false positives
  • Framework magic: decorators (@Component, @Injectable) may make symbols appear unused but they're resolved at runtime — exclude framework entry files from the scan
  • graph-it deadcode CLI command (not yet available): a native single-pass project-wide dead code scanner would eliminate the per-file iteration overhead and provide a richer output with confidence scores. If this is a bottleneck, open an issue on @magic5644/graph-it-live.

平台分布

Codex

33.28%
按下载量换算18

Claude

32.64%
按下载量换算18

Cursor

18.59%
按下载量换算10

Gemini CLI

10.2%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/magic5644/skills --skill dead-code-hunter 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills