Token导航 LogoToken导航

Agent Skill · 研究检索

audit-dead-code(审计死代码)

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

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

总安装 392周安装 16GitHub Stars 公开资料未说明下载 127核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/sebkay/skills --skill audit-dead-code

这个 Skill 是做什么的

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

用于审计代码库中的不可达代码,识别死代码并构建从入口点到候选代码的证明链以安全移除。适合在删除前验证代码可达性,分类为未使用导出、不可达代码、孤立文件等类型,避免误删关键逻辑。使用时需结合公共接口、动态加载配置和框架约定进行交叉验证,不能仅依赖静态引用分析。

安装方式:通过 npx skills add 命令从指定 GitHub 仓库添加,支持 Codex、Claude、Cursor 等宿主环境。涉及生产系统修改时,应先确认最小权限和操作边界,避免直接执行删除操作导致回归风险。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

audit-dead-code 怎么安装?

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

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

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

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

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

audit-dead-code 是免费的吗?

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

audit-dead-code 用的人多吗?

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

audit-dead-code 安全吗?

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

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

值得选的地方

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

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

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

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 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调用外部服务未明确有提醒
audit-dead-code

审计死代码 · 本页

392—需要联网未明确通过

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

SKILL.md 原文

Audit Dead Code

Audit reachability before deleting anything. Build a proof chain from live entrypoint to candidate, then apply the smallest safe removal.

Follow this workflow

  1. Map the codebase entrypoints, public surfaces, and dynamic loading surfaces in scope.
  2. Search for references from public surfaces inward, not just from the candidate itself.
  3. Classify each candidate as unused export, unreachable code, orphaned file, stale feature flag, dead registration, or legacy compatibility path.
  4. Build a proof chain with code search, config or registry checks, framework conventions, and typecheck, build, or tests where available.
  5. Prioritize findings as P1 through P4.
  6. Auto-fix only local, low-risk removals. Leave broader deletions as findings with a concrete removal plan.

Map live entrypoints first

Do not start deleting from leaf files without understanding how code can be reached.

Inspect the relevant equivalents of:

  • routes, controllers, pages, and API handlers
  • package exports, workspace boundaries, and public modules
  • CLI commands and scheduled jobs
  • queues, workers, and event subscribers
  • dependency-injection or service-container registration
  • framework auto-discovery and naming conventions
  • plugin manifests, registries, and config-driven loading
  • dynamic imports, reflection, and string-based dispatch
  • tests, fixtures, storybook stories, and demo apps
  • build scripts, codegen inputs, and release tooling

Dead code claims are weak until these entrypoints are checked.

Search for dead-code signals

Start with the language-appropriate equivalents of:

  • import
  • require
  • export
  • public
  • function
  • class
  • interface
  • type
  • const
  • enum
  • if (false)
  • if (FLAG)
  • else
  • switch
  • default
  • return
  • throw
  • break
  • continue
  • deprecated
  • legacy
  • TODO remove
  • unused
  • feature flag
  • register
  • route
  • command

Also inspect:

  • files with no inbound imports
  • modules imported only by other suspected-dead modules
  • modules re-exported but never consumed
  • path aliases, barrels, or registries that may hide the last live reference
  • duplicate implementations behind old/new paths
  • branches gated by flags that are permanently on or off
  • code after unconditional return, throw, or exhaustive matches
  • adapters kept only for migrations that already finished

Build a proof chain

Treat "no references found" as a starting signal, not proof.

Prefer at least two independent pieces of evidence when possible:

  • repo search shows no live callers after checking aliases, barrels, generated paths, and test-only consumers
  • no route, command, registry, manifest, config, or package export points at the candidate
  • framework conventions and auto-discovery rules do not require it by name or location
  • removing it keeps typecheck, build, and targeted tests green when those checks exist
  • feature-flag source of truth shows the branch is permanently on or off
  • public-surface review finds no external or cross-workspace consumers you can verify

If evidence depends on a system you cannot inspect locally, downgrade the claim to a finding with missing proof instead of deleting.

Detect these dead-code patterns

Unused exports

Flag exported values that have no live consumers.

Common signals:

  • exported helper, component, hook, class, or constant with zero references outside its file
  • barrel exports that expose symbols never imported anywhere
  • public methods required by no interface, subclass, or framework hook
  • package exports left behind after an internal refactor

Verify framework conventions before deleting. Some exports are consumed by reflection, auto-registration, templates, external packages, or sibling workspaces.

Unreachable code

Flag code paths that normal execution cannot enter.

Common signals:

  • statements after return, throw, break, or continue
  • if or switch branches guarded by impossible conditions
  • fallback branches after exhaustive enum or union handling
  • code behind version checks or environment gates that can no longer occur

Prefer proving why the branch is impossible, not just that it looks suspicious.

