Canon

The law your agents work under.

A spec-first, multi-agent coding pipeline you drop into any repo. One model writes, a different model reviews, and every mistake becomes a rule.

GitHubnpmv3.8.0 · MIT

How it got here

  1. Jan 2026GalleryPlanner starts with Gemini alone.
  2. Feb 2026Codex takes over implementation. The code gets better, and harder for me to check.
  3. Soon afterClaude joins for planning and review. Cross-model review catches what one model misses.
  4. Apr 2026A TypeScript orchestrator inside GalleryPlanner replaces the copy-paste.
  5. May 2026Canon splits out into its own open-source project.

The one rule: no self-review

Every phase is checked by a different model than the one that did the work. Different models find different bugs. It's the same reason science relies on independent replication.

PhaseDone byChecked by
Spec & planClaudeCodex, plus Claude multi-agent review
ImplementCodexClaude (anchored and cold), plus a cold Codex pass
QAClaudeYou

Claude orchestrates the whole thing. You approve the spec before any code is written, and you make the final call before anything ships.

Mistakes become law

When a bug gets through, the lesson goes into a staging log. A sweep later promotes it to a permanent rule, such as a pitfall, a pattern, a settled decision, or part of the architecture doc. Agents get the relevant rules injected right when they need them, so the next agent can't make the same mistake. Here's one, verbatim from GalleryPlanner:

Self-sizing portaled / positioned elements must always render in the DOM, even when "hidden". A common deadlock: render the element only when position !== null, compute position by measuring the element's offsetWidth / getBoundingClientRect(), but the ref is never populated because the element isn't rendered. The position never resolves. Fix: always render the element with visibility: hidden; pointer-events: none so the ref is available; the position effect fires on the first render, measures, and shows it at the correct location. Bit SelectionToolbar for both the toolbar pill and each popout, taking 3 human-test reroute iterations to fully resolve.

docs/pitfalls/canvas.md

Jumps to implementation before requirements are clear

A spec phase comes first, written conversationally, with grilling on anything non-trivial.

Silently drops a requirement

Code review opens with a spec-compliance gate. A missing acceptance criterion fails the review.

Reinvents an existing pattern

A patterns trigger table and known pitfalls are injected into implement prompts.

Re-debates a settled decision

Settled decisions live in a doc agents read but don't re-propose.

Reviews loop forever

Per-size caps auto-block runaway loops and escalate to the human.

In practice: GalleryPlanner

Canon was extracted from GalleryPlanner, a production web app for planning gallery walls, and it still runs every change there.

360+tasks shipped through the pipeline
~2,000commits in nine months
100sof codified rules: pitfalls, patterns, decisions
1human, who doesn't write TypeScript

The whole picture

Canon framework diagram: architect, implementer, and human roles; the spec-to-human-review pipeline; three-lens code review; the docs knowledge base; and the compounding learning loop.

Is it for you?

Good fit

  • You're shipping a real, ongoing product with AI agents, not a weekend prototype.
  • You can judge whether the app behaves correctly, even if you can't audit every line.
  • You're tired of being the copy-paste layer between models.

Not a fit

  • One-shot app generation. Canon adds process, and process costs time.
  • Single-model setups. It expects both Claude Code and Codex.
  • Fully autonomous agents. A human approves specs and makes the final call.

Get started

  1. Install Canon alongside Claude Code and Codex (Node 24 and git required).

    npm i -g @anthropic-ai/claude-code @openai/codex canon-ai
  2. Scaffold Canon into your repo.

    cd your-project && canon init
  3. Open Claude Code and run /canon-init. Claude interviews you about the codebase and writes the docs your agents will work from.

  4. Then just ask for what you want, like "let's add dark mode." Claude writes the spec with you, and once you approve it, Claude drives the pipeline.

Permissions, the trust model, and the full CLI are in the README. Release history is in the changelog.

Canon is an independent open-source developer tool. It is not affiliated with, endorsed by, or connected to Canon Inc. or its products.