/paranoid-qa:test-reviewfrom paranoid-qa
Reviews TypeScript + Playwright autotests against official best practices and project conventions. Produces prioritized findings with severity, line references, and fixes. Use after writing/editing any test or Page Object before commit.
Ships in paranoid-qa. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Check just-written or modified test code against best practices and produce a prioritized list of findings with fixes. Rule source — the official Playwright documentation (best-practices, locators, test-assertions) and TypeScript + the specific project's conventions.
Source of truth for the project — its root
CLAUDE.md(if present) and the style of neighboring code. This skill is the review phase: it complements project rules, it does not replace them. Expanded❌ before → ✅ afterexamples and source links for each rule — inreferences/rules-catalog.md.
You are an independent reviewer. You do not have the history of the session where the code was written, and that is deliberate: a reviewer who saw why every decision was made tends to accept those decisions. Assess the code as it is, without the author's explanations.
Scope from the caller: $ARGUMENTS
CLAUDE.md first (if present): in an isolated context it may not be loaded.git status + git diff).file:line) or from observed output of typecheck / lint / a run. Do not invent violations "by analogy" and do not reference lines you have not seen.CLAUDE.md and neighboring code: some "anti-patterns" may be intentional (legacy helpers, non-standard markup, deliberate rule exceptions). File names/endpoints/selectors from memory and past context are background — re-verify against live code.git status --short + git diff --name-only (include untracked), or the paths provided. For each spec, find the related Page Objects, constants, fixtures.Read the changed files + related POM/constants/fixtures. Read a neighboring spec in the same directory as a style reference. Cross-check the directory/suite rules (smoke / regress / api etc.) against the project's CLAUDE.md, if present.tsc --noEmit (or the project's typecheck script from package.json). Any type error in new code = 🔴 Blocker.eslint-plugin-playwright) — do not assume from memory. Lint output is the source of truth.networkidle are invisible; suggest enabling recommended. (2) Recommended is on → missing-playwright-await, prefer-web-first-assertions, no-networkidle are errors, but each covers less than its name suggests (verified against the plugin source):
missing-playwright-await checks only async matchers, expect.poll, test.step and waitFor*. An action without await (page.click(), page.goto(), locator.fill()) passes silently - unless the rule has includePageLocatorMethods: true (not in recommended) or the project has type-aware @typescript-eslint/no-floating-promises. Neither is there → missing await on actions is invisible to lint; suggest one of them.prefer-web-first-assertions fires only with toBe/toEqual/toBeTruthy/toBeFalsy. expect(await loc.getAttribute('href')).toContain(…) or toMatch(…) pass.expect(await loc.count()).toBe(n) is caught by prefer-to-have-count, and that one is only warn in recommended.no-wait-for-timeout, no-force-option and expect-expect are also only warn there - without --max-warnings 0 these warnings never fail CI. Suggest raising them to error.
Whatever lint still misses - verify manually (A/C/H/J).file:line + fix. Deeper per rule — references/rules-catalog.md.--workers=1):
npx playwright test <file> --grep "<id>" --project="<projectName>" --retries=0 --repeat-each=2
Pass-on-retry or a floating result = flake = 🟠 Major; fix the cause (races/hydration/waits), do not hide it behind retries.| Label | Meaning | Typical examples |
|---|---|---|
| 🔴 Blocker | Test is broken, non-deterministic, or masks a bug. Do not merge. | Typecheck error; missing await (floating promise); waitForTimeout/in-page setTimeout pause; pass only on retry; { force: true } / dispatchEvent / direct setter bypassing the real UI; test without asserts; test.only; conditional expect that may never execute. |
| 🟠 Major | Brittleness or flake on content/environment change; violation of a key project rule. | CSS/XPath chains instead of role/label; instant count()/isVisible()/allTextContents() as a gate; exact prices/texts/dates instead of regex; project convention violation (importing base @playwright/test where the project requires a custom fixture; a mandatory project check skipped — e.g. the network error monitor); waitForLoadState('networkidle'); a test depends on another test's state. |
| 🟡 Minor | Style/readability/maintainability; no impact on stability. | No test.step for business steps; inline comments instead of self-documentation; .nth() where .filter() fits; a working but non-priority locator; unused import/constant. |
| ⚪ Nit | Cosmetics. | Naming, import order, formatting (if not caught by Prettier). |
Each item — what to look for; the violation's severity in parentheses. Expanded examples and proofs — in the catalog.
page.waitForTimeout(ms) and no setTimeout/sleep inside page.evaluate (grep for both). Wait for state, not time. (🔴)expect, test.step, action (click/fill/goto), waitFor* — under await/return/void. A missing await = silent flake. (🔴)const p = page.waitForResponse(...); await click(); await p. Declaring after the action = race. (🔴)void second.catch(() => {}). Awaiting both before the assertions turns a rejected first request into a timeout of the second, and the report shows neither the status nor the error body. (🟠)toPass. A single action followed by a passive expect.poll is flaky: a layout shift brings the scroll back, a remount wipes the input. (🟠)waitForLoadState('networkidle'). Navigation — goto(url, { waitUntil: 'domcontentloaded' }), without a duplicate waitForLoadState right after. (🟠)await expect(async () => {...}).toPass({ timeout }), not a chain of awaits. (🟠)count()/allTextContents() right after appearance hits the emptiness window. Measure via toPass. (🟠)getByRole({ name }) → getByLabel (form fields) / getByText (static content) → getByPlaceholder → getByAltText → getByTitle → getByTestId → CSS (last resort) → XPath (almost never). (🟠 for CSS/XPath without a reason)div > div > span, .episode-actions-later). They break on rebranding. (🟠){ name } / .filter({ hasText }) / .filter({ has }), not .nth(). .nth() — only with justification. (🟡)page, not from a section. (🟠)getByText('whole sentence') is not used as an anchor — brittle to copy edits; take a stable fragment/role. (🟡)toBeVisible/toHaveText/toHaveCount/toHaveValue/toBeChecked/toHaveAttribute/toHaveURL. No expect(await loc.isVisible()).toBe(true) and expect(await loc.count()).toBe(n) — they do not retry. (🔴/🟠)expect). (🔴)expect.soft, to collect all failures at once. (🟡)test.fail() (with the single bug assert), not test.fixme(); the working behavior — as a separate regular test. (🟡)let x at describe level, reinitialized in beforeEach, is a common valid pattern; the violation is a test reading another test's result. Must pass in isolation and in any order. (🔴 if isolation is broken)describe.configure({ mode: 'serial' }) — only for a real dependency, not "just in case". (🟠)beforeEach/fixtures, no copy-paste; created entities (API) are deleted. (🟠)tsc --noEmit, strict). (🔴)any in POM / fixtures / utils — undesirable, type it (Locator/Page/Route/APIResponse). Cross-check the project config: any may be deliberately allowed in specs (e.g. for mock data) — do not flag it there. @ts-ignore — only with a reason/ticket. (🟠 for POM/utils)readonly Locator; fixtures typed (base.extend<{...}>); type the API response body explicitly if asserts rely on it. (🟡)await on an action is usually NOT caught by lint: missing-playwright-await covers it only with includePageLocatorMethods: true, otherwise type-aware no-floating-promises is needed; a promise under void passes even that one → re-read by eye, see A2. (🔴)page.route) — only for edge cases (5xx, empty response, timeout, offline). The positive happy path — against the real API. (🟠)route.fulfill answers before the network and hides exactly that seam: the test stays green while the integration is broken. The positive scenario goes over the real network and only listens to requests (waitForRequest/waitForResponse); mocks are for negative cases. Whether real data may be sent to production is the product owner's call, not the test author's. (🟠)waitForResponse (status + body) / waitForRequest + postDataJSON(). For forms — inspect the payload for [object Object], empty/non-serialized fields, not just "button is enabled". (🟠)route.abort() is fine only when the test ends there; if the test keeps living on the page (a repeat goto, further steps) — aborting a navigation sends Chromium to chrome-error:// and breaks the next navigation, and 204 is still treated by Chromium as a committed navigation. The working option is route.fulfill with an html stub (200 text/html) + a repeat goto. (🟠)page.unroute(matcher, handler). unrouteAll() also wipes routes installed by project fixtures (stubs for hanging third-party hosts etc.) — after it, other tests/steps go flaky. (🟠)test.step('Imperative name', …) (visible in Allure/HTML/trace). return — outside the callback. Do not split into a step per action. (🟡)allure.description), if the project uses them. (🟡)for...of outside test.describe, not test copies. (🟡)test.only, commented-out tests, temporary files/drafts, debug console.log/page.pause(). (🔴 for test.only/page.pause, otherwise 🟡)@allure.id:N, TC key etc.) — as in the neighboring tests in the file. (⚪){ force: true }, dispatchEvent, direct React/Vue setter, manual scroll instead of auto-actionability — unless justified by a controlled input (e.g. custom display:none inputs — verify in the browser). The fix must catch a regression if the feature breaks, not hide it. (🔴)retries/mode: serial/an increased timeout are not used as a "cure" for flake. Quarantine is acceptable only temporarily, with a ticket link. (🟠)try/catch does not swallow action/assert failures (auto-waiting is built in; .catch() hides the bug). (🟠)skip/a flag. (🟠)test.fail with a ticket, do not retrofit the assertion to the current DOM. (🔴)toBeVisible() → toBeAttached() (a CSS-hidden element then passes), a targeted assert swapped for a lenient counter, a check deleted citing "covered elsewhere" without reading that spec. Silencing the signal is not a fix. (🔴)randomUUID() from the built-in crypto per request (do not pull in the uuid package if the project does not have it); rate limit accounted for; cleanup of created entities. (🟠)frameLocator; content is located inside the frame. New tab: context.waitForEvent('page'). Download: waitForEvent('download') + filename check. Upload: setInputFiles. Time: page.clock. Geolocation/permissions: grantPermissions/setGeolocation. (🟠 for manual workarounds)toHaveScreenshot with animations:'disabled' and mask on dynamic content; baselines — on the CI platform (a macOS baseline against Linux CI = guaranteed diff). Only if the test case requires a baseline. (🟠)getByText('Request sent') → toHaveText('Request sent'), locator('.is-active') → toHaveClass(/is-active/). Such an assert fails only when the element is missing altogether and never checks the claimed property; lint does not catch it. Locate the element by an independent attribute (role, container, position) and assert the property under test separately. (🟠)count > 0, regex), so the test survives copy/price changes — especially for regression tests after a fix. (🟠)>= 8 where the page renders 15, >= 20 links where the footer has 40) survives losing half the page — a placebo oracle. Where a targeted anchor exists (a block's own class, links into a child section, footer columns), assert on it instead of a page-wide count; set thresholds from measured values on every environment. For each threshold, name the defect it still catches — and the one it no longer catches. (🟠)first() yields either a false failure on correct markup or a test that depends on content order; assert the invariant shared by all items, not a property of the first one. (🟠)not.toBeInViewport(); "after the filter there are 3 cards" → before the filter there are not 3. Otherwise the test passes on the pre-action state (after a reload the browser has already scrolled to the anchor, the data was already there). The same goes for toHaveURL with a regex that the pre-action URL also matches. (🟠)A mature test repository always has conventions no universal checklist will catch. Record them here or in the project's
CLAUDE.md— then the review will catch their violations. Typical categories with examples:
test from the custom fixture (./fixtures/custom-test) instead of @playwright/test, and which mandatory checks it provides (e.g. a network error monitor invoked at the end of the test / in afterEach). (🟠)browserName without a ticket = lost coverage (🟠). Mobile width and touch checks live in a separate mobile spec, not in the desktop one. Document the mechanism: a tag the WebKit project excludes via grepInvert, or a split by files via testMatch/testIgnore. (🟡/🟠)testIgnore/testMatch), runtime test.skip — only for dynamic conditions (feature flag, known bug with a ticket). Run outcome: passed = ok, failed = problem, skipped = requires an explanation. (🟡)@playwright/test version and do not add dependencies without checking against CI (Docker image, lock file); do not touch playwright.config.ts without necessity. (🔴 if touched without being asked)## Review: <files / scope>
**Static analysis:** typecheck ✅/❌ · lint ✅/❌ · (run: N/N pass, --repeat-each=2)
### 🔴 Blocker (N)
1. `path/to/spec.ts:42` — <what is wrong>.
Why: <link to rule/category>.
Fix:
```ts
// ❌ before / ✅ after
…
…
…
path/to/spec.ts:42 - - question to the author: <…><Ready to commit / Needs rework: list of Blocker+Major> · <run command with the correct --project>
Rules:
- Sort strictly by severity (Blocker → Nit). Within a level — by file/line.
- Every Blocker/Major — with a concrete fix (a `❌ before → ✅ after` snippet).
- A category is clean — write "clean", do not invent.
- At the end — a one-line verdict and the run command with the correct `--project`.
- The verdict ends with a line for whoever applies the fixes: one change → typecheck/run → the next, no wholesale rewrite of a working test.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub akovalion/paranoid-qa --plugin paranoid-qa5 skills in this plugin
/bug-reportQuick bug report in Jira. Invoke via /bug-report. Gathers data, shows a preview, creates the defect in Jira after confirmation./interviewStructured requirements gathering through a series of questions. Use when the task is described verbally/informally (not from an issue tracker ticket) and scope, AC, and edge cases need clarifying before work starts./test-casesTest case authoring per QA best practices, with CSV export for Zephyr Scale import (Option 1) or direct creation via your TMS MCP. Use when the user asks to generate, write, or prepare test cases, checklists, or CSV for TMS import./testingUniversal testing framework (frontend + backend) — a meticulous run of any testing task with evidence discipline. Use when you need to test a feature/form/build/API/service, draft a test plan, run checks, perform exploratory or regression testing, or find defects.Other plugins' skills for the same job