一键导入
browser
Use when automating browser interactions, web scraping, or E2E UI testing using AI-optimized abbreviated selectors and isolated multi-session contexts.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when automating browser interactions, web scraping, or E2E UI testing using AI-optimized abbreviated selectors and isolated multi-session contexts.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Invoke a Panel of Experts review on any artifact — code, architecture, plans, repos, or documentation
Registry and index of all orchestration command skills
Aggregates session data from every project slug in ~/.claude/projects/ and surfaces systemic process patterns that appear in 3+ different projects, producing a prioritized finding list with project count, example evidence, and recommended fixes
Multi-persona expert panel framework for critical analysis, refinement, and creative insight
Automatically mines Claude session JSONL and EVOKORE session data to compute efficiency metrics and produce a structured retrospective report with specific narrative improvement recommendations
| name | browser |
| description | Use when automating browser interactions, web scraping, or E2E UI testing using AI-optimized abbreviated selectors and isolated multi-session contexts. |
| aliases | ["browser-automation","web-automation","playwright","puppeteer","e2e"] |
| category | automation |
| tags | ["browser","automation","web-scraping","e2e-testing","multi-session","abbreviated-refs"] |
| archetype | AGT-018 |
| version | 1.0.0 |
AI-optimized browser automation using abbreviated element refs (93% context reduction vs verbose XPath/CSS selectors) and isolated multi-session contexts for parallel, side-effect-free flows.
Use this skill when:
If the task is a single unauthenticated HTTP GET, prefer a plain fetch/curl-style tool instead of launching a browser.
Verbose selectors dominate browser-automation context windows. Each document.querySelector('button[data-testid="submit-btn"]') burns tokens on every reference. Abbreviated refs replace these with short stable IDs assigned at snapshot time.
At session or page snapshot, the browser tool enumerates interactive elements and returns a mapping table:
| Ref | Role | Label / Text | Selector (internal) |
|---|---|---|---|
#b1 | button | "Submit" | button[data-testid="submit-btn"] |
#b2 | button | "Cancel" | button.cancel-btn |
#i1 | input | "Email" | input[name="email"] |
#i2 | input | "Password" | input[name="password"] |
#a1 | link | "Forgot password" | a[href="/reset"] |
The agent then operates in abbreviated-ref space:
click #b1
fill #i1 "user@example.com"
fill #i2 "hunter2"
click #b1
Under the hood, the tool resolves #b1 → real selector and executes. This trades ~100-byte selectors for 3-char refs — a 93% context reduction on typical flows.
snapshot callsnapshot again — the tool re-enumerates and returns a fresh mapTreat refs as scoped to the current DOM state. After any navigation or dynamic content load, re-snapshot before acting.
Each browser session gets its own profile and browser context. Sessions share nothing — no cookies, no localStorage, no sessionStorage, no service workers, no cache.
session_a = browser.launch({ session_id: "login-variant-a" })
session_b = browser.launch({ session_id: "login-variant-b" })
Each session_id maps to a distinct persistent profile directory under ~/.evokore/browser-profiles/{session_id}/. Concurrent sessions are safe because they operate on separate Chromium/Playwright contexts.
browser.launch({ session_id: "acct-1" })
browser.goto("https://app.example.com/login")
browser.snapshot() # returns ref map
browser.fill("#i1", "user@example.com")
browser.fill("#i2", "hunter2")
browser.click("#b1") # submit
browser.wait_for("networkidle")
browser.snapshot() # new refs for logged-in DOM
browser.snapshot()
for field, value in form_data:
browser.fill(field_ref, value)
browser.click(submit_ref)
browser.wait_for("networkidle")
assert browser.url().endsWith("/success")
browser.goto("https://example.com/report")
browser.wait_for("networkidle")
browser.screenshot({ path: "report.png", full_page: true })
browser.on_request(pattern="**/api/**", handler=lambda req: log(req.url, req.method))
browser.on_response(pattern="**/api/users", handler=lambda res: capture_json(res))
browser.goto("https://app.example.com/dashboard")
document.querySelector('div.foo > button[data-testid="x"]') when you have #b3. The abbreviated ref exists to stay out of your context window.sleep(3) is brittle and slow. Use wait_for("networkidle"), wait_for_selector(ref), or wait_for_url(pattern) so the flow adapts to real page timing.click #b1 after a route change will fail or, worse, click the wrong element. Re-snapshot after every navigation.Browser sessions are expensive (memory, startup time) and carry isolation requirements — a natural fit for fleet_spawn + claim_acquire.
Use fleet_spawn to run N browser agents concurrently, each with its own session_id and its own claim_acquire lock on a shared resource (e.g., test user pool, tenant slot).
fleet_spawn({
count: 4,
task: "browser-login-smoke",
per_agent_env: { BROWSER_SESSION_ID: "${agent_id}" }
})
Each spawned agent:
claim_acquire({ resource: "test-user-pool" }) to reserve a distinct test accountbrowser.launch({ session_id: process.env.BROWSER_SESSION_ID })claim_release when donefleet_spawn provides the parallelism primitiveclaim_acquire prevents two agents from grabbing the same test account or tenantCheck fleet_status to monitor running browser agents and claim_list to see which resources are held.