ccswarm
Turn tasks into PR-ready diffs with quality gates already run. Reproducibly.
ccswarm is a workflow engine for AI coding agents. You describe a task, pick a flow
(declarative YAML workflow), and ccswarm drives the provider CLI through plan →
Sangha consensus → implement → review → fix, optionally auto-committing and
opening a PR, with full NDJSON audit trails you can replay, diff, and roll back.
OK/NG driven: the only keys you press during a run are y and n.
Hire ccswarm when
- You want a quality-gated change (plan → Sangha consensus → implement → review → fix) without rebuilding the workflow each task.
- You need reproducibility: the same flow YAML yields the same quality process, whether Alice or Bob runs it.
- You want to replay, diff, or undo what the agent did yesterday.
- You use multiple provider CLIs (Claude Code / Codex, with gh copilot probed for diagnostics) and don't want to pick one.
Quick start
doctor reports missing ANTHROPIC_API_KEY as a warning, not a hard failure,
when you use provider CLIs that are already authenticated locally.
scaffold creates a new git repository, writes a minimal npm project with a
passing npm test script, then runs the selected flow in that project. The
global --provider flag is forwarded into the child pipeline, and scaffold
exits non-zero if the pipeline fails or times out.
Daily flow
After a run
Authoring flows
Stages can opt into consensus with sangha:. Each member evaluates the same
decision independently and must end with SANGHA_DECISION=APPROVE or
SANGHA_DECISION=REVISE; the stage advances only when approvals meet quorum.
stages:
- id: sangha
instruction: "Review the plan before implementation"
permission: readonly
sangha:
quorum: 2
members:
-
-
-
Multi-provider
# ccswarm.json or flow YAML (per-stage)
provider: claude # claude | codex; copilot compatibility names fail fast
model: sonnet
Precedence: stage YAML provider: > global --provider flag >
CCSWARM_PROVIDER env > Claude default. Unknown providers in provider:,
promotion.provider, or on_rate_limit.provider fail validation instead of
falling back silently.
| Provider | Status | Notes |
|---|---|---|
claude |
Full support | Uses --allowed-tools, --agent, --session-id / --continue, --append-system-prompt, --max-budget-usd, and --worktree. CCSWARM_CLAUDE_STREAM_JSON=1 enables stream telemetry |
codex |
Non-interactive codex exec |
System prompt is prepended to the user prompt (Codex has no dedicated flag). codex exec resume <thread-id> is used for same-thread continuation when Codex JSON telemetry provides a thread ID |
copilot |
Unsupported for code generation | gh copilot suggest is interactive and returns shell-command strings, not file edits. The provider fails fast with a friendly error — see providers/copilot.rs for rationale |
Machine-readable output
Use --json when scripting commands. Application data is written to stdout as
JSON; tracing/log output is written to stderr so stdout remains parseable.
Builtin flows
| Flow | Steps | Agents |
|---|---|---|
default |
plan → sangha quorum → implement → review → fix → complete | planner, reviewer, qa, coder |
team |
plan → parallel(frontend + backend) → supervisor review | planner, frontend-specialist, backend-specialist, supervisor |
team-dynamic |
plan → team_leader workers → review | planner, coder, reviewer |
quick |
single-shot | coder |
review-fix |
review → fix loop | reviewer, coder |
research |
investigate → report | researcher |
Custom: drop YAML files into .ccswarm/flows/. See ccswarm flow eject default for
a starting template.
Lab (experimental)
Group for features that sit beside the core JTBD but are not part of the primary flow. May change without notice.
Governance
Architecture at a glance
ccswarm (workflow + governance + A2A/local provider execution)
- ccswarm/cli — command parsing and dispatch (35+ subcommands)
- ccswarm/workflow — FlowEngine, faceted prompting, stage reports
- ccswarm/providers — AgentProvider trait + Claude/Codex/Copilot implementations
- ccswarm/session/bridge — A2A/local execution, retry, context, persistence
- ccswarm/events — NDJSON recorder, run summaries
- ccswarm/governance — proposals, extensions, approvals (renamed from coordination/)
- ccswarm/session/a2a — A2A Agent Card metadata and REST
message:sendclient support. SetCCSWARM_A2A_ENDPOINTto route live turns to a remote A2A server.
See docs/ARCHITECTURE.md for module responsibilities and API boundaries. See docs/CCSWARM_PRODUCT_ABSTRACTION_PLAN.md for the deeper takt-inspired product roadmap.
Development
End-to-end: examples/e2e-playwright/run.sh exercises queue intake, JSON
output, pipeline dry-run planning, and the tracked static app through a
Playwright browser test.
Safety
- Every auto-commit (
ccswarm auto) is gated by a sensitive-path deny-list (.env,*.pem,*.key,id_rsa,credentials*,secrets.y*ml, ...) before files are staged. - Run IDs accepted by
tail/cost/replay/undoare validated against a strict[A-Za-z0-9_-]allow-list to prevent path traversal. ccswarm undois intentionally advisory: it prints thegit logsince the run started, it never rewrites history on its own.
License
MIT. See LICENSE.