← 返回
未分类 中文

acpx-team

Multi-agent collaboration and task delegation via the Agent Client Protocol (ACP) using acpx. Form agent teams from Claude Code, Codex, OpenCode, Gemini, Cur...
通过代理客户端协议(ACP)使用acpx实现多代理协作与任务委托。从Claude Code、Codex、OpenCode、Gemini、Cur...组成代理团队
csuwl
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 431
下载
💾 0
安装
1
版本
#latest

概述

acpx — Multi-Agent Collaboration via ACP

Form teams of AI coding agents, run deliberations, build consensus, and delegate work — all through the Agent Client Protocol.

Prerequisites

npm i -g acpx@latest

Install the target agents you want to use (e.g., npm i -g @anthropic-ai/claude-code).

Quick Start: Single Agent

# One-shot (no session state)
acpx claude exec "fix the failing tests"

# Persistent multi-turn session
acpx claude sessions new --name worker
acpx claude -s worker "analyze the auth module"
acpx claude -s worker "now refactor it based on your analysis"

Quick Start: Multi-Agent Council

The fastest way to get multiple opinions on a task:

# 1. Assemble team (create named sessions for each agent)
acpx claude sessions new --name claude-r && acpx codex sessions new --name codex-r && acpx gemini sessions new --name gemini-r

# 2. Round 1: fan-out the same question to all agents in parallel
acpx --format quiet claude -s claude-r "Review src/auth.ts for security vulnerabilities. Be specific." > /tmp/r1-claude.txt &
acpx --format quiet codex -s codex-r "Review src/auth.ts for security vulnerabilities. Be specific." > /tmp/r1-codex.txt &
acpx --format quiet gemini -s gemini-r "Review src/auth.ts for security vulnerabilities. Be specific." > /tmp/r1-gemini.txt &
wait

# 3. Round 2: each agent sees all responses and revises
acpx --format quiet claude -s claude-r "Other reviewers said:\n[Codex]: $(cat /tmp/r1-codex.txt)\n[Gemini]: $(cat /tmp/r1-gemini.txt)\n\nRevise your assessment." > /tmp/r2-claude.txt &
acpx --format quiet codex -s codex-r "Other reviewers said:\n[Claude]: $(cat /tmp/r1-claude.txt)\n[Gemini]: $(cat /tmp/r1-gemini.txt)\n\nRevise your assessment." > /tmp/r2-codex.txt &
acpx --format quiet gemini -s gemini-r "Other reviewers said:\n[Claude]: $(cat /tmp/r1-claude.txt)\n[Codex]: $(cat /tmp/r1-codex.txt)\n\nRevise your assessment." > /tmp/r2-gemini.txt &
wait

# 4. Synthesize (the orchestrator agent does this)
echo "=== Final Reviews ===\n\n[Claude]: $(cat /tmp/r2-claude.txt)\n\n[Codex]: $(cat /tmp/r2-codex.txt)\n\n[Gemini]: $(cat /tmp/r2-gemini.txt)"

Council Protocol

The standard multi-agent collaboration pipeline:

ASSEMBLE → BRIEF → DELIBERATE → CONVERGE → EXECUTE → REVIEW → DELIVER
 组建团队   分发问题   交叉讨论    形成共识    分工执行   交叉审查   交付成果

Step-by-Step

1. ASSEMBLE — Create named sessions for each agent:

acpx claude sessions new --name council-claude
acpx codex sessions new --name council-codex
acpx opencode sessions new --name council-opencode

2. BRIEF — Send each agent the task with a role prefix:

acpx --format quiet claude -s council-claude "[ROLE: Architect] Design a caching layer for our API. Consider: invalidation strategy, TTL, cache-aside vs write-through." > /tmp/r1-claude.txt
acpx --format quiet codex -s council-codex "[ROLE: Performance Expert] Design a caching layer for our API. Consider: invalidation strategy, TTL, cache-aside vs write-through." > /tmp/r1-codex.txt

3. DELIBERATE — Each agent reviews all other responses and revises:

ALL_RESPONSES=$(echo "[Claude]: $(cat /tmp/r1-claude.txt)\n\n[Codex]: $(cat /tmp/r1-codex.txt)")
acpx --format quiet claude -s council-claude "Other architects said:\n$ALL_RESPONSES\n\nRevise your design. Address any concerns raised." > /tmp/r2-claude.txt
acpx --format quiet codex -s council-codex "Other architects said:\n$ALL_RESPONSES\n\nRevise your design. Address any concerns raised." > /tmp/r2-codex.txt

4. CONVERGE — Orchestrator synthesizes a consensus plan.

5. EXECUTE — Delegate implementation to agents in parallel:

acpx --approve-all claude -s exec-claude "Implement the caching layer based on this design: $(cat /tmp/consensus.txt)" &
acpx --approve-all codex -s exec-codex "Write tests for the caching layer: $(cat /tmp/consensus.txt)" &
wait

