/playwright-automation:add-playwright-testsfrom playwright-automation
THE DEFAULT ENTRY POINT for the Playwright execution layer in the split testing suite. Use to add, create, or set up Playwright end-to-end tests for a feature, page, or application. It orchestrates the full Playwright workflow after shared exploration and planning: analyze the Playwright codebase, consume `docs/qa/feature-map.md`, `docs/qa/exploration-report.md`, `docs/qa/coverage-plan.md`, and `docs/qa/test-cases/*.md`, write production-grade test code, review it, and verify it with real execution. Delegates to `analyze-test-codebase`, `write-test-code`, `review-test-code`, and `fix-flaky-tests`, while relying on shared `map-feature-scope`, `capture-feature-evidence`, `plan-test-coverage`, `generate-test-cases`, and `review-test-cases`.
Ships in playwright-automation. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Go from feature request to verified Playwright tests while honoring the new suite layering:
capture-feature-evidence owns live product exploration and evidence capturetest-analysis owns coverage planning, spec generation, and spec reviewplaywright-automation owns Playwright-specific analysis, authoring, code review, and flake repairParse the target URL and feature description from: $ARGUMENTS
Derive a feature slug from the feature description (for example, "Login flow" -> login).
Use the slug for file naming throughout.
Follow the workflow or runtime task-tracker protocol when one is present. Keep tasks granular enough that each gate, artifact refresh, implementation step, failure-triage verdict, and rerun has a clear status. If no tracker tool is available, maintain the same information in execution notes instead of inventing a tool call.
Before planning or coding, understand the codebase, the shared artifacts, and the execution constraints.
playwright.config.{ts,js,mjs})? If not, you may need to
scaffold one. See references/scaffolding.md.analyze-test-codebase and follow its workflow.docs/qa/exploration-report.md if it exists.docs/qa/feature-map.md and any docs/qa/exploration/*.md files if they exist.map-feature-scope first for broad
features, then run capture-feature-evidence for each required scoped area before continuing.docs/qa/coverage-plan.md and docs/qa/test-cases/*.md files for the feature if they exist.The execution layer should not improvise product behavior that the exploration layer was supposed to establish. If real product understanding is missing, stop and create or refresh the shared artifacts first.
| Activity | Skill |
|---|---|
| Shared feature decomposition before deep exploration | map-feature-scope |
| Shared exploration and blocker capture | capture-feature-evidence |
| Playwright codebase analysis | analyze-test-codebase |
| Shared coverage planning | plan-test-coverage |
| Shared TC-ID spec generation | generate-test-cases |
| Shared spec review gate | review-test-cases |
| Write or refactor Playwright code | write-test-code |
| Review Playwright code | review-test-code |
| Fix flaky or failing Playwright tests | fix-flaky-tests |
Before you write Playwright code, make sure the shared handoff artifacts exist and are current:
docs/qa/feature-map.md for broad multi-surface featuresdocs/qa/exploration-report.mddocs/qa/exploration/*.md for mapped sub-featuresdocs/qa/coverage-plan.mddocs/qa/test-cases/<feature>.mdIf any required artifact is missing, dispatch each shared skill via a Task-tool subagent — the orchestrator coordinates, subagents produce:
map-feature-scope in a subagent when the request may span multiple routes, tabs, overlays, roles, or primary interactive surfaces. The subagent writes docs/qa/feature-map.md.SINGLE-SURFACE, run one capture-feature-evidence subagent and let it write docs/qa/exploration-report.md.MULTI-SURFACE, dispatch one fresh capture-feature-evidence subagent per sub-feature marked parallel-safe = yes, then run any parallel-safe = no rows serially once their prerequisites are satisfied. Each subagent writes docs/qa/exploration/<subfeature>.md.docs/qa/exploration-report.md as a rollup over the mapped exploration artifacts. The rollup is an index and merged summary only; it does not invent observations.plan-test-coverage to produce the coverage plan (delegate if heavy).generate-test-cases to produce TC-ID specs (delegate if heavy).review-test-cases in a fresh subagent — not the agent that authored the spec. Stop if the verdict is NEEDS REVISION.Do not jump straight to write-test-code from a direct request when the shared artifacts are still missing. Do not browse or review-your-own-spec inline in the main agent — those are the exact shortcuts that have produced shallow 12-TC specs dominated by visibility checks.
Once the shared artifacts are ready:
write-test-code and implement the Playwright testsDelegate writing to subagents when the test suite is large — the main orchestrator coordinates review gates and the coverage audit; the code-writing subagent focuses on translating specs to Playwright tests. Pass the relevant artifacts into each writing call:
docs/qa/feature-map.mddocs/qa/exploration-report.mddocs/qa/exploration/<subfeature>.md filesdocs/qa/coverage-plan.mddocs/qa/test-cases/<feature>.md or docs/qa/test-cases/<feature>/<subfeature>.mdanalyze-test-codebaseIf spec review has not happened yet, dispatch review-test-cases in a fresh subagent (not the agent that authored the spec). Pass only the spec path and the exploration report path; do not pass the authoring transcript.
After write-test-code, dispatch review-test-code in a fresh subagent (not the agent that authored the code).
NEEDS REVISION, fix blockers before execution.PASS WITH WARNINGS, fix stability-critical warnings before execution.Run the tests directly in the main agent:
npx playwright test <file> --reporter=list 2>&1
fix-flaky-tests and follow its structured workflow.mcp__plugin_agent-web-interface_browser__* access and the relevant exploration artifact. The subagent reproduces the failing user action in a real browser, compares the current DOM against the recorded evidence, and returns one of: product regression (escalate; do not paper over with test changes), locator / DOM drift (refresh exploration, then update locators), test defect (fix the test code), environment / data (Gate 3 deferral candidate). Record the verdict in the run ledger before changing code. Do not patch locators or add waits without this classification.new-only, feature-suite, or regression), whether the run is eligible for signoff, files changed since the prior run, pass/fail counts, and whether the consecutive-green counter reset.Green test output is necessary but not sufficient. Dispatch a fresh subagent with the following inputs:
docs/qa/exploration-report.md (specifically the Element Inventory and Elements Not Yet Reached sections)docs/qa/exploration/<subfeature>.md files for mapped featuresThe subagent's job is to classify each inventory element as one of:
covered-functional — a test triggers the action and asserts a state changecovered-visibility-only — a test references the element but does not exercise it functionallyuncovered — no test touches the elementOutput: docs/qa/coverage-audit.md with the classification table and one of three verdicts:
A promoted TC deferred during or after execution cannot end in GREEN unless the spec and coverage plan were revised, re-reviewed, and explicitly re-baselined before Gate 4.
The Playwright workflow is complete only when Gate 4 returns GREEN or YELLOW-with-acknowledgment. "Tests passed" is not the completion signal — the coverage audit is.
The final summary must explicitly separate:
Do not claim GREEN, "all accounted for", or "no files modified" unless the artifact chain and worktree state support those statements.
If the target feature requires login, follow references/authentication.md. Never hardcode credentials.
map-feature-scope before deep exploration whenever the requested feature is broad enough to
risk one oversized browser session./add-playwright-tests https://myapp.com/checkout Checkout flow with cart, shipping, and payment
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
5 skills in this plugin
/analyze-test-codebaseScans and reports on an existing Playwright test codebase. This skill should be used to inspect the current Playwright setup before writing, reviewing, or fixing tests, and should be loaded early when working in a new project to understand existing patterns. Covers: Playwright config, page objects, fixtures, helpers, auth/globalSetup patterns, test conventions, and directory structure. Triggers: "understand", "check", "show me", "inspect", or "analyze" the current test setup, config, infrastructure, patterns, or conventions. In the full add-tests workflow, this skill serves as an early read-only analysis sub-step before planning detailed coverage or writing code. This skill examines existing files and outputs a structured report. It does NOT write or fix tests, install Playwright, or explore live websites — for live-site exploration, use `capture-feature-evidence` so evidence is captured in `docs/qa/exploration-report.md`.
/fix-flaky-testsThis skill should be used when a Playwright test is failing, flaky, timing out, or behaving inconsistently. It provides structured root cause analysis for: stabilizing intermittent tests, debugging timeouts ("Test timeout of 30000ms exceeded"), fixing race conditions, investigating local-vs-CI divergence, running repeated stability checks (--repeat-each). IMPORTANT: If running tests with --repeat-each, --retries, or multiple times to check stability, STOP and load this skill first — it has structured root cause analysis that prevents brute-force approaches. Triggers: "stabilize", "intermittent", "flaky", "keeps failing", "fails in CI", "timeout on", "race condition", "run N times to check stability", "verify tests are stable". NOT for writing new tests (use write-test-code) or analyzing setup (use analyze-test-codebase).
npx claudepluginhub lespaceman/athena-workflow-marketplace --plugin playwright-automation