skills/cmux-demo/SKILL.md
ESSENTIAL for cmux terminal demos and scripted workflows — contains critical CLI patterns, gotchas, and conventions beyond `cmux help`. Produces a runnable bash script and markdown playbook. Covers multi-pane IDE layouts, browser previews, yazi integration, multi-agent orchestration with signal coordination, sidebar metadata, visual effects, multi-window setups, and pane lifecycle. ALWAYS use when the user mentions cmux and wants to build a demo, script a walkthrough, orchestrate layouts, or automate cmux workflows. Triggers on: "cmux demo", "terminal demo", "demo script", "cmux layout", "cmux orchestration", "showcase", "scripted demo", "demo playbook", "cmux walkthrough", "cmux presentation", "multi-agent cmux", "cmux script".
npx skillsauth add catalan-adobe/skills cmux-demoInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create advanced, scripted demos that orchestrate the cmux terminal into a multi-pane IDE-style environment — with browser previews, file browsers, parallel agent workspaces, and rich sidebar feedback — all driven from a single bash script.
The skill produces two artifacts:
.sh script — self-contained, runs without LLM pauses,
includes cleanup.md playbook — human-readable reference with layout diagrams,
command explanations, and gotchasA sourceable bash library is bundled at scripts/cmux-demo-lib.sh. It
provides reusable functions that every demo script should use. Locate it
the same way other skills in this repo locate their scripts:
CMUX_LIB="${CLAUDE_SKILL_DIR}/scripts/cmux-demo-lib.sh"
With fallback:
if [[ -n "${CLAUDE_SKILL_DIR:-}" ]]; then
CMUX_LIB="${CLAUDE_SKILL_DIR}/scripts/cmux-demo-lib.sh"
else
CMUX_LIB="$(find ~/.claude -path "*/cmux-demo/scripts/cmux-demo-lib.sh" \
-type f 2>/dev/null | head -1)"
fi
The generated demo script should copy the library functions it needs inline (not source the library at runtime) so the script is fully self-contained. Use the library as a reference for correct implementations.
| Function | Purpose |
|----------|---------|
| Basics | |
| cmux_log, cmux_warn, cmux_err | Colored logging |
| cmux_require | Verify cmux is running |
| parse_field <output> <prefix> | Extract surface:NN / workspace:NN from cmux output |
| detect_tools | Check available panel-content tools (yazi, python3, node, claude) |
| Self-Awareness | |
| cmux_identify | Get current workspace/surface/pane context (JSON) |
| cmux_self <field> | Get a specific ref (e.g., cmux_self "workspace" → workspace:1) |
| HTTP | |
| ensure_http_server [port] [root] | Start HTTP server if not running |
| kill_http_server [port] | Kill HTTP server by port |
| Agent Coordination | |
| wait_for_signal <name> [timeout] | Wait for a named signal (preferred) |
| send_signal <name> | Send a signal to unblock a waiter |
| wait_for_completions <n> [timeout] | Poll notifications for agent completion (fallback) |
| Visual Effects | |
| flash_surface <ref> | Flash a surface to draw audience attention |
| animate_resize <pane> <dir> <total> <steps> | Animated pane resize (grow/shrink over N steps) |
| Browser Annotations | |
| browser_annotate <surface> <text> [position] | Inject a CSS overlay label (top-left/right, bottom-left/right, center) |
| browser_highlight <surface> <selector> | Highlight a DOM element |
| Pane Lifecycle | |
| respawn <surface> [command] | Restart a pane's command without rebuilding layout |
| breakout <surface> | Break a pane out into its own workspace |
| join_into <surface> <target-pane> | Join a surface into an existing pane |
| Multi-Window | |
| create_window | Create a new macOS window, return ref |
| move_to_window <workspace> <window> | Move workspace to a different window |
| Workspaces | |
| create_workspace [name] | Create + rename workspace, return ref |
| demo_cleanup [port] | Tear down all workspaces, surfaces, sidebar metadata |
| Timing | |
| pause_short, pause_medium, pause_long | Named timing pauses (configurable via env) |
.sh script + .md playbookcmux identify --no-caller
# → workspace:1 surface:1 pane:1
source "$CMUX_LIB"
detect_tools
If a tool is missing, suggest alternatives and proceed:
| Missing | Impact | Alternative |
|---------|--------|-------------|
| yazi | No file browser panel | Use ls/tree in a terminal pane, or ranger, lf, nnn |
| python3 | No HTTP server for browser preview | Use npx serve, or node one-liner |
| node/npx | No fallback HTTP server | Use python3 -m http.server |
| claude | No multi-agent workspaces | Use any CLI command as agent stand-in, or skip the act |
| yazi config | No cmux-preview integration | Preview files via cmux browser navigate directly |
Gather: what's being demoed, audience, desired panels, number of acts (3-7), sidebar narrative. A brief like "demo my EDS migration workflow with yazi + browser preview, 4 acts" is enough.
IDE Layout (most common):
+---------------------+--------------------+
| | Terminal | Browser |
| Main Claude Code | (tabbed pane) |
| (surface:1) +--------------------+
| | File Browser |
| | (yazi / ls) |
+---------------------+--------------------+
Multi-Agent Hub:
+---------------------+
| Main workspace | <- orchestrator
+---------------------+
| Agent 1 | Agent 2 | <- separate workspace tabs
+---------------------+
Presentation Mode:
+---------------------+--------------------+
| | |
| Terminal | Browser Preview |
| (commands) | (live output) |
| | |
+---------------------+--------------------+
Full Studio (IDE + Multi-Agent):
+---------------------+--------------------+
| | Terminal | Browser |
| Claude Code | (tabbed) |
| (main workspace) +--------------------+
| | File Browser |
+---------------------+--------------------+
+ Agent 1 workspace tab +
+ Agent 2 workspace tab +
Multi-Window (cmux new-window + move-workspace-to-window):
Window 1 (primary display) Window 2 (secondary display)
+------------------------+ +------------------------+
| Main Claude Code | | Browser Preview |
| + terminal pane | | (full-screen browser) |
+------------------------+ +------------------------+
Dynamic Layout (animate_resize or resize-pane in a loop):
Act 1: Equal split Act 2: Browser expanded
+----------+----------+ +-----+------------------+
| Terminal | Browser | → | Trm | Browser (wider) |
+----------+----------+ +-----+------------------+
Present the demo plan as a numbered act list with:
Let the user adjust before generating.
Generate both artifacts into the user's chosen output directory.
.sh)The script must be fully self-contained — inline the utility
functions it uses from cmux-demo-lib.sh, don't source it at runtime.
Required structure:
#!/usr/bin/env bash
set -euo pipefail
# [Demo title] — scripted cmux demo
# Run: bash demo.sh
# Cleanup: bash demo.sh cleanup
# ── Configuration ─────────────────────────────
PAUSE_SHORT=1.5
PAUSE_MEDIUM=2
PAUSE_LONG=3
# ── Utility Functions ─────────────────────────
# (inlined from cmux-demo-lib.sh)
log() { printf "\033[1;34m▸ %s\033[0m\n" "$1"; }
parse_field() {
local output="$1" prefix="$2"
grep -o "${prefix}:[^ ]*" <<< "$output" | head -1
}
wait_for_completions() { ... }
do_cleanup() { ... }
if [[ "${1:-}" == "cleanup" ]]; then
do_cleanup
exit 0
fi
# Ensure cleanup runs on any error or exit
trap do_cleanup EXIT
# ── Preflight ─────────────────────────────────
log "Preflight"
cmux ping >/dev/null 2>&1 || { echo "Error: cmux not running" >&2; exit 1; }
# ... start HTTP server if needed, kill stale processes
# ── Act 1 — [Name] ───────────────────────────
log "Act 1 — [Name]"
cmux set-status "demo" "[Label]" --icon "[sf.symbol]" --color "#hex"
# ... cmux commands with pauses
# ── Act N — [Name] ───────────────────────────
# ...
# ── Finale ────────────────────────────────────
log "Demo complete!"
cmux set-progress 1.0 --label "Demo complete!"
cmux notify --title "[Demo Name]" --subtitle "All acts complete" \
--body "[Summary of what was shown]"
echo ""
echo "Run 'bash $0 cleanup' to tear down."
Script conventions:
cmux identify — never assume surface:1parse_field to extract surface:NN, pane:NN, workspace:NNtrigger-flash on the active surface at act transitions for visual emphasiscleanup subcommand that tears down everything created# ── Act N — Name ── visual separatorsrespawn-pane for "reset to act N" without rebuilding layouttrap do_cleanup EXIT after the cleanup subcommand block so
interrupted runs don't leave orphaned surfaces and serversScript gotchas to handle correctly:
| Gotcha | Correct Pattern |
|--------|-----------------|
| Dynamic surface refs | out=$(cmux new-pane --direction right); SF=$(parse_field "$out" "surface") |
| Workspace discovery | cmux new-workspace >/dev/null then cmux list-workspaces \| grep -oE 'workspace:[0-9]+' \| tail -1 |
| Cross-workspace send | cmux send --workspace "$WS" "command\n" (targets active surface) |
| Regular chars vs special keys | cmux send for chars (j, k, q); cmux send-key only for Enter, Tab |
| Browser tab visibility | cmux move-surface --surface "$BROWSER_SF" --focus true after content loads |
| Notification polling | cmux clear-notifications before spawning, then wait_for_completions N |
| HTTP server root | Root at / when previewing files from arbitrary paths |
| Interactive app quit | Send q via cmux send before close-surface (yazi, vim, etc.) |
| Attention flash | cmux trigger-flash --surface "$SF" at act transitions |
| Animated resize | cmux resize-pane --pane "$PANE" -R --amount 5 in a loop for smooth grow |
| Signal coordination | Agent runs cmux wait-for -S "done", orchestrator cmux wait-for "done" |
| Self-identification | cmux identify --no-caller to discover own surface/workspace/pane |
| Browser annotations | cmux browser --surface "$SF" addstyle "css" for overlay labels |
| DOM highlighting | cmux browser --surface "$SF" highlight "selector" during browser demos |
| Pane respawn | cmux respawn-pane --surface "$SF" --command "cmd" to reset without rebuild |
| Multi-window | cmux new-window + move-workspace-to-window for multi-monitor |
| Pane reorganization | cmux break-pane / join-pane / swap-pane mid-demo |
| Flash after workspace switch | identify returns CALLER's surface, not the switched-to workspace. Capture agent surface refs at creation time and flash those instead. |
| Trap for cleanup | trap do_cleanup EXIT after the cleanup subcommand block |
.md)The playbook is a human-readable companion to the script. Structure:
# [Demo Title] — cmux Demo Playbook
[1-2 sentence description of what the demo shows]
## Prerequisites
- cmux terminal app (verify: `cmux ping`)
- [tool requirements with install commands]
## Surface Reference Guide
| Role | Variable | Created in |
|------|----------|------------|
| Main pane | `surface:1` | Pre-existing |
| ... | ... | ... |
## [Act N — Name]
Sidebar status: `icon.name` / `#color` / "label"
1. [Step with cmux command in code block]
2. [Step with explanation of what happens]
**Key gotchas:**
- [Act-specific gotchas]
---
## Layout Diagram
[ASCII art showing the final panel arrangement]
## Cleanup
[Cleanup commands]
## Sidebar Commands Reference
[Quick reference for status, progress, log, notify]
## Dependencies
[Config files, scripts, or tools needed]
After generating, run the script:
bash <script>.sh
Watch for errors, timing issues, or visual glitches. Common problems:
move-surface --focus trueBased on user feedback, adjust:
Regenerate both artifacts after changes. The cleanup subcommand makes
re-running safe — bash demo.sh cleanup && bash demo.sh.
Read the cmux reference when generating demo scripts. It contains:
SKILL.md to ~/.claude/commands/cmux-demo.mdscripts/cmux-demo-lib.sh to ~/.local/bin/cmux-demo-lib.sh
and chmod +x ittools
Reduce a webpage to a structural skeleton with semantic tokens. Two-phase pipeline: Phase 1 injects a browser script that tokenizes content ({TEXT}, {HEADING:n}, {IMAGE:WxH}, {CTA:label}, {LINK:label}, {INPUT:type}, {VIDEO}, {ICON}). Phase 2 applies LLM structural reasoning to collapse repeated patterns ({REPEAT:N}), remove decorative wrappers, strip utility classes, and produce skeleton.html + manifest.json. Use when migrating pages to EDS, analyzing page structure, extracting page blueprints, or preparing input for GenAI block generation. Triggers on: reduce page, page skeleton, page blueprint, extract structure, tokenize page, page reduction, structural skeleton, reduce URL.
tools
Capture a spatial hierarchy of rendered DOM elements from any webpage. Injects a pre-built script via playwright-cli that walks the DOM, detects layout grids, extracts backgrounds, prunes invisible nodes, promotes elements rendered outside their DOM parent (overlays, fixed navs, modals), and tags overlay nodes with occlusion metadata. Returns three outputs: LLM-friendly indented text, structured JSON tree, and a nodeMap mapping positional IDs to CSS selectors with background and overlay data. Use before page decomposition, overlay detection, brand extraction, or any workflow that needs structured page analysis. Triggers on: visual tree, capture tree, page structure, page hierarchy, DOM tree, capture visual, page analysis, extract tree.
tools
Summarize any video by analyzing both audio and visuals. Downloads via yt-dlp, extracts transcript (YouTube captions or Whisper), pulls scene-detected keyframes, and produces a multimodal summary with clickable timestamped YouTube links. Use this skill whenever the user wants to summarize a YouTube video, digest a talk or tutorial, get notes from a video, extract key points from a recording, or says things like "tl;dw", "summarize this video", "what's in this video", or pastes a YouTube URL and asks for a summary. Also triggers for non-YouTube URLs that yt-dlp supports.
development
Design and build web UIs with Adobe Spectrum 2 design system. Applies S2 layout principles, visual hierarchy, spacing, and component composition to produce accessible interfaces. Outputs vanilla CSS with Spectrum tokens (static pages) or Spectrum Web Components (interactive apps). Recommends tier based on complexity. Covers sp-theme setup, side-effect imports, overlay system, form patterns, --mod-* token customization, and 14 critical gotchas. Use for: spectrum 2 web, SWC, sp-button, sp-theme, build UI with spectrum, S2 layout, spectrum application, adobe design system, web component form, spectrum overlay.