| name | deslop |
| description | Remove AI-generated code slop from current branch |
Remove AI Code Slop
Check the diff against main and remove AI-generated slop introduced in this branch.
Step 1: Get changed files
git diff main --name-only
If an argument was provided, focus only on that file.
Great, now I want you to carefully read over all of the new code you just wrote and other existing code you just modified with "fresh eyes"
Step 2: For each file, compare with original
For each changed file:
- Read the current version
- Get the original from main:
git show main:<filepath>
- Compare style, patterns, and conventions, looking super carefully with "fresh eyes" for any obvious bugs, errors, problems, issues, confusion, etc.
Step 3: Remove slop
Use Edit tool to remove:
Unnecessary comments:
- Comments explaining obvious code (
// increment counter, // return the result)
- Comments that weren't in the original and add no value
- Comments inconsistent with the file's existing style
- Redundant JSDoc/docstrings on simple functions
Defensive over-engineering:
- Try/catch blocks around code that can't throw
- Null checks on values already validated upstream
- Defensive checks in internal/trusted code paths
- Unnecessary
|| [] or ?? {} defaults not present in similar code
Type hacks:
as any or as unknown casts
@ts-ignore / @ts-expect-error without clear reason
! non-null assertions that hide real issues
Style inconsistencies:
- Verbose patterns when the file uses terse style
- Different naming conventions than the rest of the file
- Extra blank lines or formatting differences from original
Over-abstraction:
- Helper functions used only once
- Unnecessary intermediate variables
- Overly generic code for specific use cases
General:
- Carefully fix anything you uncover
Step 4: Report
Output ONLY a 1-3 sentence summary. No bullet points, no file lists, no explanations.
Example: "Removed 4 redundant comments and 2 unnecessary null checks. Simplified error handling in auth.ts."