manaflow-ai/cmux-skills3 files

Cmux Workspace

Work inside the current cmux workspace and terminal. Use for cmux workspace, current workspace, caller surface, panes, surfaces, tagged reloads, socket targeting, and non-interfering cmux automation.

Specification
Skill ID
manaflow-ai/cmux-skills/cmux-workspace
Publisher
manaflow-ai
Repository
cmux-skills
Installs
0
Files
3
Synced
Sep 23, 2026
How to use it

Open any RiverX project, open the Skills panel in the chat, and search for this identifier. The files are fetched from the source repository at install time.

manaflow-ai/cmux-skills/cmux-workspaceInstalls these files
  • SKILL.md
  • agents/openai.yaml
  • references/commands.md

What this skill tells the agent

cmux Workspace

Use this skill when a task should be scoped to the cmux workspace that invoked the agent. A workspace is the sidebar tab-like unit in cmux. It contains split panes, and each pane contains one or more surfaces. A surface is the terminal or browser session the user interacts with.

Default Rule

Scope actions to the current caller workspace unless the user explicitly asks for another workspace, another window, or global state.

Do not assume the visually focused cmux workspace is the right target. An agent can be running in one workspace while the user is looking at another. Prefer the caller environment first:

printf 'workspace=%s\nsurface=%s\nsocket=%s\n' \
  "${CMUX_WORKSPACE_ID:-}" \
  "${CMUX_SURFACE_ID:-}" \
  "${CMUX_SOCKET_PATH:-}"
cmux identify --json

Use CMUX_WORKSPACE_ID as the default workspace anchor and CMUX_SURFACE_ID as the default caller terminal/surface anchor. If those are missing, use cmux identify --json and be explicit that you are using the currently focused cmux context.

Non-Disruptive Automation

The user may be visually focused on a different workspace, window, or app while an agent works in the caller workspace. Treat layout and focus as separate concerns. Never call focus-changing verbs speculatively.

Never call these without an explicit user ask:

  • select-workspace switches the visible sidebar tab.
  • focus-pane / focus-panel yanks pane or surface focus.
  • tab-action with focus-changing actions.

These are user-affecting actions, like clicks. The rule applies even inside the caller's own workspace, since the user may be looking elsewhere.

Build layout additively, in one shot. Prefer commands that create a new pane already populated with the right surface:

# pane and content in one call, no follow-up needed
cmux new-pane --workspace "${CMUX_WORKSPACE_ID}" --type browser --direction right --url "http://127.0.0.1:8765"
cmux new-pane --workspace "${CMUX_WORKSPACE_ID}" --type terminal --direction down

Avoid create-then-move-then-focus chains. If a layout command rejects a valid surface: or pane: ref, do not work around it by focusing. Report the bug to the user and stop.

Pass --focus false whenever the verb supports it. move-surface --focus false preserves the user's current attention. Other commands may grow the same flag over time (https://github.com/manaflow-ai/cmux/issues/1418, https://github.com/manaflow-ai/cmux/issues/2820).

Right-Side Helper Pane

When opening auxiliary output for the current task (preview apps, TUIs, logs, one-off shells, browser checks), keep the workspace organized by reusing a helper pane to the right of the caller terminal.

First inspect the caller context and panes:

cmux identify --json
cmux list-panes --workspace "${CMUX_WORKSPACE_ID:-}" --json
cmux list-pane-surfaces --workspace "${CMUX_WORKSPACE_ID:-}" --json

Use this policy:

  • If the caller workspace already has a non-caller helper pane, add a new surface to that pane instead of creating another pane: ``bash cmux new-surface --workspace "${CMUX_WORKSPACE_ID:-}" --pane pane:<helper> --type terminal --focus false ``
  • If there is no helper pane, create exactly one right-side pane: ``bash cmux new-pane --workspace "${CMUX_WORKSPACE_ID:-}" --type terminal --direction right --focus false ``
  • If there are multiple obvious stale helper panes from this same automation and the user asked to tidy or reuse, keep one right helper pane and clean up the duplicates. Do not close panes you cannot confidently identify as stale helper output.
  • Send commands to the new or reused helper surface by explicit surface ref. Do not focus it unless the user asks.

This means repeated "open it" requests should normally create tabs inside the existing right helper pane, not more splits.

