ACP Variables
ACP variables let you write one protocol and customize it for different projects. Variables are defined in the protocol and resolved at parse time.
Defining variables
Section titled “Defining variables”variables: max_reviewers: type: number default: 3 description: "Maximum number of reviewers" target_branch: type: string default: main description: "Branch to review against" strict_mode: type: boolean default: false description: "Require all reviewers to approve"Supported types
Section titled “Supported types”| Type | Values | Example |
|---|---|---|
string | Any text | "main", "src/**" |
number | Integer or float | 3, 10.5 |
boolean | true or false | true |
Using variables
Section titled “Using variables”Reference variables with ${var_name} anywhere in the protocol:
roles: reviewer: count: "1-${max_reviewers}" description: "Review changes against ${target_branch}"
phases: review: description: "Review mode: strict=${strict_mode}"Variables work in strings, numbers, and nested values. The parser resolves them before the protocol is loaded.
Overriding at runtime
Section titled “Overriding at runtime”# Override when loading a protocolwgl protocol load spec.yaml --var max_reviewers=5 --var target_branch=develop
# Override when starting a broodwgl up --var max_reviewers=5import { parseProtocol } from '@agentcoordinationprotocol/spec';
const protocol = parseProtocol(yaml, { variables: { max_reviewers: 5, target_branch: 'develop' },});brood.yaml
Section titled “brood.yaml”hives: main: acp: code-review.acp.yaml variables: max_reviewers: 5 target_branch: developResolution order
Section titled “Resolution order”- Explicit overrides (CLI flags, SDK options, brood.yaml)
- Default values from the protocol
- Error if no default and no override provided
Use cases
Section titled “Use cases”One protocol, many teams
Section titled “One protocol, many teams”variables: team_size: { type: number, default: 3 } language: { type: string, default: "typescript" } coverage_threshold: { type: number, default: 80 }Team A: --var team_size=5 --var language=python --var coverage_threshold=90
Team B: --var team_size=2 --var language=rust
Environment-specific configuration
Section titled “Environment-specific configuration”variables: budget: { type: number, default: 5 } model_tier: { type: string, default: "haiku" }
governance: budget: max_cost: ${budget}
roles: worker: model_hint: ${model_tier}Development: --var budget=1 --var model_tier=haiku
Production: --var budget=50 --var model_tier=sonnet