cmux-socket-policy

Enforce threading and focus policies for cmux socket command execution.

25.8k|2.2k|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/manaflow-ai/cmux --skill cmux-socket-policy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cmux-socket-policy
Source: https://github.com/manaflow-ai/cmux/tree/main/skills/cmux-socket-policy
Command: npx skills add https://github.com/manaflow-ai/cmux --skill cmux-socket-policy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Socket command handling in cmux can inadvertently steal focus or block UI updates on the main thread, leading to disruptive user experiences. This Skill defines threading and focus policies to ensure safe, focus-preserving command execution for socket/CLI/telemetry commands, with clear guidelines for main-thread usage and explicit focus intent.

Core Features & Use Cases

  • Off-main processing for high-frequency telemetry commands to avoid UI stutter.
  • Main-actor guidance for commands that manipulate UI state, including when to require explicit focus intent.
  • Clear documentation and references to enforce consistency across new socket/CLI commands.
  • Use Case: When adding a new socket command, telemetry handler, or automation that could grab focus, apply the policy.

Quick Start

Configure a new cmux socket or CLI command with off-main handling, document focus behavior, and reference the threading-and-focus.md guidance.

Frequently Asked Questions about cmux-socket-policy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my socket command steal focus or block UI updates on the main thread?

Socket commands steal focus when they execute main-thread work without explicit focus intent or off-main processing. This policy restricts main-thread work and focus changes to prevent disruptive UI blocking behavior in cmux.

How do I configure off-main processing for high-frequency telemetry commands?

To configure off-main processing for telemetry commands, apply the socket command policy to route high-frequency socket handlers off the main thread, preventing UI stutter while documenting focus behavior in references/threading-and-focus.md.

When do I need to define explicit focus intent for CLI commands?

You need explicit focus intent for CLI commands when they manipulate UI state on the main actor. The policy requires identifying focus-intent commands to ensure safe, focus-preserving execution for socket and telemetry automation.

What are the main-actor rules for UI mutations in socket command handling?

Main-actor rules for UI mutations require commands to declare explicit focus intent before changing UI state. The socket policy enforces these rules to keep thread handling safe and prevent unauthorized focus changes.

Can I use this socket policy for automation that could grab app focus?

Yes, you can use this socket policy for automation that could grab app focus. It applies to adding or modifying socket, CLI, and telemetry commands, enforcing focus rules and off-main processing to avoid disruptive experiences.

What limitations exist when applying threading and focus rules to new socket commands?

Threading and focus rules require strict off-main processing for high-frequency commands and explicit documentation in references/threading-and-focus.md. Commands must satisfy main-actor rules for UI mutations, limiting spontaneous focus changes during automation.