/SKILL.md
Read metadata, DOM, screenshots, and structured page payloads from an attached Chrome or Chromium tab through the local Agent Browser Relay extension. Use when Codex needs relay preflight or troubleshooting, popup attach guidance, lease-scoped concurrent tab reads, or new background tab creation through the relay without direct browser automation.
npx skillsauth add mindgames/agent-browser-relay agent-browser-relayInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill to operate through the local relay gateway on an explicitly attached browser tab, verify readiness before reads, and keep concurrent tab workflows lease-scoped instead of falling back to direct browser-control tools.
Chrome is the documented target. Chromium-based browsers that can load the extension may also work, and relay status now surfaces detected host-browser identity plus a persistent profile id, but the skill does not yet provide first-class multi-browser orchestration.
Fresh-machine rule:
skills add guarantees the installed skill at ~/.agents/skills/agent-browser-relayskills add is ~/.agents/skills/agent-browser-relay/extension~/agent-browser-relay/extension is only an optional visible convenience copy created by npm run extension:installnpm run extension:path, npm run relay:start, and npm run relay:global:install print the primary folder to loadnpm run extension:path also prints stable absolute paths for read-active-tab.js and preflight.sh so agents can avoid cwd-dependent invocationnpm run extension:status confirm that Chrome actually loaded itchrome://extensions before attach/read steps. Do not treat a missing visible convenience copy as a sandbox or socket-permission issue.Defaults are set in code:
127.0.0.118793120000 ms
Override per command with --host, --port, and --attach-timeout-ms when needed.Install dependencies and start relay
This prints the primary Chrome extension path to load in Chrome and refreshes the optional visible convenience copy when possible.
npm run relay:start -- --status-timeout-ms 3000
Or pin host/port explicitly:
npm run relay:start -- --host "127.0.0.1" --port "18793" --status-timeout-ms 3000
relay:start keeps running until you stop it or the process is restarted. If you want a bounded session, pass --auto-stop-ms explicitly:
node scripts/relay-manager.js start --auto-stop-ms 10800000
Load extension in Chrome
chrome://extensions~/.agents/skills/agent-browser-relay/extension after skills addnpm run extension:path from the installed skill directory any time you want the exact path printed again~/agent-browser-relay/extension is optional; create it with npm run extension:install if you want a visible shortcutConfirm the extension is loaded in Chrome
Open the toolbar popup once after relay is running. The popup should show Relay connected on <port>.
Agent requirement: before any attach step on a fresh machine, ask the human to open the popup once, then confirm:
npm run extension:status -- --port "18793" --wait-for-connected --connected-timeout-ms 120000
This now also reports the detected browser host and persistent profile id for the connected extension instance.
Attach the extension to the target tab (open toolbar popup and click attach)
Optional per-tab relay: in the popup, set Tab port before clicking attach if this tab should use a non-default relay port. If you want the agent to create its own first background tab instead, enable Allow agent to create new background tabs in the popup.
Agent requirement: after extension:status confirms Chrome loaded the extension, pause and ask the human to do this attach step, then wait for confirmation before continuing.
If your .agents skill folder drops extension/ after a git fetch or pull, repair it from the repo:
cd ~/.agents/skills/agent-browser-relay 2>/dev/null || cd ~/.agents/skills/private/agent-browser-relay
git sparse-checkout disable
git config --unset-all core.sparseCheckout || true
git config --unset-all core.sparseCheckoutCone || true
git checkout -- .
Check readiness and attach state
npm run relay:doctor -- --port "18793" --tab-id "<TAB_ID>" --json
Resolve <TAB_ID> from status first (npm run relay:status -- --all --status-timeout-ms 3000).
For all agent runs, use the assigned tab id:
npm run relay:doctor -- --host "127.0.0.1" --port "18793" --tab-id "<TAB_ID>" --json
Continue only if this command returns success.
18793)./status and node scripts/read-active-tab.js).agent-browser, or ad-hoc Chrome control scripts).--tab-id.npm run extension:path before any attach/read attempt. After skills add, that is normally ~/.agents/skills/agent-browser-relay/extension.npm run extension:pathnpm run extension:statusnpm run relay:startnpm run relay:statusnpm run relay:doctornpm run relay:stopnode scripts/read-active-tab.jsnpm run relay:status -- --status-timeout-ms 3000curl --max-time 3 -sS "http://127.0.0.1:18793/status"npm run relay:status -- --all --status-timeout-ms 3000relay:start, pause and ask the human to open the popup once so npm run extension:status -- --port "18793" --wait-for-connected --connected-timeout-ms 120000 can confirm Chrome actually loaded the extension.extension:status succeeds, either ask the human to attach the target tab before reads, or confirm that Allow agent to create new background tabs is enabled before first-tab creation workflows.npm run relay:doctor -- --host "127.0.0.1" --port "18793" --tab-id "<TAB_ID>" --json before reads and proceed only when it succeeds.Target.createTarget, run npm run relay:doctor -- --host "127.0.0.1" --port "18793" --require-target-create --json and proceed only when it succeeds.--tab-id <tabId> on check/read commands so every operation is lease-scoped.npm run relay:status -- --all --status-timeout-ms 3000 and prefer leaseSummary.availableAttachedTabIds or attachedTabs[].leasedSessionId when choosing the next --tab-id.TAB_LEASED_BY_OTHER_SESSION, do not attempt takeover. Wait for that session to finish or retry with another attached tab that has no active lease.Target.createTarget is enabled, the extension may create and auto-attach the first agent-controlled tab for the session without a human seed attach step.tabId is missing from relay status attachedTabs, stop and ask the human to re-attach the target tab in the popup before continuing.relay:start times out, report the actual relay log/error. Do not guess about sandbox restrictions unless the command output shows a concrete permission error.Read structured tab payload
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --tab-id "<TAB_ID>"
Optional one-command smoke test
./scripts/preflight.sh
This is a local smoke wrapper. For agent workflows, the canonical preflight remains npm run relay:doctor -- --port "18793" --tab-id "<TAB_ID>" --json for attached tabs, or npm run relay:doctor -- --port "18793" --require-target-create --json for first-tab creation workflows.
If the current working directory is not the installed skill root, use the absolute Stable read CLI path printed by npm run extension:path instead of a relative node scripts/read-active-tab.js path.
read-active-tab.js returns capability metadata in every successful payload under:
source.capabilities
Version compatibility checks are also included under source.extension:
installedVersionsourceVersionrelayVersionobservedExtensionVersionversionMismatchIf a mismatch is detected, the command also prints a human-friendly update hint to stderr on every run.
scripts/read-active-tab.js default extraction: url, title, text, links, metaDescription.--tab-id) for concurrent agent isolation per tab on one relay port.Runtime.evaluate expression mode with --expression, --expression-file, or --expression-stdin.--screenshot (optional --screenshot-full-page, --screenshot-path).--check --wait-for-attach.npm run relay:status -- --all --status-timeout-ms 3000 before selecting a tab for a concurrent run.attachedTabs plus leasedSessionId / tabLeases to understand which attached tabs are currently free.TAB_LEASED_BY_OTHER_SESSION, do not force takeover. Wait for that session to release the tab or pick another attached tabId.--preset values: default, whatsapp, wa, whatsapp-messages, chat-audit, chat.--text-regex, --exclude-text-regex, --link-text-regex, --link-href-regex.--message-regex, --exclude-message-regex, --sender-regex, --exclude-sender-regex.In agent workflows, use the --tab-id variants. Unscoped commands are for manual/local debugging only.
Prefer --expression-file or --expression-stdin over inline --expression for non-trivial JavaScript.
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --pretty false
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --tab-id 123 --pretty false
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --tab-id 123 --check --wait-for-attach --require-target-create --attach-timeout-ms 120000
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --expression "document.documentElement.outerHTML"
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --tab-id 123 --expression-file "./tmp/expression.js"
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --tab-id 123 --expression-stdin < ./tmp/expression.js
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --screenshot --screenshot-full-page --screenshot-path "./tmp/page.png"
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --preset whatsapp-messages --max-messages 200 --selector "#main"
node scripts/read-active-tab.js --preset chat-audit --selector "body" --message-regex ".*"
All successful commands return a source object with relayHost, relayPort, relayStatusUrl, and relayWebSocketUrl.
Before fetching data in an automation flow, run a lightweight preflight once to ensure relay + attached tab state are ready.
For multiple agents on one relay:
npm run relay:status -- --all --status-timeout-ms 3000).--tab-id in every read-active-tab.js call for that agent.relay:doctor reports TAB_LEASED_BY_OTHER_SESSION, inspect attachedTabs, tabLeases, and blocker detail, then pick another attached tab or wait for the owning session to release it.tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.