agentleFS
samuelclaysamuelclay/NewsBlur/.agents/skills/deslopify-tests/SKILL.md

deslopify-tests

Skill7.7k starsChanged yesterdayMITView on GitHub

Delete NewsBlur tests that cannot catch a real bug, proving each deletion by breaking the code and rerunning the suite in the web container, and keep the test rules in AGENTS.md current. Review mode checks only the tests a diff adds or changes; commit-pr runs it before committing.

Trending

More talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 1 mentionFeb 2026: 0 mentionsMar 2026: 1 mentionApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 1 mentionNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the samuelclay/NewsBlur repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about samuelclay/NewsBlur

The biggest 5 of 19 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 19

Talked about on GitHub and Stack Overflow (19 times).

On GitHub · 16

11 more on GitHub

On Stack Overflow · 3

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    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. Very specific:

    review: check only the test cases the current diff adds or changes, against origin/main or the base given.

    line 17
  2. Distinctive:

    Nothing else catches it: No other test that CI runs fails on the same bug.

    line 32
  3. Distinctive:

    Never deleted, even when they fail the bar:

    line 38
  4. Distinctive:

    Don't simplify a shared helper while deleting: dropping a parameter that only the deleted cases passed makes the case hard to restore.

    line 43
  5. Distinctive:

    Only the candidate fails: keep.

    line 59
  6. Distinctive:

    Restore the code: before the next case.

    line 60
  7. Very specific:

    Read references/newsblur.md.

    line 83
  8. Very specific:

    Keep each related_cmd a single django_junit.py command.

    line 92
  9. Distinctive:

    Delete the planned cases and nothing else.

    line 102
  10. Distinctive:

    Remove imports, fixtures, helpers, and mocks that only the deleted cases used.

    line 103
  11. Distinctive:

    Never weaken an assertion to keep a case.

    line 104
  12. Very specific:

    Run the full apps suite and the format checks from the reference.

    line 109
  13. Distinctive:

    Check AGENTS.md against references/rules.md and add only what is missing.

    line 115
  14. Distinctive:

    Never edit a test to change a mutation result.

    line 130
  15. Distinctive:

    Never run two test invocations at once, in any checkout.

    line 131
  16. Distinctive:

    Never merge. Sam reviews the ledger before anything lands.

    line 134

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

Deslopify tests

Agents write tests after the code, from reading the code, so the tests restate it. They always pass, catch almost nothing, and break on every refactor. This skill removes those tests and keeps agents from writing new ones. Adapted for NewsBlur from the Tavus skillshare deslopify-tests skill, which follows a thread by dex, Ansh Nanda, and Ray Fernando. The bar and the proof are the same; the commands, lanes, and protected areas are NewsBlur's, in references/newsblur.md.

Modes

  • review: check only the test cases the current diff adds or changes, against origin/main or the base given. commit-pr runs this before it commits a diff that touches tests.
  • prune (default when called by name with no mode): check every Django test case in the repo, or in the paths given, and delete the ones that fail the bar. Ends with a PR that commit-pr takes to ready for review. Ask Sam with AskUserQuestion before starting a whole-repo prune: it takes hours and nothing else can run tests meanwhile.
  • report-only, with either mode: write the ledger and change nothing.

Goal: what done means

Review is done when every added or changed test case has a named bug and a mutation result, and each case that fails the bar is deleted or rewritten before the commit.

Prune is done when every in-scope test case has one decision, every deletion has a mutation result from scripts/mutate.py, the Django Tests lane passes locally after the deletions, and a PR carrying the ledger is ready for review per commit-pr.

The bar

A test case stays only when both are true:

  1. It catches a realistic bug. You can name a behavior change someone could ship that makes it fail: a wrong branch, an off-by-one, a dropped field, the wrong order, a missing dedupe, a swallowed error, a premium check that no longer runs. Editing the literal the test copies, renaming, reformatting, or a deliberate copy or prompt edit is not a bug.
  2. Nothing else catches it. No other test that CI runs fails on the same bug.

These usually fail rule 1: constant or prompt mirrors, mock echo (asserting a mock received what the test handed it), tests of one-line wrappers, presentation checks (class names, layout, static copy), and snapshots with no behavior contract.

In scope: the Django tests under apps/. Out of scope: the iOS and Android suites, and anything that needs a device or a live third party. Node tests are judged by hand; see the reference.

Never deleted, even when they fail the bar:

  • Security and money boundaries: authentication, premium and archive gating, payments and receipts, SSRF checks, sharing and privacy permissions, migration safety. One mutation is thin evidence for a boundary that has to hold against every change. resolve --protect keeps the ones a pattern can see; read the rest yourself before deleting. The PR lists every kept case that failed the bar for Sam to decide.
  • Shipped-bug locks: a case whose name, comment, or docstring cites a forum topic, a Sentry issue, a regression, or "Bug:", and any test added by a fix commit. The Bug Fixing Workflow in CLAUDE.md produces these on purpose.

Don't simplify a shared helper while deleting: dropping a parameter that only the deleted cases passed makes the case hard to restore.

A test file that no CI lane collects protects nothing today. Apply the bar to it anyway, and list the kept ones in the PR as "not run in CI".

The proof: break it and rerun

Reading alone never deletes a test. Every deletion needs a mutation result.

For each candidate case:

  1. Name the bug: the rule the case claims to protect, and the realistic change most likely to make it fail. Pick the bug the case's own name and assertions point at. A weak or unrelated bug turns a good test into false slop.
  2. Apply it to the code under test, never to the test. Keep the code importable: a syntax or import error proves nothing.
  3. Run the related tests with the bug in place: the candidate's module plus every CI-run module that could plausibly catch it.
    • The candidate still passes, and the bug is shown to take effect: slop.
    • The candidate still passes, but nothing shows the bug took effect: unproven, and the case stays.
    • The candidate fails and another test fails too: redundant.
    • Only the candidate fails: keep.
  4. Restore the code before the next case.

