cleanup

Scan codebases for cleanup opportunities and apply safe automated fixes.

1|Updated Feb 26, 2026
One-click install
npx skills add https://github.com/mattbobambrose/mattbobambrose-claude-skills --skill cleanup-mattbobambrose
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cleanup
Source: https://github.com/mattbobambrose/mattbobambrose-claude-skills/tree/main/plugins/code-quality/skills/cleanup
Command: npx skills add https://github.com/mattbobambrose/mattbobambrose-claude-skills --skill cleanup-mattbobambrose

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill reduces developer time spent hunting and fixing trivial code issues by automatically applying low-risk cleanups and surfacing riskier items for human review, improving code readability and maintainability.

Core Features & Use Cases

  • Automatic safe fixes: Remove unused imports, trim trailing whitespace and inconsistent blank lines, and eliminate large commented-out code blocks when safe.
  • Human-in-the-loop approvals: Detect dead code, duplicate logic, and mismatched tests and present proposed changes for user confirmation before applying.
  • Verification and reporting: Run configured formatters and the test suite, revert problematic changes if tests fail, and produce a summary report of all actions and outstanding TODOs/FIXMEs.
  • Use Case: Use this Skill to run a project-wide cleanup prior to a major refactor or release to improve code hygiene while ensuring no functional regressions are introduced.

Quick Start

Run the cleanup skill to scan the repository, apply safe auto-fixes, and present approval-needed changes for confirmation.

Frequently Asked Questions about cleanup

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

FAQPage Schema
How do I automatically remove unused imports and dead code from my codebase?

To automatically remove unused imports and dead code, run a project-wide cleanup scan that applies safe auto-fixes to source and test files while surfacing dead code and duplicate logic for user confirmation before edits are applied.

What is the best way to auto-fix code quality issues before a major release?

The best way to auto-fix code quality issues before a release is to run an automated cleanup that removes trivial issues like whitespace and unused imports, runs the test suite, and reverts problematic changes if tests fail to prevent regressions.

Can I automatically clean up trailing whitespace and commented-out code blocks?

Yes, you can automatically clean up trailing whitespace, inconsistent blank lines, and large commented-out code blocks when safe, using an automated cleanup tool that operates on project source and test files to apply low-risk fixes.

Does automated code cleanup run project formatters and the test suite?

Yes, automated code cleanup can optionally run configured project formatters and the test suite to verify changes, automatically reverting any problematic edits if tests fail to ensure no functional regressions are introduced.

How are risky refactoring changes handled during automated code cleanup?

Risky refactoring changes like removing dead code, duplicate logic, and mismatched tests are detected and presented for human-in-the-loop user confirmation before they are applied, ensuring safe code hygiene improvements.

What limitations should I expect when using an automated code cleanup tool?

A limitation of automated code cleanup is that it only auto-fixes trivial issues like unused imports and whitespace, requiring user approval for riskier edits involving dead code and duplicate logic, and reverting changes if tests fail.