MCPInstall

playwright

Playwright testing best practices for Next.js applications (formerly test-playwright). This skill should be used when writing, reviewing, or debugging E2E tests with Playwright. Triggers on tasks involving test selectors, flaky tests, authentication state, API mocking, hydration testing, parallel execution, CI configuration, or debugging test failures.

Installs
1.2K
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/pproenca/dot-skills --skill playwright
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads playwright automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Playwright + Next.js Testing Best Practices

Comprehensive testing optimization guide for Playwright with Next.js applications. Contains 43 rules across 8 categories, prioritized by impact to guide reliable, fast, and maintainable E2E tests.

When to Apply

Reference these guidelines when:

  • Writing new Playwright tests for Next.js apps
  • Debugging flaky or failing tests
  • Optimizing test execution speed
  • Setting up authentication state reuse
  • Configuring CI/CD pipelines for testing
  • Testing Server Components and App Router features
  • Reviewing test code for reliability issues

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Test ArchitectureCRITICALarch-
2Selectors & LocatorsCRITICALloc-
3Waiting & AssertionsHIGHwait-
4Authentication & StateHIGHauth-
5Mocking & NetworkMEDIUM-HIGHmock-
6Next.js IntegrationMEDIUMnext-
7Performance & SpeedMEDIUMperf-
8Debugging & CILOW-MEDIUMdebug-

Quick Reference

1. Test Architecture (CRITICAL)

  • arch-test-isolation - Use fresh browser context for each test
  • arch-parallel-execution - Enable parallel test execution
  • arch-page-object-model - Use Page Object Model for complex pages
  • arch-fixtures - Use fixtures for shared setup
  • arch-test-production - Test against production builds
  • arch-cleanup-state - Clean up test state after each test

2. Selectors & Locators (CRITICAL)

  • loc-role-selectors - Use role-based selectors over CSS
  • loc-data-testid - Use data-testid for dynamic elements
  • loc-label-selectors - Use getByLabel for form inputs
  • loc-text-selectors - Use getByText for static content
  • loc-avoid-xpath - Avoid XPath selectors
  • loc-chained-locators - Chain locators for specificity
  • loc-placeholder-selector - Use getByPlaceholder sparingly

3. Waiting & Assertions (HIGH)

  • wait-web-first-assertions - Use web-first assertions
  • wait-avoid-hard-waits - Avoid hard waits
  • wait-network-idle - Use network idle for complex pages
  • wait-action-retries - Let actions auto-wait before interacting
  • wait-soft-assertions - Use soft assertions for non-critical checks
  • wait-custom-timeout - Configure timeouts appropriately

4. Authentication & State (HIGH)

  • auth-storage-state - Reuse authentication with storage state
  • auth-multiple-roles - Use separate storage states for different roles
  • auth-session-storage - Handle session storage for auth
  • auth-api-login - Use API login for faster auth setup
  • auth-parallel-workers - Use worker-scoped auth for parallel tests

5. Mocking & Network (MEDIUM-HIGH)

  • mock-api-responses - Mock API responses for deterministic tests
  • mock-intercept-modify - Intercept and modify real responses
  • mock-har-files - Use HAR files for complex mock scenarios
  • mock-abort-requests - Abort unnecessary requests
  • mock-network-conditions - Simulate network conditions

6. Next.js Integration (MEDIUM)

  • next-wait-hydration - Wait for hydration before interacting
  • next-server-components - Test server components correctly
  • next-app-router-navigation - Test App Router navigation patterns
  • next-server-actions - Test server actions end-to-end
  • next-baseurl-config - Configure baseURL for clean navigation

7. Performance & Speed (MEDIUM)

  • perf-sharding - Use sharding for large test suites
  • perf-headless-ci - Use headless mode in CI
  • perf-browser-selection - Select browsers strategically
  • perf-reuse-server - Reuse development server when possible
  • perf-retries - Configure retries for flaky test recovery

8. Debugging & CI (LOW-MEDIUM)

  • debug-trace-viewer - Use trace viewer for failed tests
  • debug-screenshots-videos - Capture screenshots and videos on failure
  • debug-inspector - Use Playwright Inspector for interactive debugging
  • debug-ci-reporters - Configure reporters for CI integration

