/deslop:deslop-codefrom deslop
Cleans up dead code and unnecessary abstractions in drive-by fixes. Applies Ousterhout's deep-module philosophy to collapse shallow layers and reduce cognitive hops.
Ships in deslop. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
There are a few great levers when cleaning up code:
Be aggressive when deleting code; question the user if things are ok to delete but perhaps aren't covered in E2E tests or (formal) specifications (may be a missing edge case). Consult git history, trace storage, issue tracking, slack, etc. to autonomously come to a conclusion autonomously if you can; only refer to the human if you can't be sure.
Think in terms of John Ousterhout's "A Philosophy of Software Design"; specifically, in optimizing for deep modules over shallow ones. You want narrow interfaces which provide deep functionality.
These sort of changes work best as no-op cleanup commits or PRs. Do not mix behavior changes with them if at all possible. You are trying to set up some "drive-by fixes" that leave the code better than you found it.
It's best to write code like this from the start, but often coding changes leave room for consolidation; imagine a callstack that looks like:
handle_checkout() # A
-> create_order() # B'
-> insert_order() # C
where, in the process of feature work, B' has been modified.
This is a great opportunity to look at A & C and consider whether those abstractions are shallow. Some rules of thumb:
Once you refactor, you can repeat this process recursively (collapsing adjacent shallow layers of abstraction to form deeper modules).
Example of a great diff:
def run(args):
- return f(args)
-
-def f(args):
a, b = unpack(args)
return g(a, b)
def g(a, b):
# do something
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
code-cleanup, refactoring, dead-code, abstraction-review, drive-by-fix
Other plugins' skills for the same job
5 skills in this plugin
npx claudepluginhub devdotfast/skills --plugin deslop