Open Source / Apache 2.0 + MIT

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.

The Engine

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

~/ terminal

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 types

Tier 2 — Engine

Job engine, ledger, 9 consensus algorithms

Tier 3 — Orchestration

DAG workflows, runtime decision firewall

Dependencies flow downward only (Tier 0 → 4). Enforced by dependency-cruiser in CI.

16
Packages
9
Consensus Algorithms
7
Guard Types
29
MCP Tools
The Architect

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

1

Analyze

Scans your project (package.json, tsconfig, .env), detects stack and frameworks.

2

Discover

Asks about governance needs, maps to guard domains and risk levels.

3

Recommend

Generates customized architecture diagram with package recommendations.

4

Setup

Installs packages, creates config, scaffolds starter code.

5

Prove

Runs a live evaluation with sample data, shows audit trail.

6

Extend

Shows paths to workflows, custom guards, MCP tools, dashboards.

Install in One Prompt

Smart 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

TypeScriptPythonLangChainNext.jsExpressFastifyLangGraphCrewAIAutoGen

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.

View /docs/llms.txt

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)