find-unused

Detect commented-out code, unused symbols, and unused test helpers via LSP-based analysis.

4|1|Updated Jul 31, 2025
One-click install
npx skills add https://github.com/alvis/.agents --skill find-unused-alvis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: find-unused
Source: https://github.com/alvis/.agents/tree/main/plugins/coding/skills/find-unused
Command: npx skills add https://github.com/alvis/.agents --skill find-unused-alvis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Dead code accumulates silently in growing codebases — commented-out blocks, exported symbols nobody calls, and test helpers no test uses — making maintenance harder and reviews noisier. This Skill performs read-only dead-code discovery and reports evidence-backed removal candidates without touching your source files. ## Core Features & Use Cases - Three-Agent Parallel Analysis: Launches parallel agents for commented-out code detection, hierarchical LSP-based unused-symbol analysis (file reachability, then symbol-level, then test helpers), and test-only production code detection. - Precise Reference Classification: Uses LSP operations like findReferences and incomingCalls, counting only actual usage (calls, instantiations, reads, type annotations) while ignoring exports, re-exports, and type-only imports. - Prioritized Evidence Reports: Merges and deduplicates findings into high (unused exports), medium (commented-out blocks), and low (unused test helpers) priorities, each with file:line evidence. - Use Case: Before a cleanup sprint, run the scan on your repository to get a prioritized list of dead-code candidates, then hand confirmed removals to the coding:lint pre-flight workflow. ## Quick Start Scan the src directory for unused code and report removal candidates with file and line evidence.

Frequently Asked Questions about find-unused

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find unused code in my codebase?

Run a dead-code scan over a path, directory, or glob to detect unused exports, commented-out code, and unused test helpers. The analysis uses LSP reference lookups and reports each finding with file:line evidence without modifying any files.

How does LSP-based unused symbol detection work?

It enumerates symbols with documentSymbol, then checks each with findReferences, counting only actual usage like calls, instantiations, reads, and type annotations. Exports, re-exports, imports, and type-only imports do not count, so a symbol with only those references is reported as unused.

Can this tool delete the dead code it finds?

No, the scan is strictly read-only and never edits, deletes, or creates project files. It reports removal candidates with evidence, and confirmed deletion is handled separately by the coding:lint pre-flight workflow.

Does dead-code detection work on test files and helpers?

Yes, it identifies test helper files inside test folders and checks their exports for usage, classifying unused fixtures, helpers, and mocks. It also detects production code referenced only by tests and recommends moving or removing it.

Why does unused-code analysis report false positives?

False positives come from documentation comments, license headers, and dynamic imports that pattern matching misreads as dead code. The merge phase deduplicates findings and drops these cases before producing the prioritized report.