agentleFS
theishandubeytheishandubey/dotclaude/skills/testing/SKILL.md

testing

Skill2 starsChanged 27 days agoMITView on GitHub

How implementers and fixer test their changes - unit tests for every change, end-to-end tests only when the user asks, the shape of each, setting up a harness, how to run them and output discipline. Preloaded by implementer, parallel-implementer and fixer.

194 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use bundle-dependency-prs, update-library-template and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    bundle-dependency-prs

    Fix broken dependency update PRs and aggregate the ones that work into one PR.

    Also in 7 projects that use this

  • MicrosoftSkill

    update-library-template

    Merges the latest Library.Template into this repo (at position of HEAD) and resolves conflicts.

    Also in 7 projects that use this

  • zetaloopSkill

    assign-copilot

    Assigns a GitHub issue to the Copilot coding agent, optionally specifying a custom agent. Use this when asked to assign an issue to Copilot or delegate an issue to CCA.

    Also in 3 projects that use this

  • NVIDIA-NeMoSkill

    build-and-dependency

    Dev environment setup for Megatron Bridge — container-based development, uv package management, lockfile regeneration, adding dependencies, Slurm container usage, and common build pitfalls.

    Also in 3 projects that use this

  • timmo001Skill

    changeset-scope

    Keep all scoped code work contained to the user-defined changeset. Use for implementation, fixes, diagnosis, refactoring, cleanup, and review when explicit instructions, named files, diffs, branches, pull requests, or injected work scopes define the boundary.

    Also in 3 projects that use this

  • JetBrainsSkill

    module-dependencies

    Add or modify IntelliJ module dependencies in `.iml` files.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 12 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 174 edited versions we read keep these.

  • 12

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

    Every change gets unit tests.

    line 9
  2. Distinctive:

    Test and browser output is the main cost of testing, so the output rules below are binding.

    line 11
  3. Distinctive:

    Test the logic your change adds or alters: parsing, normalizing, ordering, validation rules, calculations, error handling.

    line 15
  4. Distinctive:

    Call the code through its public functions or classes, the way the rest of the codebase calls it.

    line 16
  5. Distinctive:

    Never mock code the repo owns, never assert on private attributes, and never restructure production code only to reach it.

    line 17
  6. Distinctive:

    No mutation checks, model-based tests or forced-interleaving tests unless the spec asks for them.

    line 22
  7. Distinctive:

    Use the repo's existing test runner, directory, fixtures and naming exactly.

    line 23
  8. Distinctive:

    Write them only when the task says the user asked for end-to-end tests.

    line 27
  9. Very specific:

    Read the markup or templates to learn a page.

    line 36
  10. Distinctive:

    Run the unit tests you wrote and the ones covering the files you changed after each edit.

    line 40
  11. Distinctive:

    When end-to-end tests were asked for, run the affected specs while finishing and the whole end-to-end suite once before reporting.

    line 41
  12. Distinctive:

    Never paste traces, HTML dumps, screenshots or server logs into your report.

    line 43
  13. Distinctive:

    Start a dev server only if nothing answers at the base URL, and stop it when you finish.

    line 44

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

Testing

Every change gets unit tests. End-to-end tests are written and run only when the task says the user asked for them. Test and browser output is the main cost of testing, so the output rules below are binding.

Unit tests, always

  • Test the logic your change adds or alters: parsing, normalizing, ordering, validation rules, calculations, error handling.
  • Call the code through its public functions or classes, the way the rest of the codebase calls it. Never mock code the repo owns, never assert on private attributes, and never restructure production code only to reach it. Stub only what you cannot run in a test: the network, third-party services, the clock, randomness.
  • Cover the behavior's boundaries and invalid input, and put variations of one check in a single table-driven test (parametrize, or a loop over cases) instead of one test each.
  • Take expected values from the spec or worked examples, never by recomputing them the way the code does.
  • Each test has a plain-language name and passes in any order.
  • No mutation checks, model-based tests or forced-interleaving tests unless the spec asks for them.
  • Use the repo's existing test runner, directory, fixtures and naming exactly; if it has none, add the language's standard runner with the minimum configuration and list it in your report.

End-to-end tests, only when asked

Write them only when the task says the user asked for end-to-end tests; otherwise write and run none, and leave existing ones as they are. When asked:

  • Cover each user flow the change adds or alters through the entry point its users use, asserting only what they can observe:
    • Web UI: Playwright, with role-based locators (getByRole, getByLabel).
    • HTTP or RPC service: real requests to the running server.
    • CLI: the real command as a subprocess, asserting on output, exit code and files written.
  • Include what only a real request shows: server-side handling of input the browser would block, escaping of values echoed back to the page, and the errors a user sees.
  • Each test creates its own data and waits on visible conditions, never on fixed sleeps.
  • Use the repo's existing harness exactly; if it has none, add the minimum and list it in your report: for a web app, @playwright/test as a dev dependency through the project's package manager, a playwright.config whose webServer uses the dev script, and one e2e directory.
  • Read the markup or templates to learn a page; use agent-browser to map it only when its roles and labels are not clear from the code and it is installed (agent-browser skills get core loads its guide), with compact snapshots of the interactive elements only.

Running

  • Run the unit tests you wrote and the ones covering the files you changed after each edit; run the whole unit suite once before reporting.
  • When end-to-end tests were asked for, run the affected specs while finishing and the whole end-to-end suite once before reporting.
  • Send output to a file and read only the summary and failures: <test command> > "$LOG" 2>&1; tail -n 60 "$LOG", with LOG under mktemp -d; for Playwright, prefix PLAYWRIGHT_HTML_OPEN=never and pass --reporter=line.
  • Never paste traces, HTML dumps, screenshots or server logs into your report; give their paths.
  • Start a dev server only if nothing answers at the base URL, and stop it when you finish.

Failures

  • A test that fails because of your change: fix the change.
  • A test that fails because the test is wrong or the behavior changed on purpose: fix the test.
  • A bug that predates your change: leave the test out, and report the bug with the failing command.

Report

List each test you added, the commands you ran, and passed and failed counts per suite.

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.