Playwright
Skill codingSamss/all-my-ai-needs/platforms/codex/skills/playwright
Claude Code + Codex 双平台 AI dotfiles:统一管理 skills/agents/hooks,并一键同步到 ~/.claude 与 ~/.codex。
npx -y skills add codingSamss/all-my-ai-needs --skill playwrightAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 11 stars11 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use only when the user explicitly asks for Playwright Extension / real-browser debugging, or when HTTP, in-app Browser, and Codex Chrome plugin cannot complete an interaction-heavy workflow. This skill requires manually enabled `playwright-ext` (`@playwright/mcp --extension`).
SKILL.md
4.4 KB, as published. Nobody here has run it
Playwright MCP Skill
This is not the default browser surface. For local app checks, screenshots, ordinary page inspection, or tasks that do not require the user's active Chrome session, prefer Codex Browser / in-app browser in the background. For tasks that need the user's Chrome login state or existing tabs, prefer the Codex Chrome plugin before Playwright.
Use Playwright as the reliable browser execution fallback in this stack:
- HTTP/API or static extraction: default first choice when it can answer the task
- Codex Browser / in-app browser: default browser surface for local pages and ordinary page inspection
- Codex Chrome plugin: logged-in Chrome profile, existing tabs, and extension-backed interaction
playwright-ext: explicit fallback only after manual enablement
When this skill is deliberately selected, use a single channel only:
- Use
playwright-extMCP inside this skill only whencodex mcp get playwright-extreports it is enabled. - Do not use
playwright-cliwrapper in this skill. - Do not pivot to
@playwright/testunless the user explicitly asks for test files.
Role In The Stack
Choose Playwright when:
- the user explicitly asks to use Playwright Extension or a real Chrome extension session.
- the Codex Chrome plugin cannot complete the action and Playwright has been manually enabled.
- the workflow is interaction-heavy and must be verified step by step.
- success depends on stable refs, precise DOM transitions, or repeated re-snapshot control.
- upstream tools already proved that a lighter layer is not reliable enough for the current task.
Prerequisite check (required)
Before proposing browser actions, verify MCP and runtime dependency:
codex mcp get playwright-ext
command -v npx >/dev/null 2>&1
If playwright-ext is missing or disabled, do not configure or enable it unless the user explicitly asks. If they do, configure it with extension token:
codex mcp add playwright-ext \
--env PLAYWRIGHT_MCP_EXTENSION_TOKEN=<token> \
-- npx @playwright/mcp@latest --extension
If npx is missing, ask the user to install Node.js/npm:
node --version
npm --version
brew install node
Core workflow
- Confirm that the task truly needs reliable browser execution rather than lighter extraction or inspection layers.
- Open the page.
- Snapshot to get stable element refs.
- Interact using refs from the latest snapshot.
- Re-snapshot after navigation or significant DOM changes.
- Verify page state after each important action.
- Capture artifacts (screenshot, pdf, traces) when useful.
Takeover Rules
Take over from lighter browser paths when:
- the current layer cannot prove that the intended page state change really happened.
- login/session flow, modal flow, or multi-step navigation needs strong ref discipline.
- the workflow has become complex enough that repeated browser verification is cheaper than continued fallback guessing.
- the Codex Chrome plugin has been tried or ruled out, and
playwright-extis enabled.
When Playwright takes over, say why it is now required and keep the flow inside Playwright until the critical interaction is verified.
When to snapshot again
Snapshot again after:
- navigation
- clicking elements that change the UI substantially
- opening/closing modals or menus
- tab switches
Refs can go stale. When a command fails due to a missing ref, snapshot again.
Guardrails
- Do not position Playwright as the default first hop when Codex Browser or Chrome plugin can solve the task.
- Always snapshot before referencing element ids like
e12. - Re-snapshot when refs seem stale.
- Prefer explicit commands over
evalandrun-codeunless needed. - When you do not have a fresh snapshot, use placeholder refs like
eXand say why; do not bypass refs withrun-code. - State the takeover reason when inheriting a task from lighter browser paths.
- Use
--headedwhen a visual check will help. - When capturing artifacts in this repo, use
output/playwright/and avoid introducing new top-level artifact folders. - Default to MCP actions and workflows, not Playwright test specs.