← 返回 Skills 市场
yimeihuang1999-leaves

Acp Router

作者 yimeihuang1999-leaves · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
737
总下载
0
收藏
11
当前安装
1
版本数
在 OpenClaw 中安装
/install acp-router
功能描述
Route plain-language requests for Pi, Claude Code, Codex, OpenCode, Gemini CLI, or ACP harness work into either OpenClaw ACP runtime sessions or direct acpx-...
使用说明 (SKILL.md)

ACP Harness Router

When user intent is "run this in Pi/Claude Code/Codex/OpenCode/Gemini/Kimi (ACP harness)", do not use subagent runtime or PTY scraping. Route through ACP-aware flows.

Intent detection

Trigger this skill when the user asks OpenClaw to:

  • run something in Pi / Claude Code / Codex / OpenCode / Gemini
  • continue existing harness work
  • relay instructions to an external coding harness
  • keep an external harness conversation in a thread-like conversation

Mandatory preflight for coding-agent thread requests:

  • Before creating any thread for Pi/Claude/Codex/OpenCode/Gemini work, read this skill first in the same turn.
  • After reading, follow OpenClaw ACP runtime path below; do not use message(action="thread-create") for ACP harness thread spawn.

Mode selection

Choose one of these paths:

  1. OpenClaw ACP runtime path (default): use sessions_spawn / ACP runtime tools.
  2. Direct acpx path (telephone game): use acpx CLI through exec to drive the harness session directly.

Use direct acpx when one of these is true:

  • user explicitly asks for direct acpx driving
  • ACP runtime/plugin path is unavailable or unhealthy
  • the task is "just relay prompts to harness" and no OpenClaw ACP lifecycle features are needed

Do not use:

  • subagents runtime for harness control
  • /acp command delegation as a requirement for the user
  • PTY scraping of pi/claude/codex/opencode/gemini/kimi CLIs when acpx is available

AgentId mapping

Use these defaults when user names a harness directly:

  • "pi" -> agentId: "pi"
  • "claude" or "claude code" -> agentId: "claude"
  • "codex" -> agentId: "codex"
  • "opencode" -> agentId: "opencode"
  • "gemini" or "gemini cli" -> agentId: "gemini"
  • "kimi" or "kimi cli" -> agentId: "kimi"

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.

OpenClaw ACP runtime path

Required behavior:

  1. For ACP harness thread spawn requests, read this skill first in the same turn before calling tools.
  2. Use sessions_spawn with:
    • runtime: "acp"
    • thread: true
    • mode: "session" (unless user explicitly wants one-shot)
  3. For ACP harness thread creation, do not use message with action=thread-create; sessions_spawn is the only thread-create path.
  4. Put requested work in task so the ACP session gets it immediately.
  5. Set agentId explicitly unless ACP default agent is known.
  6. Do not ask user to run slash commands or CLI when this path works directly.

Example:

User: "spawn a test codex session in thread and tell it to say hi"

Call:

{
  "task": "Say hi.",
  "runtime": "acp",
  "agentId": "codex",
  "thread": true,
  "mode": "session"
}

Thread spawn recovery policy

When the user asks to start a coding harness in a thread (for example "start a codex/claude/pi/kimi thread"), treat that as an ACP runtime request and try to satisfy it end-to-end.

Required behavior when ACP backend is unavailable:

  1. Do not immediately ask the user to pick an alternate path.
  2. First attempt automatic local repair:
    • ensure plugin-local pinned acpx is installed in extensions/acpx
    • verify ${ACPX_CMD} --version
  3. After reinstall/repair, restart the gateway and explicitly offer to run that restart for the user.
  4. Retry ACP thread spawn once after repair.
  5. Only if repair+retry fails, report the concrete error and then offer fallback options.

When offering fallback, keep ACP first:

  • Option 1: retry ACP spawn after showing exact failing step
  • Option 2: direct acpx telephone-game flow

Do not default to subagent runtime for these requests.

ACPX install and version policy (direct acpx path)

For this repo, direct acpx calls must follow the same pinned policy as the @openclaw/acpx extension.

  1. Prefer plugin-local binary, not global PATH:
    • ./extensions/acpx/node_modules/.bin/acpx
  2. Resolve pinned version from extension dependency:
    • node -e "console.log(require('./extensions/acpx/package.json').dependencies.acpx)"
  3. If binary is missing or version mismatched, install plugin-local pinned version:
    • cd extensions/acpx && npm install --omit=dev --no-save acpx@\x3CpinnedVersion>
  4. Verify before use:
    • ./extensions/acpx/node_modules/.bin/acpx --version
  5. If install/repair changed ACPX artifacts, restart the gateway and offer to run the restart.
  6. Do not run npm install -g acpx unless the user explicitly asks for global install.

Set and reuse:

ACPX_CMD="./extensions/acpx/node_modules/.bin/acpx"

Direct acpx path ("telephone game")

Use this path to drive harness sessions without /acp or subagent runtime.

Rules

  1. Use exec commands that call ${ACPX_CMD}.
  2. Reuse a stable session name per conversation so follow-up prompts stay in the same harness context.
  3. Prefer --format quiet for clean assistant text to relay back to user.
  4. Use exec (one-shot) only when the user wants one-shot behavior.
  5. Keep working directory explicit (--cwd) when task scope depends on repo context.

Session naming

Use a deterministic name, for example:

  • oc-\x3Charness>-\x3CconversationId>

Where conversationId is thread id when available, otherwise channel/conversation id.

Command templates

Persistent session (create if missing, then prompt):

${ACPX_CMD} codex sessions show oc-codex-\x3CconversationId> \
  || ${ACPX_CMD} codex sessions new --name oc-codex-\x3CconversationId>

