Two projects.
One decision layer.
The consensus-tools SDK is the decision engine. The consensus-engineer skill wires it into your project for you. Both open source, both shipping in production today.
consensus-tools monorepo
A pnpm + Turbo monorepo with 16 packages across 5 strict dependency tiers. Wrap a function in a review gate, evaluate an action against a policy, or chain both into a workflow. Apache 2.0 licensed and runs locally with no external dependencies.
Get Started
Wrapper: gate any function
@consensus-tools/wrapper wraps any async function with a consensus gate. Reviewers score the output, strategy decides allow / block / retry / escalate.
const safeDeploy = consensus({
name: "deploy-to-prod",
fn: deploy,
reviewers: [securityReview, complianceReview],
strategy: { strategy: "threshold", threshold: 0.7 },
});
// result.action => "allow" | "block" | "escalate"Guards score every action
@consensus-tools/guards ships 7 built-in guard types with weighted voting: code_merge, deployment, send_email, publish, support_reply, agent_action, permission_escalation.
const votes = evaluatorVotes({
action: { type: "code_merge", payload: { files } },
context: {},
});
const result = finalizeVotes(votes, "code_merge");
// => { decision: "ALLOW", risk_score: 0.34 }Workflows chain guards into pipelines
@consensus-tools/workflows is a DAG engine with guard nodes, human-in-the-loop pauses, and cron scheduling.
const workflow = await runner.createWorkflow("PR Review", {
nodes: [
{ id: "guard", type: "guard", config: { guardType: "code_merge" } },
{ id: "approve", type: "hitl", config: { channel: "slack" } },
{ id: "merge", type: "action", config: { action: "github.merge_pr" } },
],
});Architecture: 5 Dependency Tiers
Tier 0 — Foundations
Schemas, secrets, and shared typesTier 1 — Primitives
Guards, telemetry, evaluators, personas, storage, integrationsTier 2 — Engine
Job engine, ledger, 9 consensus algorithmsTier 3 — Orchestration
DAG workflows, runtime decision firewallTier 4 — Interface
3-line facade, SDKs, CLI, MCP tools, appsDependencies flow downward only (Tier 0 → 4). Enforced by dependency-cruiser in CI.
consensus-engineer skill
A Claude Code skill that analyzes your project, picks the guards and config that match your stack, scaffolds the setup, and proves it works, all in an interactive 6-phase conversation.
The 6-Phase Flow
Analyze
Scans your project (package.json, tsconfig, .env), detects stack and frameworks.
Discover
Asks about governance needs, maps to guard domains and risk levels.
Recommend
Generates customized architecture diagram with package recommendations.
Setup
Installs packages, creates config, scaffolds starter code.
Prove
Runs a live evaluation with sample data, shows audit trail.
Extend
Shows paths to workflows, custom guards, MCP tools, dashboards.
Install in One Prompt
Clone the consensus-engineer skill from https://github.com/consensus-tools/toolkit/tree/main/skills/consensus-engineer into my agent's skills directory (~/.claude/skills/consensus-engineer for Claude Code). Copy SKILL.md, README.md, and llms.txt. Then reload plugins and run /consensus-engineer to start the interactive setup.
What It Detects
What It Produces
- consensus.config.ts
- Scaffolded starter code
- Live evaluation with sample data
- Audit trail artifact
llms.txt
We publish a machine-readable llms.txt containing the complete consensus-tools API reference, guard domains, policy algorithms, and integration patterns. LLMs and AI agents can use this to understand our ecosystem without scraping docs.
Built for engineers who ship agents to production
Drop it into your pipeline and keep the audit trail. No service to run, nothing leaves your machine. Run it locally or embed it in your code.
Apache 2.0 (SDK) / MIT (Skill)