pw-review — Claude Code skill: what it does, how to install
pw-review audits Playwright tests for anti-patterns, coverage gaps, and weak practices. Use it for one test file, a directory, or the project testDir.
/plugin marketplace add alirezarezvani/claude-skills
/plugin install pw@claude-code-skillsWhat pw-review does
pw-review reads playwright.config.ts, finds the test files in scope, and checks them against 20 anti-patterns. Critical checks include waitForTimeout(), non-web-first assertions, hardcoded URLs, weak selectors, missing await, shared mutable state, and test-order dependencies.
Each file receives a score from 1 to 10 with critical issues, warnings, suggestions, and possible fixes. A project-wide review can split files between sub-agents, aggregate the results, and point out coverage gaps. Related page objects and fixtures are also considered when one file is reviewed.
Install it when you need a structured Playwright test audit before making changes. For a quick check of a tiny file, the full report may be more than you need.
What it helps with
- find
waitForTimeout()in Playwright tests - check selectors and web-first assertions
- catch missing
awaitcalls - identify gaps in test coverage
- review every test file in a directory
Example prompts for the agent
- Review the tests in `tests/auth.spec.ts` for quality.
- Audit all Playwright tests in `tests/` and score each file.
- Find critical anti-patterns and show corrected code.
How to install pw-review
1Plugin marketplace
/plugin marketplace add alirezarezvani/claude-skills/plugin install pw@claude-code-skillsThis installs the whole pw plugin with all its skills
2Skills CLI (Vercel)
npx skills add alirezarezvani/claude-skills --skill pw-review -a claude-code3Manually: put the files in place
~/.claude/skills/pw-review/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/pw-review/
Manually: put the files in place
.agents/skills/pw-review/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/pw-review/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install alirezarezvani/claude-skills pw-review2Manually: put the files in place
.github/skills/pw-review/SKILL.mdPlatform CLI
gemini skills install https://github.com/alirezarezvani/claude-skills --path engineering-team/playwright-pro/skills/pw-reviewManually: put the files in place
.devin/skills/pw-review/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set349
The whole set →Similar
Questions about pw-review
How do I install pw-review in Claude Code?
Add the marketplace with /plugin marketplace add alirezarezvani/claude-skills, then install the plugin with /plugin install pw@claude-code-skills. You can also run npx skills add alirezarezvani/claude-skills --skill pw-review -a claude-code.
What does pw-review do?
The skill checks Playwright tests against 20 anti-patterns, scores each file from 1 to 10, and produces an actionable review. It also identifies missing coverage.
What does pw-review need to inspect a test project?
For a project review, it reads playwright.config.ts. You can pass a file path, a directory, or no argument to review the project's testDir.
Source text
SKILL.md · MIT
---
name: "pw-review"
description: >-
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".
---
# Review Playwright Tests
Systematically review Playwright test files for anti-patterns, missed best practices, and coverage gaps.
## Input
`$ARGUMENTS` can be:
- A file path: review that specific test file
- A directory: review all test files in the directory
- Empty: review all tests in the project's `testDir`
## Steps
### 1. Gather Context
- Read `playwright.config.ts` for project settings
- List all `*.spec.ts` / `*.spec.js` files in scope
- If reviewing a single file, also check related page objects and fixtures
### 2. Check Each File Against Anti-Patterns
Load `anti-patterns.md` from this skill directory. Check for all 20 anti-patterns.
**Critical (must fix):**
1. `waitForTimeout()` usage
2. Non-web-first assertions (`expect(await ...)`)
3. Hardcoded URLs instead of `baseURL`
4. CSS/XPath selectors when role-based exists
5. Missing `await` on Playwright calls
6. Shared mutable state between tests
7. Test execution order dependencies
**Warning (should fix):**
8. Tests longer than 50 lines (consider splitting)
9. Magic strings without named constants
10. Missing error/edge case tests
11. `page.evaluate()` for things locators can do
12. Nested `test.describe()` more than 2 levels deep
13. Generic test names ("should work", "test 1")
**Info (consider):**
14. No page objects for pages with 5+ locators
15. Inline test data instead of factory/fixture
16. Missing accessibility assertions
17. No visual regression tests for UI-heavy pages
18. Console error assertions not checked
19. Network idle waits instead of specific assertions
20. Missing `test.describe()` grouping
### 3. Score Each File
Rate 1-10 based on:
- **9-10**: Production-ready, follows all golden rules
- **7-8**: Good, minor improvements possible
- **5-6**: Functional but has anti-patterns
- **3-4**: Significant issues, likely flaky
- **1-2**: Needs rewrite
### 4. Generate Review Report
For each file:
```
## <filename> — Score: X/10
### Critical
- Line 15: `waitForTimeout(2000)` → use `expect(locator).toBeVisible()`
- Line 28: CSS selector `.btn-submit` → `getByRole('button', { name: "submit" })`
### Warning
- Line 42: Test name "test login" → "should redirect to dashboard after login"
### Suggestions
- Consider adding error case: what happens with invalid credentials?
```
### 5. For Project-Wide Review
If reviewing an entire test suite:
- Spawn sub-agents per file for parallel review (up to 5 concurrent)
- Or use `/batch` for very large suites
- Aggregate results into a summary table
### 6. Offer Fixes
For each critical issue, provide the corrected code. Ask user: "Apply these fixes? [Yes/No]"
If yes, apply all fixes using `Edit` tool.
## Output
- File-by-file review with scores
- Summary: total files, average score, critical issue count
- Actionable fix list
- Coverage gaps identified (pages/features with no tests)
© Alireza Rezvani · MIT · alirezarezvani/claude-skills