agentleFS
rafaelobrafaelob/pragmatic-agent-skills/skills/kill-slop/SKILL.md

kill-slop

Skill23 starsChanged 57 days agoApache-2.0View on GitHub

Use when code or a diff has unneeded files, dependencies, abstractions (factory of factory) or dead code. Strip them; keep the behavior. Not a PR review -> code-review. Not renames or moves -> legacy-code-change.

2 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. About 0 are common, 17 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈17

    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:

    NEVER create a file unless the task clearly needs it or a navigability split below applies

    line 45
  2. Distinctive:

    NEVER refactor unrelated code "while you're here"

    line 46
  3. Distinctive:

    NEVER add comments that restate what the code already says

    line 47
  4. Distinctive:

    NEVER expand scope beyond the user's request

    line 48
  5. Distinctive:

    NEVER invent TODOs, stubs, or "for later" scaffolding

    line 49
  6. Distinctive:

    NEVER search or list outside the workspace root unless the user explicitly asks.

    line 50
  7. Distinctive:

    NEVER invent Clean Architecture / SOLID folder trees unless the repo already uses that layout

    line 51
  8. Distinctive:

    MUST match existing project patterns before inventing new ones

    line 52
  9. Distinctive:

    MUST prefer editing an existing file over adding a new one

    line 53
  10. Distinctive:

    MUST delete dead code you introduce.

    line 54
  11. Very specific:

    Run the finder from the project's declared dev dependencies and manager (uv run, npm run/pnpm exec).

    line 62
  12. Very specific:

    Check before deleting: dynamic dispatch/reflection (getattr, registries, plugin entry points), CLI/HTTP route registration, pytest …

    line 63
  13. Distinctive:

    Delete in small commits, each carrying the finder output plus the tests as evidence.

    line 64
  14. Distinctive:

    Default to minimal. If the user explicitly asks for more structure, obey that request.

    line 69
  15. Distinctive:

    Do not override an explicit ask in the name of kill-slop.

    line 71
  16. Distinctive:

    If only (2) is true, do not split.

    line 83
  17. Distinctive:

    Before writing, name the goal (one sentence), the touch list (files the asked result actually needs) and what you will not do.

    line 87
  18. Distinctive:

    Prefer boring, readable code over cleverness

    line 100
  19. Distinctive:

    When summarizing, say what you changed and what you deliberately did not change.

    line 107

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

Kill slop

Force a minimal, merge-ready diff. Prefer the smallest change that fully solves the stated task.

Hard rules

  • NEVER create a file unless the task clearly needs it or a navigability split below applies
  • NEVER refactor unrelated code "while you're here"
  • NEVER add comments that restate what the code already says
  • NEVER expand scope beyond the user's request
  • NEVER invent TODOs, stubs, or "for later" scaffolding
  • NEVER search or list outside the workspace root unless the user explicitly asks; outside it, read only a file the governing rules name by path
  • NEVER invent Clean Architecture / SOLID folder trees unless the repo already uses that layout
  • MUST match existing project patterns before inventing new ones
  • MUST prefer editing an existing file over adding a new one
  • MUST delete dead code you introduce; do not leave unused imports/vars

Dead-code finders

Run the finders on the diff's files; go repo-wide only on an explicit "remove dead code" request. Delete only code proven dead: no hit from git grep -n --untracked (or rg -F --hidden --no-ignore-vcs -g '!.git') across the repo, config, .github/, entrypoints and registrations, and the tests stay green after the deletion. A finder nominates; it never authorizes "delete everything flagged."

  • Python: ruff check --select F401,F811,F841,ERA001, then vulture <src> --min-confidence 80; whitelist proven false positives in a file, never inline.
  • TypeScript/JavaScript: knip (unused files, exports, dependencies); tsc --noEmit with noUnusedLocals/noUnusedParameters when the project enables them. Use the ecosystem's own equivalent elsewhere.
  • Run the finder from the project's declared dev dependencies and manager (uv run, npm run/pnpm exec); never a uvx/npx/dlx stand-in — propose adding a missing one.
  • Check before deleting: dynamic dispatch/reflection (getattr, registries, plugin entry points), CLI/HTTP route registration, pytest fixtures/conftest, __all__/public re-exports, framework hooks/templates/serialization/ORM fields, and any installed or vendored payload that a generator or installer owns.
  • Delete in small commits, each carrying the finder output plus the tests as evidence.
  • Removing a path takes what only it used: its flags, modes, aliases, fallbacks, state, permissions and config. Verify the surviving flow, including what the deleted path assumed about navigation, permissions or persisted data.

User intent wins

Default to minimal. If the user explicitly asks for more structure, obey that request.

Do not override an explicit ask in the name of kill-slop. If the ask is ambiguous, prefer minimal and say what you skipped.

File shape

Default: colocate. Edit the file/folder that already owns this concern.

Split only when ALL of these hold:

  1. Pain now — the file is already hard to navigate (roughly 300–400 lines, or mixed unrelated concerns) and your change would make it worse
  2. One unit — you are extracting a single cohesive piece with a clear name
  3. Local fit — the new file follows an existing nearby pattern. If there is no pattern, colocate beside the caller

If only (2) is true, do not split.

Diff against the asked result

Before writing, name the goal (one sentence), the touch list (files the asked result actually needs) and what you will not do. An extra file or a one-use helper is justified by the problem, not by a file count — there is no fixed file budget.

Checker (diagnostic, no veto)

The bundled checker is optional diagnosis, never a gate. Read scripts/check_diff.py for flags. OVER_BUDGET is information; it does not forbid finishing. SKIP / EMPTY_SCAN means the scan failed — report that, do not treat unknown as clean.

python -X utf8 <path-to-this-skill>/scripts/check_diff.py
python -X utf8 <path-to-this-skill>/scripts/check_diff.py --base HEAD

Style

  • Prefer boring, readable code over cleverness
  • Handle real error paths the task needs; skip speculative ones
  • Names should explain intent; if you need a comment, rename instead
  • Tests: one per regression you can name, at the layer that owns it; a bug fix gets its nearest failing test first even where nothing was tested. No test that merely mirrors the implementation

Output

When summarizing, say what you changed and what you deliberately did not change.

Attribution

Adapted from iCodeCraft/anti-slop (MIT), skill kill-slop.

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.