claude-code: Skill for Claude Code

.claude/skills/playwright-best-practices/SKILL.md

playwright-best-practices is a skill for Claude Code from alleneubank/claude-code. It costs 29 tokens per session (684 once invoked), scanned A, original, Apache-2.0.

A guide for writing Playwright browser tests, which automate and verify web pages. It covers reliable element selection, automatic waiting in assertions, and test isolation.

In plain words
What is it for?
Use it when writing or modifying Playwright test files that import @playwright/test.
Why use it?
It helps tests interact with pages in ways that are less likely to break when the interface changes.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions Claude Code.

This is alleneubank/claude-code's own configuration. It tells Claude Code how to work on claude-code itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-code configures →

Reuse

Borrowing it

Nothing to install: this file belongs to alleneubank/claude-code. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/alleneubank/claude-code/main/.claude/skills/playwright-best-practices/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/alleneubank/claude-code

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for playwright-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/alleneubank/claude-code/playwright-best-practices/github.svg)](https://agentmods.dev/skills/alleneubank/claude-code/playwright-best-practices)
Your own site
<a href="https://agentmods.dev/skills/alleneubank/claude-code/playwright-best-practices"><img src="https://agentmods.dev/badge/skills/alleneubank/claude-code/playwright-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for playwright-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/skills/alleneubank/claude-code/playwright-best-practices"><img src="https://agentmods.dev/badge/skills/alleneubank/claude-code/playwright-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 684 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 16 Jun 2026
  • Snyk pass 16 Jun 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00029 $0.00684
Opus 5.5 $0.00012 $0.00274
Sonnet 5.5 $0.00006 $0.00137
Haiku 4.5 $0.00003 $0.00068

Measured 2mo ago against content hash 87d117ee9a59, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

playwright-best-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/playwright-best-practices/SKILL.md · 59 lines

How it starts

The opening of the file, as written. The whole thing — 59 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Playwright Best Practices

CLI Context: Prevent Context Overflow

When running Playwright tests from Claude Code or any CLI agent, always use minimal reporters to prevent verbose output from consuming the context window.

Use --reporter=line or --reporter=dot for CLI test runs. Configure playwright.config.ts to default to minimal reporters when CI or CLAUDE env vars are set — see playwright-patterns.md for the config snippet.

Locator Priority (Most to Least Resilient)

Always prefer user-facing attributes:

  1. page.getByRole('button', { name: 'Submit' }) — accessibility roles
  2. page.getByLabel('Email') — form control labels
  3. page.getByPlaceholder('Search...') — input placeholders
  4. page.getByText('Welcome') — visible text (non-interactive)
  5. page.getByAltText('Logo') — image alt text
  6. page.getByTitle('Settings') — title attributes
  7. page.getByTestId('submit-btn') — explicit test contracts
  8. CSS/XPath — last resort, avoid

Core Rules

  • Web-first assertions: always await expect(locator).toBeVisible(), never expect(await locator.isVisible()).toBe(true) — web-first matchers auto-wait and retry
  • Test isolation: each test creates its own data; never share state between tests
  • Auth state reuse: save authenticated state via setup project + storageState; never log in via UI in every test
  • Fixtures over beforeEach: fixtures encapsulate setup + teardown, run on-demand, and compose

Anti-Patterns

  • page.waitForTimeout(ms) — use auto-waiting locators instead
  • page.locator('.class') — use role/label/testid
  • XPath selectors — fragile, use user-facing attributes
  • Shared state between tests — each test creates own data
  • UI login in every test — use setup project + storageState
  • Manual assertions without await — use web-first assertions
  • Hardcoded waits — rely on Playwright's auto-waiting
  • Default reporter in CI/agent — use --reporter=line or --reporter=dot

Checklist

  • Locators use role/label/testid, not CSS classes or XPath
  • All assertions use await expect() web-first matchers
  • Page objects define locators in constructor
  • No page.waitForTimeout() — use auto-waiting
  • Tests isolated — no shared state
  • Auth state reused via setup project
  • Network mocks set up before navigation
  • Test data created per-test or via fixtures
  • Debug logging added for complex flows
  • Minimal reporter (line/dot) used in CI/agent contexts

Read the full file on GitHub · 59 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 59 lines · 29 tokens per session scan A 87d117ee9a59

Subscribe to this mod's changes

playwright-best-practices is a skill published in the GitHub repository alleneubank/claude-code (49 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 29 tokens to every session and 684 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

playwright-best-practices compared with skills from other repositories

playwright-best-practices next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
playwright-best-practicesalleneubank/claude-codeSkill494mo agoApache-2.0A29Claude Code
browsegarrytan/gstackSkill140kyesterdayMITB32Claude Code
cua-driverdavidondrej/skillsSkill4.3k3d agoMITA68Claude Code, Codex
create-verification-skillget-bb/bbSkill4.9kyesterdayMITA57Claude Code, Codex
browser-qahashgraph-online/awesome-codex-pluginsSkill1.5kyesterdayApache-2.0A58Claude Code, Codex
webapp-testinganthropics/skillsSkill188k9d agononeA35Claude Code
test-electron-appPostHog/posthog-fossSkill728yesterdayMITA112Claude Code