agentleFS
Igorsolop0Igorsolop0/qa-claude-skills/skills/pw-test-review/SKILL.md

pw-test-review

Skill3 starsChanged 2 months agoMITView on GitHub

Review Playwright tests (TypeScript/JavaScript) for known anti-patterns and reliability issues — networkidle abuse, missing await, nested describe, beforeAll with shared state, toContainText false positives, unchecked goto status, weak locators, force clicks, hardcoded sleeps, list-iteration false positives (`.all()`/`count()` without `toHaveCount`), positional and strict-mode locator ambiguity (`first`/`last`/`nth`), XPath-into-shadow-DOM. Use whenever a user asks to review a Playwright test file, snippet, PR diff, or code-smell-check a `.spec.ts` / `.test.ts` / `e2e` test, or asks "why is this test flaky", "is this test good", "anti-patterns in this playwright code", "code review playwright", or wants a second opinion on Playwright test quality. Trigger even if they don't explicitly say "review" — any time Playwright test code is shared with intent to evaluate it.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 are 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.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If the user shares a whole directory, scan all .spec.ts / .test.ts files.

    line 21
  2. Very specific:

    Walk the anti-pattern catalog: Read references/anti-patterns.md and check each item against the code.

    line 26
  3. Very specific:

    Context-aware bumps: If the user mentions money / iGaming / fintech / KYC / balances, raise the priority of toContainText and unchecked …

    line 27
  4. Very specific:

    Write the report: Use the structure in references/output-template.md.

    line 28
  5. Distinctive:

    Don't fabricate: If a category has no findings, omit it.

    line 29
  6. Distinctive:

    When the code under review covers money, balances, payments, or any real-value domain, also check these rules (cite them as findings only …

    line 33

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

pw-test-review

Behavioral review of Playwright tests — find anti-patterns that cause flakes, false positives, slow runs, or hidden bugs. Not a stylistic linter.

When this skill applies

Trigger on requests like:

  • "Review this playwright test"
  • "Is this test good / flaky / OK?"
  • "Why is this test flaky?"
  • "Code smell in this PW spec"
  • "PR review for playwright"
  • A .spec.ts / .test.ts / e2e file shared without explicit instructions — assume review.

If the user shares a whole directory, scan all .spec.ts / .test.ts files; otherwise focus on what they share.

Workflow

  1. Read the test code. For each file the user supplies — open it, look at the actual contents. Don't review off vibes.
  2. Walk the anti-pattern catalog. Read references/anti-patterns.md and check each item against the code. The catalog is organized by priority — work top-down, capture line numbers and code snippets as you go.
  3. Context-aware bumps. If the user mentions money / iGaming / fintech / KYC / balances, raise the priority of toContainText and unchecked response.status() findings by one level. They cause silent bugs in those domains.
  4. Write the report. Use the structure in references/output-template.md. Skip empty sections. Cite line numbers. One sentence per "why" — explain mechanism, not policy.
  5. Don't fabricate. If a category has no findings, omit it. Better three sharp findings than ten wobbly ones. Always include a "What's good" section — tells the author what to keep.

Money-domain context

When the code under review covers money, balances, payments, or any real-value domain, also check these rules (cite them as findings only when they cause a real failure mode):

  • Always apply the money-domain priority bumps from references/anti-patterns.md: balances, bonuses, and deposits are in scope even if the user doesn't say so.
  • Mock-stack leaks. ?mocks=on, x-wiremock, or PLAYWRIGHT_USE_MOCKS in a suite that reports to a test-management tool as "live" → High: the run silently tests mock data while reporting live.
  • Session/project routing. Authenticated-only assertions in a file that the config routes to a guest/unauthenticated project → High: it runs without the session and fails or, worse, passes against guest chrome.
  • Traceability. A multi-step case without test.step, or a missing/invented test-management @T id → Medium: the reporter can't show the failing step or match the case.
  • Live accounts. Registering a new real account in a spec when a shared setup session would do → Medium: each run creates real backend accounts.
  • Perpetual-network apps. Apps with long-lived connections (analytics, websockets) never reach networkidle; prefer waitUntil: "domcontentloaded" plus a wait on the element under test.

Philosophy

The user is a senior QA engineer. They value root-cause reasoning over rules. For every finding, the "why" should explain the mechanism by which the pattern causes a problem — not "the docs say so", not "best practice". If you can't justify a finding by mechanism, drop it.

This is a behavioral review. Don't nitpick formatting, variable naming, semicolons, import order, or stylistic preferences — that's what ESLint and Prettier are for. Focus on patterns that cause real flakes, false positives, slow runs, or hidden bugs.

References

  • references/anti-patterns.md — full catalog of patterns to flag, grouped Critical → Low, with mechanism and fix for each.
  • references/output-template.md — exact output structure.

Open both at the start of every review.

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.