detect-unused-code

Detects unused imports, dead functions, and commented-out blocks in codebases.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Unused imports, dead functions, and commented-out code clutter the codebase, making it harder to understand, increasing maintenance burden, and violating the "No Legacy Baggage" principle.

Core Features & Use Cases

  • Unused Code Detection: Identifies unused imports, functions/methods with zero callers, and commented-out code blocks.
  • Detailed Reporting: Generates a report with locations, reasons for flagging, and suggestions for removal.
  • Tech Debt Measurement: Provides a clear, quantifiable metric for technical debt related to code bloat.
  • Use Case: Integrate this skill into your CI pipeline to automatically detect and report any newly introduced unused code, preventing the accumulation of technical debt over time.

Quick Start

Detect unused imports, dead code, and commented-out code in the 'auth_service.py' file.

Frequently Asked Questions about detect-unused-code

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

FAQPage Schema
How do I detect unused imports and dead code in my codebase?

Unused code detection identifies imports, functions, and commented blocks that are never called or referenced. The Skill analyzes your project files, generates a structured report showing locations and reasons for flagging, and quantifies technical debt from code bloat so you can prioritize removal.

What counts as dead code that this tool will flag?

Dead code includes unused imports, functions or methods with zero callers, and commented-out code blocks. The Skill flags all three categories, providing detailed locations and removal suggestions to help you understand what's cluttering your codebase.

Can I use unused code detection in my CI pipeline?

Yes, this Skill integrates into CI pipelines to automatically detect and report newly introduced unused code before it accumulates. It outputs structured findings per-file and summaries suitable for automated pruning and prevents technical debt from growing over time.

Why should I remove unused code from my project?

Unused imports, dead functions, and commented code increase maintenance burden and make codebases harder to understand. Removing unused code reduces technical debt, improves clarity, and follows lean code principles by eliminating legacy baggage.

What output does the dead code detector provide?

The Skill outputs structured findings including per-file lists of unused code, summary metrics, deviation status, locations of flagged items, and actionable removal suggestions for automated or manual remediation.