agentleFS
milad-ahmdmilad-ahmd/agent-skills/skills/test-gap-hunter/SKILL.md

test-gap-hunter

Skill5 starsChanged 16 days agoMITView on GitHub

Finds the riskiest untested code in a project and writes meaningful tests for it using the project's existing test framework and conventions. Use when the user asks to improve coverage, add tests, find untested code, or harden a module before a refactor.

1 other project uses 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. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    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. Distinctive:

    Write the tests that actually catch bugs, not tests that only inflate coverage.

    line 8
  2. Very specific:

    Measure, if possible: Run the coverage tool when one is configured (vitest --coverage, jest --coverage, pytest --cov, go test -cover ./...).

    line 13
  3. Distinctive:

    Add no new test dependencies without asking.

    line 33

≈ “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

Test Gap Hunter

Write the tests that actually catch bugs, not tests that only inflate coverage.

Workflow

  1. Detect the test setup. Find the framework (Jest, Vitest, pytest, Go testing, JUnit, RSpec, PHPUnit, XCTest, flutter_test...), the test file locations and naming, the mocking and fixture style, and the command used to run tests (package scripts, Makefile, CI).
  2. Measure, if possible. Run the coverage tool when one is configured (vitest --coverage, jest --coverage, pytest --cov, go test -cover ./...). If not, map source files to test files by name.
  3. Rank the gaps by risk, not by line count:
    • business logic, money, auth, permissions, parsing, date/time handling, concurrency
    • code with many branches and error paths
    • recently changed code (git log --since=90.days --name-only)
    • public APIs that other modules depend on
  4. Present the top 5–10 gaps with a one-line reason each, then write tests for the ones the user picks (default: the top 3).
  5. Run the new tests and iterate until they pass. If a test reveals a real bug, don't change the test to make it pass. Report the bug.

What a good test covers

  • The happy path, plus edge cases: empty, null/None, zero, negative, max values, unicode, time zones, duplicates.
  • Error paths: invalid input, failing dependency, timeout.
  • Names that describe behaviour, such as returns 401 when token is expired.
  • Arrange–Act–Assert structure, one behaviour per test, no logic inside tests.
  • Mocks only at boundaries (network, clock, filesystem, randomness). Don't mock the unit under test.

Rules

  • Match existing conventions exactly: file placement, imports, helpers, fixtures, assertion style.
  • Add no new test dependencies without asking.
  • Tests must be deterministic: no real network calls, fixed clocks and seeds.
  • Report at the end: the files added, the number of tests, the before/after coverage (if measured) and any bugs found.

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.