browser-automation

A reference guide for automating web browsers with Playwright, a tool that drives a browser through code. It focuses on CSS selectors, which identify page elements such as buttons, links, and form fields.

In plain words
What is it for?
Use it to select buttons, inputs, links, and other elements; fill forms; and build browser-automation steps based on IDs, classes, tags, attributes, or element position.
Why use it?
It helps an agent target the correct elements when pages contain many controls or when selectors need to match attributes, positions, or form fields.

Skill for Claude CodeCodex

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 skills/librefang/librefang-registry/browser
Any agent
npx skills add librefang/librefang-registry --skill browser
Clone the repo
git clone --depth 1 https://github.com/librefang/librefang-registry

Made for: Claude Code, Codex.

Per session 14 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,639 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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.00014 $0.08639
Opus 5 $0.00007 $0.04320
Sonnet 5 $0.00003 $0.01728
Haiku 4.5 $0.00001 $0.00864

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

Security

Grade A, and why

browser-automation 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.

Origin

This is a copy

100% identical to browser-automation — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

hands/browser/SKILL.md · 936 lines

How it starts

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

Browser Automation Skill

Playwright CSS Selector Reference

Basic Selectors

Selector Description Example
#id By ID #checkout-btn
.class By class .add-to-cart
tag By element button, input
[attr=val] By attribute [data-testid="submit"]
tag.class Combined button.primary
parent child Descendant div.container button
parent > child Direct child ul > li
:nth-child(n) Nth element li:nth-child(2)
:first-child First element ul > li:first-child
:last-child Last element ul > li:last-child
[attr*=val] Attribute contains [class*="price"]
[attr^=val] Attribute starts with [href^="https"]
[attr$=val] Attribute ends with [href$=".pdf"]
:not(sel) Negation button:not(.disabled)
sel1, sel2 Multiple selectors #submit, button[type="submit"]

Form Selectors

Selector Use Case
input[type="email"] Email fields
input[type="password"] Password fields
input[type="search"] Search boxes
input[name="q"] Google/search query
textarea Multi-line text areas
select[name="country"] Dropdown menus
input[type="checkbox"] Checkboxes
input[type="radio"] Radio buttons
button[type="submit"] Submit buttons
input[type="file"] File upload fields
input[type="date"] Date pickers
input[type="tel"] Phone number fields
input[autocomplete="cc-number"] Credit card fields
[contenteditable="true"] Rich text editors

Navigation Selectors

Selector Use Case
a[href*="cart"] Cart links
a[href*="checkout"] Checkout links
a[href*="login"] Login links
nav a Navigation menu links
.breadcrumb a Breadcrumb links
[role="navigation"] a ARIA nav links
a[href*="account"] Account/profile links
a[href*="register"], a[href*="signup"] Registration links
header a[href="/"] Logo/home link
footer a Footer links

Read the full file on GitHub · 936 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 936 lines · 14 tokens per session scan A 43d4e501d6c7

Subscribe to this mod's changes

browser-automation is a skill published in the GitHub repository librefang/librefang-registry (11 stars, last pushed 8d ago), licensed MIT. It adds 14 tokens to every session and 8,639 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to browser-automation, differing in 0 lines, and is treated as a copy.