agentleFS
thongdn-itthongdn-it/react-agent-skills/skills/playwright/SKILL.md

playwright

Skill5 starsChanged 9 months agoMITView on GitHub

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.

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 79 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read individual reference files for detailed explanations and code examples:

    line 105

“Common” is measured: kept by at least 6 in 10 of the 79 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

Download now (ZIP)

  • Other versions91 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 1

    1. PyModel/react-frontend-skills★ 2393% same

    Wrote their own version · 90

    1. openai/openai-agents-python★ 30ksame name
    2. openai/skills★ 27ksame name
    3. prowler-cloud/prowler★ 15ksame name
    4. hyperdxio/hyperdx★ 10ksame name
    5. bluesky-social/atproto★ 9.7ksame name
    6. netease-youdao/LobsterAI★ 6.2ksame name
    7. Kiln-AI/Kiln★ 5.2ksame name
    8. freestylefly/wesight★ 941same name
    9. Gram-ax/gramax★ 609same name
    10. JetBrains/skills★ 386same name

    80 more not listed

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Used alongsideProjects with it also use develop-web-game, web-perf and 4 more.

    Other files people use alongside this one.

    Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
    • hebertzhuSkill

      develop-web-game

      Use when building or iterating on a web game and you need a tight implement-test-observe loop; prefer the bundled Playwright client, inspect screenshots and text state, and validate every meaningful change before moving on.

      Also in 4 projects that use this

    • OpenAISkill

      web-perf

      Analyzes web performance using Chrome DevTools MCP. Measures Core Web Vitals (FCP, LCP, TBT, CLS, Speed Index), identifies render-blocking resources, network dependency chains, layout shifts, caching issues, and accessibility gaps. Use when asked to audit, profile, debug, or optimize page load performance, Lighthouse scores, or site speed. Biases towards retrieval from current documentation over pre-trained knowledge.

      Also in 5 projects that use this

    • JetBrainsSkill

      doc

      Use when the task involves reading, creating, or editing `.docx` documents, especially when formatting or layout fidelity matters; prefer `python-docx` plus the bundled `scripts/render_docx.py` for visual checks.

      Also in 4 projects that use this

    • CloudflareSkill

      turnstile-spin

      Set up, repair, or migrate to Cloudflare Turnstile bot verification in an existing frontend and backend, including server-side Siteverify.

      Also in 3 projects that use this

    • hajekimSkill

      mcp-setup

      This skill should be used when the user wants to "Model Context Protocol", "MCP server", "MCP client", "standardized tool integration", "JSON-RPC agent tools", "LLM tool protocol", "connect agents to external tools", "MCP primitives", "FastMCP", "ADK MCPToolset", "plug-and-play agent tools", "MCP integration", "tool server for agents", "MCP tools", "agent plugin system", "MCP setup", "model context protocol integration", or build agents that use the standardized MCP protocol for tool and resource integration. Also responds to Korean: "모델 컨텍스트 프로토콜", "MCP 서버", "MCP 클라이언트", "표준화된 도구 통합", "플러그 앤 플레이 에이전트 도구", "ADK MCP 툴셋", "MCP 구성", "MCP 설정", "MCP 써보고 싶어", "MCP 툴 연결", "MCP 서버 만들어줘", "도구 표준화해줘", "플러그인 에이전트". Also responds to Japanese: "モデルコンテキストプロトコル", "MCPサーバー", "MCPクライアント", "標準化ツール統合", "MCPの設定", "MCPを使いたい", "MCP構成", "エージェントのプラグインシステム", "ツールサーバー", "MCPツール連携" Also responds to Chinese: "模型上下文协议", "MCP服务器", "MCP客户端", "标准化工具集成", "MCP配置", "想用MCP", "MCP构建", "智能体插件系统", "工具服务器", "MCP工具集成".. Apply this skill to design or implement the Model Context Protocol (MCP) agentic design pattern.

      Also in 3 projects that use this

    • CloudflareSkill

      cloudflare-one

      Design, configure, troubleshoot, or review Cloudflare One Zero Trust and SASE deployments. Use cloudflare-one-migrations for migration planning from other vendors.

      Also in 3 projects that use this

  • In this repository32 other files it gives its agents.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.