cleanup

Remove dead code and unused imports from Kotlin codebases without changing behavior.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Cleanup reduces codebase bloat by identifying and removing dead code, unused imports, and accumulated technical debt without changing behavior.

Core Features & Use Cases

  • Baseline verification: Runs tests plus static analysis to establish pass/fail status and warning baselines before any edits.
  • Detection sweep: Scans for unused imports, dead code patterns, deprecated APIs, technical-debt indicators, style inconsistencies, and stale documentation across a chosen module or the full codebase.
  • Safe, structured remediation: Applies automated fixes first, then performs manifest-driven manual cleanup using isolated worktree edits with a consolidated merge.
  • Use case: Prepare a Kotlin module (or an entire repository) for sustainable maintenance after accumulating TODOs, deprecated usages, lint/Detekt warnings, and dead/private code paths.

Quick Start

Run cleanup on the entire codebase by asking the AI to execute the cleanup workflow for module "all" and produce a cleanup report after tests pass.

Frequently Asked Questions about cleanup

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

FAQPage Schema
How do I remove unused imports and dead code from a Kotlin codebase?

You can remove dead code and unused imports by running an automated detection sweep across your Kotlin modules, followed by manifest-driven remediation that applies fixes using isolated worktree edits to ensure no behavior changes.

How does static analysis cleanup work with a no-behavior-change guarantee?

Static analysis cleanup works by first establishing a baseline of passing tests and warning counts, applying automated formatting and manual fixes in isolation, then verifying that tests still pass and warnings improve before consolidating edits.

Can I use Detekt and Ktlint to fix technical debt across an entire Kotlin repository?

Yes, you can target technical-debt hotspots and style inconsistencies across an entire repository by requesting a full codebase cleanup sweep, which applies fixes for lint and Detekt warnings while maintaining strict behavior parity.

What is the best way to clean up deprecated APIs and stale documentation in Kotlin?

The best way to clean up deprecated APIs and stale documentation is to run a manifest-driven workflow that scans for these specific technical-debt indicators, applies automated fixes first, and consolidates the results after tests pass.

Do I need to run baseline tests before removing unused Kotlin code?

Yes, baseline verification is required before removing unused Kotlin code to establish pass/fail status and warning counts, which ensures the subsequent automated formatting and fix phases do not alter existing application behavior.

When should I not use an automated code cleanup workflow?

You should not use an automated code cleanup workflow if your Kotlin module lacks a reliable test suite, as the process requires running baseline tests and static analysis to verify that warnings improve and behavior remains unchanged after edits.