Skills

Playwright Best Practices: task-based advice for TypeScript tests

For people writing, debugging, or maintaining TypeScript Playwright tests; install with the official npx command, describe the task, and read advice before changing code.

Official source · Playwright Best Practices Skill

Install

npx skills add https://github.com/currents-dev/playwright-best-practices-skill

Who it's for

This guide is for people writing, debugging, or maintaining Playwright tests in TypeScript who want an agent to give advice aimed at the current activity. Officially it is activity-driven: what you are doing points to the matching references, instead of loading every document at once.

Repository:

https://github.com/currents-dev/playwright-best-practices-skill

It fits when the repo already has Playwright tests and you need to fix an unstable case or add accessibility checks. The materials say you do not have to speak the skill name or “Playwright best practices”; stating the task clearly is enough.

It does not fit environments that mainly write tests in other languages, or that have no compatible skill-install mechanism. The existing materials keep the guidance on TypeScript Playwright tests; do not extend that to languages that are not written down.

First try in 3 minutes

Follow only the one official recommended path.

Preconditions: this machine can run npx, the current agent accepts this skill-install method, and the workspace has a Playwright test you can discuss. Before install, confirm you are writing into the agent environment you are actually using.

Install location: handled by npx skills add itself. The materials do not name a target folder; do not invent a path that does not appear.

Copy and run:

npx skills add https://github.com/currents-dev/playwright-best-practices-skill 

Success signal: the command finishes normally. Do a read-only check first: open a login-related test and tell the agent “look at this unstable login test, point out possible causes first, do not change files.” The official example is exactly “fix this flaky login test”. If the reply cites specific waits, targeting, or assertion issues instead of a vague rewrite, the matching references were used.

After you accept the analysis, explicitly authorize which file it may change. Changing tests has side effects; do not let it patch until the scope is confirmed.

Use cases

Case 1: Investigate an unstable login test. Maps to the official sample task “fix this flaky login test”. Fits when a test sometimes passes and sometimes fails, and you want focused advice first. Describe the symptom and failure log, and ask for analysis only. On success, the reply should land on references for the current activity, not dump all 57 documents at once. The materials do not name the eight categories, so do not invent category or document filenames. Before really changing a test, confirm the file and the expected behavior.

Case 2: Add accessibility tests. Maps to the official sample “add accessibility tests”. Fits when you already have a page flow and want accessibility checks. First ask the agent to propose assertions from the current page test, still without writing files. After you confirm selectors and coverage, let it add cases. The success signal is advice that matches the page you named, not a generic template. The existing materials only show that this task description can trigger the skill; they do not expand specific APIs or config keys.

Usage limits

The existing materials give one install command and the “point at references by activity” usage. Do not switch to a marketplace command, clone path, or other installer that does not appear. The materials also do not name required clients; do not write exclusive support for a handful of agents.

The reference library is 57 documents in 8 categories, but category names and per-document paths are unwritten. Do not invent document paths or skill subfolders.

It guides writing, debugging, and maintaining Playwright tests in TypeScript. Steps for other languages or other test frameworks cannot be filled in from the existing materials. Changing tests changes the repo; analyze first, then authorize writes. More detail is on the official repository:

https://github.com/currents-dev/playwright-best-practices-skill