skills/playwright-best-practices/SKILL.md
Use when writing or modifying Playwright tests (.spec.ts, .test.ts with @playwright/test imports).
npx skillsauth add awfixers-stuff/opencode-config playwright-best-practicesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
Always prefer user-facing attributes:
page.getByRole('button', { name: 'Submit' }) — accessibility rolespage.getByLabel('Email') — form control labelspage.getByPlaceholder('Search...') — input placeholderspage.getByText('Welcome') — visible text (non-interactive)page.getByAltText('Logo') — image alt textpage.getByTitle('Settings') — title attributespage.getByTestId('submit-btn') — explicit test contractsawait expect(locator).toBeVisible(), never expect(await locator.isVisible()).toBe(true) — web-first matchers auto-wait and retrystorageState; never log in via UI in every testpage.waitForTimeout(ms) — use auto-waiting locators insteadpage.locator('.class') — use role/label/testid--reporter=line or --reporter=dotawait expect() web-first matcherspage.waitForTimeout() — use auto-waitingline/dot) used in CI/agent contextsSee playwright-patterns.md for Page Object Model, fixtures, network mocking, and configuration examples.
development
Use when starting dev servers, watchers, tilt, or any process expected to outlive the conversation. Provides zmx session management patterns for long-lived processes.
development
Zig testing skill for writing and running tests. Use when using zig build test, writing comptime tests, using test filters, working with test allocators to detect leaks, or using Zig's built-in fuzz testing (0.14+). Activates on queries about Zig tests, zig test, zig build test, comptime testing, test allocators, Zig fuzz testing, or detecting memory leaks in Zig tests.
development
Zig debugging skill. Use when debugging Zig programs with GDB or LLDB, interpreting Zig runtime panics, using std.debug.print for tracing, configuring debug builds, or debugging Zig programs in VS Code. Activates on queries about debugging Zig, Zig panics, zig gdb, zig lldb, std.debug.print, Zig stack traces, or Zig error return traces.
tools
Zig cross-compilation skill. Use when cross-compiling Zig programs to different targets, using Zig's built-in cross-compilation for embedded, WASM, Windows, ARM, or using zig cc to cross-compile C code without a system cross-toolchain. Activates on queries about Zig cross-compilation, zig target triples, zig cc cross-compile, Zig embedded targets, or Zig WASM.