cleanup

Orchestrates parallel multi-agent code cleanup with import-graph chunking and review loops.

2|Updated Apr 4, 2026
One-click install
npx skills add https://github.com/DoctorMozg/claude-pipelines --skill cleanup-doctormozg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cleanup
Source: https://github.com/DoctorMozg/claude-pipelines/tree/main/plugins/mz-dev-pipe/skills/cleanup
Command: npx skills add https://github.com/DoctorMozg/claude-pipelines --skill cleanup-doctormozg

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Large-scale code cleanup — removing dead code, unused imports, and duplication across many files — is risky to do by hand and slow to do serially. This Skill automates the whole pass: it chunks the scope by import graph, runs parallel optimizer agents, verifies tests and linters after every batch, and loops reviews until every chunk passes. ## Core Features & Use Cases - Import-graph chunking with blast-radius analysis: resolves a glob, directory, git range, or free-text scope into parallel-safe chunks, isolating high-risk files and surfacing downstream impact before any code is touched. - Parallel optimize-verify-review pipeline: dispatches up to 6 optimizer agents with mirrored code reviewers, auto-fixes regressions in an inner loop, and respawns only rejected chunks. - Behavior preservation guarantees: captures a test/lint baseline first, requires explicit user approval at a plan gate, and never proceeds on a red build. - Use Case: Run it on "src/auth/" after a refactor sprint — it removes dead exports and unused imports across the module, keeps tests green, and delivers a summary of every change plus deferred observations. ## Quick Start Ask the assistant to clean up dead code and reduce complexity in the src/auth directory using the cleanup skill.

Frequently Asked Questions about cleanup

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

FAQPage Schema
How do I remove dead code and unused imports across a whole project?

Run the cleanup skill with a scope such as a glob, directory, or git range. It builds an import graph, chunks files for parallel optimizer agents, and verifies tests and linters after each batch so behavior is preserved.

What tools detect dead code in Python, TypeScript, Rust, and Go?

The skill's reference guide covers ruff and vulture for Python, tsc and knip for TypeScript, cargo and clippy for Rust, and goimports, staticcheck, and deadcode for Go, plus jscpd for cross-language duplication detection.

Can automated refactoring break my tests?

The pipeline captures a test and lint baseline before any changes and re-runs both after every optimization batch. Any regression triggers an auto-fix loop, and the run never proceeds to review on a red build.

When should I not use an automated cleanup pass?

Skip it for fixing failing tests (use polish), investigating known bugs (use debug), security hunts (use audit), or performance profiling of hotspots. Cleanup only removes dead code and reduces complexity while preserving behavior.

How does the cleanup pipeline handle high-risk files?

A blast-radius analysis runs on every scope to find files with many downstream dependents. Files rated high risk are isolated into their own chunk and flagged prominently in the user approval gate before optimization begins.