dead-code-cleanup

Detect and remove unused functions, variables, imports, and types across multi-language codebases.

165|36|Updated Jan 22, 2024
One-click install
npx skills add https://github.com/calimero-network/core --skill dead-code-cleanup-calimero-network
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dead-code-cleanup
Source: https://github.com/calimero-network/core/tree/main/.cursor/skills/dead-code-cleanup
Command: npx skills add https://github.com/calimero-network/core --skill dead-code-cleanup-calimero-network

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Detects and removes dead code introduced by AI agents. Analyzes codebase for unused functions, variables, imports, and types; verifies no references (including indirect, dynamic, or runtime); reports with file paths and line numbers; optionally generates safe patches. Use when cleaning up after AI-generated code, removing unused code, or when the user asks for dead code detection, unused code removal, or code quality cleanup.

Core Features & Use Cases

  • Identify candidates: unused functions, variables, imports, and types across the codebase.
  • Verify no references across direct, indirect, dynamic, or runtime usage.
  • Report confirmed dead code with file paths and line numbers; propose safe patches if requested.

Quick Start

Run the tool on your codebase to detect and report unused code and generate a safe patch if desired.

Frequently Asked Questions about dead-code-cleanup

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

FAQPage Schema
How do I detect and remove unused functions, variables, imports, and types from my codebase?

Dead code cleanup scans multi-language codebases to identify unused functions, variables, imports, and types, verifying no direct, indirect, dynamic, or runtime references exist before reporting exact file paths and line numbers. It optionally generates safe patches for removal.

What is the best way to clean up unused code after AI-generated changes?

Removing dead code after AI-generated changes requires scanning for unused functions, variables, imports, and types while verifying no dynamic or runtime references exist. This cleanup process reports precise file locations and can generate safe patches to prune codebase bloat.

Does dead code detection work with multi-language codebases and dynamic references?

Yes, dead code detection applies to multi-language codebases and verifies direct, indirect, dynamic, and runtime references before marking any item as dead. It excludes items with external usage or safety concerns to ensure accurate unused code identification across different languages.

How do I ensure safe unused code removal without breaking dynamic or runtime references?

Safe unused code removal requires verifying no direct, indirect, dynamic, or runtime references exist before marking items as dead. The tool excludes items with external usage or safety concerns and reports confirmed dead code with precise file paths and line numbers for manual or patched review.

Can I generate patches automatically when removing unused imports and types?

Yes, you can optionally generate safe patches when removing unused imports and types. The tool identifies dead code candidates, verifies no references exist across direct, indirect, dynamic, or runtime usage, and proposes patches with precise file paths and line numbers for maintainability.