# cmux-socket-policy

This skill sets threading, focus, and relay rules for cmux socket and CLI work. Use it when adding commands or automation that could change app focus.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 4700 installs · ★ 28491
- Author: manaflow-ai
- License: GPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/manaflow-ai/cmux/tree/HEAD/skills/cmux-socket-policy/SKILL.md
- Updated: 2026-10-25
- HTML: https://affpapa.org/en/nevibecode/skills/cmux-socket-policy

## What it does

The skill guides changes to cmux socket and CLI commands. High-frequency telemetry should parse and validate arguments off the main thread, then deduplicate or coalesce updates there before sending minimal UI or model changes through `DispatchQueue.main.async`. Commands that directly change AppKit or Ghostty state may run on the main actor. A new socket command defaults to off-main handling, and a code comment must explain any need for main-thread execution.

Focus rules keep ordinary socket and CLI commands from activating the macOS app or raising windows. Open commands focus only during interactive use; agent and script runs stay in the background, while `--focus` and `--no-focus` override that choice. The skill also treats every v2 method as a possible `cmux ssh` relay payload. `RemoteRelayCommandPolicy` denies methods by default, so an allowlist entry needs security analysis and policy tests.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add manaflow-ai/cmux --skill cmux-socket-policy -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/cmux-socket-policy/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/cmux-socket-policy/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add manaflow-ai/cmux --skill cmux-socket-policy -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/cmux-socket-policy/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add manaflow-ai/cmux --skill cmux-socket-policy -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/cmux-socket-policy/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install manaflow-ai/cmux cmux-socket-policy
```

2. **Manually: put the files in place**
- File: `.github/skills/cmux-socket-policy/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add manaflow-ai/cmux --skill cmux-socket-policy -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/manaflow-ai/cmux --path skills/cmux-socket-policy
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/cmux-socket-policy/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add manaflow-ai/cmux --skill cmux-socket-policy -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/manaflow-ai/cmux/tree/HEAD/skills/cmux-socket-policy/SKILL.md

## When to use it
- review a new socket command’s execution context
- move high-frequency telemetry off the main thread
- preserve app focus during agent automation
- assess a v2 method for `cmux ssh` relay access
- check focus behavior for open commands

## Example prompts
- Review this new socket command: keep argument validation and telemetry deduplication off the main thread.
- Check whether `surface open` should change focus when an agent runs it, including `--focus` and `--no-focus`.
- Audit this v2 method before allowing it through `cmux ssh`, and list the required relay policy tests.

## Similar
- [setup-matt-pocock-skills](https://affpapa.org/en/nevibecode/skills/setup-matt-pocock-skills.md) — skill · 1052851 installs
- [ask-matt](https://affpapa.org/en/nevibecode/skills/ask-matt.md) — skill · 766587 installs
- [to-tickets](https://affpapa.org/en/nevibecode/skills/to-tickets.md) — skill · 711230 installs
- [writing-plans](https://affpapa.org/en/nevibecode/skills/writing-plans.md) — skill · 282859 installs
- [caveman-review](https://affpapa.org/en/nevibecode/skills/caveman-review.md) — skill · 411800 installs
- [caveman-compress](https://affpapa.org/en/nevibecode/skills/caveman-compress.md) — skill · 411500 installs

From the same set: [manaflow-ai/cmux](https://affpapa.org/en/nevibecode/by/manaflow-ai/cmux.md) — 24 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
