coding: Command for Claude Code

.claude/commands/playwright-cli.md

playwright-cli is a command for Claude Code from fwornle/coding. It costs 145 tokens per session (1,880 once invoked), scanned A, original, MIT.

A command set for driving a real Chromium browser with Playwright, a tool for automating web pages.

In plain words
What is it for?
Use it to scrape pages, take screenshots or PDFs, fill in forms, click through user interfaces, and run end-to-end tests.
Why use it?
It removes the need to set up a separate tool server for browser automation.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is fwornle/coding's own configuration. It tells Claude Code how to work on coding itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything coding configures →

Reuse

Borrowing it

Nothing to install: this file belongs to fwornle/coding. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/fwornle/coding/main/.claude/commands/playwright-cli.md
Clone the repo
git clone --depth 1 https://github.com/fwornle/coding

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for playwright-cli

README.md
[![agentmods](https://agentmods.dev/badge/commands/fwornle/coding/playwright-cli/github.svg)](https://agentmods.dev/commands/fwornle/coding/playwright-cli)
Your own site
<a href="https://agentmods.dev/commands/fwornle/coding/playwright-cli"><img src="https://agentmods.dev/badge/commands/fwornle/coding/playwright-cli/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for playwright-cli

Your own site · 80×15
<a href="https://agentmods.dev/commands/fwornle/coding/playwright-cli"><img src="https://agentmods.dev/badge/commands/fwornle/coding/playwright-cli.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 145 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,880 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00145 $0.01880
Opus 5.5 $0.00058 $0.00752
Sonnet 5.5 $0.00029 $0.00376
Haiku 4.5 $0.00015 $0.00188

Measured 1mo ago against content hash 2cd1f9a7102d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

playwright-cli scanned grade A with 1 finding 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 1mo 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

| Dashboard not responding | Check `curl -s http://localhost:3032` first, rebuild if needed |
.claude/commands/playwright-cli.md · 238 lines

How it starts

The opening of the file, as written. The whole thing — 238 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Playwright CLI Skill

Drive a real Chromium browser from the bash_tool using Playwright (Node.js). No MCP server needed.


1. Environment Setup

Always run this check first. It's fast and idempotent.

# Check Node + npx availability
node --version && npx --version

# Check if playwright is available; install if not
if ! npx playwright --version 2>/dev/null; then
  echo "Installing Playwright..."
  npm install -D playwright 2>&1 | tail -5
  npx playwright install chromium 2>&1 | tail -10
fi

If npm install fails due to network restrictions, inform the user that Playwright must be pre-installed in their environment.

Working directory: Write scripts to /tmp/pw-scripts/ and run from there. For E2E test specs, use the project's tests/e2e/ directory structure.


2. Script Patterns

Write a Node.js script, save it, run it with node. Always use these boilerplate patterns:

Boilerplate (all scripts)

const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch({ headless: true });
  const context = await browser.newContext();
  const page = await context.newPage();

  try {
    // --- your task here ---
  } catch (err) {
    console.error('Error:', err.message);
    process.exit(1);
  } finally {
    await browser.close();
  }
})();

Screenshot

await page.goto('https://example.com', { waitUntil: 'networkidle' });
await page.screenshot({ path: '/tmp/pw-scripts/screenshot.png', fullPage: true });
console.log('Screenshot saved.');

PDF

await page.goto('https://example.com', { waitUntil: 'networkidle' });
await page.pdf({ path: '/tmp/pw-scripts/output.pdf', format: 'A4' });
console.log('PDF saved.');

Web Scraping

await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });

// Wait for a key element if needed
await page.waitForSelector('.content', { timeout: 10000 });

const data = await page.evaluate(() => {
  // Run in browser context — return serialisable data
  return Array.from(document.querySelectorAll('h2')).map(el => el.textContent.trim());
});

console.log(JSON.stringify(data, null, 2));

Read the full file on GitHub · 238 lines

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. 1mo ago Changed 2cd1f9a7102d
  2. 1mo ago First seen · 238 lines · 145 tokens per session scan A de51fc2d37df

Subscribe to this mod's changes

playwright-cli is a command published in the GitHub repository fwornle/coding (2 stars, last pushed today), licensed MIT. It adds 145 tokens to every session and 1,880 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.