playwright

playwright is a skill for Claude Code, Codex from Gentleman-Programming/Gentleman-Skills. It costs 28 tokens per session (2,305 once invoked), scanned A, a copy of playwright, MIT.

Guidance for writing Playwright end-to-end tests, which check a complete user journey in a real browser. It covers page objects, selectors, browser exploration, screenshots, and test file organisation.

In plain words
What is it for?
Use it to test forms, navigation, loading, success and error states, and other complete browser workflows with Playwright.
Why use it?
It reduces tests based on guessed page behaviour or selectors. Exploring the actual interface first helps make tests more accurate and less likely to fail for the wrong reason.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { SignInPage } from "../sign-in/sign-in-page";.

Good fit Use it to test forms, navigation, loading, success and error states, and other complete browser workflows with Playwright.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/Gentleman-Programming/Gentleman-Skills
agentmods
npx agentmods add skills/gentleman-programming/gentleman-skills/playwright

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/gentleman-programming/gentleman-skills/playwright.svg)](https://agentmods.dev/skills/gentleman-programming/gentleman-skills/playwright)
Your own site
<a href="https://agentmods.dev/skills/gentleman-programming/gentleman-skills/playwright"><img src="https://agentmods.dev/badge/skills/gentleman-programming/gentleman-skills/playwright.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,305 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.
Origin 94% copy Near-identical to another mod 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.00028 $0.02305
Opus 5 $0.00014 $0.01153
Sonnet 5 $0.00006 $0.00461
Haiku 4.5 $0.00003 $0.00231

Measured 8d ago against content hash a8132ea82acf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

playwright 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 8d 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.

Origin

This is a copy

94% identical to playwright — 21 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

curated/playwright/SKILL.md · 322 lines

How it starts

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

MCP Workflow (MANDATORY If Available)

⚠️ If you have Playwright MCP tools, ALWAYS use them BEFORE creating any test:

  1. Navigate to target page
  2. Take snapshot to see page structure and elements
  3. Interact with forms/elements to verify exact user flow
  4. Take screenshots to document expected states
  5. Verify page transitions through complete flow (loading, success, error)
  6. Document actual selectors from snapshots (use real refs and labels)
  7. Only after exploring create test code with verified selectors

If MCP NOT available: Proceed with test creation based on docs and code analysis.

Why This Matters:

  • ✅ Precise tests - exact steps needed, no assumptions
  • ✅ Accurate selectors - real DOM structure, not imagined
  • ✅ Real flow validation - verify journey actually works
  • ✅ Avoid over-engineering - minimal tests for what exists
  • ✅ Prevent flaky tests - real exploration = stable tests
  • ❌ Never assume how UI "should" work

File Structure

tests/
├── base-page.ts              # Parent class for ALL pages
├── helpers.ts                # Shared utilities
└── {page-name}/
    ├── {page-name}-page.ts   # Page Object Model
    ├── {page-name}.spec.ts   # ALL tests here (NO separate files!)
    └── {page-name}.md        # Test documentation

File Naming:

  • sign-up.spec.ts (all sign-up tests)
  • sign-up-page.ts (page object)
  • sign-up.md (documentation)
  • sign-up-critical-path.spec.ts (WRONG - no separate files)
  • sign-up-validation.spec.ts (WRONG)

Selector Priority (REQUIRED)

// 1. BEST - getByRole for interactive elements
this.submitButton = page.getByRole("button", { name: "Submit" });
this.navLink = page.getByRole("link", { name: "Dashboard" });

// 2. BEST - getByLabel for form controls
this.emailInput = page.getByLabel("Email");
this.passwordInput = page.getByLabel("Password");

// 3. SPARINGLY - getByText for static content only
this.errorMessage = page.getByText("Invalid credentials");
this.pageTitle = page.getByText("Welcome");

// 4. LAST RESORT - getByTestId when above fail
this.customWidget = page.getByTestId("date-picker");

// ❌ AVOID fragile selectors
this.button = page.locator(".btn-primary");  // NO
this.input = page.locator("#email");         // NO

Read the full file on GitHub · 322 lines

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. 8d ago First seen · 322 lines · 28 tokens per session scan A a8132ea82acf

Subscribe to this mod's changes

playwright is a skill published in the GitHub repository Gentleman-Programming/Gentleman-Skills (642 stars, last pushed 5mo ago), licensed MIT. It adds 28 tokens to every session and 2,305 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 94% identical to playwright, differing in 21 lines, and is treated as a copy.

Related

Other skills, from other repositories

browse

Drive a real browser through Aside: open a page, read it, click through a flow, take screenshots, check console errors. (gstack).

garrytan/gstack · 32 tokens

playwright-cli

A command-line tool for controlling Chromium, Firefox, and WebKit browsers, including navigation, page interaction, screenshots, PDFs, and recorded actions.

UnicomAI/wanwu · 76 tokens

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

anthropics/skills · 35 tokens

create-verification-skill

Create a repo-local verification skill and exhaustive feature map for driving a real app through its UI, CLI, or API. Use for "create a verification skill", "make a verify skill for this repo", or "document how agents can verify this app".

get-bb/bb · 57 tokens

browser-qa

A browser-based quality check for deployed web pages and user flows. It uses browser automation to test rendering, navigation, forms, interactions, responsive behaviour, and accessibility-related issues.

hashgraph-online/awesome-codex-plugins · 58 tokens

test-electron-app

Drive the real running PostHog Electron app (live tRPC, workspace-server, real data) over CDP with agent-browser. Connect to the running app on port 9222, test desktop changes against a local Django stack, snapshot the accessibility tree, inspect network requests, and screenshot only when explicitly asked. Use when…

PostHog/posthog-foss · 112 tokens