playwright-generate
Skill1 starsChanged 6 months agoMITView on GitHub
Generate, debug, and maintain Playwright end-to-end tests using the target repository's fixtures, helpers, page objects, setup conventions, and E2E command
In this repository6 other files it gives its agents.
The file
Show its rules and text
We split this skill into the rules it gives an agent
25 rules. About 0 are common, 19 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈19
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Do not assume a specific framework, folder structure, package manager, fixture layout, data setup method, or test command.
- Distinctive: line 12
Before writing or editing tests, discover the repository's conventions:
- Very specific: line 14
Read testing documentation if present, such as docs/testing/e2e-context.md, docs/testing.md, CONTRIBUTING.md, README.md, or files near the …
- Distinctive: line 23
Before writing or editing tests:
- Distinctive: line 25
Read the repository's testing documentation, if present.
- Distinctive: line 26
Treat mandatory rules from that documentation as required implementation constraints.
- Very specific: line 33
Use repository fixtures instead of @playwright/test directly when applicable.
- Distinctive: line 34
Use the repository's existing setup utilities for entities, users, permissions, authentication, storage state, and feature flags.
- Distinctive: line 35
Create setup data through fixtures, API helpers, factories, seed utilities, GraphQL helpers, or shared utilities already used by the …
- Distinctive: line 36
Do not create data through the UI unless that creation flow is the behavior under test.
- Distinctive: line 38
Do not put reusable locators or reusable interaction logic directly in specs when the repository has an abstraction pattern for them.
- Distinctive: line 40
Create a new focused page object or helper only when the functionality represents a distinct reusable UI area or flow.
- Distinctive: line 41
Keep assertions visible in the spec body unless they are repeated low-level checks.
- Very specific: line 46
When browser interaction, debugging, tracing, selector inspection, session management, or lightweight validation is needed, use the …
- Distinctive: line 48
Prefer Playwright CLI capabilities for:
- Distinctive: line 61
Prefer repository fixtures, page objects, helpers, and testing documentation for:
- Very specific: line 70
Use playwright-cli only for exploration and debugging:
- Distinctive: line 79
Do not paste raw generated recorder-style code into specs.
- Distinctive: line 83
Use the lightest validation strategy possible.
- Distinctive: line 88
Use Playwright CLI for fast interaction and selector validation.
- Distinctive: line 89
Run the smallest relevant Playwright test scope in headless mode using the repository's E2E command.
- Distinctive: line 90
Use headed mode only for explicit debugging.
- Distinctive: line 111
If generated code conflicts with repository testing documentation or nearby examples, revise the implementation before returning the result.
- Very specific: line 113
Use Playwright MCP only if playwright-cli is insufficient.
- Very specific: line 115
Use output-template.md for response formatting.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Generate and maintain Playwright E2E tests for the target repository.
Do not assume a specific framework, folder structure, package manager, fixture layout, data setup method, or test command.
Repository discovery
Before writing or editing tests, discover the repository's conventions:
- Read testing documentation if present, such as
docs/testing/e2e-context.md,docs/testing.md,CONTRIBUTING.md,README.md, or files near the E2E tests. - Inspect
package.jsonscripts for E2E commands such astest:e2e,e2e,playwright, or project-specific wrappers. - Inspect Playwright config files such as
playwright.config.ts,playwright.config.js, orplaywright.config.mjs. - Identify E2E folders such as
e2e/,tests/e2e/,__e2e__/,playwright/, or folders referenced by Playwright config. - Inspect nearby specs in the same feature area.
- Inspect existing fixtures, helpers, page objects, factories, API clients, seed utilities, and authentication/storage setup.
Repository conventions are mandatory and take precedence over generic Playwright patterns or generated recorder-style code.
Before writing or editing tests:
- Read the repository's testing documentation, if present.
- Treat mandatory rules from that documentation as required implementation constraints.
- Inspect the closest existing spec for the same feature area.
- Inspect the relevant fixture, helper, page object, and setup files.
- Reuse existing fixtures, helpers, setup utilities, and page object methods before introducing new patterns.
Core rules:
- Use repository fixtures instead of
@playwright/testdirectly when applicable. - Use the repository's existing setup utilities for entities, users, permissions, authentication, storage state, and feature flags.
- Create setup data through fixtures, API helpers, factories, seed utilities, GraphQL helpers, or shared utilities already used by the repository.
- Do not create data through the UI unless that creation flow is the behavior under test.
- Route UI interactions through page objects or helper abstractions when the repository uses them.
- Do not put reusable locators or reusable interaction logic directly in specs when the repository has an abstraction pattern for them.
- Extend existing page objects or helpers when possible.
- Create a new focused page object or helper only when the functionality represents a distinct reusable UI area or flow.
- Keep assertions visible in the spec body unless they are repeated low-level checks.
- Match naming, imports, structure, and style from nearby tests.
Playwright CLI Skill Usage
When browser interaction, debugging, tracing, selector inspection, session management, or lightweight validation is needed, use the installed Playwright CLI skills and their reference guides.
Prefer Playwright CLI capabilities for:
- test generation drafts
- selector validation
- browser interaction
- tracing
- storage state inspection
- request mocking
- video recording
- session management
- lightweight flow validation
- debugging failing interactions
Prefer repository fixtures, page objects, helpers, and testing documentation for:
- final test architecture
- test organization
- setup strategy
- reusable interactions
- assertion placement
- long-term maintainability
Use playwright-cli only for exploration and debugging:
- discovering current UI behavior
- validating selectors
- checking screenshots or snapshots
- debugging failing flows
playwright-cli output is exploration material only.
Do not paste raw generated recorder-style code into specs. Refactor generated interactions into fixtures, helpers, and page object methods that follow repository conventions.
Validation Rules
Use the lightest validation strategy possible.
Preferred validation order:
- Typecheck or lint changed files if available.
- Use Playwright CLI for fast interaction and selector validation.
- Run the smallest relevant Playwright test scope in headless mode using the repository's E2E command.
- Use headed mode only for explicit debugging.
Always avoid:
- unnecessary
--headed - full-suite execution
- validating unrelated specs
Before finishing, verify:
- repository testing documentation was followed, if present
- the closest existing spec was inspected
- the appropriate fixture, helper, or setup utility was used
- setup data uses repository-standard fixtures, APIs, factories, seed utilities, or helpers
- page object methods or equivalent repository abstractions are used or added where appropriate
- raw locators are kept out of specs where possible
- new interactions are reusable by future tests
- assertions remain visible in the spec body
- the generated code matches nearby repository examples
- the smallest relevant E2E command was run or clearly stated if not run
If generated code conflicts with repository testing documentation or nearby examples, revise the implementation before returning the result.
Use Playwright MCP only if playwright-cli is insufficient.
Use output-template.md for response formatting.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

