跳到主内容
智客 ZICQ

技能库 智客分类:Agent 工作流 cmux-browser

Cmux Browser

终端用户浏览器自动化与cmux. 需要打开站点时使用,检查或与浏览器表面交互,等待页面状态,并提取数据而不会偷取焦点.

7576 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

终端用户浏览器自动化

何时用

官方 description 未单独写出 Use when。按规范,代理会在用户任务与这段 description 的关键词匹配时激活本技能。

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Browser Automation with cmux、Read the CLI contract first、Find an existing browser surface without changing focus、Core workflow、Wait、Viewport sizing (WKWebView)。 其中含规范建议的小节:分步指令。

文件分析

文件分析:除 SKILL.md 外,正文引用了 references/surface-discovery.md、references/commands.md、references/snapshot-refs.md、references/authentication.md、references/session-management.md、references/video-recording.md,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

End-user browser automation with cmux. Use when you need to open sites, inspect or interact with browser surfaces, wait for page state, and extract data without stealing focus.

Browser Automation with cmuxRead the CLI contract firstFind an existing browser surface without changing focusCore workflowWaitViewport sizing (WKWebView)Limits (WKWebView)Troubleshooting `js_error`Skill distribution and refreshFrom this checkout while developing the skill:From the published repository after the change is merged:Deep-dive references

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
cmux-browser
description
End-user browser automation with cmux. Use when you need to open sites, inspect or interact with browser surfaces, wait for page state, and extract data without stealing focus.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 6
  • references/surface-discovery.md
  • references/commands.md
  • references/snapshot-refs.md
  • references/authentication.md
  • references/session-management.md
  • references/video-recording.md

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「cmux-browser」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-aa54b766eb904856-Cmux-Browser.html
请存为 .cursor/skills/cmux-browser/SKILL.md 或 .claude/skills/cmux-browser/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/manaflow-ai/cmux 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/manaflow-ai/cmux' --list

