Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

feat(cua-driver): auto-wire SKILL.md for Codex (~/.agents/skills/) too

Francesco Bonaccifadad0b76108
diff --git a/docs/content/docs/cua-driver/guide/getting-started/installation.mdx b/docs/content/docs/cua-driver/guide/getting-started/installation.mdx
index c602796fa2..4a897d7b67 100644
--- a/docs/content/docs/cua-driver/guide/getting-started/installation.mdx
+++ b/docs/content/docs/cua-driver/guide/getting-started/installation.mdx
@@ -144,6 +144,25 @@ cua-driver mcp-config | pbcopy
The client spawns `cua-driver mcp` on demand once registered.
+## Agent skills (auto-wired)
+
+The bundle ships an Anthropic-format SKILL.md pack at `/Applications/CuaDriver.app/Contents/Resources/Skills/cua-driver/`. The installer detects the agents you have and creates symlinks pointing them at the bundle so the skill auto-loads:
+
+| Agent | Skills directory | Auto-wired by installer |
+|---|---|---|
+| Claude Code | `~/.claude/skills/cua-driver` | when `~/.claude/skills/` exists |
+| Codex | `~/.agents/skills/cua-driver` | when `~/.codex/` exists (creates the agents dir if missing) |
+
+The symlink survives auto-updates because `/Applications/CuaDriver.app` is replaced atomically — the link target stays valid across releases.
+
+For agents without a SKILL.md auto-loader (Cursor, OpenClaw, OpenCode, Hermes, Pi), point them at the bundled skill manually if you want the same instructions:
+
+```bash
+cat /Applications/CuaDriver.app/Contents/Resources/Skills/cua-driver/SKILL.md
+```
+
+You can paste it into the agent's system prompt, instructions file, or whatever per-project context mechanism the agent uses (e.g. Cursor's `.cursorrules`, project-level `AGENTS.md`).
+
## Uninstall
```bash
diff --git a/libs/cua-driver/scripts/install.sh b/libs/cua-driver/scripts/install.sh
index cd3fafa9c6..5fd3c4feaa 100755
--- a/libs/cua-driver/scripts/install.sh
+++ b/libs/cua-driver/scripts/install.sh
@@ -130,27 +130,49 @@ $SUDO mkdir -p "$(dirname "$BIN_LINK")"
$SUDO ln -sf "$APP_BINARY" "$BIN_LINK"
log "symlinked $BIN_LINK -> $APP_BINARY"
-# --- Install Claude Code skill pack -------------------------------------
+# --- Install agent skill pack -------------------------------------------
#
-# Detect Claude Code users (via ~/.claude/skills/ presence) and drop a
-# symlink pointing at the skill we shipped inside the bundle. Auto-updates
-# atomically replace /Applications/CuaDriver.app, so the symlink stays
-# valid across every release. Never overwrites an existing link or
-# directory — dev users with their own ~/.claude/skills/cua-driver symlink
-# pointing at a working copy of the repo keep theirs.
-
-SKILL_LINK="$HOME/.claude/skills/cua-driver"
+# Drop a symlink for each detected agent that auto-loads SKILL.md skills:
+# - Claude Code: scans ~/.claude/skills/ on startup
+# - Codex : scans ~/.agents/skills/ on startup (Codex adopted Anthropic's
+# SKILL.md format; the "agents" path is shared, not Codex-specific)
+#
+# Auto-updates atomically replace /Applications/CuaDriver.app so the symlinks
+# stay valid across every release. We never overwrite an existing link or
+# directory — dev users with a symlink pointing at a working copy of the repo
+# keep theirs.
+
SKILL_TARGET="$APP_DEST/Contents/Resources/Skills/cua-driver"
-if [[ -d "$HOME/.claude/skills" ]]; then
- if [[ -e "$SKILL_LINK" ]] || [[ -L "$SKILL_LINK" ]]; then
- log "skill link already exists at $SKILL_LINK (skipping)"
- elif [[ -d "$SKILL_TARGET" ]]; then
- ln -s "$SKILL_TARGET" "$SKILL_LINK"
- log "symlinked Claude Code skill at $SKILL_LINK"
- else
+
+link_skill_into() {
+ local parent_dir="$1" # e.g. $HOME/.claude/skills
+ local label="$2" # e.g. "Claude Code"
+ local link_path="$parent_dir/cua-driver"
+
+ if [[ ! -d "$parent_dir" ]]; then
+ return 0
+ fi
+ if [[ -e "$link_path" ]] || [[ -L "$link_path" ]]; then
+ log "$label skill link already exists at $link_path (skipping)"
+ return 0
+ fi
+ if [[ ! -d "$SKILL_TARGET" ]]; then
log "skill pack missing at $SKILL_TARGET (skipping; older release?)"
+ return 0
fi
+ ln -s "$SKILL_TARGET" "$link_path"
+ log "symlinked $label skill at $link_path"
+}
+
+# Claude Code — only when ~/.claude/skills already exists (Claude installed).
+link_skill_into "$HOME/.claude/skills" "Claude Code"
+
+# Codex — create ~/.agents/skills if Codex is installed (~/.codex present)
+# but the agents skills dir hasn't been initialized yet, then link.
+if [[ -d "$HOME/.codex" ]] && [[ ! -d "$HOME/.agents/skills" ]]; then
+ mkdir -p "$HOME/.agents/skills"
fi
+link_skill_into "$HOME/.agents/skills" "Codex"
# --- Done ---------------------------------------------------------------
diff --git a/libs/cua-driver/scripts/uninstall.sh b/libs/cua-driver/scripts/uninstall.sh
index f6b5091118..ee1e3f2bb2 100755
--- a/libs/cua-driver/scripts/uninstall.sh
+++ b/libs/cua-driver/scripts/uninstall.sh
@@ -74,17 +74,20 @@ else
log "no config at $CONFIG_DIR (skipping)"
fi
-# Claude Code skill symlink. Only remove when the link is ours — a dev
-# user pointing ~/.claude/skills/cua-driver at a working copy of the
-# repo keeps their link untouched.
-SKILL_LINK="$HOME/.claude/skills/cua-driver"
+# Agent skill symlinks (Claude Code + Codex). Only remove when the link
+# is ours — a dev user pointing the symlink at a working copy of the repo
+# keeps theirs untouched.
SKILL_TARGET_EXPECTED="$APP_BUNDLE/Contents/Resources/Skills/cua-driver"
-if [[ -L "$SKILL_LINK" ]] && [[ "$(readlink "$SKILL_LINK")" == "$SKILL_TARGET_EXPECTED" ]]; then
- rm -f "$SKILL_LINK"
- log "removed $SKILL_LINK"
-else
- log "no install-created skill symlink at $SKILL_LINK (skipping)"
-fi
+for SKILL_LINK in \
+ "$HOME/.claude/skills/cua-driver" \
+ "$HOME/.agents/skills/cua-driver"; do
+ if [[ -L "$SKILL_LINK" ]] && [[ "$(readlink "$SKILL_LINK")" == "$SKILL_TARGET_EXPECTED" ]]; then
+ rm -f "$SKILL_LINK"
+ log "removed $SKILL_LINK"
+ else
+ log "no install-created skill symlink at $SKILL_LINK (skipping)"
+ fi
+done
cat << 'FINALUNMSG'