acpx-team 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +119 -0
- package/acpx/SKILL.md +546 -0
- package/acpx/bin/acpx-council +374 -0
- package/acpx/config/agent-profiles.yaml +245 -0
- package/acpx/config/role-templates/_README.md +41 -0
- package/acpx/lib/protocols.sh +521 -0
- package/acpx/lib/roles.sh +339 -0
- package/acpx/lib/synthesize.sh +187 -0
- package/acpx/lib/workspace.sh +274 -0
- package/acpx/references/protocols.md +273 -0
- package/acpx/references/roles.md +286 -0
- package/acpx-council.js +10 -0
- package/package.json +47 -0
package/README.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# acpx-team
|
|
2
|
+
|
|
3
|
+
Multi-agent collaboration skill for AI coding agents. Form agent teams, run deliberations, build consensus, and delegate work — all through the Agent Client Protocol (ACP).
|
|
4
|
+
|
|
5
|
+
Works with any ACP-compatible agent: Claude Code, Codex, OpenCode, Gemini CLI, Cursor, Copilot, OpenClaw, and more.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i -g acpx-team
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Requires [acpx](https://www.npmjs.com/package/acpx) and at least one agent client (e.g. `npm i -g @anthropic-ai/claude-code`).
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Code review with auto-assigned expert roles
|
|
19
|
+
acpx-council review src/auth.ts
|
|
20
|
+
|
|
21
|
+
# Ask a multi-agent council anything
|
|
22
|
+
acpx-council council "Should we use Redis or Memcached for session caching?"
|
|
23
|
+
|
|
24
|
+
# Adversarial debate for go/no-go decisions
|
|
25
|
+
acpx-council debate "Migrate from REST to tRPC?"
|
|
26
|
+
|
|
27
|
+
# Single agent with 5 role-playing sessions (no multi-agent setup needed)
|
|
28
|
+
acpx-council council "Refactor auth module" --single-agent opencode --sessions 5
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## How It Works
|
|
32
|
+
|
|
33
|
+
1. **PLAN** — All agents analyze the task independently (plan mode, no code changes)
|
|
34
|
+
2. **DELIBERATE** — Agents review each other's analysis and revise
|
|
35
|
+
3. **CONVERGE** — Orchestrator synthesizes consensus with action items
|
|
36
|
+
4. **EXECUTE** — Agents implement based on the agreed plan
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
acpx-council council "Design caching strategy"
|
|
40
|
+
→ Round 1: 3 agents analyze independently
|
|
41
|
+
→ Round 2: agents review each other's analysis
|
|
42
|
+
→ Synthesis: consensus plan with action items
|
|
43
|
+
→ acpx-council execute # implement the plan
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Key Features
|
|
47
|
+
|
|
48
|
+
- **Auto protocol selection** — `review`/`audit` → role-council, `should`/`decide` → adversarial, `quick`/`opinion` → fanout
|
|
49
|
+
- **Dynamic roles** — 8 builtin roles (security, architect, skeptic, perf, testing, maintainer, dx, neutral) + custom roles
|
|
50
|
+
- **Auto role inference** — task keywords map to relevant roles automatically
|
|
51
|
+
- **Adaptive consensus** — skip Round 2 if agents already agree (>80%), or escalate if they disagree
|
|
52
|
+
- **Team presets** — `code_review`, `security_audit`, `architecture_review`, `devil_advocate`, `balanced`, `build_deploy`
|
|
53
|
+
- **Single-agent mode** — one agent client with multiple role-playing sessions
|
|
54
|
+
- **Shared workspace** — `.acpx-workspace/` for inter-agent context sharing
|
|
55
|
+
|
|
56
|
+
## CLI Reference
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
acpx-council <command> [options] [task]
|
|
60
|
+
|
|
61
|
+
Commands:
|
|
62
|
+
review <file> Code review with auto-assigned expert roles
|
|
63
|
+
council <task> Multi-agent council with auto-selected protocol
|
|
64
|
+
debate <task> Adversarial debate (advocate vs critic + judge)
|
|
65
|
+
synthesize Synthesize workspace outputs into consensus
|
|
66
|
+
execute Execute the plan from current workspace
|
|
67
|
+
status Show current workspace status
|
|
68
|
+
roles <subcommand> Manage roles (list, create, infer)
|
|
69
|
+
workspace <subcmd> Manage workspace (init, cleanup, archive, status)
|
|
70
|
+
|
|
71
|
+
Options:
|
|
72
|
+
-p, --protocol auto|fanout|deliberation|role-council|adversarial|pipeline
|
|
73
|
+
-a, --agents auto|comma-separated (e.g. claude,codex,gemini)
|
|
74
|
+
-r, --roles auto|comma-separated (e.g. security,perf,testing)
|
|
75
|
+
-o, --orchestrator Synthesis agent (default: claude)
|
|
76
|
+
-t, --preset Team preset (code_review, security_audit, etc.)
|
|
77
|
+
-s, --single-agent Use one agent with multiple sessions (e.g. opencode)
|
|
78
|
+
-n, --sessions Number of sessions for single-agent mode (default: 3)
|
|
79
|
+
-w, --workspace Workspace directory (default: .acpx-workspace)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Supported Agents
|
|
83
|
+
|
|
84
|
+
| Agent | Install |
|
|
85
|
+
|---|---|
|
|
86
|
+
| Claude Code | `npm i -g @anthropic-ai/claude-code` |
|
|
87
|
+
| Codex | `npm i -g @openai/codex` |
|
|
88
|
+
| OpenCode | `npm i -g opencode-ai` |
|
|
89
|
+
| Gemini CLI | `npm i -g @anthropic-ai/gemini-cli` |
|
|
90
|
+
| OpenClaw | `npm i -g @openclaw/acpx` |
|
|
91
|
+
| Cursor | Cursor app |
|
|
92
|
+
| GitHub Copilot | `npm i -g @githubnext/github-copilot-cli` |
|
|
93
|
+
| Qwen Code | `npm i -g @qwen/qwen-code` |
|
|
94
|
+
|
|
95
|
+
## Examples
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Security audit preset
|
|
99
|
+
acpx-council council "Review login flow" --preset security_audit
|
|
100
|
+
|
|
101
|
+
# Custom roles for a specific domain
|
|
102
|
+
acpx-council council "Add Stripe payments" -r security,payments,testing,dx
|
|
103
|
+
|
|
104
|
+
# Specific protocol and agents
|
|
105
|
+
acpx-council council "Design caching strategy" -p role-council -a claude,codex,gemini
|
|
106
|
+
|
|
107
|
+
# Create a custom role
|
|
108
|
+
acpx-council roles create "database-expert" "Query optimization" "PostgreSQL,Prisma"
|
|
109
|
+
|
|
110
|
+
# Check workspace status
|
|
111
|
+
acpx-council status
|
|
112
|
+
|
|
113
|
+
# Archive workspace for later
|
|
114
|
+
acpx-council workspace archive auth-review
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## License
|
|
118
|
+
|
|
119
|
+
MIT
|
package/acpx/SKILL.md
ADDED
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: acpx
|
|
3
|
+
repository: https://github.com/csuwl/acpx-team
|
|
4
|
+
description: Multi-agent collaboration and task delegation via the Agent Client Protocol (ACP) using acpx. Form agent teams from Claude Code, Codex, OpenCode, Gemini, Cursor, Copilot, OpenClaw, and other ACP-compatible agents. Run parallel workstreams, switch agent modes, orchestrate deliberation and consensus, or delegate coding tasks to another agent. Triggers include "delegate to Claude", "use Claude Code", "ask Claude to", "parallel agents", "acpx", "ACP", "agent delegation", "form a team", "council", "multi-agent", "debate", "consensus", "code review team", "security audit", "have Claude/Codex/Gemini review/implement/fix", or any request involving multiple AI agents collaborating.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# acpx — Multi-Agent Collaboration via ACP
|
|
8
|
+
|
|
9
|
+
Form teams of AI coding agents, run deliberations, build consensus, and delegate work — all through the Agent Client Protocol.
|
|
10
|
+
|
|
11
|
+
## Prerequisites
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm i -g acpx@latest
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Install the target agents you want to use (e.g., `npm i -g @anthropic-ai/claude-code`).
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Option 1: npm (recommended — gives you the acpx-council CLI globally)
|
|
23
|
+
npm i -g acpx-team
|
|
24
|
+
|
|
25
|
+
# Option 2: git clone into your global skills directory
|
|
26
|
+
git clone https://github.com/csuwl/acpx-team.git ~/.claude/skills/acpx
|
|
27
|
+
|
|
28
|
+
# Option 3: git clone into a specific project
|
|
29
|
+
git clone https://github.com/csuwl/acpx-team.git .claude/skills/acpx
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
After `npm i -g`, the `acpx-council` command is available everywhere.
|
|
33
|
+
|
|
34
|
+
## Your Role: Orchestrator
|
|
35
|
+
|
|
36
|
+
When you use acpx, **you are the supervisor**. You don't implement everything yourself — you delegate. Your job is to:
|
|
37
|
+
|
|
38
|
+
1. **Define the task** clearly — what needs doing, constraints, success criteria
|
|
39
|
+
2. **Pick the right protocol** — fan-out for quick opinions, council for deliberation, debate for go/no-go
|
|
40
|
+
3. **Assign roles** — security expert, architect, skeptic, etc. based on the task domain
|
|
41
|
+
4. **Dispatch agents** — via `acpx-council` or manual `acpx` commands
|
|
42
|
+
5. **Synthesize results** — read the workspace outputs, make the final call
|
|
43
|
+
|
|
44
|
+
The agents are your team members. You are the tech lead directing their work.
|
|
45
|
+
|
|
46
|
+
## Quick Start: One-Command Council
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Code review — auto-selects protocol, roles, and agents
|
|
50
|
+
acpx-council review src/auth.ts
|
|
51
|
+
|
|
52
|
+
# General council — ask anything
|
|
53
|
+
acpx-council council "Should we use Redis or Memcached for session caching?"
|
|
54
|
+
|
|
55
|
+
# Adversarial debate for go/no-go decisions
|
|
56
|
+
acpx-council debate "Migrate from REST to tRPC?"
|
|
57
|
+
|
|
58
|
+
# Security audit preset
|
|
59
|
+
acpx-council council "Review login flow" --preset security_audit
|
|
60
|
+
|
|
61
|
+
# Single agent (e.g., OpenCode) with 5 role-playing sessions
|
|
62
|
+
acpx-council council "Refactor auth module" --single-agent opencode --sessions 5
|
|
63
|
+
|
|
64
|
+
# Check results
|
|
65
|
+
acpx-council status
|
|
66
|
+
|
|
67
|
+
# Execute the plan
|
|
68
|
+
acpx-council execute
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Quick Start: Single Agent
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# One-shot (no session state)
|
|
75
|
+
acpx claude exec "fix the failing tests"
|
|
76
|
+
|
|
77
|
+
# Persistent multi-turn session
|
|
78
|
+
acpx claude sessions new --name worker
|
|
79
|
+
acpx claude -s worker "analyze the auth module"
|
|
80
|
+
acpx claude -s worker "now refactor it based on your analysis"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Quick Start: Manual Multi-Agent Council
|
|
84
|
+
|
|
85
|
+
The fastest way to get multiple opinions on a task:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# 1. Assemble team (create named sessions for each agent)
|
|
89
|
+
acpx claude sessions new --name claude-r && acpx codex sessions new --name codex-r && acpx gemini sessions new --name gemini-r
|
|
90
|
+
|
|
91
|
+
# 2. Round 1: fan-out the same question to all agents in parallel
|
|
92
|
+
acpx --format quiet claude -s claude-r "Review src/auth.ts for security vulnerabilities. Be specific." > /tmp/r1-claude.txt &
|
|
93
|
+
acpx --format quiet codex -s codex-r "Review src/auth.ts for security vulnerabilities. Be specific." > /tmp/r1-codex.txt &
|
|
94
|
+
acpx --format quiet gemini -s gemini-r "Review src/auth.ts for security vulnerabilities. Be specific." > /tmp/r1-gemini.txt &
|
|
95
|
+
wait
|
|
96
|
+
|
|
97
|
+
# 3. Round 2: each agent sees all responses and revises
|
|
98
|
+
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 &
|
|
99
|
+
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 &
|
|
100
|
+
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 &
|
|
101
|
+
wait
|
|
102
|
+
|
|
103
|
+
# 4. Synthesize (the orchestrator agent does this)
|
|
104
|
+
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)"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## acpx-council CLI
|
|
110
|
+
|
|
111
|
+
The `acpx-council` command provides one-line access to all protocols and presets. It manages sessions, workspace, synthesis, and cleanup automatically.
|
|
112
|
+
|
|
113
|
+
### Commands
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
acpx-council <command> [options] [task]
|
|
117
|
+
|
|
118
|
+
Commands:
|
|
119
|
+
review <file> Code review with auto-assigned expert roles
|
|
120
|
+
council <task> Run a multi-agent council with auto-selected protocol
|
|
121
|
+
debate <task> Adversarial debate (advocate vs critic + judge)
|
|
122
|
+
synthesize Synthesize current workspace outputs into consensus
|
|
123
|
+
execute Execute the plan from current workspace
|
|
124
|
+
status Show current workspace status
|
|
125
|
+
roles <subcommand> Manage roles (list, create, infer)
|
|
126
|
+
workspace <subcmd> Manage workspace (init, cleanup, archive, status)
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Options
|
|
130
|
+
|
|
131
|
+
| Flag | Short | Default | Description |
|
|
132
|
+
|------|-------|---------|-------------|
|
|
133
|
+
| `--protocol` | `-p` | auto | Protocol: auto\|fanout\|deliberation\|role-council\|adversarial\|pipeline |
|
|
134
|
+
| `--agents` | `-a` | auto | Comma-separated agent list (e.g., `claude,codex,gemini`) |
|
|
135
|
+
| `--roles` | `-r` | auto | Comma-separated role list (e.g., `security,perf,testing`) |
|
|
136
|
+
| `--orchestrator` | `-o` | claude | Agent used for synthesis |
|
|
137
|
+
| `--preset` | `-t` | — | Team preset (see below) |
|
|
138
|
+
| `--single-agent` | `-s` | — | Use one agent client with multiple sessions |
|
|
139
|
+
| `--sessions` | `-n` | 3 | Number of sessions for single-agent mode |
|
|
140
|
+
| `--workspace` | `-w` | .acpx-workspace | Workspace directory |
|
|
141
|
+
|
|
142
|
+
### Plan-First Workflow
|
|
143
|
+
|
|
144
|
+
Every council protocol follows a two-phase flow:
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
Phase 1: PLAN (all agents in plan mode — analysis only, no code changes)
|
|
148
|
+
→ Discuss approach, identify risks, form consensus
|
|
149
|
+
→ Output: consensus plan document
|
|
150
|
+
|
|
151
|
+
Phase 2: EXECUTE (agents switch to execution mode)
|
|
152
|
+
→ Implement based on the agreed plan
|
|
153
|
+
→ Cross-review results
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Plan mode is automatically enabled for Phase 1. The council checks consensus after Round 1 — if agents already agree, it skips Round 2 and goes straight to synthesis.
|
|
157
|
+
|
|
158
|
+
### Examples
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# Auto everything — best for most cases
|
|
162
|
+
acpx-council review src/auth.ts
|
|
163
|
+
|
|
164
|
+
# Specific protocol and agents
|
|
165
|
+
acpx-council council "Design caching strategy" -p role-council -a claude,codex,gemini
|
|
166
|
+
|
|
167
|
+
# Custom roles for a specific domain
|
|
168
|
+
acpx-council council "Add Stripe payments" -r security,payments,testing,dx
|
|
169
|
+
|
|
170
|
+
# Single agent, multiple perspectives (no multi-agent setup needed)
|
|
171
|
+
acpx-council council "Review API design" -s opencode -n 4
|
|
172
|
+
|
|
173
|
+
# Quick fan-out opinion poll
|
|
174
|
+
acpx-council council "What testing framework?" -p fanout
|
|
175
|
+
|
|
176
|
+
# Full adversarial debate
|
|
177
|
+
acpx-council debate "Should we use microservices?"
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Shared Workspace
|
|
183
|
+
|
|
184
|
+
The council uses `.acpx-workspace/` for inter-agent context sharing:
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
.acpx-workspace/
|
|
188
|
+
├── context.md # Task description, protocol, phase, round
|
|
189
|
+
├── plan.md # Consensus plan from Phase 1
|
|
190
|
+
├── decisions.md # Agreed points, divergences, action items
|
|
191
|
+
├── open-questions.md # Unresolved questions
|
|
192
|
+
├── synthesis.md # Final synthesis from all agent outputs
|
|
193
|
+
└── agents/
|
|
194
|
+
├── claude/
|
|
195
|
+
│ ├── round-1.md # Claude's Round 1 output
|
|
196
|
+
│ ├── round-2.md # Claude's Round 2 output
|
|
197
|
+
│ └── latest.md # Symlink to most recent round
|
|
198
|
+
├── codex/
|
|
199
|
+
└── gemini/
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Each agent can read shared context and write to its own directory. The workspace enables:
|
|
203
|
+
- **Agent continuity** — agents see their prior rounds via session resume
|
|
204
|
+
- **Cross-agent awareness** — Round 2 gathers all outputs from the workspace
|
|
205
|
+
- **Synthesis** — orchestrator reads all outputs to produce consensus
|
|
206
|
+
- **Archival** — `acpx-council workspace archive` saves workspace for future reference
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
acpx-council status # Show workspace phase, agents, rounds
|
|
210
|
+
acpx-council workspace archive auth-review # Save for later
|
|
211
|
+
acpx-council workspace cleanup # Remove workspace
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Auto Synthesis
|
|
217
|
+
|
|
218
|
+
After deliberation rounds, the orchestrator agent automatically analyzes all outputs and produces a structured synthesis:
|
|
219
|
+
|
|
220
|
+
```markdown
|
|
221
|
+
### CONSENSUS
|
|
222
|
+
Points where ALL or MOST agents agree.
|
|
223
|
+
|
|
224
|
+
### DIVERGENCES
|
|
225
|
+
Points where agents disagree — with each side's position and evidence assessment.
|
|
226
|
+
|
|
227
|
+
### ACTION ITEMS
|
|
228
|
+
Concrete next steps.
|
|
229
|
+
|
|
230
|
+
### HUMAN DECISIONS NEEDED
|
|
231
|
+
Tradeoffs requiring human judgment — options and implications.
|
|
232
|
+
|
|
233
|
+
### CONFIDENCE
|
|
234
|
+
HIGH / MEDIUM / LOW with justification.
|
|
235
|
+
|
|
236
|
+
### RECOMMENDATION
|
|
237
|
+
One clear recommended path forward.
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
This replaces the manual `echo` / `cat` approach from the original protocol. The synthesis is written to `.acpx-workspace/synthesis.md`.
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## Dynamic Roles
|
|
245
|
+
|
|
246
|
+
### Builtin Roles (8)
|
|
247
|
+
|
|
248
|
+
| Role | Focus | Use When |
|
|
249
|
+
|------|-------|----------|
|
|
250
|
+
| `security` | Vulnerabilities, auth, data protection | Any code handling user input, auth, PII |
|
|
251
|
+
| `architect` | System design, scalability, patterns | Architecture decisions, tech debt |
|
|
252
|
+
| `skeptic` | Challenge assumptions, find flaws | Go/no-go decisions, proposals |
|
|
253
|
+
| `perf` | Latency, throughput, optimization | Performance-sensitive code |
|
|
254
|
+
| `testing` | Coverage, edge cases, regression | Test planning, quality gates |
|
|
255
|
+
| `maintainer` | Code quality, readability, long-term | PR reviews, refactoring |
|
|
256
|
+
| `dx` | API ergonomics, developer workflow | API design, tooling changes |
|
|
257
|
+
| `neutral` | Balanced, no specialization | General tasks |
|
|
258
|
+
|
|
259
|
+
### Auto Role Inference
|
|
260
|
+
|
|
261
|
+
Roles are automatically inferred from the task description:
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
# Auto-inferring: task mentions "Stripe payment" → roles: security, payments, testing, dx
|
|
265
|
+
acpx-council council "Add Stripe payment integration"
|
|
266
|
+
|
|
267
|
+
# Explicit roles override inference
|
|
268
|
+
acpx-council council "Add Redis caching" -r perf,testing,architect
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
Keywords mapped to roles: `security/vulnerability/auth` → security, `performance/latency/caching` → perf, `test/coverage/regression` → testing, etc.
|
|
272
|
+
|
|
273
|
+
### Custom Roles
|
|
274
|
+
|
|
275
|
+
Create domain-specific roles for your project:
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
# Create a role
|
|
279
|
+
acpx-council roles create "database-expert" "Query optimization, indexing, migration safety" "PostgreSQL,Prisma,Drizzle"
|
|
280
|
+
|
|
281
|
+
# Use it in a council
|
|
282
|
+
acpx-council council "Optimize slow queries" -r database-expert,perf,testing
|
|
283
|
+
|
|
284
|
+
# List all available roles
|
|
285
|
+
acpx-council roles list
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
Custom roles are stored in `~/.acpx/roles/` and persist across sessions.
|
|
289
|
+
|
|
290
|
+
### Community Roles (Planned)
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
# Install from community registry (future)
|
|
294
|
+
acpx-council roles install @community/stripe-expert
|
|
295
|
+
acpx-council roles install @community/a11y-expert
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## Single-Agent Multi-Session
|
|
301
|
+
|
|
302
|
+
You don't need multiple agent clients. Use `--single-agent` to create multiple sessions of the same agent, each with a different role:
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
# OpenCode with 5 different expert perspectives
|
|
306
|
+
acpx-council council "Review the auth module" --single-agent opencode --sessions 5
|
|
307
|
+
|
|
308
|
+
# Under the hood:
|
|
309
|
+
# session 1: opencode with [ROLE: Security Expert]
|
|
310
|
+
# session 2: opencode with [ROLE: Performance Expert]
|
|
311
|
+
# session 3: opencode with [ROLE: Testing Expert]
|
|
312
|
+
# session 4: opencode with [ROLE: Maintainer]
|
|
313
|
+
# session 5: opencode with [ROLE: Skeptic]
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
**When single-agent is enough**: Most code reviews, architecture discussions, and quality assessments. The role prompt is the primary quality driver, not the model identity.
|
|
317
|
+
|
|
318
|
+
**When multi-agent is better**: When you need genuinely different LLM capabilities (e.g., Claude for complex reasoning + Codex for fast implementation), or when you want model-diverse perspectives to reduce single-model bias.
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## Agent Profiles
|
|
323
|
+
|
|
324
|
+
Each agent has a capability profile used for automatic role assignment:
|
|
325
|
+
|
|
326
|
+
| Agent | Strengths | Preferred Roles |
|
|
327
|
+
|-------|-----------|-----------------|
|
|
328
|
+
| Claude Code | Complex reasoning, architecture, security | architect, security, maintainer, skeptic |
|
|
329
|
+
| Codex | Implementation, testing, algorithmic | testing, maintainer |
|
|
330
|
+
| Gemini CLI | Broad knowledge, performance, multimodal | perf, neutral, testing |
|
|
331
|
+
| OpenCode | Flexibility, local-first | maintainer, testing, dx |
|
|
332
|
+
| OpenClaw | Protocol-native, headless, automation | neutral (can fill any role) |
|
|
333
|
+
| Cursor | IDE integration, refactoring | dx, maintainer |
|
|
334
|
+
| Copilot | IDE integration, code suggestions | dx, maintainer |
|
|
335
|
+
|
|
336
|
+
Profiles are defined in `config/agent-profiles.yaml` and used for automatic role assignment when `--roles auto` is set.
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
## Council Protocol
|
|
341
|
+
|
|
342
|
+
The standard multi-agent collaboration pipeline:
|
|
343
|
+
|
|
344
|
+
```
|
|
345
|
+
PLAN → DELIBERATE → CONVERGE → EXECUTE → REVIEW → DELIVER
|
|
346
|
+
规划 交叉讨论 形成共识 分工执行 交叉审查 交付成果
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
### Step-by-Step
|
|
350
|
+
|
|
351
|
+
**1. PLAN** — All agents enter plan mode, analyze independently:
|
|
352
|
+
|
|
353
|
+
```bash
|
|
354
|
+
# Automatic via acpx-council — plan mode is the default first phase
|
|
355
|
+
acpx-council council "Design a caching layer for our API"
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
**2. DELIBERATE** — Each agent reviews all other responses and revises:
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
# Automatic Round 2 — agents see each other's analysis
|
|
362
|
+
# Skipped if Round 1 consensus is HIGH
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
**3. CONVERGE** — Orchestrator synthesizes a consensus plan:
|
|
366
|
+
|
|
367
|
+
```bash
|
|
368
|
+
# Automatic synthesis → .acpx-workspace/synthesis.md + plan.md
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
**4. EXECUTE** — Delegate implementation to agents:
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
acpx-council execute
|
|
375
|
+
# Agents switch from plan mode to acceptEdits mode
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
**5. REVIEW** — Cross-review implementations.
|
|
379
|
+
|
|
380
|
+
**6. DELIVER** — Final output.
|
|
381
|
+
|
|
382
|
+
### Adaptive Protocol Selection
|
|
383
|
+
|
|
384
|
+
When `--protocol auto` (default), the protocol is chosen based on task keywords:
|
|
385
|
+
|
|
386
|
+
| Task Pattern | Auto-Selected Protocol |
|
|
387
|
+
|---|---|
|
|
388
|
+
| "review", "audit", "assess" | role-council |
|
|
389
|
+
| "should", "decide", "choose", "whether" | adversarial |
|
|
390
|
+
| "implement", "build", "create" | role-council |
|
|
391
|
+
| "quick", "opinion", "think" | fanout |
|
|
392
|
+
| "design", "architect", "plan" | role-council |
|
|
393
|
+
| "debug", "fix", "investigate" | pipeline |
|
|
394
|
+
|
|
395
|
+
### Adaptive Consensus
|
|
396
|
+
|
|
397
|
+
After Round 1, the council checks agreement level:
|
|
398
|
+
|
|
399
|
+
| Consensus | Action |
|
|
400
|
+
|-----------|--------|
|
|
401
|
+
| HIGH (>80% agreement) | Skip Round 2, synthesize immediately |
|
|
402
|
+
| MEDIUM (40-80%) | Run Round 2 focused on divergent points |
|
|
403
|
+
| LOW (<40%) | Run full Round 2 or upgrade to more rigorous protocol |
|
|
404
|
+
|
|
405
|
+
---
|
|
406
|
+
|
|
407
|
+
## Team Presets
|
|
408
|
+
|
|
409
|
+
Pre-configured role assignments for common scenarios:
|
|
410
|
+
|
|
411
|
+
| Preset | Roles | Best For |
|
|
412
|
+
|---|---|---|
|
|
413
|
+
| `code_review` | security, perf, testing, maintainer, dx | PR reviews, quality gates |
|
|
414
|
+
| `security_audit` | security, skeptic, architect, dx, testing | Security-sensitive changes |
|
|
415
|
+
| `architecture_review` | architect, perf, skeptic, maintainer, testing | Design decisions, tech debt |
|
|
416
|
+
| `devil_advocate` | skeptic, skeptic, architect, maintainer | Go/no-go decisions |
|
|
417
|
+
| `balanced` | neutral × N | General tasks, no specialization |
|
|
418
|
+
| `build_deploy` | architect, testing, maintainer | Feature implementation |
|
|
419
|
+
|
|
420
|
+
```bash
|
|
421
|
+
acpx-council council "Review PR #42" --preset code_review
|
|
422
|
+
acpx-council council "Is this API secure?" --preset security_audit
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
---
|
|
426
|
+
|
|
427
|
+
## Supported Agents
|
|
428
|
+
|
|
429
|
+
| Agent | Command | Install |
|
|
430
|
+
|---|---|---|
|
|
431
|
+
| Claude Code | `acpx claude` | `npm i -g @anthropic-ai/claude-code` |
|
|
432
|
+
| Codex | `acpx codex` | `npm i -g @openai/codex` |
|
|
433
|
+
| OpenCode | `acpx opencode` | `npm i -g opencode-ai` |
|
|
434
|
+
| Gemini CLI | `acpx gemini` | `npm i -g @anthropic-ai/gemini-cli` |
|
|
435
|
+
| OpenClaw | `acpx openclaw` | `npm i -g @openclaw/acpx` |
|
|
436
|
+
| Cursor | `acpx cursor` | Cursor app |
|
|
437
|
+
| GitHub Copilot | `acpx copilot` | `npm i -g @githubnext/github-copilot-cli` |
|
|
438
|
+
| Pi | `acpx pi` | github.com/mariozechner/pi |
|
|
439
|
+
| Qwen Code | `acpx qwen` | `npm i -g @qwen/qwen-code` |
|
|
440
|
+
|
|
441
|
+
### OpenClaw — The Protocol Foundation
|
|
442
|
+
|
|
443
|
+
[OpenClaw](https://github.com/openclaw/acpx) is the headless agent client that implements the Agent Client Protocol (ACP). It is the foundation that acpx builds on:
|
|
444
|
+
|
|
445
|
+
- **ACP Protocol**: OpenClaw provides the standardized protocol for agent-to-agent communication
|
|
446
|
+
- **Headless Mode**: Run agents without interactive UI — essential for automation and CI
|
|
447
|
+
- **Session Management**: Persistent sessions, mode switching, and lifecycle control
|
|
448
|
+
- **Multi-Agent Orchestration**: The underlying infrastructure for acpx's council protocols
|
|
449
|
+
|
|
450
|
+
If you want to build custom agent integrations or understand how acpx works internally, explore the [OpenClaw repository](https://github.com/openclaw/acpx).
|
|
451
|
+
|
|
452
|
+
---
|
|
453
|
+
|
|
454
|
+
## Agent Mode Switching
|
|
455
|
+
|
|
456
|
+
Set working modes (Claude Code example; other agents may vary):
|
|
457
|
+
|
|
458
|
+
| Mode | Behavior | Use When |
|
|
459
|
+
|---|---|---|
|
|
460
|
+
| `plan` | Plan only, no execution | Architecture, analysis (Phase 1 default) |
|
|
461
|
+
| `default` | Ask before changes | Standard work |
|
|
462
|
+
| `acceptEdits` | Auto-accept edits | Trusted refactoring (Phase 2 default) |
|
|
463
|
+
| `dontAsk` | Auto-accept everything | Batch tasks |
|
|
464
|
+
| `bypassPermissions` | Skip all checks | CI/automation |
|
|
465
|
+
|
|
466
|
+
```bash
|
|
467
|
+
acpx claude -s worker set-mode plan
|
|
468
|
+
acpx claude -s worker set model opus # or sonnet
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
## Session Management
|
|
472
|
+
|
|
473
|
+
```bash
|
|
474
|
+
acpx claude sessions new --name worker # create named session
|
|
475
|
+
acpx claude sessions ensure # create if missing
|
|
476
|
+
acpx claude sessions list # list all
|
|
477
|
+
acpx claude sessions show # inspect current
|
|
478
|
+
acpx claude -s worker sessions history # recent turns
|
|
479
|
+
acpx claude -s worker status # pid, uptime
|
|
480
|
+
acpx claude sessions close worker # soft-close (keeps history)
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
## Output & Permissions
|
|
484
|
+
|
|
485
|
+
```bash
|
|
486
|
+
# Output formats
|
|
487
|
+
acpx --format quiet claude exec "task" # final text only
|
|
488
|
+
acpx --format json claude exec "task" # NDJSON stream
|
|
489
|
+
|
|
490
|
+
# Permissions
|
|
491
|
+
acpx --approve-all claude -s w "task" # auto-approve all
|
|
492
|
+
acpx --approve-reads claude -s w "task" # auto-approve reads
|
|
493
|
+
acpx --deny-all claude -s w "task" # analysis only
|
|
494
|
+
|
|
495
|
+
# Lifecycle
|
|
496
|
+
acpx --cwd ~/repo claude "task" # set working directory
|
|
497
|
+
acpx --timeout 300 claude "task" # set timeout (seconds)
|
|
498
|
+
acpx --no-wait claude -s w "task" # fire-and-forget
|
|
499
|
+
acpx claude -s w cancel # cancel in-flight prompt
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
## Bidirectional Communication
|
|
503
|
+
|
|
504
|
+
Any agent can call any other agent through acpx:
|
|
505
|
+
|
|
506
|
+
```bash
|
|
507
|
+
# From OpenCode → Claude Code
|
|
508
|
+
acpx claude -s worker "review src/auth.ts"
|
|
509
|
+
|
|
510
|
+
# From Claude Code → OpenCode
|
|
511
|
+
acpx opencode -s helper "analyze test results"
|
|
512
|
+
|
|
513
|
+
# From any → Codex → Gemini (chain)
|
|
514
|
+
acpx codex -s coder "implement X" && acpx gemini -s reviewer "review: $(cat result.txt)"
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
---
|
|
518
|
+
|
|
519
|
+
## Reference Files
|
|
520
|
+
|
|
521
|
+
- **`references/roles.md`** — All 8 builtin role definitions with Round 1 and Round 2 prompt prefixes, plus team presets with agent-to-role mappings.
|
|
522
|
+
- **`references/protocols.md`** — 7 collaboration patterns with decision matrix and cost estimates.
|
|
523
|
+
- **`config/agent-profiles.yaml`** — Agent capability definitions for automatic role assignment.
|
|
524
|
+
- **`config/role-templates/`** — Custom role templates directory.
|
|
525
|
+
- **`lib/workspace.sh`** — Shared workspace management (init, read, write, archive).
|
|
526
|
+
- **`lib/synthesize.sh`** — Auto consensus detection and structured synthesis.
|
|
527
|
+
- **`lib/roles.sh`** — Dynamic role management (builtin, custom, auto-inference).
|
|
528
|
+
- **`lib/protocols.sh`** — Protocol implementations with plan-first flow.
|
|
529
|
+
- **`bin/acpx-council`** — High-level CLI for one-command council invocation.
|
|
530
|
+
|
|
531
|
+
## Gotchas
|
|
532
|
+
|
|
533
|
+
- **Mode not settable at creation**: Use `set-mode` after `sessions new`
|
|
534
|
+
- **session/update warnings**: Claude Code adapter may emit `Invalid params` — harmless
|
|
535
|
+
- **Dead session recovery**: acpx auto-detects and reconnects, replaying mode settings
|
|
536
|
+
- **No direct agent-to-agent messaging**: All communication goes through the orchestrator
|
|
537
|
+
- **`--format quiet` is essential for piping**: Returns only final text, no tool calls or thinking
|
|
538
|
+
- **2 rounds is optimal**: Research shows diminishing returns beyond 2 deliberation rounds
|
|
539
|
+
- **Session resume preserves context**: Use the same `-s name` across rounds for continuity
|
|
540
|
+
- **Plan mode first**: `acpx-council` always starts in plan mode — agents analyze before executing
|
|
541
|
+
- **Single-agent works**: Use `--single-agent` when you only have one agent client installed
|
|
542
|
+
- **Workspace is per-directory**: `.acpx-workspace/` is created in the current directory
|
|
543
|
+
|
|
544
|
+
<!-- acpx-team · https://github.com/csuwl/acpx-team -->
|
|
545
|
+
|
|
546
|
+
<!-- acpx-team by csuwl · https://github.com/csuwl/acpx-team -->
|