code-cleanup

Identify and verify dead code and latent bugs in Python codebases.

317|40|Updated Jan 21, 2025
One-click install
npx skills add https://github.com/benchflow-ai/benchflow --skill code-cleanup-benchflow-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-cleanup
Source: https://github.com/benchflow-ai/benchflow/tree/main/.agents/skills/code-cleanup
Command: npx skills add https://github.com/benchflow-ai/benchflow --skill code-cleanup-benchflow-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill solves the problem of technical debt accumulation by identifying and verifying trivial refactoring wins, such as dead code and latent bugs, without introducing regressions or scope creep.

Core Features & Use Cases

  • Two-Pass Verification: Uses a discovery pass to find potential cleanups and a mandatory verification pass to ensure accuracy before presenting findings.
  • Categorized Cleanup: Targets specific issues like dead code, duplicated logic, stale comments, and latent bugs while strictly avoiding style-only changes or public API modifications.
  • Use Case: Use this skill to perform a safe, systematic sweep of a large codebase to remove unused symbols and fix minor latent bugs, ensuring that every proposed change is verified and net-LOC neutral.

Quick Start

Invoke the code-cleanup skill to perform a comprehensive refactoring sweep across the entire repository.

Frequently Asked Questions about code-cleanup

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

FAQPage Schema
How do I find and remove dead code in a Python codebase without introducing regressions?

Dead code removal is performed safely using a dual-pass discovery and verification workflow. This process identifies unused symbols and validates their usage with static analysis tools and git integration, ensuring high-confidence suggestions that maintain code integrity.

What's the best way to automate Python refactoring while avoiding public API modifications?

Automated Python refactoring is achieved through a categorized cleanup process that targets specific issues like dead code and latent bugs while strictly avoiding style-only changes or public API modifications. This ensures net-LOC neutral changes without scope creep.

Can I verify duplicated logic and latent bugs in Python before applying refactoring changes?

Yes, verifying duplicated logic and latent bugs is handled by a mandatory verification pass that follows the initial discovery phase. This dual-pass system ensures accuracy by validating symbol usage and confirming code integrity before presenting any findings.

Does Python code cleanup work with git integration to maintain file size constraints?

Python code cleanup requires git integration to validate symbol usage and ensure code integrity during the refactoring process. This integration helps maintain file size constraints while systematically sweeping the repository for technical debt.

Why should I use a dual-pass discovery workflow for technical debt cleanup instead of single-pass static analysis?

A dual-pass discovery workflow ensures high-confidence refactoring suggestions by verifying potential cleanups before presenting them. Unlike single-pass static analysis, this method prevents regressions by validating symbol usage and ensuring every proposed change is net-LOC neutral.

When should I not use automated refactoring for stale comments and trivial code issues?

Automated refactoring should not be used for style-only changes or public API modifications. It is specifically designed to target trivial refactoring wins like dead code, duplicated logic, and stale comments while maintaining strict file size constraints and avoiding scope creep.