Spec

The .leancanvas file format

A .leancanvas file is a JSON document containing a Lean Canvas, optional AI conversation histories, and discoverability hints. The format is stable, versioned, and built to be readable + writable by AI agents without bespoke integration work.

JSON Schema

Draft 2020-12. Pin to https://leancanvas.online/file-format/schema.json in your tooling.

Top-level structure

Every .leancanvas file is an object with these fields:

{
  "$schema": "https://leancanvas.online/file-format/schema.json",
  "_viewer": "https://leancanvas.online/viewer",
  "schema": "totally-lean/canvas-export@1",
  "exportedAt": 1714334400000,
  "canvas": { /* LeanCanvas */ },
  "agentHistories": { /* optional, per-agent */ }
}

The LeanCanvas object

Required fields: id, name, createdAt, updatedAt, sections. The nine sections are the standard Lean Canvas (Ash Maurya), each an array of CanvasItem:

"sections": {
  "problem":               [ ...CanvasItem ],
  "solution":              [ ...CanvasItem ],
  "uniqueValueProposition":[ ...CanvasItem ],
  "channels":              [ ...CanvasItem ],
  "customerSegments":      [ ...CanvasItem ],
  "unfairAdvantage":       [ ...CanvasItem ],
  "keyMetrics":            [ ...CanvasItem ],
  "costStructure":         [ ...CanvasItem ],
  "revenueStreams":        [ ...CanvasItem ]
}

Optional fields: threads (cross-cutting groupings), links (item-to-item directional links), themeId, themeMode, pitch (cached AI-generated pitch text), and per-section layout (sectionHeights, sectionWidths, sectionPositions) for the canvas planning board.

CanvasItem (the sticky note)

{
  "id": "p1",
  "title": "Hotels are expensive",
  "description": "Budget travelers find hotels…",
  "color": "rose",
  "threadIds": ["thread-budget"],
  "validation": "validated",
  "weight": 50000000,
  "unit": "users"
}

Writing files from an AI agent

Three guarantees the format provides for agentic workflows:

  1. 01

    Validate before writing

    Fetch the JSON Schema, validate the bundle, surface schema errors before persisting. Most JSON Schema libraries (ajv, zod via json-schema-to-ts, etc.) can drive this directly.

  2. 02

    Stable schema versioning

    Major shape changes bump the schema field (currently @1). Additive changes — new optional fields — do not. Reject bundles whose schema value you don’t recognise rather than guessing.

  3. 03

    Round-trip safety

    Any bundle produced by Totally Lean must parse and re-export identically. Agents writing bundles should preserve unknown fields they don’t understand — the format reserves the right to add fields without breaking your reader.

See also