Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/nedcodes-ok/cursor-doctor/playwrightgit clone --depth 1 https://github.com/nedcodes-ok/cursor-doctorWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00643 | $0.00643 |
| Opus 5 | $0.00321 | $0.00321 |
| Sonnet 5 | $0.00129 | $0.00129 |
| Haiku 4.5 | $0.00064 | $0.00064 |
Grade A, and why
playwright scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 57 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Playwright Cursor Rules
You are an expert in Playwright end-to-end testing. Follow these rules:
Test Structure
- One test file per feature or page: tests/auth.spec.ts, tests/checkout.spec.ts
- Use test.describe() to group related tests
- Test names should describe user behavior: test('user can add item to cart and checkout')
- Keep tests independent — no test should depend on another test's state
- Use test.beforeEach for common setup (login, navigation)
Selectors
- Use getByRole() as the primary selector: page.getByRole('button', { name: 'Submit' })
- Use getByText(), getByLabel(), getByPlaceholder() for user-visible elements
- Use getByTestId() only when no accessible selector exists — add data-testid as last resort
- Never use CSS selectors or XPath for elements users interact with
- Chain locators: page.getByRole('listitem').filter({ hasText: 'Product A' })
Assertions
- Use web-first assertions: await expect(page.getByText('Success')).toBeVisible()
- Never use page.waitForTimeout() — use expect with auto-waiting or waitForSelector
- Assert on visible state, not DOM existence: toBeVisible() over toBeAttached()
- Use toHaveURL(), toHaveTitle() for navigation assertions
- Use soft assertions (expect.soft) for non-critical checks within a test
Page Object Model
- Create page objects for reusable interactions: class LoginPage { constructor(private page: Page) {} }
- Page objects expose actions (login, fillForm) not raw locators
- Return new page objects from navigation actions: async goToSettings() { return new SettingsPage(this.page) }
- Keep assertions in tests, not in page objects
Fixtures
- Extend the base test with custom fixtures: test.extend<{ adminPage: AdminPage }>()
- Use fixtures for authenticated state, seeded data, and test accounts
- Store auth state with storageState for reuse across tests
- Use worker-scoped fixtures for expensive setup (database seeding)
Anti-Patterns — Do NOT
- ❌ Using page.waitForTimeout(2000) — always wait for a specific condition
- ❌ Using page.$() or page.$$() — use locator API
- ❌ Testing implementation details (CSS classes, internal state)
- ❌ Sharing state between test files via global variables
- ❌ Hard-coding URLs — use baseURL in playwright.config.ts
- ❌ Ignoring flaky tests — fix the root cause or add proper waiting
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 57 lines · 643 tokens per session scan A fda83a373eec
playwright is a cursor rule published in the GitHub repository nedcodes-ok/cursor-doctor (9 stars, last pushed 5mo ago), licensed MIT. It adds 643 tokens to every session, about $0.0032 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
astro
Astro: islands, content collections, zero-JS patterns.
electron
Electron: IPC, main/renderer, security best practices.
angular
Angular: signals, standalone components, RxJS patterns.
django
Django: models, views, ORM best practices.
java
Modern Java: records, sealed classes, streams, virtual threads.
javascript
Modern JavaScript: ES2023+, async patterns, common traps.