Skip to content
OpenPresentationPublic

Repository files navigation

Open Presentation Format

Open Presentation Format (OPF)

npm version npm downloads license CI nightly

Public npm package: @openpresentation/opf (npm install @openpresentation/opf).

Open Presentation Format is the portable, human-readable JSON document format for slide decks.

This repository is the canonical home for the OPF spec, JSON Schemas, catalog presets, examples, generated developer types, local validation tooling, and integration docs for the render/edit/convert toolkit. OpenPresentation publishes open-source code and documentation. The engine runs in the caller’s environment; hosts choose their own rendering, storage and application infrastructure. The MCP server has local stdio and hosted transport options, with viewer availability determined separately by the client and deployment.

For AI agents, use the OPF skill set for authoring, layout, presets, editing, export, and schema inspection.

The published CLI installs all six skills into your project with npx @openpresentation/cli skills install. It uses local copies, preserves existing instructions and refuses to overwrite customized skills. See the installation and update guide for personal or agent-specific targets and source development.

For a fresh Node 24 project that installs published packages (not this checkout), follow the developer quickstart and the compatibility matrix.

For LLM authoring, start with the authoring guide, dynamic composition, and local ecosystem verification.

File naming

Open Presentation Format documents are JSON files. Use *.opf.json for complete OPF presentation documents, for example board-review.opf.json or deck.opf.json.

Avoid using bare *.opf for OPF JSON. The .opf extension is already used by other document and project formats, while .opf.json keeps the OPF identity and still makes the underlying JSON format clear to editors, validators, agents, and version-control tooling.

Naming and reuse

The format name is Open Presentation Format. The schemas, catalogs, packages, and local tooling in this repository are free and open source under the MIT license, so third-party tools may read, write, validate, render, convert, and describe support for Open Presentation Format without adopting any product-specific branding.

Why OPF

.pptx is a zipped bundle of XML. Humans can't diff it, LLMs can't read or write it reliably, and git can't track it meaningfully. Every change looks like a binary blob.

OPF is plain JSON. A human can open it in an editor. A model can read and write it without guessing at schema-by-example. Decks live in git like the rest of your work.

That's the shift that lets LLMs actually author decks. When the format stops fighting them, models can do the work that matters — narrative structure, persuasive framing, data analysis, chart recommendations, ruthless revision passes — instead of wrestling with <p:sp> tags.

And they don't start from a blank canvas. pptx.gallery is the human-browsable reference for OPF catalog presets: layouts, themes, color schemes, font schemes, chart types, narratives, audiences, purposes, tones, languages, and social platforms.

Start in three steps

  1. Install the coordinated published packages on Node 24. See the developer quickstart for the registry-derived pin set: core, renderer, PPTX, editor, CLI and Gallery use one completed shared release, retained with --save-exact and the lockfile. The optional seventh package, @openpresentation/mcp, supplies the MCP server and viewer. The default catalog is supplied by the matching @openpresentation/gallery release; see the compatibility matrix for feature and native limits.
  2. Author, validate, paginate, preview and export. New to OPF? Run the first deck end to end first. Copy docs/quickstart/developer-quickstart.opf.json and run the commands in that guide. From code, convert("deck.opf.md", "deck.pdf") of @openpresentation/opf is the simple path to a PDF, PNG, SVG or PPTX file. validate / opf validate is one local checker for format, references, accessibility, layout and content (guide), not visual verification.
  3. Know the limits. PPTX export writes one text box per wrapped line, so text edited in PowerPoint or Keynote does not reflow (see rich text) unless you opt in to --body-text native (opf-pptx and CLI 0.22.0 or later), and fonts are named, not embedded. The compatibility matrix lists shipped APIs versus renderer issue 24, native PowerPoint issue 87, and other deferred work. Browse presets at pptx.gallery.

Your deck can live in git from the first commit. After installing dependencies and supplying referenced assets, these commands run locally without a model provider, account or hosted OPF API.

JavaScript and TypeScript

The canonical JavaScript/TypeScript package is published at packages/javascript as @openpresentation/opf. The schema is pre-stable (0.x — expect breaking changes between minor versions until 1.0). Its responsibility is local and format-level only:

  • export the canonical schemas from spec/
  • register the pptx.gallery catalog of @openpresentation/gallery (a dependency, released with core at the same version) as the Node defaults, as the CLI does; a browser host registers it itself
  • export a typed raw spec file manifest for package-addressable spec/ content
  • generate TypeScript types, with Presentation as the top-level type
  • validate OPF JSON and catalog records locally

In Node (and Bun and Deno) its root also reads and writes files (convert, open, save) and draws them through the optional engines below; in a browser or a worker the same import is a browser-safe build with the same names, where those three reject with node-only. Every other entry runs in a browser. It does not generate content with AI, fetch remote catalogs, call hosted APIs, or provide managed services. Render/edit/convert packages live in this repository as separate MIT packages that depend on @openpresentation/opf. The format package also exposes pure composition geometry so those packages share layout behavior.

