cmd-code-cleanup

Remove dead code and reduce duplication through a five-phase cleanup process.

8|Updated Jan 22, 2026
One-click install
npx skills add https://github.com/Olshansk/agent-skills --skill cmd-code-cleanup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cmd-code-cleanup
Source: https://github.com/Olshansk/agent-skills/tree/main/skills/cmd-code-cleanup
Command: npx skills add https://github.com/Olshansk/agent-skills --skill cmd-code-cleanup

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the accumulation of dead code, duplication, and complexity in a codebase, leading to improved maintainability and reduced technical debt.

Core Features & Use Cases

  • Systematic Dead Code Removal: Identifies and removes unused imports, functions, classes, and commented-out code.
  • Duplication Reduction: Extracts common patterns repeated three or more times into reusable helper functions.
  • Simplification: Removes premature abstractions and unnecessary indirection while preserving essential structure.
  • Standardized Documentation: Ensures consistent TODO formats and cleans up comments.
  • Use Case: Refactor a legacy Python project by systematically removing unused code and consolidating repetitive logic to make it easier to understand and extend.

Quick Start

Initiate a code cleanup process by following the defined five-phase approach.

Frequently Asked Questions about cmd-code-cleanup

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

FAQPage Schema
How do I remove dead code and reduce duplication in a legacy codebase?

To remove dead code and reduce duplication, this Skill performs a systematic five-phase cleanup that targets unused imports, unreferenced functions, and repeated patterns. It consolidates repetitive logic into reusable helpers while preserving essential architecture.

What is the best way to simplify unnecessary abstractions during refactoring?

Simplifying unnecessary abstractions involves removing premature abstractions and unnecessary indirection while preserving essential structure. This Skill standardizes comments and TODOs, ensuring consistent documentation alongside the structural refactoring process.

When should I extract repeated code patterns into reusable functions?

You should extract repeated code patterns into reusable helper functions when a common pattern is repeated three or more times. This duplication reduction step is a core part of the systematic code cleanup process to lower technical debt.

Does this code cleanup approach preserve essential architecture and documentation?

Yes, this code cleanup approach preserves essential architecture and documentation. While it aggressively removes dead code and simplifies unnecessary abstractions, it specifically retains essential structure and standardizes existing comments and TODOs.

Can I use this refactoring process to clean up unused imports and classes?

Yes, you can use this refactoring process to clean up unused imports, unreferenced functions, and unused classes. It systematically identifies and removes these elements across the codebase to improve overall maintainability.

What are the limitations of automated technical debt reduction?

A limitation of this technical debt reduction approach is that it targets specific issues like dead code, duplication, and unnecessary abstractions. It focuses on pragmatic simplification rather than rewriting core logic or altering the fundamental system architecture.