A passing candidate proves nothing on its own. A guard elsewhere can mask the bug, so the code the test runs behaves the same. The bug counts as having taken effect when another test fails on it, or when a probe makes the candidate fail. A probe is an edit at the same spot, applied instead of the bug: a raise inside the branch or expression the bug changes, or, for a constant the test reads, removing the text the test copies. A raise at the top of the function doesn't count when the bug changes one expression deep inside it.

A failing neighbour can be fake too. When the bug makes the candidate fail before its cleanup, the rows it leaks into the shared test databases can fail other tests in the same run. Give each spec line an isolate_cmd that excludes the candidate; a catcher then counts only if it fails on its own. For results already run without one, scripts/mutate.py isolate-spec <shard dir> writes -i recheck lines.

scripts/mutate.py run does steps 2 to 4 from a JSONL spec (its docstring has the fields). It runs a baseline once per command, reads the JUnit report that scripts/django_junit.py writes, ignores tests already red at baseline, confirms a redundant verdict on a second run so one flaky failure can't justify a deletion, and restores every source file after each mutation. A result of invalid proves nothing: try a different bug once, then keep the case. A retry reuses the id with -r, a challenge with -c, and an isolation recheck with -i; the last result for an id wins. Keep the spec and results files in the scratch directory, not the repo; they are the repeatable artifact for the PR.

Skip the run only for a clear keep: a case with a strong, specific bug where no other test in the module or the related modules checks the same behavior. Keeping is the safe default; only deletions need proof.

The unit is the test case: one test_* method. subTest rows belong to their case.

Review

  1. List the test cases the diff adds or changes: git diff <base>...HEAD plus uncommitted changes.
  2. For each added case, name the bug and run the proof. A test that was written first and seen to fail before the fix has its proof already: say so and move on. For each changed case, check that no assertion was weakened or dropped without a reason.
  3. Slop or redundant: delete it, or rewrite it so it catches the named bug when that rule is worth guarding. Rerun.
  4. Report one line per case: kept (bug and result), deleted, or rewritten.

Prune

1. Scope and baseline

  • Read references/newsblur.md. Create the prune's worktree and bring its stack up.
  • Record the baseline for the Django Tests lane: files, cases, wall time, and any tests already red. Red tests on main are reported, not pruned.
  • Prove that mutations reach the tests. Break one function a kept test covers and confirm that test fails through django_junit.py. A container that mounts a different checkout makes every mutation invisible, and every test then looks like slop.

2. Run the mutations

  • Split the test modules into shards of about 150 to 250 cases, keeping each app together.
  • Shards run one at a time: every checkout shares the same test databases, so mutation runs cannot overlap. Subagents can write the spec lines for several shards at once (reading tests and naming bugs needs no test run), but only one mutate.py run may be in flight. Each subagent returns counts and paths, never raw test output.
  • Then run a separate skeptic over each shard's deletion verdicts. For slop, it asks whether a stronger realistic bug would make the case fail, and whether the probe really sits where the bug changes behavior. For redundant, it asks whether another realistic bug would fail this case but not the tests that caught the first one: a different branch, input, or field. The bar keeps a test when any such bug exists. If an answer is yes, it writes a -c spec line, and that result replaces the original. A wrongly chosen bug is the main way a good test gets deleted.
  • Keep each related_cmd a single django_junit.py command. A chain (a && b) can't take an --exclude, so its redundant verdicts can't be isolated.

3. Resolve across shards

Run scripts/mutate.py resolve over every shard's results. It deletes a redundant case only while at least one test that caught its bug survives, so two tests that each cover the other are never both deleted, and it keeps every protected case. Its output is the deletion plan.

4. Delete

Apply the plan on the PR branch.

  • Delete the planned cases and nothing else. Trim mixed files; delete a file only when no case survives.
  • Remove imports, fixtures, helpers, and mocks that only the deleted cases used. Leave anything another test still uses.
  • Never weaken an assertion to keep a case. Keep it as it is or delete it.
  • Rerun each touched module; it must pass.

5. Verify

Run the full apps suite and the format checks from the reference. Fix breakage the deletions caused, such as a dangling import. Record the after-counts and wall time.

Then review the deletion diff the way the PR's reviewers will, with fresh subagents that see only the diff and the kept tests. For each deleted case, try to name a realistic bug the kept tests would miss: a different branch, input, or field, an idempotency or timeout path. Restore every case where one exists.

6. Rules

Check AGENTS.md against references/rules.md and add only what is missing.

7. PR

Hand off to commit-pr. The body:

  • Opens with what was removed and how each removal was proven.
  • Counts before and after: files, cases, wall time. Deletions by verdict.
  • What to review first: the redundant deletions.
  • A "Kept for Sam to decide" section: each protected case that failed the bar, with its verdict, bug, and catchers.
  • The full ledger: scripts/mutate.py ledger plan.jsonl --out-dir <dir> writes it as collapsed sections grouped by directory, split into files under GitHub's 65,536-character limit. Put the first file in the body if it fits, and the rest in PR comments.
  • Kept tests in files CI never runs get their own list.

Guardrails

  • Never edit a test to change a mutation result. Never leave a mutation in the tree: after each run, git status must show only the intended changes.
  • Never run two test invocations at once, in any checkout.
  • Prune deletes tests and the helpers only they used. It does not refactor source code, add tests, or wire files into CI.
  • report-only changes nothing.
  • Never merge. Sam reviews the ledger before anything lands.

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.