After creating a helper terminal, verify that it is usable before claiming work is visible there:

cmux surface-health --workspace "${CMUX_WORKSPACE_ID:-}"
cmux read-screen --workspace "${CMUX_WORKSPACE_ID:-}" --surface surface:<helper> --lines 20
cmux top --workspace "${CMUX_WORKSPACE_ID:-}" --processes --format tsv

If read-screen reports Terminal surface not found, or surface-health shows the helper terminal is not attached and top shows no process for it, treat that as a cmux CLI/runtime bug. Do not claim the command is running in the workspace. Clean up any empty helper surfaces you created, then report the bug or use an already-materialized cmux terminal surface. Do not use hidden tmux, nohup, or detached background fallbacks for visible dogfood handoff unless the user explicitly asks for that workaround.

Artifact Previews

When a task produces videos, images, checked frames, screenshots, PDFs, or other user-facing artifacts, open the final artifacts in cmux before handoff. Put them in the caller workspace's right-side helper pane as file preview tabs, and use --no-focus so the user's current terminal stays selected.

Final user-facing artifacts should persist under /cmux-assets/<branch>/.... If /cmux-assets cannot be created because the root volume is read-only, use cmux-assets/<branch>/... under the current repo checkout and state that fallback. Use /tmp only for scratch, then copy accepted artifacts into the durable tree before opening or reporting them.

Use absolute durable paths or paths relative to the current repo checkout. If the artifact lives in a worktree, copy it into the durable branch-scoped asset tree before final handoff; do not report paths that only work from inside the worktree.

Resolve the workspace and pane in this order:

  1. Prefer CMUX_WORKSPACE_ID and CMUX_SURFACE_ID.
  2. If those are missing or rejected by cmux, inspect cmux identify --json and state that you are falling back to the current focused cmux context.
  3. Reuse an existing non-caller helper pane when obvious.
  4. If no helper pane exists, create one on the right with --focus false, then re-list panes to get the pane ref.

Template:

ARTIFACTS=(
  "/cmux-assets/<branch>/demos/demo.mov"
  "/cmux-assets/<branch>/demos/frame-tail.png"
)

WORKSPACE="${CMUX_WORKSPACE_ID:-}"
SURFACE="${CMUX_SURFACE_ID:-}"

cmux identify --json
cmux list-panes --workspace "$WORKSPACE" --json
cmux list-pane-surfaces --workspace "$WORKSPACE" --json

# Pick an existing non-caller helper pane from the pane list. If none exists:
cmux new-pane --workspace "$WORKSPACE" --type terminal --direction right --focus false
cmux list-panes --workspace "$WORKSPACE" --json

cmux open "${ARTIFACTS[@]}" \
  --workspace "$WORKSPACE" \
  --pane pane:<right-helper> \
  --no-focus
cmux list-pane-surfaces --workspace "$WORKSPACE" --json

If cmux open fails because the caller env points at a stale workspace, retry once with the refs from cmux identify --json. Do not keep guessing across other workspaces. If opening still fails, report the failure and include the exact artifact paths.

Hierarchy

  • Window: a macOS cmux window.
  • Workspace: a sidebar entry. The UI may call it a tab, but CLI/socket APIs call it a workspace.
  • Pane: a split region inside a workspace.
  • Surface: a tab inside a pane. Surfaces can be terminals or browser panels.
  • Panel: internal content type inside a surface. Prefer CLI surface commands instead of panel internals.

Inspect Current Context

cmux identify --json
cmux current-workspace --json
cmux list-workspaces --json
cmux list-panes --workspace "${CMUX_WORKSPACE_ID:-}" --json
cmux list-pane-surfaces --workspace "${CMUX_WORKSPACE_ID:-}" --json
cmux list-panels --workspace "${CMUX_WORKSPACE_ID:-}" --json

Use --id-format both when logs or handoffs need stable UUIDs plus human refs:

cmux --json --id-format both identify

Workspace-Scoped Actions

Prefer explicit workspace flags even when env vars are set. It makes automation auditable and avoids affecting a focused workspace in another window.

Use this skill in a project

Open any RiverX project, search the Skills panel for manaflow-ai/cmux-skills/cmux-workspace, and install it in one click.

Use this skill