agentleFS
DobroslavRadosavljevicDobroslavRadosavljevic/cabrakan/.agents/skills/playwright/SKILL.md

playwright

Skill1 starsChanged 3 months agoMITView on GitHub

Build, review, debug, configure, migrate, or plan Playwright browser automation and E2E tests with current docs. Use for @playwright/test, playwright, playwright.config, locators, getByRole, assertions, fixtures, Page Object Model, storageState auth, network mocking, HAR, traces, UI Mode, codegen, CI sharding, Docker, APIRequestContext, experimental component testing, accessibility, screenshots, visual comparisons, and Playwright MCP or CLI agent tooling.

102 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use develop-web-game, msw and 6 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 3 projects that use this

  • thongdn-itSkill

    msw

    MSW (Mock Service Worker) best practices for API mocking in tests (formerly test-msw). This skill should be used when setting up MSW, writing request handlers, or mocking HTTP APIs. This skill does NOT cover general testing patterns (use test-vitest or test-tdd skills) or test methodology.

    Also in 3 projects that use this

  • SupabaseSkill

    react-hook-form

    Correct React Hook Form usage anywhere in the monorepo — data flow, subscriptions,

    Also in 3 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

  • MicrosoftSkill

    typescript

    TypeScript best practices for this monorepo. Use this skill when: (1) writing new TypeScript code, (2) reviewing TypeScript code, (3) working with API responses, fetch calls, or JSON parsing, (4) adding or modifying types and interfaces.

    Also in 8 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

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 88 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when work touches Playwright Test, browser automation, E2E tests, locators, fixtures, auth setup, network mocking, traces, …

    line 8
  2. Very specific:

    Test layout: specs, setup projects, fixtures, POM classes, playwright/.auth, snapshots, and CI workflows.

    line 15
  3. Very specific:

    Prefer @playwright/test for E2E.

    line 23
  4. Distinctive:

    After changing Playwright package versions, reinstall matching browser binaries.

    line 24
  5. Very specific:

    Prefer user-facing locators: getByRole first, then label/placeholder/text/alt/title, then getByTestId.

    line 29
  6. Very specific:

    Keep tests isolated. Prefer setup-project storageState or worker-scoped accounts over shared mutable login in every test.

    line 32
  7. Distinctive:

    Treat experimental CT (React/Vue) as optional and separate from E2E.

    line 36
  8. Distinctive:

    Prefer the repo's existing checks.

    line 41

“Common” is measured: kept by at least 6 in 10 of the 88 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

Use this skill when work touches Playwright Test, browser automation, E2E tests, locators, fixtures, auth setup, network mocking, traces, CI, API testing alongside UI, or agent browser tooling built on Playwright.

Workflow

  1. Inspect the local Playwright surface before changing code:
    • Package versions for @playwright/test, playwright, optional @playwright/browser-*, experimental CT packages, and Node.
    • Config: playwright.config.ts / .js, testDir, projects, use options, webServer, reporters, retries/workers.
    • Test layout: specs, setup projects, fixtures, POM classes, playwright/.auth, snapshots, and CI workflows.
    • Runtime intent: E2E UI, API-only, auth reuse, network mocks, visual/a11y checks, component tests, or agent-driven exploration.
  2. Refresh docs when the user asks for latest/current behavior, versions are unclear, or the work touches CI, CT, or agent tooling. Start from source-map.md.
  3. For install, Library vs Test, config, projects, webServer, and CLI, use setup-core.md.
  4. For locators, actions, auto-waiting, web-first assertions, and anti-patterns, use locators-assertions.md.
  5. For fixtures, POM, auth/storageState, parallelism, and network/HAR mocking, use fixtures-auth-network.md.
  6. For traces, UI Mode, debug, CI/sharding/Docker, API testing, CT, a11y/visuals, and agent tooling, use debugging-ci-advanced.md.
  7. Implement in the existing project style:
    • Prefer @playwright/test for E2E. Use the playwright library only for standalone scripts/automation without the Test Runner.
    • After changing Playwright package versions, reinstall matching browser binaries.
    • Match local locator conventions, fixture patterns, and CI artifact settings unless they contradict official guidance.

Playwright Judgment

  • Prefer user-facing locators: getByRole first, then label/placeholder/text/alt/title, then getByTestId. Avoid CSS/XPath unless justified.
  • Assert with web-first await expect(...).toBeVisible() (and siblings). Never expect(await locator.isVisible()).toBe(true).
  • Trust auto-waiting. Do not ship waitForTimeout / sleep-based synchronization.
  • Keep tests isolated. Prefer setup-project storageState or worker-scoped accounts over shared mutable login in every test.
  • Mock third-party or uncontrollable network at context/page.route; start waitForResponse before the triggering action.
  • Local debug path: UI Mode → Trace Viewer for CI failures → --debug / Inspector for step-through.
  • CI defaults: forbidOnly, retries, trace: 'on-first-retry', screenshot: 'only-on-failure', install with --with-deps or a version-matched Docker image, scale with shards not only workers.
  • Treat experimental CT (React/Vue) as optional and separate from E2E. Svelte CT package was removed.
  • For coding agents writing tests in-repo, prefer Playwright CLI when available; use Playwright MCP for live exploratory browser loops. Do not confuse harness browser tools with @playwright/mcp.

Verification

Prefer the repo's existing checks. For meaningful Playwright work, include the relevant subset:

  • Focused bunx playwright test for the changed specs/projects (--project, file path, or -g title).
  • UI Mode or headed run when locator/timing behavior is unclear.
  • Trace or HTML report review for flake, actionability, or network failures.
  • CI-shaped smoke when changing retries, shards, reporters, Docker tags, auth setup, or webServer.
  • Snapshot update (-u) only when visual baselines intentionally change, generated on the same OS/browser as CI when possible.
  • Typecheck for TypeScript configs, fixtures, and POM helpers when the project typechecks tests.

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.