skills/slop-cleaner/SKILL.md
Clean AI-generated code slop with a regression-safe, deletion-first workflow
npx skillsauth add Cheggin/skill-chain slop-cleanerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill to clean AI-generated code slop without drifting scope or changing intended behavior. This is the bounded cleanup workflow for code that works but contains dead code, duplication, needless abstraction, boundary violations, weak tests, or unnecessary dependencies.
--review flag for report-only modeDetermine the cleanup surface. Use one of:
git diff --name-only HEAD~N for recent changesgit diff --name-only main..HEAD for branch changesDo NOT silently expand scope beyond the identified files.
Read each file and classify code into smell categories:
| Smell | Description | Priority | |-------|-------------|----------| | Dead code | Unused functions, unreachable branches, stale flags, commented-out blocks | 1 (safest to remove) | | Duplication | Copy-pasted logic, repeated helpers, near-identical functions | 2 | | Needless abstraction | Pass-through wrappers, single-use helpers, premature generalization | 3 | | Boundary violations | Hidden coupling, wrong-layer imports, leaking side effects | 4 | | Weak tests | Assert nothing meaningful, mock everything, snapshot-only | 5 | | Unnecessary dependencies | Trivial package usage, stdlib duplicates | 6 |
Before editing any code:
bun test or project-specific test commandFirst pass — safest changes:
Run tests after this pass.
Second pass:
Run tests after this pass.
Third pass — riskier changes:
Run tests after this pass.
Full test suite verification:
Produce a structured report:
## Slop Cleaner Report
### Summary
- Files scanned: N
- Files modified: N
- Lines deleted: N
- Lines added: N
- Net delta: -N lines
### Changes by Smell Type
- Dead code: N removals
- Duplication: N consolidations
- Needless abstraction: N simplifications
### Test Verification
- Before: N tests passing
- After: N tests passing
- Regressions: none
### Remaining Risks
- [Any smells skipped due to uncertainty]
- [Any files that need human review]
These are explicit failures of the slop cleaning process. Avoid them:
Bundling unrelated refactors — Each pass targets one smell type. Do not mix dead code removal with naming changes with structural refactors in the same commit.
Adding new abstractions while removing old ones — The goal is net reduction in abstraction. Replacing one wrapper with a different wrapper is not cleanup, it is churn.
Skipping test verification — Every pass must be bookended by test runs. No exceptions. If you cannot run tests, switch to --review mode and report only.
Expanding scope without permission — If the caller specified files A, B, C, clean only A, B, C. Do not "while I'm here" into files D and E.
Refactoring when deletion suffices — If code is unused, delete it. Do not refactor unused code into "better" unused code.
Creating new files during cleanup — Cleanup reduces files, it does not add them. If you find yourself creating a new utility file to "consolidate," you are adding abstraction, not removing it.
When invoked with --review, execute Steps 1-2 only. Produce a findings report without modifying any files:
## Slop Review Findings
### [filename]
- Line N-M: [smell type] — [description]
- Confidence: high/medium/low
- Recommended action: [delete/consolidate/inline/skip]
Review mode is for pre-merge audits and when you want a human to approve changes before execution.
development
Design engineering principles for making interfaces feel polished. Use when building UI components, reviewing frontend code, implementing animations, hover states, shadows, borders, typography, micro-interactions, enter/exit animations, or any visual detail work. Triggers on UI polish, design details, "make it feel better", "feels off", stagger animations, border radius, optical alignment, font smoothing, tabular numbers, image outlines, box shadows.
documentation
Agentic memory system for writers - track characters, relationships, scenes, and themes
documentation
LLM Wiki — persistent markdown knowledge base that compounds across sessions (Karpathy model)
development
Build production-quality SaaS websites with opinionated design presets. Use when creating any startup website. The user MUST pick a design style before building. Enforces shadcn/ui, Figma design principles, specific CSS values per style, and anti-AI-writing. Load alongside anti-ai-writing skill. LIGHT MODE ONLY.