agentleFS
SID-SURANGESID-SURANGE/cursor-team-ops/skills/core/deslop/SKILL.md

deslop

Skill0 starsChanged 4 months agoMITView on GitHub

Strip redundant comments, dead variables/imports, and defensive try/catches wrapping trivially safe operations. Triggered by "deslop", "clean this up", "remove dead code", "clean up AI-generated code", "remove noise", "tidy this", "remove unnecessary code", "clean the output", "simplify this", "remove boilerplate".

59 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use verify-this, thermo-nuclear-code-quality-review and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • AnastasiyaWSkill

    verify-this

    Prove a concrete behavior, performance, UI, CLI, API, or memory claim with fresh baseline-versus-treatment evidence and one explicit verdict. Use when asked to verify, prove, compare before and after, show evidence, or confirm that a fix works. Do not use for vague claims such as cleaner code, a full plan-based release verification, or a known bug that needs a red-to-green reproducer.

    Also in 4 projects that use this

  • AnastasiyaWSkill

    thermo-nuclear-code-quality-review

    Run an opt-in strict maintainability review for giant files, spaghetti growth, misplaced logic, weak boundaries, unnecessary abstractions, and missed structural simplifications. Use for a thermonuclear review, harsh code-quality audit, code-judo review, or a file approaching 1000 lines. Do not use as an automatic rewrite mandate or for cosmetic cleanup.

    Also in 3 projects that use this

  • maxvaegaSkill

    dream

    Self-improving memory loop — capture the user's preferences, corrections, and standing rules as project memories; periodically consolidate them (REM pass) and propose improvements to skills and CLAUDE.md. Modes - default, history, queued, rem, proposals, setup. Full loop on Claude Code; capture-only portable mode on Claude Cowork.

    Also in 3 projects that use this

  • Hugging FaceSkill

    simplify

    Refactor code after tests pass. The "Refactor" phase of Red-Green-Refactor.

    Also in 4 projects that use this

  • AWSSkill

    teach

    Teach the user a new skill or concept, within this workspace.

    Also in 5 projects that use this

  • nicodianskSkill

    brainstorm

    Use when starting creative work - creating features, building components, adding functionality, or modifying behavior. Explores requirements through Socratic dialogue before any implementation.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 12 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 58 edited versions we read keep these.

  • 12

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Remove low-value noise from code: comments that narrate what the code already says, unused variables and imports, and try/catch blocks that …

    line 9
  2. Distinctive:

    If the user points at a file or selection, scope to that.

    line 23
  3. Distinctive:

    If no scope given, ask: "Which file or directory should I deslop?"

    line 24
  4. Distinctive:

    Do not deslop the entire repo unsolicited.

    line 25
  5. Distinctive:

    Keep comments that explain *why* (non-obvious intent, trade-offs, constraints, workarounds).

    line 42
  6. Distinctive:

    Keep try/catches that: log the error, transform the exception type, implement real recovery, or wrap genuinely unsafe I/O.

    line 64
  7. Distinctive:

    Remove blocks of code that have been commented out.

    line 67
  8. Distinctive:

    Do not refactor logic, rename variables, or restructure code in a deslop pass.

    line 72
  9. Distinctive:

    If something is ambiguous (e.g.

    line 73
  10. Distinctive:

    Never remove the only comment explaining a non-obvious algorithm or business rule.

    line 94
  11. Distinctive:

    Never remove imports/variables without confirming they're unused (use static analysis or grep first).

    line 95
  12. Distinctive:

    Never change logic — if a cleanup requires a logic decision, stop and ask.

    line 96

“Common” is measured: kept by at least 6 in 10 of the 58 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

🧹 Skill: deslop

Purpose

Remove low-value noise from code: comments that narrate what the code already says, unused variables and imports, and try/catch blocks that add no recovery logic. Makes the codebase easier to read and maintain.

Note: "deslop" is common terminology across the AI-coding ecosystem by 2026, and Cursor's own official cursor-team-kit plugin ships a skill with this same name. This version is scoped-by-default (asks which file/directory rather than sweeping the repo) and never touches logic — see Guardrails below for the exact boundary.

Trigger phrases

  • "deslop"
  • "clean this up"
  • "remove dead code"
  • "strip unnecessary comments"
  • "remove unused imports"

Steps

1. Determine scope

  • If the user points at a file or selection, scope to that.
  • If no scope given, ask: "Which file or directory should I deslop?"
  • Do not deslop the entire repo unsolicited.

2. Scan for slop categories

A. Narrating comments

Comments that restate what the code does with no additional insight:

# Bad — obvious from the code
i = i + 1  # Increment i

# Bad — restates the function name
def get_user(id):
    # Get the user by ID
    return db.query(User, id)

Keep comments that explain why (non-obvious intent, trade-offs, constraints, workarounds).

B. Dead variables and imports

  • Variables assigned but never read.
  • Imports that are never referenced.
  • Function parameters that are accepted but ignored (note: may be interface-required — flag, don't auto-delete).

C. Defensive try/catches with no recovery

# Slop — try/except that only re-raises or swallows silently
try:
    x = int(value)
except:
    pass  # no recovery, no logging

# Also slop — wraps a trivially safe operation
try:
    name = obj.name
except AttributeError:
    name = None  # could just use: name = getattr(obj, 'name', None)

Keep try/catches that: log the error, transform the exception type, implement real recovery, or wrap genuinely unsafe I/O.

D. Commented-out code blocks

  • Remove blocks of code that have been commented out.
  • Exception: leave a comment if the block includes a TODO or a link to an issue explaining why it's disabled.

3. Apply changes

  • Make minimal edits — only remove what's clearly slop.
  • Do not refactor logic, rename variables, or restructure code in a deslop pass.
  • If something is ambiguous (e.g. an import that might be used dynamically), leave it and note it.

4. Report

Deslopped: <filename>

Removed:
- <count> narrating comments
- <count> unused imports: <list>
- <count> dead variables: <list>
- <count> empty/pointless try/catches

Left in place (flagged for review):
- <item> — reason

Output

Cleaned file(s) + a brief removal summary. No behaviour changes — only noise removal.

Guardrails

  • Never remove the only comment explaining a non-obvious algorithm or business rule.
  • Never remove imports/variables without confirming they're unused (use static analysis or grep first).
  • Never change logic — if a cleanup requires a logic decision, stop and ask.

Gotchas

  • Grep-based "unused import" detection is unreliable in dynamic languages — Python re-exports via __all__, JS/TS barrel files, and reflection-based lookups can all reference a symbol without a matching identifier appearing in a text search. Prefer the project's actual linter output when one exists; treat a plain grep as advisory only.
  • A parameter that looks unused may be required by an interface, protocol, or callback signature the file doesn't show — check the call site or interface definition before flagging it as dead.
  • A try/except that looks like a no-op recovery may exist specifically to suppress a known third-party library quirk — if the surrounding code or a comment hints at that, ask rather than strip it.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.