agentleFS
PostHogKnown publisherPostHog/posthog-foss/.agents/skills/playwright-test/SKILL.md

playwright-test

Skill728 starsChanged 9 days agoMITView on GitHub

Write a playwright test, make sure it runs, and is not flaky.

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 7 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read @playwright/README.md for best practices, gotchas, and how to run tests.

    line 7
  2. Distinctive:

    Follow the best practices in the README strictly

    line 11
  3. Distinctive:

    After UI interactions, always assert on UI changes, do not assert on network requests resolving

    line 12
  4. Distinctive:

    Keep looping until all tests pass: Do not give up or ask the user for help.

    line 13
  5. Very specific:

    Use the Playwright MCP tools (e.g., mcp__playwright__browser_navigate, mcp__playwright__browser_click, mcp__playwright__browser_screenshot) …

    line 21
  6. Distinctive:

    After your exploration, present the plan to me for confirmation or any changes.

    line 23
  7. Distinctive:

    Write the tests, making sure to use common patterns used in neighbouring files.

    line 27
  8. Very specific:

    Run the tests with BASE_URL='http://localhost:8010' pnpm --filter=@posthog/playwright exec playwright test <file name> --retries 0 …

    line 28
  9. Very specific:

    After all tests pass in the file, run with --repeat-each 10 added to the command.

    line 33
  10. Distinctive:

    If any test fails across the 10 runs, treat it as a real failure: go back to Step 2, debug, fix, and re-run Step 3.

    line 35

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Read @playwright/README.md for best practices, gotchas, and how to run tests.

Rules

  • Follow the best practices in the README strictly
  • After UI interactions, always assert on UI changes, do not assert on network requests resolving
  • Keep looping until all tests pass. Do not give up or ask the user for help. You must resolve every failure yourself.

Instructions

You are to plan an end to end playwright test for a feature.

Step 1: Plan the test(s) to be done.

Use the Playwright MCP tools (e.g., mcp__playwright__browser_navigate, mcp__playwright__browser_click, mcp__playwright__browser_screenshot) to interact with the browser and plan your tests.

After your exploration, present the plan to me for confirmation or any changes.

Step 2: Implement the test plan

  • Write the tests, making sure to use common patterns used in neighbouring files.
  • Run the tests with BASE_URL='http://localhost:8010' pnpm --filter=@posthog/playwright exec playwright test <file name> --retries 0 --workers 3
  • Debug any failures. Look at screen shots, if needed launch the playwright mcp skills to interact with the browser. Go back to step 1 after attempting a fix.

Step 3: Ensure no flaky tests

After all tests pass in the file, run with --repeat-each 10 added to the command. This will surface any flaky tests.

If any test fails across the 10 runs, treat it as a real failure: go back to Step 2, debug, fix, and re-run Step 3. Do not proceed to Step 4 until every run of every test passes.

Step 4: Report

Once all tests pass, output a single line: Testing Complete

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.