agentleFS
NovusEdgeNovusEdge/curt/skills/anti-slop-code/SKILL.md

anti-slop-code

Skill1 starsChanged 34 days agoMITView on GitHub

Audit and trim code itself — narrator comments, defensive boilerplate, dead generality, tests that assert mocks, docstrings that restate the signature. Use for source files; use anti-slop for prose.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. sukirman1901/frontend-expert★ 9same 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 repositoryOne other file it gives its agents.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 8 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    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 rule here is a code-quality rule with a reason.

    line 12
  2. Distinctive:

    Before you commit code you or a model just wrote

    line 20
  3. Very specific:

    Delete vacuous code: if True, x == x, if flag == True, an if/else returning True/False for a value the condition already holds, a branch …

    line 45
  4. Distinctive:

    Write the code the task needs.

    line 48
  5. Very specific:

    Delete a try/except around code that cannot throw.

    line 52
  6. Distinctive:

    Delete a null check on a value that a type or a caller already guarantees.

    line 54
  7. Distinctive:

    No emoji section markers, no badge walls, no title case in headings, unless the repo already does it.

    line 102
  8. Distinctive:

    Delete comments that carry no fact

    line 122
  9. Distinctive:

    Remove a comment that records a constraint, a bug, or an external cause

    line 129
  10. Distinctive:

    Remove error handling at a trust boundary, or around IO that genuinely fails

    line 130

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

anti-slop-code

The prose rules in anti-slop cover text a developer reads. This covers the code and the documentation around it.

Every rule here is a code-quality rule with a reason. None of them detects authorship. Human code carries all of these patterns too, and a rule that fires on "this looks generated" is a rule that fires on clean idiomatic code, on a junior developer's first pass, and on anyone writing English as a second language. Judge the artifact.

When to Use

  • Before you commit code you or a model just wrote
  • Reviewing a large diff, especially one you did not type
  • Writing a README, an API reference, a docstring, or a commit body
  • Cleaning a file that reads padded and you cannot say why

The Rules

Comments

A comment earns its place by carrying a fact the reader cannot get from the code. Delete every comment that fails that test.

See references/comments.md. The short version:

CutKeep
Paraphrase of the line belowThe constraint that forced the shape
// Step 1: // Step 2: narrationThe invariant a reader would break
A docstring restating the signatureThe failure this code already shipped
The story of how you found the answerThe lock order, the null-row count, the limit
Deferral text: "for now", "temporary"A ponytail: marker naming the ceiling
Hedges: "should work", "hopefully"A measured number

Structure

  • Delete vacuous code: if True, x == x, if flag == True, an if/else returning True/False for a value the condition already holds, a branch with the same body on both sides, except E as e: raise e.
  • Write the code the task needs. Extra statements around the same task are the most measurable tell in the literature, and they cost review time forever.
  • Extract a function when logic repeats across files. Re-deriving near-identical logic in a nearby scope is the failure mode, and it reads as thoroughness.
  • Delete a try/except around code that cannot throw. Name the exception you expect and let the rest crash.
  • Delete a null check on a value that a type or a caller already guarantees.
  • One variable per value. Two names holding the same thing is a rename left half-done.
  • Collapse runs of blank lines inside a function body. One blank line separates two ideas; three separate nothing.

Architecture rules that earn their keep: dependencies point one way, IO sits at the edges, errors get translated once at the layer that owns the driver, a constructor does no work, an abstraction waits for its second implementation.

Over-abstraction (an interface with one implementation, a factory for one product, config for a constant that never changes) belongs to the ponytail skill, which already owns that ground. Use it rather than duplicating it here. Those patterns are ordinary over-engineering and predate any model.

See references/structure.md.

Imports and APIs

Resolve every import against the lockfile or the registry before you claim the code runs. An invented package name is the one failure here with no judgment in it: the package exists or it does not.

Same for a method on a library type. Read the signature, then call it.

Tests

  • Write the test before the code. A test written after the code passes because the code runs, bugs included. A test written first defines the behavior the code must satisfy. The order matters: test → red → code → green → refactor.
  • State the expected outcome from the requirement, not from running the code. An assertion built by pasting output encodes today's behavior. A test that went green on the first run never proved anything.
  • A red test is a claim that the code is wrong. Fix the code. Change the test only when you can name why the expectation was wrong, and put that reason in the commit body.
  • Never weaken an assertion to reach green. Loosening == to is not None, widening a tolerance, skipping the case, deleting the case, or catching the exception the test exists to prove: each makes the suite green and the code no more correct.
  • Test behavior at boundaries, not every line. A pure function with no branches needs one test. A function with three branches needs three. A getter needs zero. Coverage measures lines that ran, not bugs that would be caught; a 100% covered codebase with no boundary tests catches nothing.
  • Assert behaviour, not implementation. A test that asserts which internal method was called in which order breaks on a refactor that changed nothing, and passes when the behaviour is wrong. Mock what hits the network, the clock, or the disk, and nothing else.
  • No tautologies. assert True, assert x == x, an expected value produced by calling the code under test.
  • Cover the error path, which is where the bugs are and where a single happy-path test stops.

See references/tests.md.

Documentation

  • A docstring on an exported symbol carries the contract: what it returns, what it raises, what it does not handle. A docstring that restates the signature in English carries nothing.
  • A README says what the thing does, how to run it, and what breaks. A feature tour with a section per capability is marketing.
  • A commit body says what changed and why. The investigation goes nowhere.
  • A PR description says what the diff does. Claiming a change the diff does not contain is the expensive version of this mistake.
  • No emoji section markers, no badge walls, no title case in headings, unless the repo already does it. Match the file you are in.

See references/docs.md.

Checking

# comments and docstrings, extracted from source
python3 tools/lint.py --code src/

# structural checks that need a parse
python3 tools/ast_check.py src/

The linter reports what a regex can see. Everything above it needs a reader.

Boundaries

Will:

  • Delete comments that carry no fact
  • Cut defensive code around paths that cannot fail
  • Rewrite tests that assert implementation into tests that assert behaviour
  • Strip feature-tour prose from a README

Will not:

  • Claim a file was machine-written
  • Remove a comment that records a constraint, a bug, or an external cause
  • Remove error handling at a trust boundary, or around IO that genuinely fails
  • Flatten a complex solution to a genuinely complex problem
  • Impose its own house style on a repo that already has one
<!-- anti-slop: ignore-file (this file quotes the banned patterns) -->

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.