nakaokarei/swiftautogui/browser-control
Claude Code and agent skill by nakaokarei/swiftautogui
- community
Checking that the SKILL.md file is still in the repository.
Control web pages in an existing Chromium remote-debugging session with deterministic sagui commands or the browser-only AI Agent. Use when Claude Code needs to inspect tabs, observe semantic elements, navigate, click, type, send keys, scroll, or complete a browser goal through CDP without controlling native macOS UI, Accessibility, or CGEvent input.
Install
npx vskill@latest install nakaokarei/swiftautogui/browser-controlSKILL.md
browser-control
Use sagui browser to inspect and automate Chromium pages through the Chrome DevTools Protocol (CDP). Treat this as a browser-only environment: it never falls back to native macOS automation.
Preflight
Run these checks before browser automation:
Stop if the platform is not macOS. If sagui is missing, or the installed version has no browser command, ask before installing or upgrading it:
Do not claim that Accessibility or Screen Recording permission is required for browser-only CDP actions. Those permissions apply to native sagui commands, not sagui browser.
Connect to Chromium
List tabs on the default loopback endpoint:
If no debugging endpoint is available, ask the user to start a dedicated Chromium profile, or obtain approval before launching it:
Keep the endpoint on loopback. Do not expose or connect CDP to a LAN or public address. The browser session does not launch Chromium, manage profiles, bypass login, solve CAPTCHA, or handle 2FA.
Use the target ID printed by sagui browser tabs when a specific tab matters. Re-list tabs after a tab closes, opens, or navigates unexpectedly because target IDs and page observations may become stale.
Choose the domain allowlist
Build the narrowest allowlist that satisfies the user's stated goal:
github.compermits exactlygithub.com.'*.github.com'permits subdomains but not the parent domain; quote wildcards in the shell.- Repeat
--domainfor multiple hosts. - Never use a global wildcard, a public suffix such as
com, or unrelated domains. - Ask before adding a domain that is not clearly implied by the goal.
An allowlist entry only makes a destination eligible. Cross-origin navigation is still denied unless --allow-cross-origin is present. Use that flag only when the goal requires navigation from another origin, such as from chrome://newtab/ to an allowed website. It never permits navigation outside the allowlist. Downloads remain denied.
Use deterministic commands
Prefer direct commands when the requested action is known. They do not call the OpenAI API and do not require OPENAI_API_KEY.
First list tabs and observe the intended tab:
The observation prints actionable elements as [#N] role "name". Select elements by exact --role and --name. When multiple current elements share both values, also pass the observed --element-id; the command verifies all three values against a fresh observation before acting.
Other deterministic commands:
| Command | Purpose | Required selection | |
|---|---|---|---|
tabs | List page targets | None | |
observe | Print tabs and semantic elements | --tab-id | |
activate-tab | Activate a page target | positional target ID | |
open | Navigate to an allowed HTTP(S) URL | URL, --tab-id, --domain | |
click | Click a freshly verified semantic element | --tab-id, --role, --name | |
set-value | Replace an editable element value | value, --tab-id, --role, --name | |
type | Insert text into the focused element | text, --tab-id | |
key | Send a key or shortcut | keys, --tab-id | |
scroll | Scroll the page | non-zero axis, --tab-id |
After navigation, click, typing, keys, or scrolling, use the updated semantic map printed by the command. Do not reuse an old element ID after the page changes. Prefer set-value over type when the target textbox is known because set-value focuses and verifies the semantic element first.
Handle the OpenAI API key
The Agent defaults to the on-device Apple model. For --provider openai, prefer OPENAI_API_KEY; never print the value, request it in chat, or put it in a command with --api-key, where it may enter shell history or process listings.
Check only whether the variable exists:
When using --provider openai, if the key is absent, ask the user to configure it securely in their shell and stop until they confirm. On-device use does not need an API key.
Run a browser-only Agent
First list tabs, then run a narrowly scoped goal:
Omit --tab-id when the current active page is the intended starting point. Useful optional controls include:
Use automatic as the normal vision mode. The Agent primarily observes semantic DOM and Accessibility data and re-observes after navigation, DOM changes, stale elements, or action failures.
Before goals that submit forms, publish content, purchase items, change permissions, delete data, or otherwise have meaningful external effects, confirm the final consequential action with the user unless their request already authorized it explicitly.
Interpret results
unsupportedAction: The model requested a native-only action. Do not retry it through mouse or
keyboard fallback.
staleElement: The DOM node, frame, loader, or tab changed. List tabs or run a fresh Agent step;
never click an old coordinate.
navigationNotAllowed: Add the exact destination host only if it belongs to the user's goal.authorizationDenied: Cross-origin navigation needs explicit--allow-cross-originapproval.disconnected: Chromium exited or its debugging endpoint closed.
Treat Completed: true as the Agent's completion report, then verify any important result from its printed actions or by listing/observing the relevant tab again.
Native macOS boundary
This Skill controls page content only. It cannot operate Chromium window chrome, permission dialogs, file pickers implemented as native macOS UI, Finder, System Settings, or other apps. For those tasks, use the separate macos-control Skill in a distinct phase. Do not represent the two backends as one Agent run and do not silently fall back from CDP to Accessibility or CGEvent.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/swift-auto-gui/skills/browser-control/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/nakaokarei/swiftautogui/browser-control)