dead-code-scanner

Scan codebases for unused or orphaned code and output Markdown reports.

Updated Jul 24, 2024
One-click install
npx skills add https://github.com/jasonwilmot/little-riddle --skill dead-code-scanner-jasonwilmot
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dead-code-scanner
Source: https://github.com/jasonwilmot/little-riddle/tree/main/.claude/skills/dead-code-scanner
Command: npx skills add https://github.com/jasonwilmot/little-riddle --skill dead-code-scanner-jasonwilmot

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Find unused or orphaned code after refactors or for ongoing hygiene. This tool helps maintain code health by identifying dead code and guiding safe remediation.

Core Features & Use Cases

  • Quick (HEAD~5) scans for recently orphaned code after refactors.
  • Full codebase scans for comprehensive hygiene passes.
  • Outputs a Markdown report at .agents/research/YYYY-MM-DD-dead-code-{mode}.md and supports an interactive removal workflow.

Quick Start

Run a quick scan to identify dead code and review the generated report at .agents/research/YYYY-MM-DD-dead-code-quick.md

Frequently Asked Questions about dead-code-scanner

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

FAQPage Schema
How do I find unused or orphaned code in a codebase during a refactor?

Dead code identification parses source files to locate unused or orphaned code, improving maintainability during refactors. It respects ignore lists and inline annotations to prevent false positives and ensure safe remediation.

What's the best way to scan for recently orphaned code after a refactor?

Quick scan mode targets recently orphaned code by analyzing recent commits (HEAD~5). This mode efficiently isolates newly dead code introduced during active refactoring sessions without scanning the entire project.

Can I run a full codebase scan for comprehensive code hygiene?

Full scan mode performs comprehensive hygiene passes across large codebases to identify all unused or orphaned code. It parses all source files while respecting configured ignore lists and inline annotations.

How does this dead code scanner report its findings?

The scanner outputs Markdown reports to .agents/research/YYYY-MM-DD-dead-code-{mode}.md. These reports detail identified unused code and support an interactive removal workflow to guide safe remediation.

Do I need to configure ignore lists before scanning for unused code?

Ignore lists and inline annotations are respected during source file parsing to exclude specific files or code blocks. Configuring them before a full codebase scan prevents false positives and protects intentionally retained code.

When should I use quick scan versus full scan for dead code removal?

Use quick scan after recent refactors to isolate newly orphaned code from recent commits, ensuring fast feedback. Use full scan for routine maintenance or comprehensive hygiene sweeps across large codebases to identify all unused code.