${ACPX_CMD} codex -s oc-codex-\x3CconversationId> --cwd \x3CworkspacePath> --format quiet "\x3Cprompt>"

One-shot:

${ACPX_CMD} codex exec --cwd \x3CworkspacePath> --format quiet "\x3Cprompt>"

Cancel in-flight turn:

${ACPX_CMD} codex cancel -s oc-codex-\x3CconversationId>

Close session:

${ACPX_CMD} codex sessions close oc-codex-\x3CconversationId>

Harness aliases in acpx

  • pi
  • claude
  • codex
  • opencode
  • gemini
  • kimi

Built-in adapter commands in acpx

Defaults are:

  • pi -> npx pi-acp
  • claude -> npx -y @zed-industries/claude-agent-acp
  • codex -> npx @zed-industries/codex-acp
  • opencode -> npx -y opencode-ai acp
  • gemini -> gemini
  • kimi -> kimi acp

If ~/.acpx/config.json overrides agents, those overrides replace defaults.

Failure handling

  • acpx: command not found:
    • for thread-spawn ACP requests, install plugin-local pinned acpx in extensions/acpx immediately
    • restart gateway after install and offer to run the restart automatically
    • then retry once
    • do not ask for install permission first unless policy explicitly requires it
    • do not install global acpx unless explicitly requested
  • adapter command missing (for example claude-agent-acp not found):
    • for thread-spawn ACP requests, first restore built-in defaults by removing broken ~/.acpx/config.json agent overrides
    • then retry once before offering fallback
    • if user wants binary-based overrides, install exactly the configured adapter binary
  • NO_SESSION: run ${ACPX_CMD} \x3Cagent> sessions new --name \x3CsessionName> then retry prompt.
  • queue busy: either wait for completion (default) or use --no-wait when async behavior is explicitly desired.

Output relay

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.

安全使用建议
This skill appears to do what it claims (route harness work), but its instructions let an agent install npm packages, run local acpx binaries, write into ./extensions/acpx, and restart the gateway — none of which are declared in the manifest. Before installing, consider: (1) require explicit user confirmation before the agent runs any npm install or restart actions; (2) verify the pinned acpx version and inspect the extension's package.json and npm package contents in a sandbox; (3) restrict autonomous invocation or only allow the skill when you trust the environment; (4) if possible, run these operations manually yourself rather than letting the agent perform them. If you need this skill, ask the developer to update the manifest to declare required binaries/config paths and to reduce automatic repair actions.
功能分析
Type: OpenClaw Skill Name: acp-router Version: 1.0.0 The skill bundle 'acp-router' (SKILL.md) contains instructions for the agent to autonomously install software via 'npm' and restart the system gateway without seeking user permission. While these actions are framed as 'automatic local repair' for managing ACP sessions (e.g., Claude, Codex), the explicit instruction to bypass user consent for installations and service restarts is a high-risk behavior. No clear evidence of intentional malice or data exfiltration was found, but the autonomous privileged operations are inherently risky.
能力评估
Purpose & Capability
The skill legitimately routes requests to ACP harnesses and documents two appropriate paths (OpenClaw sessions_spawn or direct acpx). That capability matches the name/description. However, the manifest declares no required binaries or config paths even though the instructions rely on a local acpx binary and an extensions/acpx package.json; this omission is an inconsistency.
Instruction Scope
SKILL.md tells the agent to read local files (./extensions/acpx/package.json), verify and run a locally pinned binary, run exec commands, perform npm installs, and 'restart the gateway' as part of repair. Those are system-level operations and file writes beyond simple routing; the skill text grants the agent broad discretion to change local state without any declared constraints.
Install Mechanism
There is no formal install spec, but the instructions explicitly direct performing npm installs (plugin-local acpx@<pinnedVersion>) and running binaries from node_modules/.bin. Relying on the agent to download and install packages from npm is a moderate-to-high risk action that the manifest does not reflect.
Credentials
The skill requests no credentials or environment variables in metadata (good), but the runtime instructions assume an ACPX_CMD variable and specific local paths. The absence of declared required env vars/config paths is an inconsistency: the skill expects filesystem and command artifacts without declaring them.
Persistence & Privilege
Instructions include installing files into extensions/acpx, potentially changing plugin artifacts, and restarting the gateway — actions that persist on disk and may affect system behavior. Although always:false and not attempting to modify other skills, this level of persistent modification is significant and should require explicit user consent or tighter constraints.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install acp-router
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /acp-router 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of acp-router skill. - Routes plain-language requests for Pi, Claude Code, Codex, OpenCode, Gemini CLI, or ACP harness work into correct ACP runtime or direct acpx-driven sessions. - Provides clear guidelines on intent detection, session spawn, agentId mapping, and error recovery. - Enforces ACP runtime path for thread creation with `sessions_spawn`; direct acpx path (“telephone game”) supported as fallback. - Details robust install, versioning, and repair policies for plugin-local acpx. - Outlines session management, fallback procedures, and clean user output handling for both ACP and acpx flows.
元数据
Slug acp-router
版本 1.0.0
许可证
累计安装 11
当前安装数 11
历史版本数 1
常见问题

Acp Router 是什么?

Route plain-language requests for Pi, Claude Code, Codex, OpenCode, Gemini CLI, or ACP harness work into either OpenClaw ACP runtime sessions or direct acpx-... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 737 次。

如何安装 Acp Router?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install acp-router」即可一键安装,无需额外配置。

Acp Router 是免费的吗?

是的,Acp Router 完全免费(开源免费),可自由下载、安装和使用。

Acp Router 支持哪些平台?

Acp Router 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Acp Router?

由 yimeihuang1999-leaves(@yimeihuang1999-leaves)开发并维护,当前版本 v1.0.0。

💬 留言讨论