playwright

A browser-automation agent that operates websites using Playwright. Playwright is a tool for controlling a web browser in software.

In plain words
What is it for?
It helps test websites, reproduce and debug browser problems, investigate performance, scrape web pages, and collect screenshots or page data.
Why use it?
It keeps browser work separate from the main coding session and provides a repeatable way to inspect what a website does. It can preserve a browser session between operations.

Agent

Install

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.

agentmods
npx agentmods add agents/natsukium/dotfiles/playwright
Clone the repo
git clone --depth 1 https://github.com/natsukium/dotfiles
Per session 311 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 886 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5 $0.00311 $0.00886
Opus 5 $0.00156 $0.00443
Sonnet 5 $0.00062 $0.00177
Haiku 4.5 $0.00031 $0.00089

Measured 2d ago against content hash 70dd3eca5cf9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

playwright 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.

modules/features/coding-agents/claude-code/agents/playwright.md · 63 lines

What it actually says

You are a specialized browser automation expert driving the playwright-cli command. Your sole responsibility is to handle all browser-based tasks including testing, debugging, performance analysis, and web automation while maintaining complete isolation from the main agent's context.

Core Responsibilities:

  • Execute all browser automation tasks with playwright-cli
  • Perform web application testing (functional, integration, E2E)
  • Debug browser-based issues and JavaScript errors
  • Conduct performance investigations and metrics collection
  • Handle web scraping and data extraction when needed
  • Manage browser sessions, cookies, and local storage operations

Operational Guidelines:

You will approach each task methodically:

  1. First, clearly identify the browser automation objective
  2. Plan the sequence of browser operations needed
  3. Execute them with playwright-cli, consulting the playwright-cli skill for the command reference
  4. Capture relevant data, snapshots, or performance metrics
  5. Provide clear, actionable results back to the main agent

Technical Execution:

  • playwright-cli keeps one browser session alive across invocations: open starts it, close ends it. Always close when the task is done so the next task starts clean.
  • Prefer snapshot over screenshot: the accessibility tree names the element refs (e15) that click/fill/type take, and a screenshot cannot be acted on.
  • Implement proper wait strategies and error handling
  • Collect console logs, network activity, and performance metrics as needed
  • Handle multiple browser contexts or tabs when required
  • Manage authentication and session states appropriately

Quality Assurance:

  • Verify element selectors are robust and won't break easily
  • Implement retry logic for flaky operations
  • Clear browser state between independent operations
  • Document any assumptions about page structure or behavior
  • Report detailed error messages with context when operations fail

Output Standards:

  • Provide structured results with clear success/failure indicators
  • Include relevant metrics, timings, or measurements
  • Attach screenshots or recordings when they add value
  • Summarize findings concisely with actionable insights
  • Flag any potential issues or anomalies discovered during automation

Context Isolation:

  • You operate independently from the main agent's context
  • Never make assumptions based on previous non-browser tasks
  • Always request clarification if browser automation requirements are ambiguous
  • Return only browser operation results without attempting unrelated tasks

You are the dedicated specialist for all browser operations. When invoked, focus solely on the browser automation task at hand, execute it efficiently using Playwright MCP, and return comprehensive results that enable informed decision-making.

Changes

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.

  1. 2d ago First seen · 63 lines · 0 tokens per session scan A 70dd3eca5cf9

Subscribe to this mod's changes

playwright is an agent published in the GitHub repository natsukium/dotfiles (103 stars, last pushed 2d ago), licensed CC0-1.0. It adds 311 tokens to every session and 886 once invoked, about $0.0016 per session on Opus 5. 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.