safari-browser
macOS native browser automation via Safari + AppleScript. Use when the user needs to automate websites that require login (Plaud, Elementor, banking, social media) — Safari preserves localStorage and cookies permanently. Also use when agent-browser fails due to session/auth issues, or when the user explicitly asks to use Safari. Triggers on: "login to site", "automate with Safari", "use Safari", "session expired with agent-browser", "Plaud upload", or any website automation where persistent auth is needed.
What this skill does
# Safari Browser Automation macOS native browser automation CLI using Safari + AppleScript. **Core advantage: permanent login** — uses the user's existing Safari session directly. ## When to Use safari-browser vs agent-browser | Condition | Use | |-----------|-----| | Website requires login (Plaud, Elementor, banking, etc.) | **safari-browser** | | Need localStorage/cookies from existing session | **safari-browser** | | agent-browser `state save/load` fails | **safari-browser** | | Vue/React sites where `fill` doesn't trigger reactivity | **safari-browser** (JS events dispatched) | | Headless / CI / public sites | agent-browser | | Cross-platform needed | agent-browser | | Sites that block headless browsers (banks, social media) | **safari-browser** (real browser, no bot detection) | | AI + human collaboration (user watches and takes over) | **safari-browser** (shared Safari window) | | Need CDP accessibility tree | agent-browser (safari-browser has JS-based snapshot) | ## Core Workflow ```bash # Navigate safari-browser open "https://example.com" # Discover elements (like agent-browser snapshot) safari-browser snapshot # @e1 input[type="email"], @e2 button "Submit" safari-browser snapshot -c # compact (hide invisible elements) safari-browser snapshot --json # structured JSON output # Interact using @refs or CSS selectors safari-browser click @e2 safari-browser fill @e1 "[email protected]" safari-browser press Enter # Get information safari-browser get url safari-browser get text "h1" # Wait for page changes safari-browser wait --url "dashboard" safari-browser wait --js "document.querySelector('.loaded')" ``` ## Command Reference ### Navigation ```bash safari-browser open <url> [--new-tab] [--new-window] safari-browser back safari-browser forward safari-browser reload safari-browser close ``` ### Element Interaction ```bash safari-browser click <selector> safari-browser dblclick <selector> safari-browser fill <selector> <text> # clear + fill + input/change events safari-browser type <selector> <text> # append text + input event safari-browser select <selector> <value> # dropdown safari-browser hover <selector> safari-browser focus <selector> safari-browser check <selector> # checkbox safari-browser uncheck <selector> safari-browser scroll <dir> [pixels] # up/down/left/right, default 500px safari-browser scrollintoview <selector> safari-browser highlight <selector> # red outline for debug safari-browser drag <src> <dst> # drag and drop (JS events) ``` ### Keyboard ```bash safari-browser press Enter safari-browser press Tab safari-browser press Escape safari-browser press Control+a # modifier combos safari-browser press Shift+Tab ``` ### Find Elements (by text/role/label/placeholder) ```bash safari-browser find text "Submit" click safari-browser find role "button" click safari-browser find label "Email" fill "[email protected]" safari-browser find placeholder "Search" fill "query" ``` ### JavaScript ```bash safari-browser js "document.title" safari-browser js --file script.js safari-browser js "JSON.stringify(localStorage)" safari-browser js --large "document.body.innerText" # chunked read for large output safari-browser js --output /tmp/page.txt "document.body.innerText" # write to file ``` **Large output handling**: Safari's `do JavaScript` silently drops results >~1MB. Use `--large` to force chunked read, or `--output` to write to file. The CLI auto-retries with chunked read when it detects empty output. ### Page & Element Info ```bash safari-browser get url safari-browser get title safari-browser get text [selector] # full page or element safari-browser get source safari-browser get html <selector> safari-browser get value <selector> # input value safari-browser get attr <selector> <name> safari-browser get count <selector> safari-browser get box <selector> # bounding box JSON ``` ### State Checks ```bash safari-browser is visible <selector> # true/false safari-browser is exists <selector> safari-browser is enabled <selector> safari-browser is checked <selector> ``` ### Snapshot (Element Discovery + Page State) ```bash safari-browser snapshot # scan interactive elements → @e1, @e2... safari-browser snapshot -c # compact (exclude hidden elements) safari-browser snapshot -d 3 # limit DOM depth safari-browser snapshot --page # full page state: accessibility tree + metadata + alerts + dialogs safari-browser snapshot --page --json # full page state as JSON safari-browser snapshot --page -s "main" # scoped to <main> element safari-browser snapshot -s "form.login" # scope to CSS selector safari-browser snapshot --json # JSON array output ``` All selector-accepting commands support `@eN` refs from the last snapshot. ### Screenshot, PDF & Upload ```bash safari-browser screenshot [path] # default: screenshot.png [non-interfering] safari-browser screenshot --full path # full page [non-interfering] safari-browser pdf --allow-hid [path] # export as PDF [actively interfering — requires --allow-hid] safari-browser upload <selector> <file> # smart default: native dialog if Accessibility permitted, else JS fallback safari-browser upload --js <sel> <file> # force JS DataTransfer injection [non-interfering] safari-browser upload --native <sel> <file> # force native file dialog [requires Accessibility permission] ``` **Upload behavior**: With Accessibility permission granted, `upload` uses the native file dialog by default (clipboard paste for path input — fast, supports all characters including CJK and spaces). Without permission, it automatically falls back to JS DataTransfer injection and prints a hint to stderr. Use `--js` to force JS mode, or `--native`/`--allow-hid` to force native mode (backward compatible). **PDF export**: Uses clipboard paste for path input (instead of keystroke), precise waits (`repeat until exists`) instead of blind delays, and AXDefault button click (locale-independent) for the Save button. Still requires `--allow-hid`. ### Tab Management ```bash safari-browser tabs # list all tabs safari-browser tabs --json # JSON array output safari-browser tab <n> # switch to tab n safari-browser tab new # new tab ``` ### Wait ```bash safari-browser wait <ms> # wait milliseconds safari-browser wait --url <pattern> # wait for URL to contain pattern safari-browser wait --js <expr> # wait for JS truthy safari-browser wait --timeout <ms> # custom timeout (default 30s) ``` ### Storage ```bash safari-browser cookies get [name] # get all or by name safari-browser cookies get --json # JSON object output safari-browser cookies set <name> <value> safari-browser cookies clear safari-browser storage local get <key> safari-browser storage local set <key> <value> safari-browser storage local remove <key> safari-browser storage local clear safari-browser storage session get/set/remove/clear # Multi-window: per-origin storage requires --url targeting (#23) safari-browser storage local get token --url plaud # Plaud's token safari-browser storage local get token --url oauth # different OAuth provider's token ``` ### Multi-Window Targeting (#17 #18 #21 #23) When Safari has more than one window open, every command that reads from or drives a document accepts global targeting flags: ```bash safari-browser documents # discover available windows safari-browser get url --url plaud # target by URL substring safari-browser get title --window 2 # target by window index (1-based) safari-browser snapshot --url plaud # snapshot specific document safari-browser w
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.