agentleFS
tejastn10tejastn10/workbench/skills/quality/deslopify/SKILL.md

deslopify

Skill1 starsChanged 2 months agoMITView on GitHub

Strip AI slop from code an agent just wrote — comments that restate the code, defensive branches for cases that can't happen, abstractions with one implementation, commented-out code, verbose docstrings on obvious functions. A diff-only pass that only ever removes or simplifies, never adds, so it can't introduce slop itself. Run after any agent session that touched code, before committing. Use when asked to "deslopify", "clean this up", "remove the slop", or as the last step before a commit.

9 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use caveman and grill-me.

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.
  • MicrosoftSkill

    caveman

    Ultra-compressed response style that reduces output token count while preserving technical accuracy, with intensity levels and auto-clarity safety rules

    Also in 3 projects that use this

  • GoogleSkill

    grill-me

    A relentless interview to sharpen a plan or design.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every edit in this pass removes or shortens.

    line 14
  2. Distinctive:

    Delete. Keep a comment only if it explains *why*, records a non-obvious constraint, or warns about a footgun.

    line 29
  3. Distinctive:

    Remove the guard. If the "impossible" case is actually reachable, that's a real bug — flag it, don't silently keep the guard.

    line 40
  4. Very specific:

    Delete it. Git remembers. No "kept for reference", no // old: blocks.

    line 55
  5. Very specific:

    Test names and it(...) strings that restate the assertion verbatim.

    line 81
  6. Distinctive:

    If removing a guard breaks a test, decide: was the test asserting slop, or is the case real?

    line 99

“Common” is measured: kept by at least 6 in 10 of the 9 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

Deslopify

Agents pad. They narrate what the next line does, guard against inputs the type system already rules out, wrap one function in an interface "for testability", and leave the old version commented above the new one. This pass removes that.

Hard rule: subtractive only

Every edit in this pass removes or shortens. No new code, no new comments, no new abstractions, no renames, no behaviour changes. If a fix would add anything, it's out of scope for deslopify — note it and move on. This constraint is what keeps the pass from becoming another slop generator.

Work only from the diff of the session being cleaned (git diff, or the diff against the branch point). Don't audit pre-existing code — that's not this pass.

What to cut

1. Comments that restate the code

// increment the counter
counter++

Delete. Keep a comment only if it explains why, records a non-obvious constraint, or warns about a footgun. When unsure, the test is: does the comment survive the reader also reading the line below it?

2. Defensive code for cases that can't happen

  • Null/undefined checks on a value the type guarantees is present.
  • default: branches on an exhaustive switch over a closed union.
  • try/catch around code that doesn't throw.
  • Re-validating an argument a caller one line up already validated.
  • if (!Array.isArray(x)) on a parameter typed T[].

Remove the guard. If the "impossible" case is actually reachable, that's a real bug — flag it, don't silently keep the guard.

3. Abstractions with one implementation

  • An interface / Protocol / abstract class with exactly one implementer and no test double that needs it.
  • A config object / options bag passed one value.
  • A factory that constructs one type.
  • A wrapper function that only forwards its arguments.
  • A single-caller helper that's used once, three lines long, and named worse than the code it replaces.

Inline it back to the concrete thing.

4. Commented-out code

Delete it. Git remembers. No "kept for reference", no // old: blocks.

5. Verbose docstrings on obvious functions

def get_user_name(user):
    """
    Get the name of the user.

    Args:
        user: The user to get the name of.

    Returns:
        The name of the user.
    """
    return user.name

Cut to one line, or delete if the signature already says everything. Keep docstrings that document units, edge-case behaviour, raised exceptions, or non-obvious contracts.

6. Other tells

  • Redundant type annotations a good inferrer doesn't need (const x: number = 5).
  • console.log / print / logger.debug left from the session.
  • Ceremonial blank lines and section-divider comments (// ---- helpers ----) inside a short file.
  • TODO / FIXME with no ticket and no owner that the session itself added.
  • Test names and it(...) strings that restate the assertion verbatim.
  • Over-split functions: a function called once, whose body would read fine inlined.

What to leave alone

  • Anything outside the session diff.
  • Comments explaining why, TODOs that predate the session, domain-specific guards, docstrings carrying real contract detail.
  • Style a formatter/linter owns — that's not slop, that's config.
  • Genuine simplifications that require adding code (extract, dedupe, refactor) — those belong in a separate /simplify pass, not here.

Process

  1. Get the session diff. List the changed files.
  2. Walk each hunk against the six categories above.
  3. Apply only subtractive edits.
  4. Re-run the tests / typecheck / lint — a deslopify pass must leave them green. If removing a guard breaks a test, decide: was the test asserting slop, or is the case real? Real → revert and flag as a bug. Slop → the test goes too.
  5. Report: what was cut (grouped by category), and anything you flagged as a real bug or a follow-up /simplify.

Anti-patterns for the agent running this

  • ❌ Adding a comment, a rename, or a refactor "while you're in there".
  • ❌ Touching code the session didn't.
  • ❌ Removing a guard for a case that's actually reachable.
  • ❌ Deleting a why comment because it looks like a what comment — read it.
  • ❌ Turning this into a general code review. One job: cut what the session padded.

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.