agentleFS
allmontyallmonty/better-code-agent/skills/review-tests/SKILL.md

review-tests

Skill0 starsChanged 10 days agoMITView on GitHub

Audits whether tests would actually catch bugs - mentally mutates the code under test, checks assertions, test level, mocking, flakiness, acceptance-criteria coverage, and any skipped, deleted or loosened tests. Use when the user asks if tests are good enough, before trusting AI-written tests, or after a feature's tests are written.

14 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 2

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

    Read .claude/rules/testing.md and the plan's acceptance criteria in docs/plans/ if one applies.

    line 22
  2. Distinctive:

    Mocks: only things the project doesn't control.

    line 30
  3. Distinctive:

    Deterministic: no sleeps, real clock, unseeded randomness, network, or reliance on test order.

    line 31

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

Review tests

Work in the user's project: the current working directory. Every path below is relative to it, not to this skill's own folder.

You are checking tests someone else wrote. Read only; don't edit files.

1. Scope

Target: $ARGUMENTS

  • Empty: tests changed in uncommitted work, else in the last commit.
  • A path: those tests and the code they cover.
  • A commit or range: tests and code changed there.

Read .claude/rules/testing.md and the plan's acceptance criteria in docs/plans/ if one applies.

2. For each piece of code under test

Pick its most important branches and mentally apply mutations: flip a condition, change < to <=, return early, drop a call, swap two arguments, return an empty value. For each, ask: does some test fail? A mutation that survives is a finding. If the project has a mutation tool configured (Stryker, mutmut, PIT, ...), run it on the changed files and use its report.

3. Check each test

  • Asserts behaviour: specific expected values on outputs or visible effects, not just "no exception" or "was called".
  • Right level: unit for logic, integration with real dependencies for I/O, e2e only for critical journeys.
  • Mocks: only things the project doesn't control. Mocking the project's own modules hides integration bugs.
  • Deterministic: no sleeps, real clock, unseeded randomness, network, or reliance on test order.
  • Readable: the name says the behaviour; one reason to fail; setup is not longer than it needs to be.
  • Not weakened: in the diff, look for deleted tests, removed asserts, new skips, widened tolerances, snapshots updated without explanation.

4. Coverage of intent

Map each acceptance criterion and each error path to a test. List the ones with none. Where example tests can't cover a wide input space (parsing, serialisation, arithmetic), suggest the property-based test to add.

5. Report

Ranked findings, each with the test or code location, the surviving mutation or gap, and the test to add or change. End with: tests that can be trusted, tests that can't, and the missing ones.

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.