Agent skill · software engineering · code-yeongyu

remove-ai-slops

Removes AI-generated code smells from branch changes or an explicit file list behind regression tests, including junk tests (prose pins, source greps, copied inventories, mock echoes), each proven by its class's rule before a cut. Use when the user asks to clean up, deslop, remove AI-slop patterns, or prune tests from recent changes.

Why this skill is useful

Adds a comprehensive automated cleanup script for AI-generated code smells that includes regression testing and quality verification, which the AI cannot generate on its own.

What it needs

Requires black, flake8, pytest installed locally. About 12k tokens when loaded. Last updated 2026-08-07. 67,387 stars on the source repository.

What this skill does

Remove AI Slops Skill Inputs Default scope: branch diff vs merge-base main (no arguments needed) Optional scope: explicit file list passed by the caller (e.g., a Ralph workflow's changed-files set) What this skill does Cleans AI-generated slop from a bounded set of changed files while strictly preserving behavior. Locks behavior with regression tests first, then runs a categorized multi-pass cleanup, then verifies with quality gates and a critical review. Reverts and direct-edits when verification fails. The core safety invariant: behavior is locked by green tests before a single line is removed. A checklist alone is not safety; a passing regression test is. --- Categories (what counts as slop) The agent looks for these ten categories. The first three are stylistic, the next three are structural, the next two are about hidden cost, the ninth is tests, and the last is size. Stylistic 1. Obvious comments — comments restating code, trivial docstrings, section dividers, commented-out code, vague TODOs/Notes. KEEP: comments explaining WHY (business logic, edge cases, workarounds), ticket links, regex/algorithm explanations. KEEP: BDD markers (# given, # when, # then, # when/then). 2. Over-defensive code — null checks for guaranteed values, try/except around code that cannot raise, isinstance checks for statically typed params, default values for required params, backward-compat shims, redundant validation duplicated at multiple layers, broad exception catching (except Exception/except BaseException in Python, empty catch {} or catch (e) { console.error(e) } without narrowing in TypeScript/JavaScript). KEEP: validation at system boundaries (user input, external APIs), I/O error handling, nullable DB fields. Top-level boundary catch-all (CLI main(), HTTP handler) with explicit logging + re-raise is acceptable. REFACTOR: except Exception → catch the specific exception you expect. Empty catch {} → add instanceof narrowing or re-throw. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills code-yeongyu/remove-ai-slops

View the source on GitHub

Browse the @skills marketplace