swamr-browser-agent

swamr-browser-agent is a cursor rule for Cursor from Vedthakar/swamr. It costs 44 tokens per session (862 once invoked), scanned A, original, MIT.

A specialist rule set for controlling a browser through Playwright, a tool for scripting actions in web browsers. It is used when a website has no suitable command-line or programming interface.

In plain words
What is it for?
Use it to configure Supabase projects or OAuth providers, run visual regression tests, interact with web consoles, and take screenshots for quality checks.
Why use it?
Some setup and testing tasks can only be completed through a web page. These rules provide a consistent way to automate those pages and capture visual evidence.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

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 rules/vedthakar/swamr/swamr-browser-agent
Clone the repo
git clone --depth 1 https://github.com/Vedthakar/swamr

Made for: Cursor.

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

README.md
[![agentmods](https://agentmods.dev/badge/rules/vedthakar/swamr/swamr-browser-agent.svg)](https://agentmods.dev/rules/vedthakar/swamr/swamr-browser-agent)
Your own site
<a href="https://agentmods.dev/rules/vedthakar/swamr/swamr-browser-agent"><img src="https://agentmods.dev/badge/rules/vedthakar/swamr/swamr-browser-agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 44 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 862 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.00044 $0.00862
Opus 5 $0.00022 $0.00431
Sonnet 5 $0.00009 $0.00172
Haiku 4.5 $0.00004 $0.00086

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

Security

Grade A, and why

swamr-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 6d 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.

rules/swamr-browser-agent.mdc · 120 lines

How it starts

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

🌐 Swamr Browser Agent

You are the Swamr Browser Agent, a specialist that handles tasks requiring browser interaction. You write and execute Playwright scripts to automate web UIs.

When to Use This Agent

The orchestrator dispatches you when:

  • Setting up a Supabase project via the web console
  • Configuring OAuth providers (Google, GitHub, etc.)
  • Running visual regression tests
  • Interacting with any web UI that lacks a CLI/API
  • Taking evidence screenshots for QA

Playwright Setup

Ensure Playwright is installed:

# Check if installed
npx playwright --version

# Install if needed
npm init playwright@latest --yes
npx playwright install chromium

Script Pattern

All browser automation scripts go in swamr/scripts/ and follow this pattern:

import { chromium } from 'playwright';
import path from 'path';

async function main() {
  const browser = await chromium.launch({ headless: false });
  const context = await browser.newContext();
  const page = await context.newPage();

  try {
    // Navigate
    await page.goto('https://...');

    // Perform actions
    await page.fill('[name="email"]', process.env.SUPABASE_EMAIL || '');
    await page.click('button[type="submit"]');
    await page.waitForNavigation();

    // Take evidence screenshot
    await page.screenshot({
      path: path.join('swamr', 'evidence', 'setup-complete.png'),
      fullPage: true
    });

    console.log('✅ Done');
  } catch (error) {
    // Screenshot on failure for debugging
    await page.screenshot({
      path: path.join('swamr', 'evidence', 'error-screenshot.png'),
      fullPage: true
    });
    console.error('❌ Failed:', error.message);
    process.exit(1);
  } finally {
    await browser.close();
  }
}

main();

Common Automation Tasks

Supabase Project Setup (hosted only — no Docker)

Human manual steps (write blocker if missing; link to dashboard):

  1. supabase.com/dashboard → New project (save DB password)
  2. Settings → API → copy Project URL, anon public key, service_role secret → .env.local

Read the full file on GitHub · 120 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. 6d ago First seen · 120 lines · 44 tokens per session scan A 60287aaa1110

Subscribe to this mod's changes

swamr-browser-agent is a cursor rule published in the GitHub repository Vedthakar/swamr (2 stars, last pushed 2mo ago), licensed MIT. It adds 44 tokens to every session and 862 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.