README.md

July 5, 2026 · View on GitHub

pom

AI-friendly PowerPoint generation with a Flexbox layout engine.

npm version License

pom (PowerPoint Object Model) is a TypeScript library that converts XML into editable PowerPoint files (.pptx).

Try it online — Playground

Playground


Features

  • AI Friendly — Simple XML structure designed for LLM code generation.
  • Declarative — Describe slides as XML. No imperative API calls needed.
  • Flexible Layout — Flexbox-style layout with VStack / HStack, powered by yoga-layout.
  • Rich Nodes — 20 built-in node types: charts, flowcharts, tables, timelines, org trees, and more.
  • Schema-validated — XML input is validated with Zod schemas at runtime with clear error messages.
  • PowerPoint Native — Full access to native PowerPoint shape features (roundRect, ellipse, arrows, etc.).

Quick Start

Requires Node.js 22+

npm install @hirokisakabe/pom
import { buildPptx } from "@hirokisakabe/pom";

const xml = `
<Slide>
  <VStack w="100%" h="max" padding="48" gap="24" alignItems="start">
    <Text fontSize="48" bold="true">Presentation Title</Text>
    <Text fontSize="24" color="666666">Subtitle</Text>
  </VStack>
</Slide>
`;

const { pptx } = await buildPptx(xml, { w: 1280, h: 720 });
await pptx.writeFile({ fileName: "presentation.pptx" });

Packages

This repository is a pnpm monorepo containing the following packages:

PackageDescriptionnpm
packages/pomCore library — XML to PPTX conversion@hirokisakabe/pom
packages/pom-mdMarkdown to pom XML converter@hirokisakabe/pom-md
packages/pom-vscodeVS Code extension for live previewMarketplace
apps/websiteDocumentation website (pom.pptx.app)

pom kit — Agent Skills

The pom kit bundles two agent skills (pom-theme, pom-slide) and the pom-cli preview server. Installed into a coding agent such as Claude Code, it gives you a prompt-to-PPTX workflow: onboard your brand, generate slides from natural language, and iterate in a live preview.

Install (2 commands):

npx skills add hirokisakabe/pom --all   # install all skills (pom-slide, pom-theme)
npm install -g @hirokisakabe/pom-cli    # live preview / build CLI

skills auto-detects your installed agents (Claude Code, Codex, Cursor, and more) and places the skills for each. Note that --all installs every skill for every detected agent, scoped to the current project; pass -g for a user-level (global) install, or --agent / --skill to narrow the targets. To update the skills later, run npx skills update.

Usage — theme → design → preview:

  1. Theme (optional): onboard your brand assets with /pom-theme:

    /pom-theme ブランドカラーは #0052CC。コーポレート向けのライトテーマで
    

    This saves a pom-theme.json (color palette + typography + SlideMaster settings) in the current directory. Subsequent /pom-slide runs automatically apply its colors, fonts, and background. The SlideMaster settings can also be passed directly to buildPptx() as the master option.

  2. Design: generate slides with /pom-slide:

    /pom-slide 四半期の売上レポート。3 枚構成で、タイトル・グラフ・まとめを含む
    

    The agent generates a slides.pom.xml file in the current directory, applying the theme if present, and self-reviews the rendered result.

  3. Preview: if pom-cli is installed, a live preview server starts automatically at http://localhost:3000. Edit the XML (yourself or via follow-up prompts) and the preview updates live. When you're happy, export the deck with pom build slides.pom.xml -o slides.pptx.

Documentation

DocumentDescription
API ReferencebuildPptx() function and options
NodesComplete reference for all node types
Master SlideHeaders, footers, and page numbers
Text MeasurementText measurement options and settings
llm.txtCompact XML reference for LLM prompts
PlaygroundTry pom XML in the browser

License

MIT