Back to Skills

review

Review Playwright tests for quality. Use when user says "review tests", "check test quality", "audit tests", "improve tests", "test code review", or "playwright best practices check".

23,446stars3,238forksUpdated 7/30/2026

Security Assessment

Safe(95/100)
Security Score95/100

About review

This skill systematically reviews Playwright test files for quality problems, checking them against a curated catalogue of twenty anti-patterns spanning flakiness, maintainability, and coverage gaps. It solves a common problem in end-to-end testing: suites that pass locally but flake in CI because of arbitrary waits, non-web-first assertions, hardcoded URLs, brittle CSS/XPath selectors, missing awaits, and order-dependent shared state. Instead of ad-hoc code review, it gives the agent a repeatable rubric to grade tests objectively.

The workflow gathers context from `playwright.config.ts` and the target spec files, then checks each file against critical, warning, and informational anti-patterns drawn from the bundled `anti-patterns.md` reference. It scores each file on a 1-10 scale, produces a structured per-file report with line-level findings and suggested replacements (for example swapping `waitForTimeout` for a web-first `expect().toBeVisible()`), and can offer to apply fixes with the Edit tool. For large suites it can spawn parallel sub-agents per file and aggregate results into a summary table, also surfacing coverage gaps where pages or features have no tests.

It targets QA engineers, SDETs, and developers maintaining Playwright test suites who want to reduce flakiness and enforce best practices before merging. Typical use cases include auditing an inherited test suite, gating pull requests on test quality, and coaching teams toward role-based locators and independent, well-named tests.

FAQ

How do I invoke a review on a specific scope?

Pass a file path to review one spec file, a directory to review all tests within it, or leave the argument empty to review every test in the project's configured testDir.

What does the skill actually check for?

It checks each test against 20 anti-patterns grouped into Critical (e.g. waitForTimeout, non-web-first assertions, hardcoded URLs, missing await, shared state), Warning (long tests, magic strings, generic names), and Info (missing page objects, a11y and visual-regression gaps).

Does it change my code automatically?

No. It generates a scored report with suggested fixes first, then asks for confirmation before applying any corrections via the Edit tool.

Is it limited to a particular test framework?

Yes. It is specific to Playwright and expects .spec.ts/.spec.js files plus a playwright.config.ts; the guidance assumes Playwright's locator and assertion APIs.

Can it handle very large test suites?

Yes. For project-wide reviews it can spawn up to five concurrent sub-agents per file (or use a batch mode) and aggregate results into a summary table with average scores and critical-issue counts.

All Files

2 files
anti-patterns.md4.2 KB
View
SKILL.md3.0 KB
View

Install review

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill