unused-code-refactor-suggester

Scans source files for unused code and generates refactoring reports with risk summaries.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/HMWKR/dotclaude --skill unused-code-refactor-suggester
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unused-code-refactor-suggester
Source: https://github.com/HMWKR/dotclaude/tree/main/skills/unused-code-refactor-suggester
Command: npx skills add https://github.com/HMWKR/dotclaude --skill unused-code-refactor-suggester

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps developers clean up their codebase by identifying and suggesting the removal of functions, classes, and definitions that are no longer used within their own files, reducing clutter and potential maintenance overhead.

Core Features & Use Cases

  • File-scoped Unused Code Detection: Scans individual source files to pinpoint definitions without internal references.
  • Refactoring Recommendations: Generates clear suggestions to delete or keep identified items, along with concise reasons and risk assessments.
  • Use Case: After a large refactor, you suspect some helper functions are no longer called. Run this Skill on your src/utils/ directory to get a report of functions that can likely be removed, saving you from maintaining dead code.

Quick Start

Scan the 'src/components' directory for any unused code within each file and generate a refactoring report.

Frequently Asked Questions about unused-code-refactor-suggester

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

FAQPage Schema
How do I find unused functions and dead code in my source files?

To find unused functions and dead code, you can scan individual source files or directories to pinpoint file-scoped definitions without internal references. This generates a refactoring report recommending deletion or preservation with risk summaries for each identified item.

What is file-scoped unused code detection and how does it work?

File-scoped unused code detection scans individual source files to pinpoint functions, classes, and top-level definitions that lack internal references within that same file. It then flags these unreferenced definitions as dead code for potential cleanup.

How do I clean up dead code after a large refactor?

To clean up dead code after a large refactor, run a file-scoped scan on your target directories to generate a refactoring report. This report identifies unreferenced functions and classes, recommending whether to delete or keep them based on concise risk assessments.

Does unused code detection work across an entire project or just single files?

Unused code detection operates at the file-scoped level, scanning individual source files or specified directories to find definitions without internal references. It does not track cross-file dependencies, so it focuses strictly on dead code contained within its own file.

Can I get a risk assessment before removing dead code?

Yes, you can get a risk assessment before removing dead code. The generated refactoring report provides clear recommendations to either delete or keep identified unused functions and classes, accompanied by concise reasons and risk summaries for safe removal.

What's the best way to remove unused classes and top-level definitions?

The best way to remove unused classes and top-level definitions is to scan the target source files for unreferenced items and generate a refactoring report. This provides clear deletion or preservation recommendations with risk summaries to guide safe code cleanup.