agentleFS
diegopachecodiegopacheco/agent-skills/playwright-skill/SKILL.md

playwright-skill

Skill0 starsChanged 3 months agoUnlicenseView on GitHub

Rules for running Playwright and Chrome/Chromium on macOS without touching the user's own Chrome. Use when the user mentions Playwright, playwrite, browser automation, UI tests, screenshots, Chrome or Chromium automation, headless browser, or the Playwright MCP.

32 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use playwright-ci, playwright-migration and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • jovd83Skill

    playwright-ci

    CI and delivery skill for Playwright automation. Use when the agent needs to design, debug, or optimize Playwright execution in GitHub Actions, GitLab CI, CircleCI, Azure DevOps, Jenkins, Docker, sharded pipelines, artifact workflows, or shared setup and teardown.

    Also in 3 projects that use this

  • jovd83Skill

    playwright-migration

    Migration skill for moving existing UI automation to Playwright. Use when the agent needs to translate Cypress or Selenium/WebDriver patterns, plan incremental migration, preserve coverage during framework change, or explain architectural differences that affect the suite design.

    Also in 3 projects that use this

  • noahsilve123Skill

    pytest-skill

    Generates production-grade pytest tests in Python with fixtures, parametrize, markers, mocking, and conftest patterns. Use when user mentions "pytest", "conftest", "@pytest.fixture", "@pytest.mark", "Python test". Triggers on: "pytest", "conftest", "Python test", "parametrize", "Python unit test".

    Also in 3 projects that use this

  • noahsilve123Skill

    vitest-skill

    Generates Vitest tests in JavaScript/TypeScript with Vite-native speed. Jest-compatible API with ESM support and HMR. Use when user mentions "Vitest", "vi.mock", "vitest.config". Triggers on: "Vitest", "vi.mock", "vi.fn", "Vite test", "vitest config".

    Also in 3 projects that use this

  • MicrosoftSkill

    playwright-cli

    Automate browser interactions, test web pages and work with Playwright tests.

    Also in 5 projects that use this

  • OpenAISkill

    brainstorming

    You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

    Also in 5 projects that use this

  • +1 more from jovd83

The file

Show its rules and text

We split this skill into the rules it gives an agent

18 rules. 0 are common, 5 are distinctive, and 13 are very specific to this project.

  • 0

    Common

    Most of the 29 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 13

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Always run the browser headless.

    line 8
  2. Distinctive:

    Never open a visible browser window unless the user explicitly asks to see it.

    line 9
  3. Very specific:

    Only use the browser Playwright installs: npx playwright install chromium.

    line 13
  4. Very specific:

    Never use channel: 'chrome', channel: 'msedge', --browser chrome or executablePath pointing at /Applications/Google Chrome.app.

    line 14
  5. Very specific:

    Never use the user profile ~/Library/Application Support/Google/Chrome as userDataDir, not even a copy of it.

    line 15
  6. Very specific:

    When a persistent context is needed, use a fresh temp dir: chromium.launchPersistentContext(fs.mkdtempSync(path.join(os.tmpdir(), 'pw-')), …

    line 16
  7. Very specific:

    Never connectOverCDP to the user Chrome and never start the user Chrome with --remote-debugging-port.

    line 17
  8. Very specific:

    Never pkill, killall or osascript quit Google Chrome.

    line 18
  9. Distinctive:

    Never read or write the user Chrome cookies, history, bookmarks, passwords or extensions.

    line 19
  10. Distinctive:

    Never edit the Info.plist or re-sign the Playwright Chromium app to hide it from the Dock, it stops launching.

    line 23
  11. Very specific:

    When the user wants to see what happened, stay headless and give them a video (recordVideo), a trace (npx playwright show-trace) or …

    line 24
  12. Distinctive:

    Only go headed when the user explicitly asks for it after knowing it will show in the Dock, and close the browser as soon as the task is …

    line 25
  13. Very specific:

    Always pass --browser chromium.

    line 29
  14. Very specific:

    Never --browser chrome, never --user-data-dir pointing at the user Chrome, never --extension.

    line 30
  15. Very specific:

    When the MCP says the browser is not installed, install Chromium for the Playwright version the MCP uses.

    line 31
  16. Very specific:

    Always close every browser, context and page, also when the script fails: use try / finally.

    line 35
  17. Distinctive:

    Delete the temp profile dirs that were created.

    line 36
  18. Very specific:

    Before finishing, check nothing is left: pgrep -fl ms-playwright must print nothing.

    line 37

“Common” is measured: kept by at least 6 in 10 of the 29 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

Always Hidden

  • Always run the browser headless. headless: true in code, --headless for the Playwright MCP, never --headed.
  • Never open a visible browser window unless the user explicitly asks to see it.
  • Screenshots, videos, traces and PDFs work headless. Never go headed to take them.

Never Touch The User Chrome

  • Only use the browser Playwright installs: npx playwright install chromium. It lives in ~/Library/Caches/ms-playwright.
  • Never use channel: 'chrome', channel: 'msedge', --browser chrome or executablePath pointing at /Applications/Google Chrome.app.
  • Never use the user profile ~/Library/Application Support/Google/Chrome as userDataDir, not even a copy of it.
  • When a persistent context is needed, use a fresh temp dir: chromium.launchPersistentContext(fs.mkdtempSync(path.join(os.tmpdir(), 'pw-')), { headless: true }).
  • Never connectOverCDP to the user Chrome and never start the user Chrome with --remote-debugging-port.
  • Never pkill, killall or osascript quit Google Chrome. Only close what was launched: await browser.close().
  • Never read or write the user Chrome cookies, history, bookmarks, passwords or extensions.

When It Must Be Visible

  • Headless is the only mode that keeps the browser out of the macOS Dock and the CMD + Tab switcher. A visible browser always shows in the Dock.
  • Never edit the Info.plist or re-sign the Playwright Chromium app to hide it from the Dock, it stops launching.
  • When the user wants to see what happened, stay headless and give them a video (recordVideo), a trace (npx playwright show-trace) or screenshots instead.
  • Only go headed when the user explicitly asks for it after knowing it will show in the Dock, and close the browser as soon as the task is done.

Playwright MCP

  • Configure it hidden and isolated: npx @playwright/mcp@latest --headless --isolated --browser chromium.
  • Always pass --browser chromium. It uses the Playwright Chrome for Testing, not /Applications/Google Chrome.app.
  • Never --browser chrome, never --user-data-dir pointing at the user Chrome, never --extension.
  • When the MCP says the browser is not installed, install Chromium for the Playwright version the MCP uses. Never switch to --browser chrome to work around it.
  • The MCP blocks data: URLs, use a real http or https URL.

Cleanup

  • Always close every browser, context and page, also when the script fails: use try / finally.
  • Delete the temp profile dirs that were created.
  • Before finishing, check nothing is left: pgrep -fl ms-playwright must print nothing.

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.