Review Playwright tests for quality

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".
--- 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`
Overview
Systematically review Playwright test files for anti-patterns, missed best practices, and coverage gaps.
What you get
- File-by-file review with scores
- Summarytotal files, average score, critical issue count
- Actionable fix list
- Coverage gaps identified (pages/features with no tests)
Manual install (npx, ZIP)
npx skills add alirezarezvani/claude-skills --skill pw-review -g -a claude-codemkdir -p ~/.claude/skills && curl -sL https://codeload.github.com/alirezarezvani/claude-skills/tar.gz/19392f7a0826 \
| tar -xz -C ~/.claude/skills --strip-components=4 claude-skills-19392f7a0826/engineering-team/playwright-pro/skills/pw-reviewNew-Item -ItemType Directory -Force "$HOME\.claude\skills" | Out-Null; Invoke-WebRequest "https://m.agentalley.io/zip/fcbea7447637d23334dd/pw-review.zip" -OutFile "$env:TEMP\pw-review.zip"; Expand-Archive "$env:TEMP\pw-review.zip" -DestinationPath "$HOME\.claude\skills" -ForceConnects with Agent Alley MCP · agentalley.io/mcp
Files included
SKILL.md3.0 KBanti-patterns.md4.2 KB
Read the files here
alirezarezvani/
Show the full text103 lines
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.tsfor project settings - List all
*.spec.ts/*.spec.jsfiles 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):
waitForTimeout()usage- Non-web-first assertions (
expect(await ...)) - Hardcoded URLs instead of
baseURL - CSS/XPath selectors when role-based exists
- Missing
awaiton Playwright calls - Shared mutable state between tests
- 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
/batchfor 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)
| 1 | |
| 2 | name "pw-review" |
| 3 | description >- |
| 4 | Review Playwright tests for quality. Use when user says "review tests", |
| 5 | "check test quality", "audit tests", "improve tests", "test code review", |
| 6 | or "playwright best practices check". |
| 7 | |
| 8 | |
| 9 | # Review Playwright Tests |
| 10 | |
| 11 | Systematically review Playwright test files for anti-patterns, missed best practices, and coverage gaps. |
| 12 | |
| 13 | ## Input |
| 14 | |
| 15 | `$ARGUMENTS` can be: |
| 16 | A file path: review that specific test file |
| 17 | A directory: review all test files in the directory |
| 18 | Empty: review all tests in the project's `testDir` |
| 19 | |
| 20 | ## Steps |
| 21 | |
| 22 | ### 1. Gather Context |
| 23 | |
| 24 | Read `playwright.config.ts` for project settings |
| 25 | List all `*.spec.ts` / `*.spec.js` files in scope |
| 26 | If reviewing a single file, also check related page objects and fixtures |
| 27 | |
| 28 | ### 2. Check Each File Against Anti-Patterns |
| 29 | |
| 30 | Load `anti-patterns.md` from this skill directory. Check for all 20 anti-patterns. |
| 31 | |
| 32 | **Critical (must fix):** |
| 33 | `waitForTimeout()` usage |
| 34 | Non-web-first assertions (`expect(await ...)`) |
| 35 | Hardcoded URLs instead of `baseURL` |
| 36 | CSS/XPath selectors when role-based exists |
| 37 | Missing `await` on Playwright calls |
| 38 | Shared mutable state between tests |
| 39 | Test execution order dependencies |
| 40 | |
| 41 | **Warning (should fix):** |
| 42 | Tests longer than 50 lines (consider splitting) |
| 43 | Magic strings without named constants |
| 44 | Missing error/edge case tests |
| 45 | `page.evaluate()` for things locators can do |
| 46 | Nested `test.describe()` more than 2 levels deep |
| 47 | Generic test names ("should work", "test 1") |
| 48 | |
| 49 | **Info (consider):** |
| 50 | No page objects for pages with 5+ locators |
| 51 | Inline test data instead of factory/fixture |
| 52 | Missing accessibility assertions |
| 53 | No visual regression tests for UI-heavy pages |
| 54 | Console error assertions not checked |
| 55 | Network idle waits instead of specific assertions |
| 56 | Missing `test.describe()` grouping |
| 57 | |
| 58 | ### 3. Score Each File |
| 59 | |
| 60 | Rate 1-10 based on: |
| 61 | **9-10**: Production-ready, follows all golden rules |
| 62 | **7-8**: Good, minor improvements possible |
| 63 | **5-6**: Functional but has anti-patterns |
| 64 | **3-4**: Significant issues, likely flaky |
| 65 | **1-2**: Needs rewrite |
| 66 | |
| 67 | ### 4. Generate Review Report |
| 68 | |
| 69 | For each file: |
| 70 | |
| 71 | ## <filename> — Score: X/10 |
| 72 | |
| 73 | ### Critical |
| 74 | - Line 15: `waitForTimeout(2000)` → use `expect(locator).toBeVisible()` |
| 75 | - Line 28: CSS selector `.btn-submit` → `getByRole('button', { name: "submit" })` |
| 76 | |
| 77 | ### Warning |
| 78 | - Line 42: Test name "test login" → "should redirect to dashboard after login" |
| 79 | |
| 80 | ### Suggestions |
| 81 | - Consider adding error case: what happens with invalid credentials? |
| 82 | |
| 83 | |
| 84 | ### 5. For Project-Wide Review |
| 85 | |
| 86 | If reviewing an entire test suite: |
| 87 | Spawn sub-agents per file for parallel review (up to 5 concurrent) |
| 88 | Or use `/batch` for very large suites |
| 89 | Aggregate results into a summary table |
| 90 | |
| 91 | ### 6. Offer Fixes |
| 92 | |
| 93 | For each critical issue, provide the corrected code. Ask user: "Apply these fixes? [Yes/No]" |
| 94 | |
| 95 | If yes, apply all fixes using `Edit` tool. |
| 96 | |
| 97 | ## Output |
| 98 | |
| 99 | File-by-file review with scores |
| 100 | Summary: total files, average score, critical issue count |
| 101 | Actionable fix list |
| 102 | Coverage gaps identified (pages/features with no tests) |
| 103 |
Details
- Updated
- Aug 30, 2026
- License
- MIT
- Stars on the repo
- ★ 26,349
- Checked
- Source
- alirezarezvani/claude-skills ↗
- Creator
- alirezarezvani · 363 listings
Similar skills
See all →
SkillRequires technical rigor and verificationCode Review Reception
SkillConduct high-quality, persona-driven code reviewsCode Review Expert
SkillExplain something in the format that is fastestLLM output explainer
SkillRequests code review before mergingRequesting code review
PromptAct as a code review agent to evaluate and improve code
PromptAct as an expert AI code reviewerCode review by coderabitMore from alirezarezvani
SkillResume a paused experiment/ar:ar-resume — Resume Experiment
SkillShow experiment dashboard with results, active loops/ar:ar-status — Experiment Dashboard
SkillStart an autonomous experiment loop with user-selected/ar:loop — Autonomous Experiment Loop
SkillRun a single experiment iteration/ar:run — Single Experiment Iteration
SkillSet up a new autoresearch experiment interactively/ar:setup — Create New Experiment
Skill/cs:boardroom <brief/cs:boardroom — Multi-Role Boardroom Deliberation