agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when writing end-to-end browser tests with Playwright. Covers resilient locators, auto-waiting, network interception, authentication reuse, parallelization, and eliminating flakiness.
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill e2e-playwright --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/e2e-playwrightContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when writing end-to-end browser tests with Playwright. Covers resilient locators, auto-waiting, network interception, authentication reuse, parallelization, and eliminating flakiness.
name: e2e-playwright description: Use when writing end-to-end browser tests with Playwright. Covers resilient locators, auto-waiting, network interception, authentication reuse, parallelization, and eliminating flakiness. metadata: category: testing version: 1.0.0 tags: [playwright, e2e, browser, flakiness, automation]
Write browser tests that fail only when the application is broken. An end-to-end suite that fails randomly is worse than no suite: it consumes attention and trains the team to ignore red.
1. **Choose the journeys** — End-to-end tests are slow and expensive. Test the paths whose failure would be a serious incident: sign up, check out, pay. Not every form. 2. **Locate the way a user would** — `getByRole("button", { name: "Place order" })`. Not a CSS class, not an XPath. Class names change; the accessible name is the contract with the user. 3. **Never sleep** — Playwright's assertions auto-wait and retry. `waitForTimeout` is the single largest cause of both flakiness and slowness in an E2E suite. 4. **Reuse authentication** — Log in once in a setup project, save the storage state, and reuse it. Logging in before every test triples the suite runtime. 5. **Control the network where the test is not about the network** — Mock the third-party payment provider; do not depend on its sandbox being up. 6. **Capture traces on failure** — A CI failure with a trace is diagnosable in two minutes. Without one, it is a mystery.
**Resilient, independent, and free of sleeps:**
import { test, expect } from "@playwright/test";
test.describe("checkout", () => {
test("a customer can place an order and see it confirmed", async ({ page }) => {
// Unique data per test: the suite can run in parallel without collisions.
const email = `test-${crypto.randomUUID()}@example.com`;
await seedCustomer({ email, cardOnFile: true });
// The payment provider is a third party. The test is not about their uptime.
await page.route("**/v1/payment_intents", (route) =>
route.fulfill({ status: 200, json: { id: "pi_test", status: "succeeded" } }),
);
await page.goto("/checkout");
// Located as a user perceives them, not by class name.
await page.getByRole("textbox", { name: "Email" }).fill(email);
await page.getByRole("button", { name: "Place order" }).click();
// Web-first assertion: retries until it passes or times out. No sleep needed.
await expect(page.getByRole("heading", { name: "Order confirmed" })).toBeVisible();
await expect(page.getByTestId("order-number")).toHaveText(/^ord_[0-9A-Z]{10}$/);
});
});**Authentication reused, not repeated:**
// auth.setup.ts — runs once, before everything.
setup("authenticate", async ({ page }) => {
await page.goto("/login");
await page.getByRole("textbox", { name: "Email" }).fill(process.env.TEST_USER!);
await page.getByRole("textbox", { name: "Password" }).fill(process.env.TEST_PASS!);
await page.getByRole("button", { name: "Sign in" }).click();
await expect(page.getByRole("heading", { name: "Dashboard" })).toBeVisible();
await page.context().storageState({ path: ".auth/user.json" });
});
// playwright.config.ts
projects: [
{ name: "setup", testMatch: /auth\.setup\.ts/ },
{
name: "chromium",
dependencies: ["setup"],
use: { storageState: ".auth/user.json" }, // every test starts logged in
},
],A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Repo: nimadorostkar/Claude-Skills-collection
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory, structuring notes for retrieval, and…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should not be trusted to remember,…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling, versioning, testing, and…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive disclosure, and the difference between a…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base model, and measuring whether the…