About deslop
deslop is a Skill for removing unnecessary AI-generated code from a change. It is intended for development workflows reviewing diffs, focusing on abnormal defensive code, broad type escapes, excessive nesting, and speculative abstractions while preserving behavior and running checks.
Key features
- 01Reviews the current change diff
- 02Removes unnecessary defensive checks and fallbacks
- 03Cleans up broad type escapes
- 04Simplifies nesting with early returns
- 05Removes abstractions without a real need
Use cases
- 01Reviewing AI-generated code changes
- 02Trimming unnecessary casts and suppression comments
- 03Reducing excessive defensive logic in a diff
- 04Running type checks and tests after edits
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ riffingonsoftware/ agent-skills --skill deslopAfter installing, type/deslopin Claude Code to confirm it loaded.
Bundled filesLICENSE
Details
From the project READMERemove AI code slop
Remove AI-generated slop introduced in the change. Use the caller's diff, or otherwise the diff against the base branch, including staged, unstaged, and untracked files. Finish when you have removed each focus-area instance in the change or kept it because a guardrail requires it.
Focus areas
- Defensive checks, try/catch blocks, or fallback defaults that are abnormal for trusted code paths or hide failures
- Casts to
any(or similar language-specific overly broad type) used only to bypass type issues, and subtler dodges that do the same (as unknown as T, suppression comments) - Deeply nested code that should be simplified with early returns
- Speculative generality: an interface with one implementation, an option nobody sets, a parameter always passed the same value, a wrapper that only forwards
- A second name for something the codebase already names
Guardrails
- Keep behavior unchanged unless fixing a clear bug.
- Remove a guard only when it is provably redundant or removing it fixes a bug. Keep validation at trust boundaries and error handling that prevents data loss.
- Prefer minimal, focused edits over broad rewrites.
- Run the project's type check and tests after editing.
- Keep the final summary concise (1-3 sentences).
Comments
Markdown supported