agentic-playwright
AGENTS.md268 starsChanged 8 days agoMITView on GitHub
Rules for every agent in this repository. Skills hold the detail; load the one the index names first. {area} is the app folder; ls pages/ (or tests/, enums/) gives the real name.
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,843 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository35 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- ai-native-workflowSkill
- api-testingSkill
- common-tasksSkill
- configSkill
- data-strategySkill
- debuggingSkill
- enumsSkill
- fixturesSkill
- helpersSkill
- page-objectsSkill
- playwright-cliSkill
- pr-reviewerSkill
- refactor-valuesSkill
- selectorsSkill
- skill-creatorSkill
- test-standardsSkill
- type-safetySkill
- ai-native-workflowSkill
- api-testingSkill
- common-tasksSkill
- configSkill
- data-strategySkill
- debuggingSkill
- enumsSkill
- fixturesSkill
- helpersSkill
- page-objectsSkill
- playwright-cliSkill
- pr-reviewerSkill
- refactor-valuesSkill
- selectorsSkill
- skill-creatorSkill
- test-standardsSkill
- type-safetySkill
The file
We split this AGENTS.md into the rules it gives an agent
10 rules. About 1 is common, 1 is distinctive, and 8 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
Test Verification: run npx playwright test <file> after editing a spec.
- Very specific: line 37
No Hard Waits: never page.waitForTimeout().
- Common: line 38
No Secrets: never a hardcoded credential.
- Very specific: line 40
No Tags on Describe: never on test.describe().
- Very specific: line 43
No Manual Instantiation: never new PageObject(page).
- Very specific: line 44
No Loose Schemas: never z.object().
- Distinctive: line 47
No Explore-Only Files: never commit a page-dump or probe spec.
- Very specific: line 50
No Substitute UI Exploration: no IDE or MCP browser, no codegen.
- Very specific: line 51
No Silent Coverage Drops: every documented status code has a test or a test.skip with // FIXME.
- Very specific: line 58
Commit: ask first; one verified task per commit, Conventional Commit subject.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md 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
Playwright Scaffold
Rules for every agent in this repository. Skills hold the detail; load the one the index names first.
Constitution
{area} is the app folder; ls pages/ (or tests/, enums/) gives the real name.
MUST
- Dependency Injection: page objects are fixtures from
fixtures/pom/test-options.ts. - Imports:
testandexpectfromfixtures/pom/test-options.tsonly, never@playwright/test. - Selectors:
getByRole()>getByLabel()>getByPlaceholder()>getByText()>getByTestId(). - Type Safety: Zod schemas in
fixtures/api/schemas/; noany. - Strict Schemas: API schemas use
z.strictObject(). - Response Validation: exactly
expect(SchemaName.parse(body)).toBeTruthy();. - Sources of Truth: URLs and credentials from
process.env.*(env/.env.example); endpoint paths, routes, messages and storage-state paths fromenums/{area}/*andenums/util/*. - Assertions: web-first,
expect(locator).toBeVisible(); neverwaitForTimeout(). - Linting: ESLint and Prettier clean, zero warnings.
- Data Strategy: invalid arrays in
test-data/static/util/invalid-values.ts; curated sets intest-data/static/{area}/; happy-path data fromtest-data/factories/{area}/. - State Cleanup: a test that mutates persistent state reverts it in
afterEachorafterAll. - API Test Steps: two or more API calls means one
test.step()per call. - Test Verification: run
npx playwright test <file>after editing a spec; red is never done. - Explore Before Generate: API: build from the OpenAPI document; live capture only when none exists, flagged; a runtime mismatch is
test.skipplus// FIXME:, never a loosened schema. UI: you explore withplaywright-cli(read that skill first) before you write anypages/**file, UI spec or selector; cannot run means stop and tell the human.
SHOULD
- Data Generation: Faker factories in
test-data/factories/for happy-path values, UI content too. - Test Isolation: independent tests;
test.beforeEachfor setup. - Test Steps:
test.step()with Given/When/Then. - JSDoc on Actions: JSDoc (
@param,@returns) on action methods only. - Enums for Strings: repeated strings come from
enums/.
WON'T
- No XPath.
- No Hard Waits: never
page.waitForTimeout(). - No Secrets: never a hardcoded credential.
- No
any. - No Tags on Describe: never on
test.describe(). - No Multiple Tags: exactly one of
@smoke,@sanity,@regression,@e2e,@api,@destructive; never@functional.@destructivealone when shared state (locale, roles, settings) is mutated, not for own-data cleanup. - No Magic Numbers: constants in
config/orenums/. - No Manual Instantiation: never
new PageObject(page). - No Loose Schemas: never
z.object(). - No JSDoc on Locators.
- No Hardcoded Test Content: names, labels and text come from factories.
- No Explore-Only Files: never commit a page-dump or probe spec.
- No Empty-Body-Only 400: per-field omission and invalid-type
for...oftests. - No Feedback-Less POM: form and CRUD page objects have success, error and validation selectors.
- No Substitute UI Exploration: no IDE or MCP browser, no
codegen; onlyplaywright-cli. - No Silent Coverage Drops: every documented status code has a test or a
test.skipwith// FIXME. - No JSON Static Data:
test-data/static/**is.tswithas const.
Workflow
- Proceed: load
ai-native-workflowfirst on every non-trivial task; it routes, explores and stops at a confidence-scored proposal before any edit. One-line fix, typo or single import: direct mode, verify the premise, apply, report. - Verify:
npm run lint, thennpx playwright test <affected files>; red meansdebugging, never a skipped or loosened test. - Commit: ask first; one verified task per commit, Conventional Commit subject; never
test.onlyor a real env file.
Skills Index
Your harness loads skills from its native directory. Claude Code uses .claude/skills/, Codex, Cursor and Copilot use .agents/skills/.
ai-native-workflow: first on any non-trivial task.playwright-cli: exploring the live app before any UI code.selectors: choosing or reviewing a locator.page-objects: a page object or component underpages/**.fixtures: registering a page object; setup/teardown fixtures.test-standards: a spec undertests/**; type, tag, loop, cleanup.api-testing: an API spec, endpoint coverage, a schema from the contract.type-safety: a Zod schema, inferred types,any,!versus??.data-strategy: a factory or static set; generated versus static.enums: an endpoint path, route, message, role or storage-state path.config: an environment variable, config property or utility URL.helpers: a plain function underhelpers/**; the auth bootstrap.common-tasks: a prompt template; the verification checklist.refactor-values: changing an existing enum or static value.debugging: a failing, flaky or slow test; aZodError; CI-only red.pr-reviewer: reviewing a named branch against the base.skill-creator: creating or improving a skill.
Before you report done
npm run lintclean; affected tests green; notest.only.- A failing check is a rule you missed: fix the cause, never bypass the check.
- Generated artifacts went through the
common-tasksverification checklist. - Report files changed, lint and test status; ask before committing.
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
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.