Toolkit libraries

OPF is seven packages. Core (@openpresentation/opf) is the format and its API: it reads and writes the text formats (JSON, YAML, Markdown) and validates, and in Node reads and writes files, through the same import. The gallery (@openpresentation/gallery) is the pptx.gallery catalog of layouts, themes, color and font schemes and the other records, released with the other packages; core depends on it and registers it in Node. The CLI (@openpresentation/cli) is the opf command. The MCP server (@openpresentation/mcp, npx -y @openpresentation/mcp) lets an MCP-native agent learn OPF (docs, schemas, catalog, examples and skills as resources) and validate and convert decks. Render (opf-render), PPTX (opf-pptx) and the editor (opf-editor) are the engines: drawing, PowerPoint and editing, installed as needed. All seven live in this repository (packages/) and are released together at one version. See ecosystem development for local builds and verification, and dynamic composition for portable layout rules.

Package Role Boundary
packages/javascript (@openpresentation/opf) Core: format, schemas, validation, composition The format and its API; reads and writes files in Node and draws through the optional engines
packages/gallery (@openpresentation/gallery) The pptx.gallery catalog Catalog records only, no runtime dependency; records are authored by pull request here, and a changed drawing or a removed record needs a minor release
packages/cli (@openpresentation/cli) opf command Runs core's Node engine: reads and writes files and calls the engines below as optional peers
packages/mcp (@openpresentation/mcp) MCP server and viewer Docs, schemas, catalog lookup, validation, conversion and show_deck for MCP clients
packages/render (@openpresentation/opf-render) OPF to SVG/PNG/PDF Local and embeddable rendering library
packages/editor (@openpresentation/opf-editor) WYSIWYG bindings/components Headless editor primitives plus optional UI components
packages/pptx (@openpresentation/opf-pptx) OPF to PPTX and PPTX to OPF Pure local import/export library for browser and server use where supported

These packages provide OSS primitives only. Downstream applications own hosting, auth, storage, collaboration, queues, previews, analytics, support, and workflow UX.

Usage

Install from npm:

pnpm add @openpresentation/opf
# or: npm install @openpresentation/opf

To work on the packages, clone this repo and build the workspace (all seven packages are in packages/; see CONTRIBUTING):

pnpm install
pnpm build

Use the format package from JavaScript or TypeScript:

import { presentation, validate } from "@openpresentation/opf";
import { gallery } from "@openpresentation/gallery";

import type { Presentation } from "@openpresentation/opf";

const deck: Presentation = {
  name: "Quarterly Review",
  slides: [{ title: "Quarterly Review", items: ["Revenue", "Product", "Hiring"] }],
};

const report = validate(deck);
console.log(report.valid); // no finding has severity "error"
console.log(report.findings); // every finding: rule id, severity, category, JSON Pointer path, message, fixes
// Core ships no catalog records; in Node, validate registers the gallery when a call names no catalogs, and a host may name its own.
console.log(validate({ ...deck, design: { theme: "classic" } }, { catalogs: [gallery] }).valid);
console.log(Object.keys(gallery.audiences).length);

Convert, open and save files in Node with @openpresentation/opf, the same import a browser uses (the engines @openpresentation/opf-render and @openpresentation/opf-pptx are optional peers, installed as needed; see OPF files in Node):

import * as opf from "@openpresentation/opf";

await opf.convert("deck.opf.md", "deck.pdf");
const deck = await opf.open("deck.opf.md");
deck.slides.push({ title: "Q4" });
await opf.save(deck, "deck.opf.md");
const { files } = await opf.convert(deck, { format: "pptx" }); // bytes, nothing written

Use focused imports when you only need one surface:

import { presentation } from "@openpresentation/opf/schemas";
import { specFileEntries } from "@openpresentation/opf/spec-files";
import { validate } from "@openpresentation/opf/validator";
import type { Presentation } from "@openpresentation/opf/types";

Use raw JSON when an engine or resolver needs package-addressable files:

import presentationSchema from "@openpresentation/opf/spec/schemas/opf.schema.json" with {
  type: "json",
};

Use the installable OPF CLI to create, validate, and edit files locally:

pnpm --filter @openpresentation/cli build
node packages/cli/dist/index.js create deck.opf.json --title "Decision brief"
node packages/cli/dist/index.js validate deck.opf.json
node packages/cli/dist/index.js edit deck.opf.json --patch changes.json --in-place

See CSV and JSON data import for editable tables and charts in the editor, CLI, and package API, and content conversions for the pure converters (@openpresentation/opf/convert) that change a block's kind, nest list items, restructure a slide and split or merge slides, and Markdown and outlines for the deterministic Markdown dialect (@openpresentation/opf/markdown, opf convert deck.md deck.opf.json) that reads and writes a whole deck as text.

