agentleFS
kriscardkriscard/Skills/skills/dev/playwright/SKILL.md

playwright

Skill15 starsChanged 15 days agoMITView on GitHub

Write, review, and debug end-to-end (E2E) tests with Playwright Test, including new suites, configuration, and migration. Use when Playwright is requested or discovered and the work involves browser test authoring, specs, runner configuration, projects, fixtures, authentication or storage state, locators, waiting, network routing, browser isolation, traces or media, parallelism, sharding, failures, or upgrades. Detect the installed version before version-sensitive guidance. Use test for test strategy, agent-browser for one-off browser automation, and framework specialists for framework rendering and routing contracts.

94 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use develop-web-game, web-perf and 4 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • hebertzhuSkill

    develop-web-game

    Use when building or iterating on a web game and you need a tight implement-test-observe loop; prefer the bundled Playwright client, inspect screenshots and text state, and validate every meaningful change before moving on.

    Also in 4 projects that use this

  • OpenAISkill

    web-perf

    Analyzes web performance using Chrome DevTools MCP. Measures Core Web Vitals (FCP, LCP, TBT, CLS, Speed Index), identifies render-blocking resources, network dependency chains, layout shifts, caching issues, and accessibility gaps. Use when asked to audit, profile, debug, or optimize page load performance, Lighthouse scores, or site speed. Biases towards retrieval from current documentation over pre-trained knowledge.

    Also in 5 projects that use this

  • JetBrainsSkill

    doc

    Use when the task involves reading, creating, or editing `.docx` documents, especially when formatting or layout fidelity matters; prefer `python-docx` plus the bundled `scripts/render_docx.py` for visual checks.

    Also in 4 projects that use this

  • CloudflareSkill

    turnstile-spin

    Set up, repair, or migrate to Cloudflare Turnstile bot verification in an existing frontend and backend, including server-side Siteverify.

    Also in 3 projects that use this

  • OpenAISkill

    nextjs

    Next.js App Router expert guidance. Use when building, debugging, or architecting Next.js applications — routing, Server Components, Server Actions, Cache Components, layouts, middleware/proxy, data fetching, rendering strategies, and deployment on Vercel.

    Also in 4 projects that use this

  • CloudflareSkill

    cloudflare-one

    Design, configure, troubleshoot, or review Cloudflare One Zero Trust and SASE deployments. Use cloudflare-one-migrations for migration planning from other vendors. Also use when an agent, script, crawler, or other non-browser client needs to reach a webpage or API protected by Cloudflare Access.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 81 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill when writing or adding Playwright E2E tests, creating a new suite, or changing persistent tests, runner configuration, …

    line 25
  2. Very specific:

    When a framework contract is involved, load its owner too.

    line 32
  3. Distinctive:

    Run the local CLI through the owning package manager, for example:

    line 47
  4. Distinctive:

    If dependencies are not installed, derive the resolved version from the lockfile and record that the CLI could not confirm it.

    line 59
  5. Distinctive:

    Read the focused config, relevant project, fixture exports, auth setup, helper layers, nearby specs, scripts, and CI invocation.

    line 71
  6. Distinctive:

    Complete when: every Playwright-specific decision is covered by a loaded branch and matches the detected version.

    line 90
  7. Distinctive:

    Use Playwright's locator and web-assertion model rather than sleeps or DOM-structure selectors.

    line 95
  8. Distinctive:

    Run the narrowest Playwright command first and inspect the first failure using the most informative available artifact.

    line 109

“Common” is measured: kept by at least 6 in 10 of the 81 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Playwright Engineering

Apply Playwright Test mechanics that match the repository's installed version. Compose with the general workflow owner instead of replacing it: test decides what behavior needs browser coverage and what evidence is sufficient; this skill owns how Playwright implements and diagnoses that coverage.

Workflow

1. Confirm Playwright owns the task

Use this skill when writing or adding Playwright E2E tests, creating a new suite, or changing persistent tests, runner configuration, fixtures, browser state, debugging, or migration. Load test for behavioral scope and its browser/E2E guidance; this skill supplies the runner-specific authoring process. Use agent-browser for one-off website interaction, scraping, exploratory automation, or operational browser work that does not belong in a Playwright suite.

When a framework contract is involved, load its owner too. For example, nextjs-app-architecture owns Next.js rendering, routing, caching, and loading behavior; this skill owns the Playwright configuration, APIs, locators, and browser evidence used to verify that behavior.

Complete when: Playwright-specific work and adjacent owners are explicit.

2. Detect the installed contract

