ln-626-dead-code-auditor by levnikolaevich/claude-code-skills
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-626-dead-code-auditor路径说明: 文件路径(
shared/、references/、../ln-*)是相对于技能仓库根目录的。如果在当前工作目录未找到,请定位此 SKILL.md 文件所在的目录,然后向上返回一级以找到仓库根目录。如果缺少shared/目录,请通过 WebFetch 从https://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}获取文件。
专门用于审计未使用和不可达代码的工作器。
必读: 加载 shared/references/audit_worker_core_contract.md。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
接收包含技术栈、代码库根目录、output_dir 的 contextStore。
必读: 加载 shared/references/two_layer_detection.md 以了解检测方法。
index_project,然后使用 find_unused_exports 作为未使用导出的主要检测方法。将基于 grep 的检测作为非 JS 语言或当依赖图不可用时的后备方案。shared/templates/audit_worker_report_template.md 在内存中构建完整的 Markdown 报告,通过单次 Write 调用写入 {output_dir}/626-dead-code.md必读: 加载 shared/references/clean_code_checklist.md 以了解通用的死代码模式和严重性定义。
检测方法:
no-unreachable (ESLint)return、throw、break 之后的代码严重性: 中等
检测方法:
no-unused-varsnoUnusedLocals、noUnusedParametersflake8 配合 F401、F841严重性:
检测方法:
//.*{ 或 /*.*function 模式严重性: 低
建议: 删除(git 会保留历史记录)
内容: 向后兼容性垫片、已弃用的模式、应删除的旧代码
检测方法:
const oldName = newName 或 export { newModule as oldModule }function oldFunc() { return newFunc(); }(用于向后兼容的包装器)// DEPRECATED、@deprecated JSDoc 标签export.*as.*old.* 或 export.*legacy.*if.*legacy.* 或 if.*old.*version.* 或 isOldVersion ? oldFunc() : newFunc()migrate.*、Legacy.*Adapter、.*Shim、.*Compat// backward compatibility、// legacy support、// TODO: remove in v// old implementation、// deprecated、// kept for backward严重性:
建议:
工作量:
必读: 加载 shared/references/audit_worker_core_contract.md 和 shared/references/audit_scoring.md。
必读: 加载 shared/references/audit_worker_core_contract.md 和 shared/templates/audit_worker_report_template.md。
将报告写入 {output_dir}/626-dead-code.md,包含 category: "Dead Code" 和检查项:unreachable_code、unused_exports、commented_code、legacy_shims。
向协调器返回摘要:
Report written: docs/project/.audit/ln-620/{YYYY-MM-DD}/626-dead-code.md
Score: X.X/10 | Issues: N (C:N H:N M:N L:N)
shared/references/clean_code_checklist.mdshared/references/audit_output_schema.md必读: 加载 shared/references/audit_worker_core_contract.md。
必读: 加载 shared/references/audit_worker_core_contract.md。
shared/references/clean_code_checklist.md 加载清洁代码清单shared/references/audit_scoring.md 计算分数{output_dir}/626-dead-code.md(原子性的单次 Write 调用)版本: 3.0.0 最后更新: 2025-12-23
每周安装量
190
仓库
GitHub 星标数
245
首次出现
2026年1月24日
安全审计
安装于
claude-code172
cursor172
gemini-cli171
opencode171
codex169
github-copilot164
Paths: File paths (
shared/,references/,../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. Ifshared/is missing, fetch files via WebFetch fromhttps://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}.
Specialized worker auditing unused and unreachable code.
MANDATORY READ: Load shared/references/audit_worker_core_contract.md.
Receives contextStore with tech stack, codebase root, output_dir.
MANDATORY READ: Load shared/references/two_layer_detection.md for detection methodology.
index_project then find_unused_exports as primary detection for unused exports. Keep grep-based detection as fallback for non-JS languages or when graph is unavailable.shared/templates/audit_worker_report_template.md, write to {output_dir}/626-dead-code.md in single Write callMANDATORY READ: Load shared/references/clean_code_checklist.md for universal dead code patterns and severity definitions.
Detection:
no-unreachable (ESLint)return, throw, breakSeverity: MEDIUM
Detection:
no-unused-varsnoUnusedLocals, noUnusedParametersflake8 with F401, F841Severity:
Detection:
//.*{ or /*.*function patternsSeverity: LOW
Recommendation: Delete (git preserves history)
What: Backward compatibility shims, deprecated patterns, old code that should be removed
Detection:
const oldName = newName or export { newModule as oldModule }function oldFunc() { return newFunc(); } (wrapper for backward compatibility)// DEPRECATED, @deprecated JSDoc tagsexport.*as.*old.* or export.*legacy.*if.*legacy.* or if.*old.*version.* or Severity:
Recommendation:
Effort:
MANDATORY READ: Load shared/references/audit_worker_core_contract.md and shared/references/audit_scoring.md.
MANDATORY READ: Load shared/references/audit_worker_core_contract.md and shared/templates/audit_worker_report_template.md.
Write report to {output_dir}/626-dead-code.md with category: "Dead Code" and checks: unreachable_code, unused_exports, commented_code, legacy_shims.
Return summary to coordinator:
Report written: docs/project/.audit/ln-620/{YYYY-MM-DD}/626-dead-code.md
Score: X.X/10 | Issues: N (C:N H:N M:N L:N)
shared/references/clean_code_checklist.mdshared/references/audit_output_schema.mdMANDATORY READ: Load shared/references/audit_worker_core_contract.md.
MANDATORY READ: Load shared/references/audit_worker_core_contract.md.
shared/references/clean_code_checklist.mdshared/references/audit_scoring.md{output_dir}/626-dead-code.md (atomic single Write call)Version: 3.0.0 Last Updated: 2025-12-23
Weekly Installs
190
Repository
GitHub Stars
245
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
claude-code172
cursor172
gemini-cli171
opencode171
codex169
github-copilot164
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
31,600 周安装
isOldVersion ? oldFunc() : newFunc()migrate.*, Legacy.*Adapter, .*Shim, .*Compat// backward compatibility, // legacy support, // TODO: remove in v// old implementation, // deprecated, // kept for backward