km-browser-abstraction

km-browser-abstraction is a skill for Claude Code, Codex from treylom/knowledge-manager. It costs 21 tokens per session (997 once invoked), scanned A, original, MIT.

A common interface for extracting content from websites through built-in browser tools, Playwright, or Hyperbrowser. Playwright is a browser automation library, while Hyperbrowser is a hosted browser service.

In plain words
What is it for?
Use it to navigate websites, capture page snapshots, scrape content, and work with sites that require sessions or stealth browsing.
Why use it?
It lets the same web-extraction workflow work with different browser providers and choose between local setup, built-in access, or a hosted service.

Skill for Claude CodeCodex

Part of the km plugin — 10 skills, 10 commands, 2 agents shipped together

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

Made for: Claude Code, Codex.

Or install km, the plugin that ships this one along with the rest of its 10 skills, 10 commands, 2 agents.

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 km-browser-abstraction

README.md
[![agentmods](https://agentmods.dev/badge/skills/treylom/knowledge-manager/km-browser-abstraction.svg)](https://agentmods.dev/skills/treylom/knowledge-manager/km-browser-abstraction)
Your own site
<a href="https://agentmods.dev/skills/treylom/knowledge-manager/km-browser-abstraction"><img src="https://agentmods.dev/badge/skills/treylom/knowledge-manager/km-browser-abstraction.svg" alt="Measured on agentmods" height="20"></a>
Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 997 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.00021 $0.00997
Opus 5 $0.00010 $0.00498
Sonnet 5 $0.00004 $0.00199
Haiku 4.5 $0.00002 $0.00100

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

Security

Grade A, and why

km-browser-abstraction 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 3d 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.

.agent/skills/km-browser-abstraction/SKILL.md · 168 lines

How it starts

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

Browser Abstraction Layer

Unified interface for web content extraction across browser providers


Provider Selection

function get_browser_provider() {
  // 1. Check environment first
  if (is_antigravity_environment()) {
    return "antigravity"  // Use native browser agent
  }

  // 2. Fall back to config
  config = Read("km-config.json")
  return config?.browser?.provider || "playwright"
}

function is_antigravity_environment() {
  // Antigravity provides built-in browser capabilities
  // Check if running inside Antigravity IDE
  return typeof antigravity !== 'undefined' ||
         process.env.ANTIGRAVITY_SESSION ||
         file_exists("~/.gemini/antigravity/")
}

Provider Comparison

Feature Antigravity Native Playwright Hyperbrowser
Setup required None (built-in) MCP server MCP + API key
Simple scraping Natural language navigatesnapshot scrape_webpage
Stealth mode Built-in Not supported useStealth: true
Social media Excellent May be blocked Good
Cost Free (with Antigravity) Free API key required
Authentication Session-aware Limited Profile support

Unified Scraping Function

function scrape_url(url, options = {}) {
  provider = get_browser_provider()

  switch (provider) {
    case "antigravity":
      // Antigravity has built-in browser agent
      // Simply ask it to fetch and analyze the page
      return antigravity_browser_fetch(url, options)

    case "hyperbrowser":
      return mcp__hyperbrowser__scrape_webpage({
        url: url,
        outputFormat: ["markdown"],
        sessionOptions: {
          useStealth: options.stealth || false
        }
      })

    case "playwright":
    default:
      mcp__playwright__browser_navigate({ url: url })
      mcp__playwright__browser_wait_for({ time: 3 })
      return mcp__playwright__browser_snapshot()
  }
}

Read the full file on GitHub · 168 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. 3d ago First seen · 168 lines · 21 tokens per session scan A 6562730de4af

Subscribe to this mod's changes

km-browser-abstraction is a skill published in the GitHub repository treylom/knowledge-manager (230 stars, last pushed yesterday), licensed MIT. It adds 21 tokens to every session and 997 once invoked, about $0.0001 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-09-01.

Related

Other skills, from other repositories

v8-jit

V8 JIT optimization patterns for writing high-performance JavaScript in Next.js server internals. Use when writing or reviewing hot-path code in app-render, stream-utils, routing, caching, or any per-request code path. Covers hidden classes / shapes, monomorphic call sites, inline caches, megamorphic deopt, closure…

vercel/next.js · 88 tokens

use-agent-browser-for-airi

Test AIRI display-model imports with agent-browser across stage-tamagotchi Electron, stage-web, and stage-pocket mobile web layouts. Use when uploading and verifying contributor-supplied Live2D ZIP, VRM, or MMD ZIP/PMX/PMD files through AIRI's model selector, including onboarding bypass, format-specific import…

moeru-ai/airi · 87 tokens

opencli-sitemap-author

Use when creating or maintaining OpenCLI site sitemaps: agent-facing navigation, page-state, action, workflow, API-reference, pitfall, and fallback knowledge for a website. Use after browser exploration discovers durable site context, when a sitemap is stale, or when promoting local site knowledge into the repo.

jackwener/OpenCLI · 67 tokens

debug-optimize-lcp

Guides debugging and optimizing Largest Contentful Paint (LCP) using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions…

ChromeDevTools/chrome-devtools-mcp · 99 tokens

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

every-app/open-seo · 35 tokens

interactive-login

How to complete browser/interactive logins (aws / gh / glab / gcloud). The platform backgrounds the login poller so it survives the human's browser round-trip — and when that does NOT work.

yc-software/qm · 46 tokens