npx skills add 'https://github.com/manaflow-ai/cmux' --skill 'cmux-browser'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: cmux-browser description: "End-user browser automation with cmux. Use when you need to open sites, inspect or interact with browser surfaces, wait for page state, and extract data without stealing focus." --- # Browser Automation with cmux ## Read the CLI contract first Check the binary that will actually run before giving an exact command: ```bash cmux browser --help cmux --version ``` There are two deliberately different command shapes: - **Create a browser surface** with `open`, `open-split`, or `new`. These commands may be workspace-scoped and do not need a surface handle. - **Use an existing surface** with every surface-bound navigation, inspection, interaction, tab, state, or diagnostic command. Pass the handle explicitly with `--surface ` or as the first positional token. Prefer the flag form in scripts because it makes the target unmissable: ```bash SURFACE="surface:7" # use a ref returned by discovery; do not guess an index cmux browser --surface "$SURFACE" get url cmux browser --surface "$SURFACE" get-url # accepted alias cmux browser --surface "$SURFACE" snapshot --interactive cmux browser --surface "$SURFACE" snapshot -i # accepted alias cmux browser --surface "$SURFACE" url # accepted alias cmux browser --surface "$SURFACE" tab list cmux browser --surface "$SURFACE" click e1 --snapshot-after ``` The positional form is equivalent (`cmux browser "$SURFACE" get url`). `url` and `get-url` are accepted URL aliases, and the short interactive snapshot flag is accepted when a surface is already present; use `get url` and `snapshot --interactive` in new documentation so the target and operation are clear. Surface-bound operations have no unscoped form. The current CLI's explicitly global browser verbs (`open`, `open-split`, `new`, `identify`, `import`, `profile`, `profiles`, `react-grab`, `reactgrab`, `devtools`, `dev-tools`, `focus-mode`, `design-mode`, `zoom`, and `history`) may omit the handle and use caller/workspace routing; do not infer a target from visible focus for any other verb. ## Find an existing browser surface without changing focus `identify`, `tree`, and list commands are read-only and do not select a workspace, pane, or browser. Do not infer that the visually focused surface is the one the user wants. First inspect the caller context (useful for the default workspace): ```bash cmux identify --json ``` To discover browser surfaces in the caller or another workspace/window, use the all-window tree. It includes parent refs, so a browser in a different workspace can be targeted directly without selecting that workspace: ```bash cmux tree --all --json \ | jq -r ' .windows[]? as $window | $window.workspaces[]? as $workspace | $workspace.panes[]? as $pane | $pane.surfaces[]? | select(.type == "browser") | [$window.ref, $workspace.ref, $pane.ref, .ref] | @tsv' ``` The filtered output is `window`, `workspace`, `pane`, and `surface` refs. Keep the `surface` ref, then target it explicitly: ```bash SURFACE="surface:N" # copied from the filtered tree output cmux browser --surface "$SURFACE" get url cmux browser --surface "$SURFACE" snapshot --interactive ``` If the user gives a URL or title instead of a workspace/pane, match that metadata locally and emit only the unique surface ref. This never prints the matched URL or title: ```bash MATCH_FIELD="url" # use "title" when matching a page title MATCH_VALUE="${BROWSER_URL_OR_TITLE:?set BROWSER_URL_OR_TITLE without logging it}" SURFACE="$( cmux tree --all --json | jq -r --arg field "$MATCH_FIELD" --arg value "$MATCH_VALUE" ' [ .windows[]? as $window | $window.workspaces[]? as $workspace | $workspace.panes[]? as $pane | $pane.surfaces[]? | select(.type == "browser") | select((if $field == "url" then (.url // "") else (.title // "") end) == $value) | .ref ] as $matches | if ($matches | length) == 1 then $matches[0] elif ($matches | length) == 0 then error("no matching browser surface") else error("multiple matches; use workspace/pane context") end' )" if [[ -z "$SURFACE" ]]; then printf '%s\n' 'no uniquely matching browser surface; provide workspace/pane context' >&2 exit 1 fi cmux browser --surface "$SURFACE" get url ``` For one known workspace, `cmux --json list-pane-surfaces --workspace ` is a smaller read-only query. Raw tree/list payloads can contain page URLs and titles; filter or redact them before logging or pasting them. Never use a focus/select command merely to discover a surface. ## Core workflow Open (or create) a surface without stealing focus, capture the returned ref, then use that ref for every existing-surface operation: ```bash OPEN_JSON="$(cmux --json browser open https://example.com --focus false)" SURFACE="$(printf '%s' "$OPEN_JSON" | jq -r '.surface_ref // .surface_id // empty')" [ -n "$SURFACE" ] || { printf '%s\n' 'browser open did not return a surface ref' >&2; exit 1; } cmux browser --surface "$SURFACE" get url cmux browser --surface "$SURFACE" wait --load-state complete --timeout-ms 15000 cmux browser --surface "$SURFACE" snapshot --interactive cmux browser --surface "$SURFACE" fill e1 "hello" cmux browser --surface "$SURFACE" click e2 --snapshot-after cmux browser --surface "$SURFACE" snapshot --interactive ``` The `open` response contains the new surface ref; in a script, extract it from the JSON response instead of printing the full response. If `get url` is empty or `about:blank`, navigate first instead of waiting on load state. Re-snapshot after navigation, modal open/close, or any major DOM change because refs go stale. ## Wait ```bash cmux browser --surface "$SURFACE" wait --selector "#ready" --timeout-ms 10000 cmux browser --surface "$SURFACE" wait --text "Success" --timeout-ms 10000 cmux browser --surface "$SURFACE" wait --url-contains "/dashboard" --timeout-ms 10000 cmux browser --surface "$SURFACE" wait --load-state complete --timeout-ms 15000 cmux browser --surface "$SURFACE" wait --function "document.readyState === 'complete'" --timeout-ms 10000 ``` ## Viewport sizing (WKWebView) `cmux browser --surface "$SURFACE" viewport ` sets an exact logical viewport from 1 to 4096 CSS pixels. The page is aspect-fitted inside its existing pane, so pane layout and focus stay unchanged, and screenshots use the requested logical dimensions. `viewport reset` returns to native pane sizing. Close or detach the browser inspector first: its inspector-managed split layout cannot be combined with viewport emulation, and opening or redocking an attached inspector resets emulation to native sizing. Large viewport and page-zoom combinations are bounded; the command returns structured `maximum_page_zoom` details and leaves the viewport unchanged when the combination exceeds WKWebView render limits. ## Limits (WKWebView) Offline emulation, trace/screencast recording, network route interception/mocking, and low-level raw input injection return `not_supported`; they depend on Chrome/CDP-only APIs. Use `click`, `fill`, `press`, `scroll`, `wait`, and `snapshot` instead. ## Troubleshooting `js_error` Some complex pages reject the JavaScript behind `snapshot --interactive` and `eval`. Recover by checking whether the page actually navigated, then fall back to raw text or HTML: ```bash cmux browser --surface "$SURFACE" get url cmux browser --surface "$SURFACE" get text body cmux browser --surface "$SURFACE" get html body ``` If it still fails, navigate to a simpler intermediate page and retry from there. If the CLI and this skill disagree, refresh help (`cmux browser --help`) and refresh the installed skill before continuing; do not invent an implicit target. ## Skill distribution and refresh The repository copies are the source of truth: `.claude/skills/cmux-browser` and `.agents/skills/cmux-browser` point at `skills/cmux-browser`. Do not edit a mirror by hand. The supported Vercel installer (pinned here to the reviewed `skills` 1.5.23 release) refreshes both global Claude Code and Codex discovery roots and copies the complete skill (including references and templates): ```bash # From this checkout while developing the skill: npx --yes [email protected] add . --global --yes --skill cmux-browser --agent claude-code codex --copy # From the published repository after the change is merged: npx --yes [email protected] add manaflow-ai/cmux --global --yes --skill cmux-browser --agent claude-code codex --copy ``` Restart an agent session after a refresh if it cached the previous document. The repository's `skills.sh` remains available for a Codex-only destination; pass its `--dest` explicitly when that is the installation path: ```bash ./skills.sh --dest "$HOME/.codex/skills" --skill cmux-browser ``` Never commit home-directory skill copies, credentials, cookies, or saved browser state. ## Deep-dive references | Reference | When to Use | |-----------|-------------| | [references/surface-discovery.md](references/surface-discovery.md) | Find and target an existing browser surface without focus changes | | [references/commands.md](references/commands.md) | Full command mapping, aliases, `agent-browser` equivalents, viewport error codes | | [references/snapshot-refs.md](references/snapshot-refs.md) | Ref lifecycle and stale-ref troubleshooting | | [references/authentication.md](references/authentication.md) | Login/OAuth/2FA patterns and state save/load | | [references/session-management.md](references/session-management.md) | Multi-surface isolation and state persistence | | [references/video-recording.md](references/video-recording.md) | Recording status and practical alternatives | | [references/proxy-support.md](references/proxy-support.md) | Proxy behavior in WKWebView and workarounds | ## Ready-to-use templates | Template | Description | |----------|-------------| | [templates/form-automation.sh](templates/form-automation.sh) | Snapshot/ref form fill loop (requires an explicit surface) | | [templates/authenticated-session.sh](templates/authenticated-session.sh) | Login once, save/load state (requires an explicit surface) | | [templates/capture-workflow.sh](templates/capture-workflow.sh) | Navigate and capture snapshots/screenshots (requires an explicit surface) |

