Clean AI-generated code slop with a regression-safe, deletion-first workflow and optional reviewer-only mode
Add this skill
npx mdskills install Yeachan-Heo/ai-slop-cleanerRegression-safe cleanup workflow with bounded scope, multi-pass smell classification, and writer/reviewer separation
1---2name: ai-slop-cleaner3description: Clean AI-generated code slop with a regression-safe, deletion-first workflow and optional reviewer-only mode4level: 35---67# AI Slop Cleaner89Use this skill to clean AI-generated code slop without drifting scope or changing intended behavior. In OMC, this is the bounded cleanup workflow for code that works but feels bloated, repetitive, weakly tested, or over-abstracted.1011## When to Use1213Use this skill when:14- the user explicitly says `deslop`, `anti-slop`, or `AI slop`15- the request is to clean up or refactor code that feels noisy, repetitive, or overly abstract16- follow-up implementation left duplicate logic, dead code, wrapper layers, boundary leaks, or weak regression coverage17- the user wants a reviewer-only anti-slop pass via `--review`18- the goal is simplification and cleanup, not new feature delivery1920## When Not to Use2122Do not use this skill when:23- the task is mainly a new feature build or product change24- the user wants a broad redesign instead of an incremental cleanup pass25- the request is a generic refactor with no simplification or anti-slop intent26- behavior is too unclear to protect with tests or a concrete verification plan2728## OMC Execution Posture2930- Preserve behavior unless the user explicitly asks for behavior changes.31- Lock behavior with focused regression tests first whenever practical.32- Write a cleanup plan before editing code.33- Prefer deletion over addition.34- Reuse existing utilities and patterns before introducing new ones.35- Avoid new dependencies unless the user explicitly requests them.36- Keep diffs small, reversible, and smell-focused.37- Stay concise and evidence-dense: inspect, edit, verify, and report.38- Treat new user instructions as local scope updates without dropping earlier non-conflicting constraints.3940## Scoped File-List Usage4142This skill can be bounded to an explicit file list or changed-file scope when the caller already knows the safe cleanup surface.4344- Good fit: `oh-my-claudecode:ai-slop-cleaner skills/ralph/SKILL.md skills/ai-slop-cleaner/SKILL.md`45- Good fit: a Ralph session handing off only the files changed in that session46- Preserve the same regression-safe workflow even when the scope is a short file list47- Do not silently expand a changed-file scope into broader cleanup work unless the user explicitly asks for it4849## Ralph Integration5051Ralph can invoke this skill as a bounded post-review cleanup pass.5253- In that workflow, the cleaner runs in standard mode (not `--review`)54- The cleanup scope is the Ralph session's changed files only55- After the cleanup pass, Ralph re-runs regression verification before completion56- `--review` remains the reviewer-only follow-up mode, not the default Ralph integration path5758## Review Mode (`--review`)5960`--review` is a reviewer-only pass after cleanup work is drafted. It exists to preserve explicit writer/reviewer separation for anti-slop work.6162- **Writer pass**: make the cleanup changes with behavior locked by tests.63- **Reviewer pass**: inspect the cleanup plan, changed files, and verification evidence.64- The same pass must not both write and self-approve high-impact cleanup without a separate review step.6566In review mode:671. Do **not** start by editing files.682. Review the cleanup plan, changed files, and regression coverage.693. Check specifically for:70 - leftover dead code or unused exports71 - duplicate logic that should have been consolidated72 - needless wrappers or abstractions that still blur boundaries73 - missing tests or weak verification for preserved behavior74 - cleanup that appears to have changed behavior without intent754. Produce a reviewer verdict with required follow-ups.765. Hand needed changes back to a separate writer pass instead of fixing and approving in one step.7778## Workflow79801. **Protect current behavior first**81 - Identify what must stay the same.82 - Add or run the narrowest regression tests needed before editing.83 - If tests cannot come first, record the verification plan explicitly before touching code.84852. **Write a cleanup plan before code**86 - Bound the pass to the requested files or feature area.87 - List the concrete smells to remove.88 - Order the work from safest deletion to riskier consolidation.89903. **Classify the slop before editing**91 - **Duplication** — repeated logic, copy-paste branches, redundant helpers92 - **Dead code** — unused code, unreachable branches, stale flags, debug leftovers93 - **Needless abstraction** — pass-through wrappers, speculative indirection, single-use helper layers94 - **Boundary violations** — hidden coupling, misplaced responsibilities, wrong-layer imports or side effects95 - **Missing tests** — behavior not locked, weak regression coverage, edge-case gaps96974. **Run one smell-focused pass at a time**98 - **Pass 1: Dead code deletion**99 - **Pass 2: Duplicate removal**100 - **Pass 3: Naming and error-handling cleanup**101 - **Pass 4: Test reinforcement**102 - Re-run targeted verification after each pass.103 - Do not bundle unrelated refactors into the same edit set.1041055. **Run the quality gates**106 - Keep regression tests green.107 - Run the relevant lint, typecheck, and unit/integration tests for the touched area.108 - Run existing static or security checks when available.109 - If a gate fails, fix the issue or back out the risky cleanup instead of forcing it through.1101116. **Close with an evidence-dense report**112 Always report:113 - **Changed files**114 - **Simplifications**115 - **Behavior lock / verification run**116 - **Remaining risks**117118## Usage119120- `/oh-my-claudecode:ai-slop-cleaner <target>`121- `/oh-my-claudecode:ai-slop-cleaner <target> --review`122- `/oh-my-claudecode:ai-slop-cleaner <file-a> <file-b> <file-c>`123- From Ralph: run the cleaner on the Ralph session's changed files only, then return to Ralph for post-cleanup regression verification124125## Good Fits126127**Good:** `deslop this module: too many wrappers, duplicate helpers, and dead code`128129**Good:** `cleanup the AI slop in src/auth and tighten boundaries without changing behavior`130131**Bad:** `refactor auth to support SSO`132133**Bad:** `clean up formatting`134
Full transparency — inspect the skill content before installing.