playwright-auth-state
Playwright workflows for authenticated browser state reuse through storageState and setup projects.
Conducts rigorous authoring and review of Playwright E2E tests. Enforces accessibility-first locators, web-first assertions, strict isolation, and DAMP architecture. Use when generating, refactoring, or reviewing any Playwright test code.
Claude Code
$ npx -y skills add hzijad/playwright-agent-skills --skill playwright-core --agent claude-code
Codex
$ npx skills add hzijad/playwright-agent-skills --skill playwright-core -a codex -y
Cursor
$ npx skills add hzijad/playwright-agent-skills --skill playwright-core -a cursor -y
Gemini CLI
$ npx skills add hzijad/playwright-agent-skills --skill playwright-core -a gemini-cli -y
GitHub Copilot
$ npx skills add hzijad/playwright-agent-skills --skill playwright-core -a github-copilot -y
OpenCode
$ npx skills add hzijad/playwright-agent-skills --skill playwright-core -a opencode -y
Windsurf
$ npx skills add hzijad/playwright-agent-skills --skill playwright-core -a windsurf -y
name: playwright-core description: Conducts rigorous authoring and review of Playwright E2E tests. Enforces accessibility-first locators, web-first assertions, strict isolation, and DAMP architecture. Use when generating, refactoring, or reviewing any Playwright test code.
Writing end-to-end tests is easy. Writing end-to-end tests that survive UI refactors and network latency without flaking requires discipline.
Use this skill when you are authoring, reviewing, or refactoring Playwright tests that should behave like a real user journey. It pairs well with `playwright-auth-state` for logged-in flows, `playwright-network-mocking` for external API control, and `playwright-debugging` when a test is already failing.
**The approval standard:** A test is only valid if it tests the application exactly how a human user interacts with it. We do not test implementation details, we do not rely on fixed sleep timers, and we do not share state between tests. If a test fails, it should indicate a true user-facing bug, not a brittle CSS selector or a race condition.
Every Playwright test must be evaluated across these five dimensions before execution:
Does the test target user intent, or is it coupled to implementation?
Are we relying on Playwright's actionability engine, or are we manually guessing execution speed?
Can this test run in complete isolation, in any order, and in parallel?
Can another engineer read the test top-to-bottom and understand the business requirement?
Does the test verify what the user cares about?
---
When you identify a structural problem in a test, do not just patch it. Reach for a named restructuring:
---
You must follow this exact order of preference when querying the DOM. Fall to the next level only if the previous is impossible.
1. `page.getByRole()` - Always the first choice. Tests accessibility and user intent simultaneously. 2. `page.getByLabel()` - The standard for form inputs. 3. `page.getByPlaceholder()` - Acceptable for inputs without labels. 4. `page.getByText()` - For generic non-interactive text elements. 5. `page.getByTestId()` - The fallback. Use only when semantic querying is impossible, such as dynamic SVG charts. 6. CSS/XPath - Forbidden unless explicitly requested for legacy integration.
When a locator could match more than one element, refine it with semantic filtering instead of switching to position-based selection. Prefer `filter()`, `and()`, or a narrower accessible name over `nth()` or DOM traversal.
---
Always use auto-retrying assertions. Never read a value and assert it synchronously.
// Bad: synchronous evaluation. Causes race conditions if the element is still rendering.
const isVisible = await page.getByRole('button').isVisible();
expect(isVisible).toBeTruthy();
// Good: Playwright handles the polling and timeout automatically.
await expect(page.getByRole('button', { name: 'Submit' })).toBeVisible();Do not force clicks on unready elements. Let Playwright wait for actionability.
// Bad: bypassing actionability checks.
await page.locator('.btn').click({ force: true });
// Good: waiting for the app to be ready.
await page.getByRole('button', { name: 'Submit' }).click();###
Playwright test patterns that avoid the mistakes agents make by default. Playwright Agent Skills is a small, opinionated set of reusable prompts for writing and reviewing Playwright tests.
Playwright workflows for authenticated browser state reuse through storageState and setup projects.
Diagnostic Playwright workflows for flaky or failing tests, including trace analysis, UI mode, and state isolation.
Playwright workflows for deterministic third-party responses using page.route().
Produce the "Playwright 1.xx API Review" artifact for a range of commits - the public API additions and the breaking or behavior…
Write, refine, run, and QA promptfoo evaluation suites: promptfooconfig.yaml, prompts, providers, vars, tests, assertions,…
DeepEval evaluation workflow for AI agents and LLM applications. TRIGGER when the user wants to evaluate or improve an AI agent,…