/cave-teams:cave-conditionsfrom cave-teams
Program WHEN each agent may be messaged — conditions on messages, the GUARDRAILS of a leader-driven team run. Use to gate agents on runtime state: after these two respond, only when a flag holds, any predicate over the message log. THIS is what makes cave-teams programmable where Claude Code Teams' flow is fixed.
Ships in cave-teams. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Teams run LEADER-DRIVEN: a leader agent proposes each message; cave-teams CHECKS the proposal
against the conditions (the guardrails) before delivery. An invalid message is never delivered —
the leader is re-prompted with the error string and self-fixes. Conditions are predicates over the
team's MESSAGE LOG: Condition = Callable[[List[TeamMessage]], bool].
from cave_teams import (responded, after, when_flag, when_message, all_of, any_of, always,
Edge, register_condition, compile_to_edges, run_team, check_proposal)
edges = compile_to_edges(seq(a, par(b, c), d)) # the algebra compiles to the guardrails
# or hand-build an edge:
edges += [Edge(to="publisher", conditions=[when_flag("approved")])] # only after approval
edges += [Edge(to="merge", conditions=[after("frontend", "backend")])] # join — wait for BOTH
edges += [Edge(to="worker", conditions=[when_message(lambda m: m.kind == "flag")])] # any rule
register_condition("qa_passed", after("qa")) # name a condition for team configs
run_team(team, task, leader, runtimes, team_dir) enforces them: check_proposal blocks a message
to a non-member or an out-of-turn agent and re-prompts the leader with {e}. Re-dispatch to an
agent that already responded IS allowed (revision loops are the leader's call) — conditions
enforce ORDER, the leader decides.
Not a cave() build-op — conditions are the message state machine (a separate runtime axis),
not a composition Link. Two tiers: these CLOSED-WORLD checks (enforced mechanically) + OPEN-WORLD
open_rules={agent: [str]} (surfaced to the leader, assumed true when it proceeds).
cave-branch · cave-gate · cave-teams
Part of the cave-teams plugin — the language + full DSL is the cave-teams skill; drive any pattern from data with the cave skill.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub sancovp/cave-teams --plugin cave-teams21 skills in this plugin
/caveDrive the whole cave-teams library from one function, as DATA — build/run any team from a spec in any sequence, save a team to your proven library, reuse a proven team anywhere, and discover teams across projects. Use when you want to serialize a team, run a team from JSON/dict, save+reuse a proven team across repos ("golden"), or have a higher system / global app drive cave-teams. NOT how you normally program (use the cave-teams DSL for that). Triggers: "cave()", "metacontrol", "run from a spec", "team as data", "golden team", "reuse a proven team", "scan for .cave", "global cave"./cave-blackboardN agents read and write a shared state over rounds, with a mutator that folds each contribution in and an optional adjudicator (stigmergy arena). Use for agents collaborating on a shared board, a market, a workspace they all see. `blackboard()`./