OPF as YAML describes the strict YAML form of a deck (@openpresentation/opf/yaml, opf convert deck.opf.json deck.opf.yaml, .opf.yaml files in every command, editor autocomplete); JSON stays the canonical form. A deck can equally be a Markdown file, deck.opf.md: every command reads and writes it (see Markdown decks in every command), and parse / stringify read and write a deck in JSON, YAML or Markdown with one call.

See Templates and variables for fillable OPF templates: typed variables, {{id}} tokens, opf fill and resolveVariables.

Layout

Path Contents
spec/schemas/opf.schema.json Canonical JSON Schema for top-level OPF Presentation documents.
docs/how-opf-works.md Conceptual introduction: the document model, content shapes, catalog resolution, and the validation philosophy. Start here.
docs/slide-design-principles.md Timeless principles for slide layout, typography, spacing, visual balance, and reviewing layout defaults.
docs/design-resolution.md The design precedence algorithm (slide design → deck design → resolved theme → engine defaults) with worked examples.
docs/schema-reference.md Author-facing reference for top-level OPF fields and every presentation schema $defs object/type.
docs/slide-sizes.md OPF's slide-size presets in inches, points and EMU, how they compare with PowerPoint's presets, and what PPTX export and import do with them.
docs/catalog-schema-reference.md Author-facing reference for every companion catalog schema.
docs/content-payloads.md Author-facing notes for slide and region content payloads, including chart and table object shapes.
docs/diagrams.md Mermaid, Graphviz DOT and PlantUML diagrams as a content kind: when to use one, the supported families, how the deck styles and sizes them, accessibility, export (native PowerPoint shapes by default) and limits.
docs/shapes.md Shapes: the 187 DrawingML presets as blocks, custom outlines, slide overlays and connectors, and how PowerPoint export and import carry them.
docs/shape-effects.md The six shape effects (shadow, glow, reflection, soft edge, blur, 3-D) and how each engine draws them.
docs/smartart.md The pyramid, matrix, cycle, chevrons, process and vertical-process layouts: live SmartArt in PowerPoint where it holds the text, native shapes elsewhere.
docs/icons.md Icons on list entries, metrics and groups, icon cards, and the Lucide and Tabler icon sets in @openpresentation/gallery/icon-sets.
docs/mcp.md The MCP server (npx -y @openpresentation/mcp): tools, resources, and show_deck, which opens the OPF viewer in clients such as Claude.
docs/footnotes-citations-captions.md Citations (cite), inline footnotes, the deck references list, captions on images, charts, tables and videos, and how every engine draws them.
docs/examples.md Guide to the expanded scenario-oriented examples under examples/gallery/.
docs/live-editor.md Browser canvas, live OPF editing, font loading, published packages, and current fidelity limits.
docs/release-process.md Maintainer runbook for the one-click release: gate, tag, trusted npm publishing of all seven packages, verification, GitHub release notes, and the site bumps.
docs/governance.md Governance (proposed): the steward, how a spec change is proposed and decided, versioning and stability promises, implementation listings, security, the name and logo, and maintainers.
docs/conformance.md The conformance suite in conformance/: valid and invalid documents with expected results, a runner to point at your tool, the levels (Core Reader and Core Writer today) and how to claim one.
spec/schemas/*.schema.json Companion schemas for catalog records and sub-objects.
packages/gallery (@openpresentation/gallery) The default catalog and layout previews, released with the other packages.
spec/openapi.yaml Optional reference OpenAPI contract for downstream services that choose to expose OPF over HTTP. OpenPresentation does not host this API.
examples/technical/ Focused OPF fixtures for validator, renderer, catalog-resolution, design, content-payload, and region behavior.
examples/gallery/ Broader OPF example decks organized by industry, function, education, government, presentation type, international, and design/media scenarios.
packages/javascript/ Public pre-stable source for @openpresentation/opf.
packages/cli/ Installable local CLI for creating, validating, editing, and inspecting OPF.
legacy/ Tombstone for service-specific clients, CLIs, tool integrations, and workflows removed from the OpenPresentation OSS repo.

OpenPresentation Boundary

OpenPresentation defines the format, bundled presets, local validation, examples, docs, and planned local render/edit/convert libraries. It does not provide hosted functions or managed product surfaces.

Future non-JavaScript OPF packages should follow the same local-first boundary: Python and Go packages should expose schemas, types/models, catalogs, validation, and package-addressable assets. Future toolkit packages should expose embeddable library APIs with no required network calls, hosted callbacks, hidden telemetry, or managed infrastructure assumptions.

The published JavaScript package copies package-addressable OPF schemas, catalogs, reference assets, and the optional reference spec/openapi.yaml from spec/. It intentionally remains @openpresentation/opf instead of introducing a separate @openpresentation/opf-spec package so downstream imports can advance by semver-pinning one canonical package.

License

MIT. See LICENSE.

Releases

Packages

Contributors

Languages