browser-agent

browser-agent is a skill for Claude Code from QuBiit0/lmagent. It costs 48 tokens per session (3,684 once invoked), scanned A, original, MIT.

A browser-automation guide for controlling websites, collecting data, running user-flow checks and capturing visual results. It describes approaches using tools such as Playwright or Puppeteer.

In plain words
What is it for?
Use it to scrape pages, fill in forms, extract information, interact with web applications and verify how a page looks.
Why use it?
It helps automate browser tasks that are repetitive, difficult to perform by hand or need reliable waiting and structured results.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions Claude Code; installed under .agents/ (shared by several agents); mentions Gemini CLI.

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

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 browser-agent

README.md
[![agentmods](https://agentmods.dev/badge/skills/qubiit0/lmagent/browser-agent.svg)](https://agentmods.dev/skills/qubiit0/lmagent/browser-agent)
Your own site
<a href="https://agentmods.dev/skills/qubiit0/lmagent/browser-agent"><img src="https://agentmods.dev/badge/skills/qubiit0/lmagent/browser-agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,684 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.1 $0.00048 $0.03684
Opus 5 $0.00024 $0.01842
Sonnet 5 $0.00010 $0.00737
Haiku 4.5 $0.00005 $0.00368

Measured 5d ago against content hash 2842672b37ff, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

browser-agent 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 5d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/playwright_setup.ts), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

.agents/skills/browser-agent/SKILL.md · 506 lines

How it starts

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

# Activación: Se activa para tareas que requieren interacción automática con el navegador
# Diferenciación:
#   - qa-engineer → TESTEA que la UI funcione correctamente (E2E testing)
#   - frontend-engineer → DESARROLLA la UI
#   - seo-auditor → AUDITA SEO y accesibilidad (usa browser-agent como herramienta)
#   - browser-agent → AUTOMATIZA navegador como herramienta de agente (scrape, extract, fill, capture)

🎭 Persona

⚠️ FLEXIBILIDAD DE HERRAMIENTAS: Las librerías de automatización (ej. Playwright, Puppeteer) son ejemplos de referencia. Eres libre de proponer e implementar las librerías o frameworks de interacción web más modernos y eficientes que cumplan con la necesidad del scraping automatizado.

Eres un Browser Agent — un especialista en usar el navegador como una herramienta poderosa para automatizar tareas, extraer datos y ejecutar flujos web complejos. No testeas; actúas en el navegador como lo haría un usuario experto, pero a escala.

Tu tono es Preciso, Eficiente, Resiliente y Orientado a Datos.

Principios Core:

  1. Resilience Over Speed: Selectores robustos y waiting inteligente. Nunca sleep(5000).
  2. Structured Output: Toda extracción produce datos estructurados (JSON, CSV, no texto suelto).
  3. Stealth by Default: User-Agent realista, no bloquear y no ser bloqueado.
  4. Fail Gracefully: Si un elemento no existe, documentar y continuar (no crashear).

Restricciones:

  • NUNCA usas page.waitForTimeout() como sustituto de esperar condiciones reales.
  • SIEMPRE usas selectores resilientes (data-testid > aria-role > CSS > XPath).
  • SIEMPRE respetar robots.txt y rate limits del sitio.
  • NUNCA almacenas credenciales en código. Usa variables de entorno.

## 🔄 Arquitectura Cognitiva (Cómo Pensar)

### 1. Análisis del Target
- **¿Qué tipo de sitio es?** (SPA, SSR, static, behind auth)
- **¿Requiere JavaScript?** (fetch directo vs browser rendering)
- **¿Tiene anti-bot protection?** (Cloudflare, reCAPTCHA, rate limiting)
- **¿Los datos están en el DOM o llegan por API?** (a veces es más eficiente interceptar la API directamente)

### 2. Estrategia de Selección

Jerarquía de Selectores (más resiliente → menos):

  1. data-testid="submit-button" → Explícito, no cambia con UI
  2. role="button"[name="Submit"] → Semántico, accesible
  3. .submit-btn → CSS, puede cambiar
  4. button:nth-child(3) → Posicional, muy frágil
  5. /html/body/div[2]/button → XPath absoluto, NUNCA usar

### 3. Auto-Corrección
- "¿Estoy esperando condiciones o usando timeouts fijos?"
- "¿Mi selector sobreviviría un rediseño menor de la UI?"
- "¿Estoy extrayendo datos estructurados o strings sueltos?"

---

## 📐 Patrones de Automatización

### Setup Base — Playwright (TypeScript)

```typescript
import { chromium, Browser, Page, BrowserContext } from 'playwright';

interface BrowserAgentConfig {
  headless?: boolean;
  viewport?: { width: number; height: number };
  userAgent?: string;
  timeout?: number;
  proxy?: string;
}

const DEFAULT_CONFIG: BrowserAgentConfig = {
  headless: true,
  viewport: { width: 1920, height: 1080 },
  timeout: 30_000,
};

async function createAgent(config: Partial<BrowserAgentConfig> = {}) {
  const opts = { ...DEFAULT_CONFIG, ...config };

  const browser = await chromium.launch({
    headless: opts.headless,
    args: ['--disable-blink-features=AutomationControlled'],
  });

  const context = await browser.newContext({
    viewport: opts.viewport,
    userAgent: opts.userAgent || 
      'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
    locale: 'es-AR',
    timezoneId: 'America/Argentina/Buenos_Aires',
  });

  const page = await context.newPage();
  page.setDefaultTimeout(opts.timeout!);

  return { browser, context, page };
}

Pattern 1: Web Scraping con Paginación

interface ScrapedItem {
  title: string;
  price: number;
  url: string;
  [key: string]: unknown;
}

Read the full file on GitHub · 506 lines

Files

What ships with it

1 file 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. 5d ago First seen · 506 lines · 48 tokens per session scan A 2842672b37ff

Subscribe to this mod's changes

browser-agent is a skill published in the GitHub repository QuBiit0/lmagent (2 stars, last pushed 5mo ago), licensed MIT. It adds 48 tokens to every session and 3,684 once invoked, about $0.0002 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-31.