A Playwright Skill is a structured Markdown file (or set of files) that teaches an AI coding agent how to write, debug, and maintain Playwright tests according to your team's specific standards.
The problem it solves is straightforward. AI models trained on generic internet data produce generic test code: brittle CSS selectors, no page object structure, inconsistent naming, missing await calls. A Skill file tells the agent your rules before it writes a single line of code.
- Always use getByRole(), getByLabel(), getByTestId() or getByText()
- Never use CSS selectors or XPath unless no semantic alternative exists
- Prefer data-testid as a last resort, never class names
- Follow the Page Object Model (POM)
- One describe block per feature, one test per user scenario
- Use fixtures for authentication and shared setup
- Use web-first assertions (toBeVisible, toHaveText, toHaveURL)
- Never use page.waitForTimeout() or any hard-coded delays
- Always await every assertion
- Test files: feature-name.spec.ts
- Page objects: FeatureNamePage.ts
- Describe blocks: human-readable feature names
Skills work with any AI coding agent that accepts context files: Claude Code reads CLAUDE.md, Cursor reads .cursorrules, GitHub Copilot reads instruction files in .github/. The concept is the same across tools. You feed the agent structured instructions, and it produces code that matches your architecture.
Since Playwright v1.56, the CLI itself supports Skills natively through the agent system. When you run npx playwright init-agents, it scaffolds agent definitions that include Skill-like instructions for the Planner, Generator, and Healer.
The interview-ready distinction: Skills are not test code. They are the knowledge layer that makes AI-generated test code production-ready. Without a Skill, an AI agent writes generic tests. With a Skill, it writes tests that match your project's locator strategy, page object pattern, naming conventions, and assertion style.
For deeper context on how Skills, CLI, and MCP fit together in the full AI testing stack, the Playwright AI ecosystem guide on TestDino covers the complete four-layer architecture.