Agent Skills › manaflow-ai/cmux › cmux-socket-policy

cmux-socket-policy

GitHub

定义 cmux CLI/socket 命令的线程调度与焦点策略,规范遥测命令异步处理及防止窃取应用焦点的行为。

skills/cmux-socket-policy/SKILL.md manaflow-ai/cmux

Trigger Scenarios

添加或修改 socket/CLI 命令 涉及应用焦点、选择或 UI 状态变更的操作

Install

npx skills add manaflow-ai/cmux --skill cmux-socket-policy -g -y
More Options

Use without installing

npx skills use manaflow-ai/cmux@cmux-socket-policy

指定 Agent (Claude Code)

npx skills add manaflow-ai/cmux --skill cmux-socket-policy -a claude-code -g -y

安装 repo 全部 skill

npx skills add manaflow-ai/cmux --all -g -y

预览 repo 内 skill

npx skills add manaflow-ai/cmux --list

SKILL.md

Frontmatter
{
    "name": "cmux-socket-policy",
    "description": "Socket command threading and focus policy for cmux CLI\/socket work. Use when adding or changing socket commands, CLI commands, telemetry commands, focus\/select\/open\/close\/send-key behavior, or automation that could steal app focus."
}

cmux Socket Policy

Threading policy

  • Do not use DispatchQueue.main.sync for high-frequency socket telemetry commands such as report_*, ports_kick, status/progress updates, or log metadata updates.
  • For telemetry hot paths, parse and validate arguments off-main.
  • Dedupe and coalesce off-main first.
  • Schedule minimal UI/model mutation with DispatchQueue.main.async only when needed.
  • Commands that directly manipulate AppKit/Ghostty UI state are allowed to run on the main actor.
  • If adding a new socket command, default to off-main handling and require an explicit reason in code comments when main-thread execution is necessary.

Focus policy

  • Socket/CLI commands must not steal macOS app focus.
  • Do not activate the app or raise windows unless the command has explicit focus intent.
  • Only explicit focus-intent commands may mutate in-app focus/selection.
  • Explicit focus-intent commands include window.focus, workspace.select/next/previous/last, surface.focus, pane.focus/last, browser focus commands, and v1 focus equivalents.
  • All non-focus commands should preserve the current user focus context while still applying data/model changes.
  • Open commands (vm/cloud shell, tui, open, new, base, workspace new/open, agent; surface open/new-terminal; cmux open; cmux ssh) focus only when run interactively and stay in the background when run by an agent or script (defaultFocusForUserOpen); --focus opts in, --no-focus opts out. Their socket methods default focus to false, and a pane opened without focus is marked unread.

Remote relay authorization

Every v2 method is a potential cmux ssh relay payload. RemoteRelayCommandPolicy denies by default; allowlisting a method needs the security analysis and policy tests in remote relay authorization.

Detailed references

Version History

  • 42048bd Current 2026-10-19 17:12

    新增 agent 和脚本打开的工作区/窗格保持后台运行逻辑,引入 defaultFocusForUserOpen 机制并同步文档。

  • a616a2b 2026-09-28 08:34

    新增远程中继授权安全策略(RemoteRelayCommandPolicy),要求对v2方法进行白名单审核与安全测试;更新详细引用文档路径。

  • cef69a7 2026-08-20 08:16

Same Skill Collection

skills/cmux-architecture/SKILL.md
skills/cmux-backend/SKILL.md
skills/cmux-billing/SKILL.md
skills/cmux-browser/SKILL.md
skills/cmux-capture/SKILL.md
skills/cmux-cloud-vm/SKILL.md
skills/cmux-cua/SKILL.md
skills/cmux-custom-sidebar/SKILL.md
skills/cmux-customization/SKILL.md
skills/cmux-debugging/SKILL.md
skills/cmux-dev-workflow/SKILL.md
skills/cmux-diagnostics/SKILL.md
skills/cmux-ghostty/SKILL.md
skills/cmux-keyboard-shortcuts/SKILL.md
skills/cmux-localization/SKILL.md
skills/cmux-markdown/SKILL.md
skills/cmux-release/SKILL.md
skills/cmux-review/SKILL.md
skills/cmux-settings/SKILL.md
skills/cmux-shared-behavior/SKILL.md
skills/cmux-test-bisect/SKILL.md
skills/cmux-testing/SKILL.md
skills/cmux-workspace/SKILL.md
skills/cmux/SKILL.md

Metadata

Files
0
Version
42048bd
Hash
31a9c7e2
Indexed
2026-08-20 08:16

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-31 06:18
浙ICP备14020137号-1