Skip to main content

compono

Agent-oriented, code-based PPTX/DOCX generation. Describe a deck or document as typed primitives — an LLM agent never writes raw coordinates or touches OOXML.

compono lets an LLM agent (or a human) describe a slide deck as data — headers, bullet text, stats, tables, charts, images, process sequences, shapes — and get back a real, editable .pptx file. The agent never writes raw x/y/w/h coordinates: a constraint-based layout resolver computes every position from a small set of typed primitives.

Every rendered element is a genuine, editable native shape (p:sp, p:pic, p:graphicFrame) — never a flattened image or embedded video. Open the result in PowerPoint and drag a box around; it's a real object, not a picture of one.

compono also generates .docx documents — its second output format, for linear content (proposals, reports) rather than slides, with its own smaller primitive set (heading, paragraph, bullet_list, table, image, chart, ...). See DOCX generation for the full write-up; the rest of this README covers the original .pptx path.

Building a JS/TS agent harness instead of a Python one? See compono-js — a parallel TypeScript port of the same schema/resolver/validator/render pipeline, plus review(), Inspire, and DOCX generation, plus an MCP server — same primitive-JSON contracts, independent implementation and version.

Why compono

Ask an LLM to write raw python-pptx (or drive a browser-based renderer like pptx.js) and you get code littered with hand-picked EMU coordinates — the model has to simultaneously invent content and do pixel-perfect layout math it's genuinely bad at. The usual failure modes: overlapping boxes, text running off the slide, margins that drift slide to slide, titles crammed against the edge. None of that is a content problem; it's a coordinates problem.

compono removes coordinates from the agent's job entirely:

  • You describe intent, not geometry. {"primitive": "grid", "columns": 2, ...}, not left=Inches(0.6), top=Inches(1.9), width=.... A directional, flexbox-style resolver computes every real position.
  • A cheap pre-flight check, before paying render cost. validate(spec) catches schema errors, layout impossibilities, and text overflow — measured against real glyph metrics, not guessed — in milliseconds, with no file write. Bad specs get a structured {slide, primitive, field, error, detail, fix} back, not a broken .pptx or a stack trace.
  • A design-quality pass, still optional. review(spec) — contrast, whitespace, image-fit, font-size-near-overflow, style — flags things a human designer would notice that "renders successfully" doesn't catch.
  • Nothing is ever a flattened image. Every primitive is a real, editable OOXML shape or graphicFrame. A generated table is a real table; a generated chart has live, editable series data. Open the file and it's actually still a deck, not a picture of one.

The result: an agent's job shrinks to "pick the right primitives and content," and a resolver + validator handle everything spatial.

Install

pip install compono
# or
uv add compono

Quickstart

from compono import render_deck

spec = {
    "slides": [
        {
            "header": {"title": "Q3 Results", "subtitle": "Engineering team"},
            "body": [
                {
                    "primitive": "text",
                    "mode": "bullets",
                    "content": [
                        "Shipped the new layout resolver",
                        "Cut render time by 40%",
                        "Zero overflow bugs in production",
                    ],
                    "emphasis_indices": [1],
                }
            ],
        }
    ]
}

report = render_deck(spec, "deck.pptx")
print(report.pptx_path, report.warnings)

Or from the command line:

compono validate spec.json
compono render spec.json -o deck.pptx

How an agent should use this

The intended loop is validate, fix, render — not "render and hope":

  1. Build a spec (plain dict/JSON — whatever your tool-calling naturally produces).
  2. validate(spec) — cheap, no file write. If .valid is False, apply each error's fix field directly and re-validate.
  3. Optionally review(spec) once it validates — apply suggestions that matter for this deck, ignore the rest; it never blocks anything.
  4. render_deck(spec, output_path) — writes the real .pptx. It refuses to write anything on a validation failure, so a broken spec never produces a broken file.

compono reference (or compono.reference() in Python) prints the same full reference an MCP client or Claude Code skill would get — useful if you're wiring up a different agent framework and want the whole primitive catalog and error shape in one shot.

Documentation

  • Getting started — install, quickstart, core concepts
  • API reference — verbs, error shape, the feedback loop, design review
  • Primitives — full catalog, image placeholders, worked examples
  • Templates and fontsDeck.template, font_family
  • CLI
  • MCP servercompono-mcp, and what to do when compono has no context
  • Inspire — scan liked decks into a style profile/skill, structure and style only, never literal content
  • DOCX generation — compono's second output format, for linear documents rather than slides
  • compono-js — TypeScript port (pptx via pptxgenjs, plus review/Inspire/DOCX) and its MCP server, for JS/TS agent harnesses
  • Claude Code plugin
  • Examples — rendered screenshots across genres, from real examples/*.json specs

(Absolute links, not relative — this README is also rendered as-is on PyPI, which can't resolve links to other files in the repo.)

Agents: the full reference in one file is compono reference / compono.reference(), or skills/compono/SKILL.md — that's the doc written for you, not this page.

Contributing

See CONTRIBUTING.md for dev setup, branching, and code style. If you're using Claude Code, .claude/README.md describes the build-workflow skill, review subagent, and commit/format hooks set up for this repo.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

compono-0.2.2.tar.gz (129.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

compono-0.2.2-py3-none-any.whl (136.4 kB view details)

Uploaded Python 3

File details

Details for the file compono-0.2.2.tar.gz.

File metadata

  • Download URL: compono-0.2.2.tar.gz
  • Upload date:
  • Size: 129.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for compono-0.2.2.tar.gz
Algorithm Hash digest
SHA256 e6a615801f56f76a4def0de2c134b11ea482b6fe3fc8154f5e3f13f6b517d77f
MD5 6403740683548cbfcc9e1a1c40631a1e
BLAKE2b-256 cee04a0d24c6efa61ffb21c44e5098a20941e2ce29cb757024c3c06e2e65601e

See more details on using hashes here.

File details

Details for the file compono-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: compono-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 136.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for compono-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4106bb9d5d1baf834a3a65d36ad42090542f629f8defbc36f12d381356fa58dd
MD5 9b06f9c5982a38d38c192ddbbdb1f2c2
BLAKE2b-256 18f53e74c0ac1e53193a89f4ce7b154bfb9b324dd108c565dcd3f0be5f80fcf1

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.0

2 files

This release

0.2.2 This release

2 files

0.2.1

2 files

0.2.0

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page