extensions/acpx/skills/acp-router/SKILL.md
When user intent is "run this in Pi/Claude Code/Cursor/Copilot/OpenClaw/OpenCode/Gemini/Qwen/Kiro/Kimi/iFlow/Droid/Kilocode (ACP harness)", do not use subagent runtime or PTY scraping. Route through ACP-aware flows.
Codex is special: plain chat/conversation binding and control should use the native Codex app-server plugin (/codex bind, /codex threads, /codex resume) instead of the default ACP path. Use ACP for Codex only when the user explicitly names ACP//acp/acpx, or when spawning background child sessions through sessions_spawn where a native Codex runtime spawn is not available yet.
Trigger this skill when the user asks OpenClaw to:
/acp, or acpxMandatory preflight for coding-agent thread requests:
OpenClaw ACP runtime path below; do not use message(action="thread-create") for ACP harness thread spawn.Choose one of these paths:
sessions_spawn / ACP runtime tools.acpx path (telephone game): use acpx CLI through exec to drive the harness session directly.Use direct acpx when one of these is true:
acpx drivingDo not use:
subagents runtime for harness control/acp command delegation as a requirement for the useracpx is availableUse these defaults when user names a harness directly:
agentId: "pi"agentId: "openclaw"agentId: "claude"agentId: "codex" only for explicit ACP/acpx requests or background ACP runtime spawnagentId: "copilot"agentId: "cursor"agentId: "droid"agentId: "opencode"agentId: "gemini"agentId: "iflow"agentId: "kilocode"agentId: "kimi"agentId: "kiro"agentId: "qwen"These defaults match current acpx built-in aliases.
If policy rejects the chosen id, report the policy error clearly and ask for the allowed ACP agent id.
Required behavior:
sessions_spawn with:
runtime: "acp"thread: truemode: "session" (unless user explicitly wants one-shot)message with action=thread-create; sessions_spawn is the only thread-create path.task so the ACP session gets it immediately.agentId explicitly unless ACP default agent is known.Example:
User: "spawn a test codex ACP session in thread and tell it to say hi"
Call:
{
"task": "Say hi.",
"runtime": "acp",
"agentId": "codex",
"thread": true,
"mode": "session"
}
When the user asks to start a coding harness in a thread, treat that as an ACP runtime request and try to satisfy it end-to-end.
Required behavior when ACP backend is unavailable:
${ACPX_CMD} --versionWhen offering fallback, keep ACP first:
Do not default to subagent runtime for these requests.
For this repo, direct acpx calls must follow the same pinned policy as the @openclaw/acpx extension package.
${ACPX_PLUGIN_ROOT}/node_modules/.bin/acpxnode -e "console.log(require(process.env.ACPX_PLUGIN_ROOT + '/package.json').dependencies.acpx)"cd "$ACPX_PLUGIN_ROOT" && npm install --omit=dev --no-save acpx@<pinnedVersion>${ACPX_PLUGIN_ROOT}/node_modules/.bin/acpx --versionnpm install -g acpx unless the user explicitly asks for global install.Set and reuse:
ACPX_PLUGIN_ROOT="<bundled-acpx-plugin-root>"
ACPX_CMD="$ACPX_PLUGIN_ROOT/node_modules/.bin/acpx"
Use this path to drive harness sessions without /acp or subagent runtime.
exec commands that call ${ACPX_CMD}.--format quiet for clean assistant text to relay back to user.exec (one-shot) only when the user wants one-shot behavior.--cwd) when task scope depends on repo context.Use a deterministic name, for example:
oc-<harness>-<conversationId>Where conversationId is thread id when available, otherwise channel/conversation id.
Persistent session (create if missing, then prompt):
${ACPX_CMD} codex sessions show oc-codex-<conversationId> \
|| ${ACPX_CMD} codex sessions new --name oc-codex-<conversationId>
${ACPX_CMD} codex -s oc-codex-<conversationId> --cwd <workspacePath> --format quiet "<prompt>"
One-shot:
${ACPX_CMD} codex exec --cwd <workspacePath> --format quiet "<prompt>"
Cancel in-flight turn:
${ACPX_CMD} codex cancel -s oc-codex-<conversationId>
Close session:
${ACPX_CMD} codex sessions close oc-codex-<conversationId>
claudecodexcopilotcursordroidgeminiiflowkilocodekimikiroopenclawopencodepiqwenDefaults are:
openclaw -> openclaw acpclaude -> bundled @agentclientprotocol/[email protected]codex -> bundled @zed-industries/[email protected] through OpenClaw's isolated CODEX_HOME wrappercopilot -> copilot --acp --stdiocursor -> cursor-agent acpdroid -> droid exec --output-format acpgemini -> gemini --acpiflow -> iflow --experimental-acpkilocode -> npx -y @kilocode/cli acpkimi -> kimi acpkiro -> kiro-cli acpopencode -> npx -y opencode-ai acppi -> npx pi-acp@^0.0.22qwen -> qwen --acpIf ~/.acpx/config.json overrides agents, those overrides replace defaults.
If your local Cursor install still exposes ACP as agent acp, set that as the cursor agent override explicitly.
acpx: command not found:
acpx unless explicitly requestedclaude-agent-acp not found):
~/.acpx/config.json agent overridesNO_SESSION: run ${ACPX_CMD} <agent> sessions new --name <sessionName> then retry prompt.--no-wait when async behavior is explicitly desired.When relaying to user, return the final assistant text output from acpx command result. Avoid relaying raw local tool noise unless user asked for verbose logs.