AI Slop Cleaner Skill
Reduce AI-generated slop with a regression-tests-first, smell-by-smell cleanup workflow that preserves behavior and raises signal quality.
When to Use
Use this skill when:
- A code path works but feels bloated, noisy, repetitive, or over-abstracted
- A user asks to “cleanup”, “refactor”, or “deslop” AI-generated output
- Follow-up implementation left duplicate code, dead code, weak boundaries, missing tests, or unnecessary wrapper layers
- You need a disciplined cleanup workflow without broad rewrites
GPT-5.4 Guidance Alignment
- Keep outputs concise and evidence-dense unless risk or the user requests more detail.
- Treat newer user instructions as local workflow updates without discarding earlier non-conflicting constraints.
- Keep using inspection, tests, diagnostics, and verification until the cleanup is grounded.
- Proceed automatically through clear, reversible cleanup steps; ask only when a choice materially changes scope or behavior.
Procedure
Lock behavior with regression tests first
- Identify the behavior that must not change
- Add or run targeted regression tests before editing cleanup candidates
- If behavior is currently untested, create the narrowest test coverage needed first
Create a cleanup plan before code
- List the specific smells to remove
- Bound the pass to the requested files/scope
- Order fixes from safest/highest-signal to riskiest
- Do not start coding until the cleanup plan is explicit
Categorize issues before editing
- Duplication — repeated logic, copy-paste branches, redundant helpers
- Dead code — unused code, unreachable branches, stale flags, debug leftovers
- Needless abstraction — pass-through wrappers, speculative indirection, single-use helper layers
- Boundary violations — hidden coupling, leaky responsibilities, wrong-layer imports or side effects
- Missing tests — behavior not locked, weak regression coverage, gaps around edge cases
Execute passes one smell at a time
- Pass 1: Dead code deletion
- Pass 2: Duplicate removal
- Pass 3: Naming/error handling cleanup
- Pass 4: Test reinforcement
- Re-run targeted verification after each pass
- Avoid bundling unrelated refactors into the same edit set
Run quality gates
- Regression tests stay green
- Lint passes
- Typecheck passes
- Relevant unit/integration tests pass
- Static/security scan passes when available
- Diff stays minimal and scoped
- No new abstractions or dependencies unless explicitly required
Finish with an evidence-dense report
- Changed files
- Simplifications made
- Tests/diagnostics/build checks run
- Remaining risks
- Residual follow-ups or consciously deferred cleanup
Output Format
AI SLOP CLEANUP REPORT
======================
Scope: [files or feature area]
Behavior Lock: [targeted regression tests added/run]
Cleanup Plan: [bounded smells and order]
Passes Completed:
1. Pass 1: Dead code deletion - [concise fix]
2. Pass 2: Duplicate removal - [concise fix]
3. Pass 3: Naming/error handling cleanup - [concise fix]
4. Pass 4: Test reinforcement - [concise fix]
Quality Gates:
- Regression tests: PASS/FAIL
- Lint: PASS/FAIL
- Typecheck: PASS/FAIL
- Tests: PASS/FAIL
- Static/security scan: PASS/FAIL or N/A
Changed Files:
- [path] - [simplification]
Remaining Risks:
- [none or short deferred item]
Scenario Examples
Good: The user says continue after tests already lock behavior and the next smell pass is clear. Continue with the next bounded cleanup pass.
Good: The user narrows the scope to a specific file after planning. Keep the regression-tests-first workflow, but apply the new scope locally.
Bad: Start rewriting architecture before protecting behavior with tests.
Bad: Collapse multiple smell categories into one large refactor with no intermediate verification.
1---2name: ai-slop-cleaner3description: Run an anti-slop cleanup/refactor/deslop workflow4---56# AI Slop Cleaner Skill78Reduce AI-generated slop with a regression-tests-first, smell-by-smell cleanup workflow that preserves behavior and raises signal quality.910## When to Use1112Use this skill when:13- A code path works but feels bloated, noisy, repetitive, or over-abstracted14- A user asks to “cleanup”, “refactor”, or “deslop” AI-generated output15- Follow-up implementation left duplicate code, dead code, weak boundaries, missing tests, or unnecessary wrapper layers16- You need a disciplined cleanup workflow without broad rewrites1718## GPT-5.4 Guidance Alignment1920- Keep outputs concise and evidence-dense unless risk or the user requests more detail.21- Treat newer user instructions as local workflow updates without discarding earlier non-conflicting constraints.22- Keep using inspection, tests, diagnostics, and verification until the cleanup is grounded.23- Proceed automatically through clear, reversible cleanup steps; ask only when a choice materially changes scope or behavior.2425## Procedure26271. **Lock behavior with regression tests first**28 - Identify the behavior that must not change29 - Add or run targeted regression tests before editing cleanup candidates30 - If behavior is currently untested, create the narrowest test coverage needed first31322. **Create a cleanup plan before code**33 - List the specific smells to remove34 - Bound the pass to the requested files/scope35 - Order fixes from safest/highest-signal to riskiest36 - Do not start coding until the cleanup plan is explicit37383. **Categorize issues before editing**39 - **Duplication** — repeated logic, copy-paste branches, redundant helpers40 - **Dead code** — unused code, unreachable branches, stale flags, debug leftovers41 - **Needless abstraction** — pass-through wrappers, speculative indirection, single-use helper layers42 - **Boundary violations** — hidden coupling, leaky responsibilities, wrong-layer imports or side effects43 - **Missing tests** — behavior not locked, weak regression coverage, gaps around edge cases44454. **Execute passes one smell at a time**46 - **Pass 1: Dead code deletion**47 - **Pass 2: Duplicate removal**48 - **Pass 3: Naming/error handling cleanup**49 - **Pass 4: Test reinforcement**50 - Re-run targeted verification after each pass51 - Avoid bundling unrelated refactors into the same edit set52535. **Run quality gates**54 - Regression tests stay green55 - Lint passes56 - Typecheck passes57 - Relevant unit/integration tests pass58 - Static/security scan passes when available59 - Diff stays minimal and scoped60 - No new abstractions or dependencies unless explicitly required61626. **Finish with an evidence-dense report**63 - Changed files64 - Simplifications made65 - Tests/diagnostics/build checks run66 - Remaining risks67 - Residual follow-ups or consciously deferred cleanup6869## Output Format7071```text72AI SLOP CLEANUP REPORT73======================7475Scope: [files or feature area]76Behavior Lock: [targeted regression tests added/run]77Cleanup Plan: [bounded smells and order]7879Passes Completed:801. Pass 1: Dead code deletion - [concise fix]812. Pass 2: Duplicate removal - [concise fix]823. Pass 3: Naming/error handling cleanup - [concise fix]834. Pass 4: Test reinforcement - [concise fix]8485Quality Gates:86- Regression tests: PASS/FAIL87- Lint: PASS/FAIL88- Typecheck: PASS/FAIL89- Tests: PASS/FAIL90- Static/security scan: PASS/FAIL or N/A9192Changed Files:93- [path] - [simplification]9495Remaining Risks:96- [none or short deferred item]97```9899## Scenario Examples100101**Good:** The user says `continue` after tests already lock behavior and the next smell pass is clear. Continue with the next bounded cleanup pass.102103**Good:** The user narrows the scope to a specific file after planning. Keep the regression-tests-first workflow, but apply the new scope locally.104105**Bad:** Start rewriting architecture before protecting behavior with tests.106107**Bad:** Collapse multiple smell categories into one large refactor with no intermediate verification.