agentleFS
al3rezal3rez/theo-mode/skills/slop-audit/SKILL.md

slop-audit

Skill2 starsChanged 3 months agoMITView on GitHub

Hunt for slop in a codebase and remove it: useless tests, unnecessary function wrappers, dead abstractions, copy-pasted helpers, comments that restate code. Use when the user says "slop audit", "find slop", "clean up slop", "what can we delete", "this codebase feels bloated", or runs /theo-mode slop.

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. brenbuilds1/skills★ 1same name
    2. limiteinductive/agent-skills★ 1same name
    3. qduc/skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository6 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 7 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Look for these, in rough order of payoff:

    line 17
  2. Very specific:

    Find candidates fast: Use the tools the repo already has: knip or ts-prune for dead exports, coverage output for …

    line 40
  3. Distinctive:

    Verify each deletion is safe: before making it:

    line 44
  4. Distinctive:

    Test: the test either cannot fail or is covered by another test.

    line 46
  5. Distinctive:

    Do not "clean up" style, naming, or formatting.

    line 58
  6. Distinctive:

    Do not delete tests that exercise real behavior just because they are ugly.

    line 60
  7. Distinctive:

    Do not replace a wrapper with a different wrapper.

    line 61
  8. Distinctive:

    Do not touch generated files, vendored code, or migrations.

    line 62

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

Slop Audit

Goal: leave the codebase smaller and no less correct. Deletions are the deliverable. Refactors that add code are out of scope.

What counts as slop

Look for these, in rough order of payoff:

  1. Tests that cannot fail. Tests that assert a mock returns what the mock was told to return. Tests with no assertions. Snapshot tests nobody reads. Tests that duplicate another test with different names.
  2. Pass-through wrappers. function getUser(id) { return db.getUser(id) }. One-call-site helpers whose name is longer than their body. Classes with one method and no state.
  3. Dead code. Exports nothing imports. Feature flags that are always on. Branches for platforms or versions the project no longer supports.
  4. Defensive noise. Null checks on values the type system already guarantees. try/catch that rethrows. Validation of inputs that come from your own code.
  5. Comment slop. Comments that restate the line below. JSDoc on private functions that says @param id the id. TODOs older than the last release.
  6. Abstraction slop. Interfaces with one implementation. Config objects with one caller. Generic utilities used exactly once.

Process

  1. Scope. Count source and test files. If over ~300 files, pick the three directories with the most churn (git log --format= --name-only | sort | uniq -c | sort -rn | head) and audit those first. Say which.
  2. Find candidates fast. Use the tools the repo already has: knip or ts-prune for dead exports, coverage output for untested-but-tested-looking code, grep -rn "return .*(" --include=*.ts for wrappers. Do not read every file top to bottom.
  3. Verify each deletion is safe before making it:
    • Wrapper: every call site can call the wrapped thing directly.
    • Test: the test either cannot fail or is covered by another test. Prove it by temporarily breaking the code under test and watching the test stay green.
    • Dead export: grep the whole repo including configs, scripts, and docs.
  4. Delete in batches of related changes. Run the test suite after each batch, not after each file. Commit each batch with a message that says what was removed and why it was safe.
  5. Report as a table: what was removed, lines deleted, how you proved it was safe. Total lines deleted at the bottom.

Do not

  • Do not "clean up" style, naming, or formatting. That is not slop, that is churn.
  • Do not delete tests that exercise real behavior just because they are ugly.
  • Do not replace a wrapper with a different wrapper.
  • Do not touch generated files, vendored code, or migrations.

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.