agentleFS
alex-macraalex-macra/claude-codex-skills-assembly/skills/qa-automation/SKILL.md

qa-automation

Skill1 starsChanged 3 months agoMITView on GitHub

Write, run and fix automated tests: unit, integration, and browser, CLI or HTTP end-to-end; fixtures, mocks, coverage, flakes. Use when adding or debugging tests (pytest, vitest, jest, Playwright, Cypress) or E2E journeys.

3 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

4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 2

    Distinctive

    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:

    Test behavior through the public API, not private state or call counts.

    line 25
  2. Distinctive:

    Run only that test until green, then the surrounding suite, then the full suite once before committing.

    line 52
  3. Very specific:

    Never --ignore a failing test to merge.

    line 54
  4. Very specific:

    Not a launch-and-look pass: that is see-it-live.

    line 56

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

QA automation

Levels

  • Unit: pure functions or single classes; no I/O, network or clock.
  • Integration: real dependencies (db, fs, queue) in process; mocks only at the system boundary.
  • E2E: the running app through its public interface (browser, HTTP, CLI); load references/e2e.md.

Pick the cheapest level that catches the bug: mostly unit, a thin integration layer, a few critical E2E flows. An inverted pyramid means slow, flaky CI.

Writing a test

  • Arrange, act, assert; one concept per test. A name needing "and" is two tests.
  • Test behavior through the public API, not private state or call counts.
  • Name scenario and outcome: returns_400_when_email_missing.
  • Small explicit data in the test body beats beforeEach magic.

Mocks versus reals

  • Database, filesystem, in-process queue: real (in-memory db, tmp dir). Mocked persistence hides schema drift; default to a real in-memory db.
  • HTTP to your own service: real, in a harness. Third party: stub at the boundary (nock, respx, MSW) with responses recorded once.
  • Time: inject a clock or fake timers; never sleep to wait. Randomness: seed it.

Stack notes

  • Vitest and Jest: vitest run or jest --ci in CI; reset mocks in afterEach; commit snapshots and never --update-snapshot reflexively; with React, query by role or label, not test-ids.
  • Pytest: -x --ff while developing; explicit fixture scope, autouse only for global setup; parametrize over loops; pytest-randomly for order bugs, pytest-xdist for parallelism.
  • HTTP integration: real app on an ephemeral port; per-test rollback transaction or fresh schema; one login() helper.

Coverage

A percentage alone is meaningless: expect(result).toBeDefined() covers a line and proves nothing. Cover preconditions, branches, error paths and edge values (empty, max, negative, unicode). Delete unreachable defensive code instead of testing it.

Flakes

A flaky test is broken; fix it, never retry it green. Causes: timing, shared state, real network, ordering, time-of-day logic. Reproduce with shuffled order and repeats (--repeat-each=20). A genuinely racy codebase means the test found a real bug.

Adding tests to existing code

  1. For a bug, write the failing reproduction first.
  2. Run only that test until green, then the surrounding suite, then the full suite once before committing.
  3. Tests pass deterministically on a clean checkout with only documented env vars.
  4. Never --ignore a failing test to merge; fix or delete it.

Not a launch-and-look pass: that is see-it-live.

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.