ai-slop-cleaner

Remove duplicated logic and dead code from specified files while preserving behavior.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/kamelmh/opencode --skill ai-slop-cleaner-kamelmh
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ai-slop-cleaner
Source: https://github.com/kamelmh/opencode/tree/main/skills/ai-slop-cleaner
Command: npx skills add https://github.com/kamelmh/opencode --skill ai-slop-cleaner-kamelmh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

ai-slop-cleaner removes AI-generated code “slop” like duplicated logic, dead code, needless abstractions, and weakly supported cleanup that would otherwise drift scope or subtly change behavior.

Core Features & Use Cases

  • Regression-safe, deletion-first cleanup: prioritizes deleting dead code and consolidating duplicates to keep diffs small and behavior stable.
  • Behavior preservation with verification gates: encourages adding or running the narrowest regression tests needed before editing and re-verifying after each cleanup pass.
  • Optional reviewer-only workflow (--review): separates writer changes from reviewer inspection to prevent self-approval of high-impact cleanup without an explicit review step.
  • Scoped file targeting: supports cleaning a bounded set of files (e.g., Ralph sessions) to avoid expanding the cleanup surface unintentionally.

Quick Start

Run the skill on the specified file(s) to remove AI slop while locking behavior with targeted regression tests and keeping the changes focused.

Frequently Asked Questions about ai-slop-cleaner

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

FAQPage Schema
How do I remove AI-generated code slop without changing program behavior?▼

AI code slop removal safely simplifies over-abstracted implementations by enforcing a deletion-first workflow and regression-test verification gates. This ensures behavior remains stable while dead code, duplicated logic, and needless wrappers are eliminated.

What is the best way to clean up dead code and duplicated logic from AI-generated files?▼

The best way to clean dead code and duplicated logic is using a bounded, scoped file targeting approach. This confines the cleanup surface to specified files or session-changed files, preventing unintentional scope drift while consolidating duplicates.

Can I review AI code cleanup changes before they are applied to my codebase?▼

Yes, you can review AI code cleanup changes using an optional reviewer-only workflow mode. This mode separates writer changes from reviewer inspection, outputting a verdict and follow-ups before any writer changes are approved.

How does regression testing protect code during refactoring and wrapper removal?▼

Regression testing protects refactoring by running the narrowest tests needed before editing and re-verifying after each cleanup pass. This verification gate ensures small reversible diffs do not subtly alter intended behavior.

When should I avoid unbounded code cleanup on over-abstracted implementations?▼

You should avoid unbounded code cleanup when weakly tested code lacks regression coverage or when cleanup scope expands unintentionally. Limit removal to scoped file targets to prevent drift and ensure refactoring safety with small reversible diffs.