browser-interact
БесплатноЗапускает вложенные скриптыНе проверенDrive a real browser during frontend work — verify a change rendered, click through a flow, fill forms, read console errors, take screenshots, or debug…
от david-crespo★ 20 звёзд на GitHubОб этом скилле
How to interact with a browser during frontend dev work.
Default: one Playwright script per check
For any multi-step flow (load a page, click around, fill a form, verify a
change), write a Playwright script and run it with node. Driving the browser
action-by-action through MCP tools costs a full model round trip per action: a
~25-action flow takes minutes through MCP calls and ~5 seconds as one script.
One-shot scripts are fine — headless chromium launches in ~70ms, so the app's
own load time dominates. Don't set up a persistent browser server
(launchServer/connect saves CPU, not wall-clock) unless running many
checks in a tight loop.
Template
import { chromium } from 'playwright'
const browser = await chromium.launch()
// 2x so screenshots match a Retina display; 1x looks half-res to the user
const page = await browser.newPage({ deviceScaleFactor: 2 })
await page.goto('http://localhost:4444/projects', { waitUntil: 'domcontentloaded' })
// wait on a real element, never 'networkidle'
await page.getByRole('link', { name: 'New project' }).waitFor()
// interact by accessible role/name; crib selectors from the repo's e2e tests
await page.getByRole('link', { name: 'New project' }).click()
await page.getByRole('textbox', { name: 'Name' }).fill('my-project')
await page.getByRole('button', { name: 'Create project' }).click()
await page.waitForURL('**/projects/my-project/instances')
// verify created state via CLIENT-SIDE nav — see mock-API gotcha below
await page
.getByRole('navigation', { name: 'Breadcrumbs' })
.getByRole('link', { name: 'Projects' })
.click()
console.log(await page.locator('body').ariaSnapshot()) // ~3KB page summary
await page.screenshot({ path: 'check.png' })
// console/errors are readable retroactively (Playwright 1.61+, last 200 msgs;
// filter: 'since-navigation' scopes to after the last full page load)
for (const m of await page.consoleMessages()) console.log(`[${m.type()}] ${m.text()}`)
for (const e of await page.pageErrors()) console.log(`[pageerror] ${e.message}`)
await browser.close()
Gotchas (each of these caused a first-run failure in testing)
- Module resolution: ESM ignores
NODE_PATH. Run the script from inside the frontend repo (most already have@playwright/test), or symlink the repo'snode_modulesnext to the script. If chromium isn't cached in~/Library/Caches/ms-playwright, ask before downloading it. - SPA + in-memory mock API (MSW etc.): any full page load —
page.goto, reload, URL navigation — reboots the service worker and resets the mock DB, wiping state created earlier in the flow. Verify mutations by navigating in-app via clicks. - Waiting: wait on a specific element at the destination, not
networkidle(SPAs may never go idle) and notlocation.pathname(URL updates before the destination renders). After a mutation,waitForURLis reliable. - Strict mode: ambiguous selectors throw (e.g. a "Projects" link in both
breadcrumb and sidebar). Scope through a parent
(
getByRole('navigation', { name: ... }).getByRole(...)). - Selectors: prefer role + accessible name. If the repo has e2e tests,
copy their selectors instead of guessing; otherwise print an
ariaSnapshot()first and pick names from it. - Page summary:
page.locator('body').ariaSnapshot()(~3KB) instead of dumping HTML. Screenshots go to files; Read them after. - Screenshot resolution: any screenshot the user will look at must be taken
at
deviceScaleFactor: 2(default is 1, which looks half-res on their display). In a Playwright test file, usetest.use({ deviceScaleFactor: 2 }). Preferlocator.screenshot()on the relevant element (a dialog, a card) over a full-page shot.
When to use browser MCP tools instead
For a one-off interactive look at a page that's already up — a screenshot,
reading console errors, a single click. Per-call latency is only 1–3s; it's
the per-action round trips that make long flows slow. (The chrome-devtools
CLI has the same tradeoff: ~0.2s fixed overhead per invocation, so idiomatic
one-command-per-action scripts run ~2x slower than Playwright; batching
everything into evaluate_script blobs matches Playwright's speed but is
worse to write.)
Debugging: pick by job
chrome-devtools MCP/CLI is uniquely capable where it vendors DevTools' own analysis code (unreachable via Playwright or raw CDP):
- Performance traces:
performance_start_trace/performance_analyze_insightrun DevTools' trace engine — LCP breakdown, CWV insights. - Heap analysis: CLI with
--memoryDebuggingexposes dominator trees, retainer paths, duplicate strings, snapshot comparison. - Console stacks: auto-symbolicated through source maps.
- The user's real Chrome:
--autoConnect(Chrome ≥144) attaches to the actual logged-in default-profile browser — useful when the bug needs real app state.
Playwright is better for network debugging: request.timing() gi
Установить browser-interact в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл browser-interact?
Drive a real browser during frontend work — verify a change rendered, click through a flow, fill forms, read console errors, take screenshots, or debug performance/memory/network. Use whenever interacting with a local web app in a browser (Playwright script templates, chrome-devtools tradeoffs, SPA mock-API gotchas).
Как установить скилл browser-interact?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл browser-interact запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic