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/golid-ai/golid/write-tests-e2egit clone --depth 1 https://github.com/golid-ai/golidWhat 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.00000 | $0.01034 |
| Opus 5 | $0.00000 | $0.00517 |
| Sonnet 5 | $0.00000 | $0.00207 |
| Haiku 4.5 | $0.00000 | $0.00103 |
Grade A, and why
write-tests-e2e 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 2d ago.
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 — 144 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Writing E2E Tests
Thesis: E2E tests verify browser-visible user journeys against the full stack, so they wait for rendered UI, use stable role selectors, and run serially against shared state.
E2E tests live in frontend/tests/e2e/. They require the full stack running
(backend + DB + frontend).
SPA Navigation: Wait for Page Content
SolidJS uses client-side routing (pushState). Playwright's waitForURL waits
for a browser load event that never fires during SPA navigation. Always wait
for page content instead.
// BAD: hangs forever on SPA navigation
await page.click('button[type="submit"]');
await page.waitForURL("**/dashboard", { timeout: 15000 });
// GOOD: waits for actual rendered content
await page.click('button[type="submit"]');
await expect(page.getByRole("heading", { name: "Dashboard" })).toBeVisible({
timeout: 15000,
});
Login Verification
The login page shows "Welcome back" as its heading. Never use /welcome/i to
verify login succeeded because it matches the login page before login completes.
// BAD: matches the login page itself
await expect(page.getByText(/welcome/i)).toBeVisible();
// GOOD: "Dashboard" h1 only exists after successful login
await expect(page.getByRole("heading", { name: "Dashboard" })).toBeVisible({
timeout: 15000,
});
Selectors
When text appears in multiple elements, use role-based selectors:
// BAD: "Golid" appears in navbar, h1, and footer
await expect(page.getByText("Golid")).toBeVisible();
// GOOD: targets the specific heading
await expect(page.getByRole("heading", { name: "Golid" })).toBeVisible();
When a heading and button share text, target the button role:
// BAD: may click the h2 heading instead of the button
await page.click("text=Change Password");
// GOOD
await page.getByRole("button", { name: "Change Password" }).click();
Playwright has no getByDisplayValue. Use locator + toHaveValue:
await expect(page.locator("#email")).toHaveValue("[email protected]");
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.
- 2d ago First seen · 144 lines · 0 tokens per session scan A 85a41d8be1b4
write-tests-e2e is a cursor rule published in the GitHub repository golid-ai/golid (40 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,034 tokens. 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-30.
Other cursor rules, from other repositories
cursorrules
AGENTS.md.
adapter-features
Database-specific features must be implemented in the specialized adapter only. Base adapters (postgres, mysql, etc.) must remain database-agnostic.
git-commits
Git commit safety — commits are human-only; AI suggests, never executes.
unit-tests-tdd
TDD required for behavior changes; ≥80% package coverage on touched packages; unit-test conventions.
token-optimization
Agent-mode tool-call efficiency. Cuts the largest hidden cost in modern AI IDEs — wasted tool calls and oversized context windows.
config-resilience
Config warn-and-continue for non-sensitive keys; Auth/ACL/JWT/secrets/DB credentials fail closed.