ai-slop-cleaner

Refactor AI-generated code by removing code smells while preserving behavior.

6|Updated Apr 26, 2026
One-click install
npx skills add https://github.com/Weihong-Liu/GenericAgent_project --skill ai-slop-cleaner-weihong-liu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-slop-cleaner
Source: https://github.com/Weihong-Liu/GenericAgent_project/tree/main/.codex/skills/ai-slop-cleaner
Command: npx skills add https://github.com/Weihong-Liu/GenericAgent_project --skill ai-slop-cleaner-weihong-liu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

The ai-slop-cleaner Skill unit addresses the issue of bloated, noisy, or redundant code generated by AI systems, providing a methodical cleanup and refactoring process to enhance code quality.

Core Features & Use Cases

  • Regression Tests-First Cleanup: Ensures that behavior remains unchanged while cleaning code.
  • Smell-by-Smell Refactoring: Focuses on specific code smells like duplication, dead code, and unnecessary abstraction.
  • Scoped Cleanup: Allows for a precise cleanup of selected files or a broader feature area.
  • Quality Gate Integration: Ensures code quality through tests, linters, and static analysis.

Quick Start

Execute the ai-slop-cleaner skill on your project to begin cleaning code slop with:

run ai-slop-cleaner

Frequently Asked Questions about ai-slop-cleaner

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

FAQPage Schema
How do I clean up AI-generated code without changing its behavior?

AI-generated code cleanup requires a regression tests-first approach to ensure behavior preservation. This skill systematically identifies code smells like duplication and dead code, then refactors them while running tests, linters, and static analysis to verify behavior remains unchanged throughout the process.

What is the best way to refactor redundant abstractions in AI-generated code?

Smell-by-smell refactoring is the best approach for redundant abstractions in AI-generated code. By targeting specific code smells individually—such as unnecessary abstractions, dead code, and duplication—you can methodically clean up bloated code while maintaining strict regression test coverage to preserve original behavior.

Can I run code cleanup on specific files or do I need to process the whole project?

You can perform scoped code cleanup on specific files or broader feature areas rather than processing the whole project. This targeted approach allows precise desloping of AI-generated code sections while maintaining behavior preservation through regression tests and quality gate checks on the selected scope.

How does a quality gate integration work when refactoring AI code?

Quality gate integration for refactoring AI code works by enforcing tests, linters, and static analysis checks throughout the cleanup process. This mechanism ensures that each refactoring step passes code quality standards before proceeding, preventing regressions and systematically removing AI-generated slop while maintaining structural integrity.

When should I use an automated AI code cleanup workflow instead of manual refactoring?

An automated AI code cleanup workflow should be used when dealing with large volumes of AI-generated code containing systematic smells like duplication, dead code, and unnecessary abstraction. Its regression test-first approach ensures behavior preservation, making it ideal for AI development pipelines where manual refactoring would be inefficient.

Do I need existing test coverage before running an anti-slop cleanup on my code?

Yes, existing test coverage is required before running an anti-slop cleanup because the workflow is regression tests-first. These tests verify behavior preservation during smell-by-smell refactoring, ensuring that removing dead code, duplication, and unnecessary abstractions does not alter the original functionality.