From deslop
Use when cleaning up AI-generated code slop — removes stale comments, delegates to code-simplifier, and proposes identifier renames with user approval
How this skill is triggered — by the user, by Claude, or both
Slash command
/deslop:deslopThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Deslop cleans up AI-generated code in 3 phases:
Deslop cleans up AI-generated code in 3 phases:
code-simplifier subagentBefore starting, you need a file list and phase selection. These come from the /deslop command's argument parsing. If invoked directly (not via command), ask the user what files to target and default to git diff.
Remove slop comments automatically. No user approval needed — these are unambiguously bad.
Read references/comment-patterns.md for the complete pattern catalog.
Collect target files. Use the file list from the command. Filter to only text/code files (skip images, binaries, lock files).
Scan each file. Read the file contents. Identify comments matching the three categories from the reference:
Remove identified comments. Use the Edit tool to remove each identified comment. When removing a comment:
Track removals. Keep a running count per file, per category.
Output the summary. After processing all files, output a summary table:
Phase 1: Comment Cleanup
src/auth.ts — removed 4 comments (2 obvious, 1 commented-out, 1 marker)
src/utils.ts — removed 2 comments (2 obvious)
Total: 6 comments removed across 2 files
If no comments were found, output:
Phase 1: Comment Cleanup
No slop comments found. Code is clean.
// eslint-disable or @ts-ignore that have an explanation after them// HACK, // FIXME, or // XXX — flag them in the summary as "needs review" but leave them in place. The user can decide.Delegate to the official code-simplifier subagent. This handles redundancy elimination, readability improvements, modernization, and structural improvements.
Launch code-simplifier. Use the Task tool to dispatch a subagent:
subagent_type: Use the general-purpose agent typeWait for completion. The subagent will make edits directly.
Report results. After the subagent completes, output:
Phase 2: Code Simplification
[Summary of what the code-simplifier changed]
If the subagent found nothing to simplify:
Phase 2: Code Simplification
No simplification opportunities found.
Analyze code for verbose identifiers and trivial wrappers, then propose changes for user approval.
Scan for verbose identifiers. Read each target file and identify:
handleUserAuthenticationProcess → authenticateisCurrentlyLoadingData → isLoadinggetAllUserDataFromDatabase → getUsersperformDataValidationCheck → validateuserData.userEmail → userData.emailconfigSettings.settingsTimeout → configSettings.timeouterrorHandler.handleError → errorHandler.handleuserArray → usersnameString → nameisActiveBoolean → isActiveresultData → resultScan for trivial wrappers. Identify functions that:
function getUser(id) { return userService.get(id); } — inline the callScan for unnecessary abstractions. Identify:
Build proposal list. For each finding, create a proposal with:
Present to user. Use AskUserQuestion with multiSelect: true:
question: "Phase 3 found these rename and inline opportunities. Select which to apply:"
options:
- label: "authenticateUser → authenticate"
description: "src/auth.ts:42 — name is redundant in AuthService context"
- label: "Inline getUser wrapper"
description: "src/services.ts:15 — trivial wrapper around userRepo.find()"
- label: "userData.userEmail → userData.email"
description: "src/profile.ts:28 — redundant 'user' prefix"
AskUserQuestion supports max 4 options. If there are more than 4 proposals, batch them into multiple questions grouped by type (renames first, then inlines, then abstractions).
Apply selected changes. For each user-approved proposal:
replace_all: true for renames (to catch all occurrences)Output summary.
Phase 3: Rename & Inline
Applied 3 of 5 proposals:
✓ authenticateUser → authenticate (src/auth.ts, 4 occurrences)
✓ Inlined getUser wrapper (src/services.ts, removed wrapper + 2 call sites updated)
✓ userData.userEmail → userData.email (src/profile.ts, 1 occurrence)
✗ Skipped: isLoading rename (user declined)
✗ Skipped: resultData rename (user declined)
replace_all: true to catch every occurrence in the file. Also search other files in the target set for cross-file references.After all phases complete (or whichever phases were selected), output a final summary:
Deslop complete.
Phase 1: N comments removed across M files
Phase 2: [code-simplifier summary]
Phase 3: N of M proposals applied
npx claudepluginhub michellemayes/vibe-tooling --plugin deslopFinds and removes AI-generated slop including useless comments, verbose patterns, and unnecessary abstractions from code. Useful for cleaning AI-assisted codebases.
Detects and removes AI-generated code slop including unnecessary comments, over-engineering, verbose error handling, premature abstractions, and documentation bloat. Cleans code to senior engineer standards.
Cleans AI-generated code by systematically removing LLM smells like dead code, over-commenting, verbose naming while preserving exact behavior via tests. Use after generation or on 'clean up', 'deslop' requests.