Orphaned files

Flag files, directories, or modules with no live entrypoint.

Common signals:

  • module not imported, registered, routed, or referenced by config
  • page, component, job, or worker replaced by a new implementation but never removed
  • fixture, test helper, or mock file not referenced by any tests
  • scripts that are no longer invoked by package scripts, CI, cron, or docs

Check for out-of-repo or cross-workspace consumers before deleting shared packages or public artifacts.

Stale feature flags

Flag flags whose rollout is finished but both paths still remain.

Common signals:

  • flag is always on or always off in current config
  • old branch is still present long after migration or launch
  • flag name includes a completed rollout, migration, or temporary workaround
  • kill switch exists but no owner, expiry, or current use remains

Confirm the source of truth for the flag. Code search alone is not enough if flags are managed remotely.

Dead registrations and compatibility layers

Flag code kept only to support paths that no longer exist.

Common signals:

  • event listeners subscribed to events no producer emits
  • adapters for old payload shapes after all producers migrated
  • deprecated routes, commands, or aliases with no callers
  • serializer fields kept for clients that no longer exist

These often survive because the registration site looks live even though the upstream caller is gone.

Guard against false positives

Dead-code audits are easy to get wrong where usage is indirect.

Be careful around:

  • reflection and runtime method lookup
  • DI container resolution by string or class name
  • framework auto-discovery by filename or folder
  • dynamic imports and lazy loading
  • package exports, CLI bin entries, or monorepo workspace consumers
  • generated registries, manifests, or codegen that recreate the reference chain
  • templates that reference symbols indirectly
  • code generation inputs and generated outputs
  • public SDK or package APIs consumed outside the repo
  • migrations, backfills, and historical one-off scripts that are intentionally retained
  • feature flags controlled in remote dashboards or environment management

If reachability depends on conventions or external systems, report the finding with the missing proof instead of deleting speculatively.

Classify findings

P1

Use for dead paths that actively create risk: stale flags masking security, billing, or data-integrity behavior, duplicate write paths that can diverge, or unreachable rollback logic that operators may believe still works.

P2

Use for dead code in active boundaries: orphaned routes, handlers, jobs, or compatibility layers that increase maintenance cost or hide which path is truly live.

P3

Use for routine cleanup: unused exports, unreachable local branches, dead helpers, unreferenced tests, or unused files with low behavioral risk.

P4

Use for cosmetic leftovers: comments referencing removed flags, empty barrels, deprecated aliases with obvious replacements, or cleanup that does not materially affect maintenance risk.

Auto-fix only when safe

Auto-fix local removals when proof is strong and the blast radius is contained.

Safe examples:

  • remove statements after unconditional return or throw
  • delete a private helper or local constant with zero references in one module
  • remove an import/export pair that is unused and not part of a public surface
  • collapse a stale flag branch when the live branch is unambiguous and locally verified
  • delete an orphaned test helper or fixture with no references

Do not auto-fix without explicit approval when the change affects:

  • public APIs, SDKs, or package exports
  • framework conventions or auto-discovery
  • dynamic loading or reflection
  • remote feature-flag systems
  • database migrations, backfills, or compliance artifacts
  • shared build, CI, release, or deployment scripts
  • cross-repo consumers you cannot verify locally

For those, report the finding and recommend the smallest removal plan.

Choose the smallest defensible fix

Prefer this order:

  1. Remove the dead leaf code.
  2. Remove imports, exports, and registrations that only existed for it.
  3. Remove stale tests or fixtures tied only to the deleted path.
  4. Remove the flag or compatibility shim if both sides are now gone.
  5. Stop once the live path is simpler and still verified.

Avoid broad "cleanup passes" that mix proven dead code with speculative simplification.

Report findings in this format

List findings first, highest severity first.

For each finding, include:

  • priority: P1 to P4
  • dead-code type: unused export, unreachable code, orphaned file, stale feature flag, dead registration, or compatibility layer
  • location: file and line or the smallest concrete scope available
  • proof chain: what references, registries, conventions, and validation checks were used
  • false-positive risk: dynamic loading, external consumers, or unknowns
  • recommended fix
  • whether it is safe to auto-fix now

If no issues are found, say so explicitly and mention which entrypoints and dynamic-loading surfaces were checked plus any remaining blind spots.

Default review stance

  • Prefer proof over suspicion
  • Prefer deletion over deprecation once reachability is disproven
  • Prefer contained removals over broad cleanups
  • Prefer preserving live entrypoints over chasing local neatness
  • Prefer findings with concrete reference evidence over style commentary

平台分布

Codex

38.36%
按下载量换算49

Claude

26.41%
按下载量换算34

Cursor

17.44%
按下载量换算22

Gemini CLI

9.89%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

继续浏览同类 Skills