Work from the package that owns the tests, not automatically from the repository root. Inspect its manifest, workspace configuration, lockfile, Playwright config, imports, installed package declarations, and nearby tests. Determine whether the suite uses @playwright/test, playwright, playwright-core, or an experimental component-testing package.

Run the local CLI through the owning package manager, for example:

pnpm exec playwright --version
npm exec playwright -- --version
yarn playwright --version

For a new suite with no resolved dependency, verify the current stable release, select and record a compatible target, then use that version's contracts. A request for modern practices does not authorize upgrading an existing suite or copying prerelease APIs.

If dependencies are not installed, derive the resolved version from the lockfile and record that the CLI could not confirm it. Check that directly related Playwright packages use compatible versions and that CI installs the browser binaries expected by the suite. Treat local types and declarations as the API boundary. Use current official docs only for the detected version's supported behavior; verify newer APIs against release notes and installed declarations before recommending them.

Complete when: package owner, package manager, runner package, exact resolved version, config path, and browser-install path are known or explicitly unresolved.

3. Inspect the existing suite before prescribing structure

Read the focused config, relevant project, fixture exports, auth setup, helper layers, nearby specs, scripts, and CI invocation. Preserve established conventions unless they cause the reported failure or conflict with the requested behavior. Establish a focused command with --project, file path, or -g before editing.

Complete when: the baseline command, current isolation/state model, and local conventions are known.

4. Load only the applicable reference

PriorityLoad whenReference
1 — HighWriting, adding, or reviewing an E2E test or user journey, or creating a new Playwright suitereferences/e2e-authoring.md
1 — HighRunner config, projects, dependencies, fixtures, setup/teardown, authentication, or storage statereferences/runner-and-state.md
1 — HighLocators, assertions, actions, navigation readiness, timeouts, flaky waits, or helper/page-object designreferences/interaction-and-readiness.md
1 — HighRequest observation, route interception, response mocking, HAR, service workers, contexts, or shared-state failuresreferences/network-and-isolation.md
1 — HighTrace Viewer, screenshots, visual/accessibility baselines, video, UI Mode, Inspector, CI artifacts, retries, flaky-test policy, workers, parallelism, or shardingreferences/diagnostics-and-scale.md
1 — HighUpgrade, deprecated or removed API, browser/package mismatch, unexplained runner failure, or version-sensitive reviewreferences/migrations-and-failures.md

Complete when: every Playwright-specific decision is covered by a loaded branch and matches the detected version.

5. Implement the smallest resilient change

Use Playwright's locator and web-assertion model rather than sleeps or DOM-structure selectors. Keep each test independently reproducible through browser-context isolation and explicit external-state setup. Add fixtures, projects, auth reuse, network routing, or abstraction only when the behavior requires them.

Retries may collect diagnostic evidence, but a test that passes only on retry remains flaky. Diagnose the first failure and preserve the classification in CI rather than raising retries until the suite appears green.

Complete when: the change proves the requested browser behavior without hidden order, time, account, or worker dependencies.

6. Run focused evidence, then affected checks

Run the narrowest Playwright command first and inspect the first failure using the most informative available artifact. Then run the affected project or suite plus repository validation. For concurrency work, verify under the intended worker/shard settings rather than only with one worker. For migration, confirm test discovery before and after, run a representative test per project/browser, and verify browser installation in CI.

Complete when: commands, detected version, passing evidence, artifacts inspected, and unresolved environment limits are recorded.

Non-negotiable defaults

  • Readiness comes from a user-visible state, URL, response, download, popup, or other behavior-specific signal. networkidle is not the default readiness signal.
  • Fixed sleeps are debugging tools, not production synchronization.
  • Retries reveal flaky tests; they do not make flakiness acceptable.
  • Browser contexts and external test data preserve independence; test order does not.
  • Page objects or large helper layers require demonstrated repeated complexity and a coherent interface, not merely the existence of a page.
  • Auth state files are credentials. Keep them out of version control and separate accounts when parallel tests mutate shared server state.

Completion gate

Before finishing, confirm:

  • installed Playwright version and package owner were detected before version-sensitive advice;
  • local declarations and official release notes support every used API;
  • for E2E authoring, its reference and test were loaded, with setup and mocks leaving the claimed behavior observable;
  • locators express user-facing semantics or an explicit test contract;
  • waits observe the behavior that marks readiness;
  • tests remain isolated across order, workers, projects, and retries;
  • failures retain useful trace/media/log evidence without recording everything by default;
  • the focused command and affected validation pass, or exact blockers are reported.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.