How to Use

Read individual reference files for detailed explanations and code examples:

  • Section definitions - Category structure and impact levels
  • Rule template - Template for adding new rules

Reference Files

FileDescription
AGENTS.mdComplete compiled guide with all rules
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information

FAQ

What does the playwright skill do?

Playwright testing best practices for Next.js applications (formerly test-playwright). This skill should be used when writing, reviewing, or debugging E2E tests with Playwright. Triggers on tasks involving test selectors, flaky tests, authentication state, API mocking, hydration testing, parallel execution, CI configuration, or debugging test failures.

How do I install playwright?

Run npx skills add https://github.com/pproenca/dot-skills --skill playwright in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/playwright/ (personal) or .claude/skills/playwright/ (project).

Which AI agents can use playwright?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is playwright safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains playwright?

It is published by pproenca in pproenca/dot-skills. It has 1,152 recorded installs.

More from pproenca/dot-skills

View all →

zod

pproenca/dot-skills

Zod schema validation best practices for type safety, parsing, and error handling. This skill should be used when defining z.object schemas, using z.string validations, safeParse, or z.infer. This skill does NOT cover React Hook Form integration patterns (use react-hook-form skill) or OpenAPI client generation (use orval skill).

Frontend & Design7.1K installs

vitest

pproenca/dot-skills

Vitest testing framework patterns for test setup, async testing, mocking with vi., snapshots, and test performance (formerly test-vitest). This skill should be used when writing or debugging Vitest tests. This skill does NOT cover TDD methodology (use test-tdd skill), API mocking with MSW (use test-msw skill), or Jest-specific APIs.

Testing & QA6.2K installs

react-hook-form

pproenca/dot-skills

React Hook Form performance optimization for client-side form validation using useForm, useWatch, useController, useFieldArray, the subscribe() API, and the Watch / FormStateSubscribe / FieldArray render-prop components. Covers RHF 7.82 additions including resetDefaultValues() and the disabled field-array option. This skill should be used when building client-side controlled forms with React Hook Form library. This skill does NOT cover React 19 Server Actions, useActionState, or server-side form handling (use react-19 skill for those).

emilkowal-animations

pproenca/dot-skills

Emil Kowalski's animation best practices for web interfaces. Use when writing, reviewing, or implementing animations in React, CSS, or Framer Motion. Triggers on tasks involving transitions, easing, gestures, toasts, drawers, or motion.

Frontend & Design2.8K installs

nuqs

pproenca/dot-skills

nuqs (type-safe URL query state) best practices for Next.js and other React frameworks. This skill should be used when writing, reviewing, or refactoring code that uses nuqs for URL state management. Triggers on tasks involving useQueryState, useQueryStates, search params, URL state, query parameters, nuqs parsers, limitUrlUpdates, Standard Schema, NuqsAdapter, or Next.js routing with state.

Frontend & Design2.3K installs

clean-architecture

pproenca/dot-skills

Clean Architecture principles and best practices from Robert C. Martin's book. This skill should be used when designing software systems, reviewing code structure, or refactoring applications to achieve better separation of concerns. Triggers on tasks involving layers, boundaries, dependency direction, entities, use cases, or system architecture.

Popular testing & qa skills

View category →

tdd

mattpocock/skills

Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.

Testing & QA1.2M installs

grilling

mattpocock/skills

Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.

Testing & QA996.2K installs

migrate-to-shoehorn

mattpocock/skills

Migrate test files from as type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace as in tests, or needs partial test data.

Testing & QA484.1K installs

run-train

lllllllama/rigorpilot-skills

Rigor Train skill for deep learning research repositories. Use when a documented or selected training command should be run conservatively for startup verification, short-run verification, full kickoff, or resume, with command, config, seed, log, checkpoint, status, and metric evidence written to standardized trainoutputs/. Do not use for environment setup, exploratory sweeps, speculative idea implementation, or end-to-end orchestration.

Testing & QA337.8K installs

test-driven-development

obra/superpowers

Use when implementing any feature or bugfix, before writing implementation code

Testing & QA261.8K installs

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work

Testing & QA216.8K installs