1---2name: circom3description: Agent-oriented reference for the circom language and compiler—circuits, constraints, signals, templates, compilation, and safety.4---56> Skill is based on circom 2.x, generated at 2026-02-24.78circom is a domain-specific language and compiler for defining arithmetic circuits used in zero-knowledge proving systems (e.g. with snarkjs). Circuits are built from parameterized templates and components; the compiler outputs R1CS (and optionally WASM/C++ witness generators). This skill focuses on language semantics, constraint generation, and practical usage for agents.910## Core References1112| Topic | Description | Reference |13|-------|-------------|-----------|14| Signals | Input/output/intermediate, assignment operators, public/private, immutability | [core-signals](references/core-signals.md) |15| Templates and components | Definition, instantiation, dot notation, arrays, parallel and custom templates | [core-templates-components](references/core-templates-components.md) |16| Constraint generation | Quadratic constraints, ===, <== vs <-- + === | [core-constraints](references/core-constraints.md) |17| Main component | Entry point, public input list, single main | [core-main-component](references/core-main-component.md) |18| Pragma and include | Version, custom_templates, include, -l | [core-pragma-include](references/core-pragma-include.md) |1920## Features2122| Topic | Description | Reference |23|-------|-------------|-----------|24| Operators | Field, boolean, relational, bitwise; precedence; conditional ? : | [features-operators](references/features-operators.md) |25| Control flow | if/for/while, known vs unknown conditions, instantiation order | [features-control-flow](references/features-control-flow.md) |26| Functions | Pure computations, no signals/constraints, return on every path | [features-functions](references/features-functions.md) |27| Variables and data types | var, arrays (known size), field and signal arrays | [features-variables-data-types](references/features-variables-data-types.md) |28| Anonymous components and tuples | Inline instantiation, multiple outputs, _, array <== | [features-anonymous-tuples](references/features-anonymous-tuples.md) |29| Tags | Signal tags (e.g. binary, maxbit), inheritance, valued tags | [features-tags](references/features-tags.md) |30| Buses | Struct-like signal groups, tagging, nested/parameterized, input format | [features-buses](references/features-buses.md) |31| Compilation | CLI flags (r1cs, wasm, c, sym, O0/O1/O2, prime, -l, inspect) | [features-compilation](references/features-compilation.md) |32| Scoping | Signals/components at top-level or known-condition if; var block scope | [features-scoping](references/features-scoping.md) |3334## Best Practices3536| Topic | Description | Reference |37|-------|-------------|-----------|38| Signal safety | Prefer <==/==>; use <-- only when needed and add ===; use --inspect | [best-practices-signal-safety](references/best-practices-signal-safety.md) |39| Assert and log | Compile-time vs witness-time assert; log() for debugging | [best-practices-assert-log](references/best-practices-assert-log.md) |40| Known vs unknown | Signals unknown; constraints and indices under known control flow | [best-practices-unknowns](references/best-practices-unknowns.md) |41| Simplification | When to use O0/O1/O2; PLONK vs Groth16; large circuits | [best-practices-simplification](references/best-practices-simplification.md) |