agentleFS
nazmulnahid-gitnazmulnahid-git/Ai-Stack/skills/prodtest/SKILL.md

prodtest

Skill4 starsChanged 17 days agoMITView on GitHub

Senior-QA test pass on a newly implemented feature. Detects the project's real test stack, writes unit and functional/integration tests, then drives the running app with Playwright for end-to-end coverage, saving screenshots to a gitignored folder for human review. Asks upfront whether found bugs should be fixed or only reported. Use when asked to test a new feature, add test coverage, or when the user runs /prodtest.

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. About 0 are common, 13 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈13

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Test a feature the way a senior QA engineer would: find out what the feature actually claims to do, then try to break it — at the unit, …

    line 8
  2. Distinctive:

    Before writing anything, ask once:

    line 14
  3. Distinctive:

    Wait for the answer. It governs the whole run:

    line 18
  4. Distinctive:

    Use the user's description if given.

    line 29
  5. Distinctive:

    Write down, in 3–6 bullets, what the feature is supposed to do — the behaviors you are about to verify.

    line 33
  6. Distinctive:

    Read, don't guess:

    line 39
  7. Distinctive:

    If no test infrastructure exists at all, say so and propose the minimal setup before installing anything.

    line 50
  8. Distinctive:

    No test that only re-asserts a mock.

    line 63
  9. Distinctive:

    Check whether Playwright is already installed and configured.

    line 83
  10. Distinctive:

    Start the app the way the project documents it, wait for readiness, and seed any data the flow needs.

    line 85
  11. Distinctive:

    Write specs for the real user journeys of this feature, including at least one unhappy path (validation error, permission denied, or …

    line 87
  12. Very specific:

    Prefer role/label/text selectors and web-first assertions (expect(locator).toBeVisible()).

    line 89
  13. Very specific:

    Ensure .gitignore contains .prodtest/ — add the line if missing and say that you did.

    line 108
  14. Very specific:

    Write .prodtest/report.md as an index: each spec, pass/fail, and relative links to its screenshots in order.

    line 110
  15. Distinctive:

    Run the unit, integration, and E2E suites and paste the real summary output.

    line 115
  16. Distinctive:

    Never report a suite as passing that you did not actually run to completion.

    line 133

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

prodtest

Test a feature the way a senior QA engineer would: find out what the feature actually claims to do, then try to break it — at the unit, integration, and browser level.

Step 0 — Ask the fix policy first

Before writing anything, ask once:

Should I fix bugs as I find them, or only report them?

Wait for the answer. It governs the whole run:

  • Fix mode — when a test fails because the product is wrong, fix the product, re-run, and note the fix in the report.
  • Report-only mode — leave the failing test in place (or document the repro), change no product code, and list every defect at the end.

In both modes, a test that fails because the test is wrong is always yours to fix.

Step 1 — Identify the feature under test

  • Use the user's description if given.
  • Otherwise diff the branch: git diff $(git merge-base HEAD origin/main)...HEAD --stat plus recent commit messages, and read the changed handlers, components, and models.
  • Write down, in 3–6 bullets, what the feature is supposed to do — the behaviors you are about to verify. Show these to the user as your test basis; a wrong premise here wastes the whole run.

Step 2 — Learn the real test stack (do not assume)

Read, don't guess:

  • package.json / pyproject.toml / composer.json / go.mod — which runner exists (vitest, jest, pytest, phpunit, go test) and which scripts run it.
  • An existing test file near the feature — copy its imports, factories, fixtures, mocking style, DB setup/teardown, and naming. Match the house style exactly.
  • CI config — the command that must pass.
  • How the app boots locally (dev script, env vars, docker compose, seed/migrate commands) and on which port.

If no test infrastructure exists at all, say so and propose the minimal setup before installing anything.

Step 3 — Unit tests

Cover the pure logic the feature introduced: calculations, validators, reducers, permission predicates, formatters, state machines.

For each unit: the happy path, then the edges that actually bite — empty, null/undefined, zero, negative, very large, unicode, duplicates, boundary values, wrong types at trust boundaries, timezone/DST for dates, rounding for money.

No test that only re-asserts a mock. If mocking the dependency makes the test tautological, promote it to an integration test.

Step 4 — Functional / integration tests

Exercise the feature through its real seams with real wiring — HTTP handler → service → database, or component → store → API client.

Cover:

  • Success path with a realistic payload.
  • Validation failures and the exact status codes/messages contracted.
  • Authorization: unauthenticated, wrong role, and another tenant's user hitting the same resource must all be rejected.
  • Persistence: assert the database state after the call, not just the response.
  • Idempotency/duplicates where the feature can be retried.
  • Failure of a dependency (DB error, third-party timeout) — the system should degrade, not corrupt.

Step 5 — End-to-end with Playwright

  1. Check whether Playwright is already installed and configured. If it is not, ask before adding it and its browsers — it is a heavy dependency.
  2. Start the app the way the project documents it, wait for readiness, and seed any data the flow needs.
  3. Write specs for the real user journeys of this feature, including at least one unhappy path (validation error, permission denied, or network failure).
  4. Prefer role/label/text selectors and web-first assertions (expect(locator).toBeVisible()); no arbitrary waitForTimeout.
  5. Capture the browser console and failed network requests during each spec and surface them — a green test over a console full of 500s is not green.

Screenshots for human review

Save artifacts to .prodtest/ at the repo root:

.prodtest/
  screenshots/<spec-name>/01-<step>.png
  report.md
  • Screenshot every meaningful state transition, not just failures, so the user can eyeball the feature without running anything.
  • Configure Playwright with screenshot: 'only-on-failure' plus explicit page.screenshot() calls at each step; also enable trace: 'retain-on-failure'.
  • Ensure .gitignore contains .prodtest/ — add the line if missing and say that you did. Never commit these artifacts.
  • Write .prodtest/report.md as an index: each spec, pass/fail, and relative links to its screenshots in order.

Step 6 — Run everything and report honestly

Run the unit, integration, and E2E suites and paste the real summary output.

For each defect found:

### [Sev] Short title
Where: apps/web/src/checkout/apply-coupon.ts:73
Repro: 1. ... 2. ... 3. ...
Expected: ...  Actual: ...
Evidence: .prodtest/screenshots/checkout/04-coupon-error.png
Status: fixed in <file:line> | reported only

Then a summary: tests added (by layer), pass/fail counts, defects by severity, screenshot folder path, and — explicitly — what you did not test and why (flows you could not reach, external services you had to stub, browsers you skipped).

Never report a suite as passing that you did not actually run to completion.

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.