相关技能

Agent 工作流

Skill Creator

创造有效技能指南。 当用户想创造出新的技能(或更新现有的技能),以专业知识,工作流程,或工具集成来扩展克洛德的能力时,应该使用这种技能.

Agent 工作流

Clawdhub

使用ClawdHub CLI搜索,安装,更新并发布从taladhub.com的代理技能. 需要获取苍蝇上的新技能时使用,将安装的技能同步到最新版本或特定版本,或者发布 npm-instainddhub CLI 的新/更新的技能文件夹.

Agent 工作流

Agent Team Orchestration

管弦乐团多代理团队,任务设定周期,交接协议,审查工作流程. 使用时间: (1)建立2+特派员队伍,具有不同专业,(2)确定任务路线和生命周期(收录框_ spec_建设_审查_完成),(3)在特派员之间制定交接协议,(4)建立审查和质量关口,(5)管理特派员之间的交流和文物共享.

Agent 工作流

Superpowers

Spec-first,TDD,子代理驱动的软件开发工作流程. 当:(1)构建任何新功能或应用——触发脑暴_计划_子代理执行回路,(2)调试出一个bug或测试失败——触发系统性的根起过程,(3)用户说"让我们构建","帮助我计划","我想添加X",或"这个被打破",(4)完成一个功…