kanevry/session-orchestrator/playwright-driver
Claude Code and agent skill by kanevry/session-orchestrator
- community
Checking that the SKILL.md file is still in the repository.
Use this skill when executing web tests via the canonical `playwright` npm package (Microsoft, Apache-2.0). Dispatched by `skills/test-runner/` to execute web tests against a target, captures token-frugal AX-tree snapshots + screenshots + console output under `.orchestrator/metrics/test-runs/<run-id>/`, and exits with deterministic JSON output the orchestrator can parse.
Install
npx vskill@latest install kanevry/session-orchestrator/playwright-driverSKILL.md
The same SKILL.md was published earlier as kanevry/session-orchestrator/playwright-driver.
Playwright Driver Skill
Soul
Before anything else, read and internalize soul.md in this skill directory. It defines WHO you are — a thin executor, not an orchestrator. Every action in this session should reflect that identity.
Phase 0: Bootstrap Gate
Read skills/_shared/bootstrap-gate.md and execute the gate check. If GATE_CLOSED, invoke skills/bootstrap/SKILL.md and wait for completion. If GATE_OPEN, continue.
<HARD-GATE> This driver wraps playwright (Apache-2.0, Microsoft). It does NOT use @playwright/mcp for browser drive — MCP is ~4× more expensive in tokens per test (Microsoft's own benchmark: ~114K tokens MCP vs ~27K CLI). The R5 grep-canary in scripts/lib/validate/check-playwright-mcp-canary.mjs enforces this: any reference to @playwright/mcp or playwright-mcp under skills/playwright-driver/** or scripts/lib/test-runner/** fails validate-plugin. </HARD-GATE>
Package Note — PRD Correction (Read This First)
The PRD originally referenced `@playwright/cli` — that wording is WRONG. Do not use it.
| Package | Version (2026-05-14) | Status | |
|---|---|---|---|
playwright | 1.60.0 | Canonical — use this | |
@playwright/test | 1.60.0 | Test framework (same release train) | |
@playwright/cli | 0.1.13 | Unrelated, unstable — DO NOT USE | |
@playwright/mcp | 0.0.75 | MCP adapter — R5 hard-gate blocks this |
Verified via npm view playwright version → 1.60.0 (2026-05-14 probe). The binary the orchestrator dispatches is named playwright (not playwright-cli), and it is deliberately the TARGET repo's own @playwright/test dependency — the driver never relies on a globally installed binary, so scripts/lib/playwright-driver/runner.mjs aborts with exit 2 when the target cannot resolve Playwright locally rather than letting npx download it mid-run. Use playwright@^1.60.0 for compatible-minor updates or pin to playwright@1.60.0 for reproducibility.
Install
Install into the TARGET repo — that is the only install this driver uses, in CI and locally alike:
Both commands run in the target repo, so npx resolves the local binary. A global install is neither used nor sufficient: the driver's preflight requires @playwright/test (or playwright) under the target's own node_modules.
Canonical Usage
The orchestrator (skills/test-runner/) dispatches this driver via Bash. Session naming follows the artifact-paths contract:
Canonical: see https://playwright.dev/docs/test-reporters — reporter names are comma-separated; paths flow via env vars. Seescripts/lib/playwright-driver/runner.mjsfor the canonical invocation.
The orchestrator provides RUN_ID and RUN_DIR via environment variables, plus the resolved navigation URL TARGET_URL and expected pages for the selected scope in driver context. The driver executes Playwright and ensures the per-page capture contract below before handing artifacts to the evaluator. --target still names the target repository; it is not the navigation URL.
Artifact Layout
All artifacts land under ${RUN_DIR}/. Structure:
Division of responsibility:
- runner.mjs (driver): spawns
playwright test, sets reporter env vars (PLAYWRIGHT_HTML_OUTPUT_DIR,PLAYWRIGHT_JSON_OUTPUT_FILE,PLAYWRIGHT_HTML_OPEN), pre-createsax-snapshots/andscreenshots/directories before spawn so test fixtures can write into them without racing, captures the process exit code, and routes reporter output toresults.json/report/. - Driver skill: arrange capture for every expected page at widths 1440 and 390, using the recipe below in the target-local Playwright harness. Existing fixture output counts only if it meets this contract. The spawn wrapper alone does not produce these artifacts.
- Test fixtures / capture harness: navigate the resolved
TARGET_URL, capture the required page pairs, run axe-core scans, and append console NDJSON — all under the providedRUN_DIR.
Token discipline: NEVER inline AX-tree dumps into the coordinator context — they balloon to 50–200K tokens. Always write to disk under ${RUN_DIR}/ax-snapshots/. The ux-evaluator agent reads from disk, not from prompt context.
Per-Page Capture Contract
For every page in the selected scope, capture both widths, including intermediate journey pages rather than only the final page of a test. Use exactly the rubric-v2 convention ax-snapshots/<page-slug>-w<viewport>.yaml and the matching screenshots/<page-slug>-w<viewport>.png. Assign a stable, unique slug per page (/start → start, / → index); pass the page/slug inventory to the evaluator so omitted pages cannot disappear from completeness checks.
Use the target's installed Playwright in its capture harness; no new dependency is needed. At each page's settled state, apply this pattern (with page, its unique pageSlug, absolute runDir, and page-specific readyLocator supplied by the harness):
visited is one array per capture pass (declare it before the first page) and route is the page's route (/start); test-runner grants LIVE RUN / PRODUCTION-BUILD RUN only when every recorded url has the origin of TARGET_URL, so a pass that writes no visited-urls.json always reports as a dev-server run.
Prefer locator.ariaSnapshot() because it includes link targets for the dead-link check. Resize before each capture and use the same page state for its screenshot and AX snapshot. Never copy a desktop snapshot into a mobile file. Avoid parallel writers for the same page slug.
Before returning, verify all four non-empty artifacts for every expected page. If existing fixtures omit them, execute a capture pass with the same navigation URL, authentication, and page-ready conditions. If a page or viewport cannot be captured, report that exact gap and retain it in the expected-page inventory; the evaluator must leave the report incomplete (BLOCKED). Do not treat the Playwright exit code as proof of captures. AX contents stay on disk, never in coordinator context.
Console Capture Pattern
To capture console output as NDJSON:
Headed vs Headless
Default: headless (CI-friendly). Operator override via profile:
The test-runner profile registry (.orchestrator/policy/test-profiles.json) controls headed/headless and browser selection — the driver stays simple and reads these from environment variables set by the orchestrator.
Composability Contract
Invocation Shape
Canonical: see https://playwright.dev/docs/test-reporters — reporter names are comma-separated; paths flow via env vars. Seescripts/lib/playwright-driver/runner.mjsfor the canonical invocation.
Exit Codes
| Code | Meaning | Orchestrator Action | |
|---|---|---|---|
| 0 | All tests passed | Record pass, continue | |
| 1 | At least one test failed | Failures become findings (non-fatal) | |
| 2 | Framework error (network, browser-install), or no local Playwright in the target repo (preflight) | Surface as driver error, halt run |
Outputs the Orchestrator MUST Parse
${RUN_DIR}/results.json— Playwright JSON reporter format (testRun.{expected,unexpected,skipped,status})${RUN_DIR}/test-results/**/trace.zip— trace bundles, one per test${RUN_DIR}/screenshots/**/*.png— per-step screenshots${RUN_DIR}/console.log— captured console as NDJSON${RUN_DIR}/ax-snapshots/<page-slug>-w<viewport>.yaml— per-page aria snapshots at 1440 and 390, paired with matching screenshots${RUN_DIR}/ax-snapshots/axe-*.json— axe-core violation reports from@axe-core/playwright(written by test fixtures; consumed byux-evaluatorCheck 2)
Version Pin + Upper-Bound Advisory
Pinned: playwright@1.60.0 (verified 2026-05-14). The 1.x line is the long-term stable track — Playwright has not announced a v2. Upper-bound advisory: re-validate this skill when upstream crosses 1.65; check for behavioral shifts in JSON reporter format and trace bundle schema before re-pinning.
Playwright Subcommands Reference
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/playwright-driver/SKILL.md
Popularity
- Repository stars
- 52
- Repository forks
- 7
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kanevry/session-orchestrator/playwright-driver)