add-browser-tool

A development guide for adding new browser operations to BrowserMesh, a system that exposes browser control through tools. It covers the shared interfaces, Playwright implementation, session routing, and tests.

In plain words
What is it for?
Adding, extending, or renaming browser tools in BrowserMesh, including changes to its browser engine interface and Playwright adapter.
Why use it?
It helps prevent browser features from bypassing the system's rules for separate sessions, pages, operation tracking, and queued access.

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

Made for: Claude Code, Codex.

Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 919 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.00069 $0.00919
Opus 5 $0.00034 $0.00460
Sonnet 5 $0.00014 $0.00184
Haiku 4.5 $0.00007 $0.00092

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

Security

Grade A, and why

add-browser-tool 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.

.claude/skills/add-browser-tool/SKILL.md · 76 lines

How it starts

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

Adding a browser operation

Dependency direction is the whole point: define the contract first, implement it at the edge last. A capability that shows up in the MCP adapter before it exists in the port has already broken the architecture test.

Order of work

  1. Define the engine-independent contract. Input and result types in src/domain/. No Playwright types, no MCP types.
  2. Extend BrowserEnginePort (src/application/ports/browser-engine.ts) only if genuinely new engine capability is required. Reuse an existing method where the difference is routing.
  3. Implement the concrete behaviour in src/adapters/playwright/playwright-browser-engine.ts. This is the only place that resolves handles into real Browser, BrowserContext, Page, or locators.
  4. Route through BrowserMeshRuntime (src/runtime/browsermesh-runtime.ts).
  5. Target an explicit sessionId. No implicit current session.
  6. Target an explicit pageId for page-scoped operations. Reject a pageId owned by another session.
  7. Pass live browser access through the session queue (src/runtime/serial-queue.ts) — read operations included.
  8. Allocate and correlate an operationId.
  9. Map concrete failures into stable BrowserMeshError codes (src/domain/errors.ts). Raw Playwright errors must never reach a client.
  10. Expose it through validated MCP input in src/adapters/mcp/contracts.ts and register it in src/adapters/mcp/server.ts.
  11. Write an AI-facing description — see the rules in CLAUDE.md; a description is chosen by a model, not read by a human.
  12. Add positive and negative tests.
  13. Add isolation, concurrency, and cleanup coverage where the operation touches live state.
  14. Run the affected suites, then npm run verify.

What the compiler and tests will force

These are not optional; skipping one turns into a red suite rather than a silent omission.

  • ToolName is keyof typeof outputSchemas (contracts.ts:365). Adding an output schema creates the name.
  • toolPresentation is Record<ToolName, ToolPresentation> (contracts.ts:388), so TypeScript requires a title and annotations for the new tool.
  • tests/unit/tool-profiles.test.ts asserts every ToolName belongs to exactly one profile in src/adapters/mcp/tool-profiles.ts (core, observability, or persistence). A new tool that is in no profile fails here.
  • tests/integration/mcp.test.ts asserts discovered tool names equal Object.keys(outputSchemas) exactly, invokes every public tool, and validates its structuredContent.
  • tests/unit/architecture.test.ts rejects Playwright or MCP imports reaching domain, application, or runtime.

Read the full file on GitHub · 76 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. 2d ago First seen · 76 lines · 69 tokens per session scan A 8ded4cc0f824

Subscribe to this mod's changes

add-browser-tool is a skill published in the GitHub repository scrollDynasty/BrowserMesh (4 stars, last pushed 3d ago), licensed Apache-2.0. It adds 69 tokens to every session and 919 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

browser-harness

Always use browser-harness for any web interaction: automation, scraping, testing, or site/app work.

browser-use/browser-harness · 25 tokens

web-crawl

Get data from websites with the least necessary complexity. Use for quick lookups, visible-page extraction, search results, tables, pagination, detail-page traversal, downloadable files (Excel/CSV/PDF/ZIP), embedded page state, internal JSON/XHR APIs, bulk collection, reusable crawler generation, and delivery in any…

KuiChi-x/reverseloom · 108 tokens

eric-task-master

Install, connect, and use Eric Task Master for durable Playwright browser jobs with persistent or ephemeral Profiles, live fast-auto-human behavior control, task queues, progress health, semantic diagnostics, recovery, artifacts, and composable Task Packs.

npcworkspace-cmyk/eric-task-master · 52 tokens

opencli-browser

Use when an agent needs to drive a real Chrome window via opencli — inspect a page, fill forms, click through logged-in flows, or extract data ad-hoc. Covers the selector-first target contract, compound form fields, stale-ref handling, network capture, and the agent-native envelopes the CLI returns. Not for writing…

jackwener/OpenCLI · 80 tokens

opencli-adapter-author

Use when writing an OpenCLI adapter for a new site or adding a new command to an existing site. Guides end-to-end from first recon through field decoding, adapter coding, and verify. Replaces opencli-oneshot / opencli-explorer. For ad-hoc browser driving (no adapter), see opencli-browser instead; for a top-level…

jackwener/OpenCLI · 88 tokens

cloud

Documentation reference for using Browser Use Cloud — the hosted API and SDK for browser automation. Use this skill whenever the user needs help with the Cloud REST API (v2, v3, or v4), browser-use-sdk (Python or TypeScript), X-Browser-Use-API-Key authentication, cloud sessions, browser profiles, profile sync, CDP…

browser-use/browser-use · 177 tokens