AgentSkillsCN

analyze-dead-code

查找未使用的代码、已弃用的路径,以及逐渐偏离文档的代码。在清理代码库、准备重构,或审计技术债务时,此技能将助你事半功倍。

SKILL.md
--- frontmatter
name: analyze-dead-code
description: "Find unused code, deprecated paths, and documentation drift. Use when cleaning up codebase, preparing for refactor, or auditing technical debt."

Analyze Dead Code

Detect unused and deprecated code using the dead-code-analyzer agent.

What It Finds

  1. Dead Code - Functions, classes, modules, variables never used
  2. Deprecated Paths - Code reachable but abandoned or marked for removal
  3. Documentation Drift - Code that contradicts README, comments, or docstrings

When to Use

  • "Clean up unused code"
  • "Is this function used anywhere?"
  • "Audit before major refactor"
  • "Check if docs match implementation"

Output

code
### Dead Code Inventory
| Location | Type | Confidence | Notes |
|----------|------|------------|-------|

### Deprecated Paths
| Location | Pattern | Signal | Recommendation |

### Documentation Divergence
| Documented Claim | Actual State | Severity |

### Summary
- High confidence (safe to remove): X items
- Medium confidence (verify first): X items
- Priority actions: [list]

Agent

Use subagent_type: dead-code-analyzer