6. REVIEW — Cross-review implementations:

acpx --format quiet codex -s council-codex "Review Claude's implementation for bugs and edge cases:\n$(cat /tmp/impl-claude.txt)"
acpx --format quiet claude -s council-claude "Review Codex's tests for coverage gaps:\n$(cat /tmp/tests-codex.txt)"

Quick Council Commands

# Assemble a 3-agent team in one line
acpx claude sessions new --name t1 && acpx codex sessions new --name t2 && acpx gemini sessions new --name t3

# Fire-and-forget fan-out (don't wait)
acpx --no-wait --format quiet claude -s t1 "task..." > /tmp/r1-t1.txt

# Collect all Round 1 results
cat /tmp/r1-*.txt

# Cleanup after deliberation
acpx claude sessions close t1 && acpx codex sessions close t2 && acpx gemini sessions close t3

Team Presets

Pre-configured role assignments for common scenarios. See references/roles.md for full definitions.

PresetAgentsBest For
---------
code_reviewmaintainer, perf, testing, security, dxPR reviews, quality gates
security_auditsecurity, skeptic, architect, dx, testingSecurity-sensitive changes
architecture_reviewarchitect, perf, skeptic, maintainer, testingDesign decisions, tech debt
devil_advocateskeptic, skeptic, architect, maintainerGo/no-go decisions, proposals
balancedneutral × NGeneral tasks, no specialization
build_deployarchitect, testing, maintainerFeature implementation

Supported Agents

AgentCommandInstall
---------
Claude Codeacpx claudenpm i -g @anthropic-ai/claude-code
Codexacpx codexnpm i -g @openai/codex
OpenCodeacpx opencodenpm i -g opencode-ai
Gemini CLIacpx gemininpm i -g @anthropic-ai/gemini-cli
Cursoracpx cursorCursor app
GitHub Copilotacpx copilotnpm i -g @githubnext/github-copilot-cli
Piacpx pigithub.com/mariozechner/pi
Qwen Codeacpx qwennpm i -g @qwen/qwen-code

Agent Mode Switching

Set working modes (Claude Code example; other agents may vary):

ModeBehaviorUse When
---------
planPlan only, no executionArchitecture, analysis
defaultAsk before changesStandard work
acceptEditsAuto-accept editsTrusted refactoring
dontAskAuto-accept everythingBatch tasks
bypassPermissionsSkip all checksCI/automation
acpx claude -s worker set-mode plan
acpx claude -s worker set model opus      # or sonnet

Session Management

acpx claude sessions new --name worker    # create named session
acpx claude sessions ensure               # create if missing
acpx claude sessions list                 # list all
acpx claude sessions show                 # inspect current
acpx claude -s worker sessions history    # recent turns
acpx claude -s worker status              # pid, uptime
acpx claude sessions close worker         # soft-close (keeps history)

Output & Permissions

# Output formats
acpx --format quiet claude exec "task"    # final text only
acpx --format json claude exec "task"     # NDJSON stream

# Permissions
acpx --approve-all claude -s w "task"     # auto-approve all
acpx --approve-reads claude -s w "task"   # auto-approve reads
acpx --deny-all claude -s w "task"        # analysis only

# Lifecycle
acpx --cwd ~/repo claude "task"           # set working directory
acpx --timeout 300 claude "task"          # set timeout (seconds)
acpx --no-wait claude -s w "task"         # fire-and-forget
acpx claude -s w cancel                   # cancel in-flight prompt

Bidirectional Communication

Any agent can call any other agent through acpx:

# From OpenCode → Claude Code
acpx claude -s worker "review src/auth.ts"

# From Claude Code → OpenCode
acpx opencode -s helper "analyze test results"

# From any → Codex → Gemini (chain)
acpx codex -s coder "implement X" && acpx gemini -s reviewer "review: $(cat result.txt)"

Reference Files

  • references/roles.md — All 8 role definitions (security, architect, skeptic, perf, testing, maintainer, dx, neutral) with prompt prefixes for Round 1 and Round 2, plus team presets with agent-to-role mappings.
  • references/protocols.md — 7 collaboration patterns (fan-out, deliberation, role council, adversarial debate, sequential pipeline, DOVA hybrid, DCI structured) with acpx command examples, decision matrix, and cost estimates.

Gotchas

  • Mode not settable at creation: Use set-mode after sessions new
  • session/update warnings: Claude Code adapter may emit Invalid params — harmless
  • Dead session recovery: acpx auto-detects and reconnects, replaying mode settings
  • No direct agent-to-agent messaging: All communication goes through the orchestrator
  • --format quiet is essential for piping: Returns only final text, no tool calls or thinking
  • 2 rounds is optimal: Research shows diminishing returns beyond 2 deliberation rounds
  • Session resume preserves context: Use the same -s name across rounds for continuity

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-03 07:47 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,355 📥 318,026
ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 711 📥 243,706
security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,214 📥 266,406