---
name: html-slides
description: >-
Builds single-file HTML slide decks from any content: DESIGN.md brand or a style preset, light/dark, embedded fonts, tracks, speaker notes, live stages, offline; PDF and optional PowerPoint (PPTX) export, a quality gate and an anonymity check before sending. Trigger: "create a presentation", "make slides", "slide deck", "html slides", "PowerPoint alternative", "/slides".
metadata:
scope: core
version: 2.5.0
last_updated: 2026-11-12
---
# HTML Slide Deck Generator
Single-file HTML presentations: a scroll-snap engine with keyboard, tracks,
speaker notes and deep links, the Bridge's DESIGN.md brand or one of
10 style presets, light and dark, fonts embedded, nothing fetched from a network. The
foundation (tokens, fonts, the quality gate, the send bundle) is shared with
`html-canvas` and called from there, never copied: this skill needs
`skills/html-canvas/` next to it.
## Decision tree
| The request | Do this | Read |
|---|---|---|
| A new deck | `scripts/new-deck.py` (Build path below) | `reference/slide-types.md`, `reference/rules.md` |
| Bring an existing deck up to date: newer engine, changed DESIGN.md, other preset | `new-deck.py --refresh deck.html` | `reference/deck-build.md` |
| Edit the slides of an existing deck | edit them by hand (outside the marker regions), then the gate | `reference/slide-types.md` |
| A different cut of one deck (prep vs. live, short vs. long) | `data-track` on slides, key F | `reference/slide-types.md` § Engine Contract |
| Speaker notes, a clickable agenda | ``, slide type 10 (Overview) | `reference/slide-types.md` |
| A running simulation inside a slide | `new-deck.py --with-stage`, a `.stage` element | `reference/stage.md` |
| The simulation in a chosen scenario or at a chosen moment on one slide | `data-src="run.html#load=high&t=120"` or `data-stage-hash`; the send bundle keeps it, the slide posts it as `stage:hash` | `reference/stage.md` § A scenario per slide |
| Presenting live: blank screen, jump to a slide number, zoom, language switch, notes handout | built in: keys B / W, digits + Enter, Alt+click, L, `data-print-notes` | `reference/slide-types.md` § Engine Contract |
| An optional deck feature (one of the 6 modules below) or writing one | `new-deck.py --with NAME` (or `--with all`), `SlideDeck.use()` | `reference/modules.md` |
| A presenter view on a second screen, a time budget per slide, a rehearsal with plan vs actual | `--with presenter`, `data-time="90"` on slides, key P | `reference/modules.md` § Module: presenter |
| Point at or mark up a slide while presenting: laser pointer, pen, marker | `--with draw`, keys Q and D | `reference/modules.md` § Module: draw |
| Reveal points one by one, walk through code line by line | `--with steps`, `data-step`, `data-lines` | `reference/modules.md` § Module: steps |
| Morph an element from one slide to the next | `--with morph`, `data-morph="name"` | `reference/modules.md` § Module: morph |
| Motion that plays when a slide comes up: count-up numbers, staggered entrances, lines that draw, a message flow | `--with motion`, `data-count`, `data-stagger`, `data-draw` | `reference/modules.md` § Module: motion |
| A slide that looks like a canvas page: KPI row, matrix, timeline, swimlane, decision, glossary and the other html-canvas blocks | `new-deck.py --blocks kpi-row,matrix` (`--list` shows them) | `reference/blocks.md` |
| A keynote look: a photo filling half the slide, gradient numbers, a glowing arc under a heading, a quote, a decision with a result card, a numbered agenda | `slide--media`, `slide__stat`, `slide__arc`, `slide--quote`, `slide__result`, `slide__numbered` (all opt-in markup) | `reference/slide-types.md` § Keynote Forms |
| The deck in the design of a context or persona | `--context NAME` / `--persona ID` | `reference/deck-build.md` § Presets |
| Generated illustrations or mood images on slides, from the Codex CLI, a configured command or the agent's own image tool | ` ` in the slide, then `html-canvas/scripts/gen-images.py` plan / generate / place | `html-canvas/references/images.md` |
| A deck page to browse first: every slide as a card under a toolbar (title, language, theme, help, PDF and PowerPoint downloads, Present), presenting full screen from the card in view | `--deck-attr data-view=deck`, then `scripts/embed-downloads.py` after the PDF and PPTX renders; P or F5 present, Esc returns | `reference/slide-types.md` § Deck view, `reference/output-formats.md` § 5 |
| A deck handed over to be read, not presented: every slide with its notes as one document | `--with read`, key R; a send copy opens in it with `--deck-attr data-read-default=` | `reference/modules.md` § Module: read |
| Terms on a slide that open their knowledge on the right while presenting (split screen, no pop-up) | `new-deck.py --blocks knowledge`, then `html-canvas/scripts/knowledge-pack.py` mark and embed; key K | `html-canvas/references/knowledge.md` |
| Pick a look | DESIGN.md (default) or a style preset by name | `reference/deck-build.md` § Presets |
| A deck in no house brand, or no DESIGN.md exists | `--preset ` | `presets/_template.yaml`, `assets/discovery-menu.html` |
| PDF, mail, customer, external | the send path below | `reference/output-formats.md` |
| A new style preset | fill `presets/_template.yaml` | `reference/deck-build.md` § Presets |
| A page to read, not a deck to present | use `html-canvas` instead | |
## Build path: generator first
Never hand-assemble a deck. The generator writes every generated part between
markers, asserts each splice, and keeps the deck refreshable.
```bash
python3 skills/html-slides/scripts/new-deck.py --title "Quarterly review" --lang en \
--slides slides.html --out work/tasks//deliverables/deck.html
```
1. **Plan the content** against the density limits in `reference/rules.md`:
title, sections, content slides, closing. Split, never cram.
2. **Write the slides** as one HTML fragment of ``
elements, from the 16 slide types in `reference/slide-types.md`. Without
`--slides` the deck gets one title slide to fill in.
3. **Generate** with `new-deck.py`. Engine options (tracks, counter format, back
link) go on the deck element with `--deck-attr data-NAME=VALUE`. It splices the pre-paint theme script, the
embedded fonts, the tokens, `assets/slide-engine.css` and `assets/slide-engine.js`
(first line `slide-engine v2`), plus the stage module with `--with-stage`,
each deck module named by `--with` (`reference/modules.md`) and the html-canvas
blocks named by `--blocks` (`reference/blocks.md`).
`--lang de` localises the controls, the help and the ARIA texts; `--title-de` and
`--title-en` give the title slide both languages. `--list` names the presets,
modules and blocks.
4. **The gate runs on its own** at the end of every build and refresh (static, with
`--allow-sample`), and the exit code is its result. Fix what it reports, run the
browser pass (Definition of done), then open the file in the browser.
**Updating an existing deck:** `new-deck.py --refresh deck.html` rewrites only the
marker regions the deck already carries (engine, tokens, fonts, preset CSS, blocks, stage,
modules) from the current assets, DESIGN.md and preset. A design deck records the design
it was built with (`/* design-source: */`) and a refresh reads it back, so
`--design` is only needed to change it. The slides are never touched, and a
second run gives the same bytes. A deck from before the generator has no markers:
leave it as it is (its engine is embedded and keeps working), or move its slides
into a fresh `new-deck.py --slides` build. Details: `reference/deck-build.md`.
## Look: DESIGN.md first, style presets as fallback
- **DESIGN.md wins.** When one is found walking up from the output path, or given
with `--design` (a path or an id under `identity/designs/`), `--context` or
`--persona` (whose `design_ref` names it), the `design` preset is the default. A deck inside the Bridge wears the design the Bridge resolves (the
theme's `branding.design`, else the root DESIGN.md); a deck written into another
repository keeps that repository's DESIGN.md: colours through
`presets/design.map.yaml` and `html-canvas/scripts/design-to-css.py`, families and
weights from DESIGN.md typography. Nothing is hand-picked. The preset also holds
the brand rules a slide's markup cannot break: headings in the heading colour,
status colours for state only (a chapter colour or glow from a snippet gives
way), 1px lines, code in the mono family on the muted surface, no shadow or
texture. `.fx` on ``, the deck or a slide brings the decoration back.
- **Style presets** (`--preset swiss-modern` and the others) are for a deck that
should not carry the house brand, and the fallback without DESIGN.md (the one
marked `default: true`). Offer the picker `assets/discovery-menu.html` when the
user wants to choose; no answer means the default.
- **Theme contract:** the engine keeps `.theme-dark` / `.theme-light` on ``,
stored as `slide-theme`, the OS preference while nothing is stored (or the deck's
own default: `new-deck.py --theme-default dark` for a brand made for the dark), key T
toggles. The shared rule set is `html-canvas/references/theme-contract.md`.
- **Fonts are embedded by default** (style presets depend on their typefaces);
`--no-embed-fonts` leaves the deck on its fallback stacks. A send copy always
embeds.
## Definition of done
`verify-page.py` from html-canvas is the gate. Exit 0 is done; a requested browser
pass that cannot run is an error, not a pass.
```bash
V=skills/html-canvas/scripts/verify-page.py
python3 $V deck.html # new-deck.py runs this after every build: no external or sibling file,
# no placeholder ({{X}} or a catalog {Heading}), no sample, no stray hex
uv run --with playwright python $V deck.html --deck # before delivery: renders it,
# contrast per theme, overflow per slide, one print page per slide
```
The gate reads the design the deck recorded; a deck that records none is checked
against the nearest DESIGN.md at or above it, never above the project root (the
first folder with `.git` or `bridge-config.yaml`), and the output says which one it
used. A style preset deck is off brand by definition: its own palette is one
`style-preset` warning, not a list of `hex` errors (a hex picked by hand elsewhere
still is one). Before sending, the sample slides `--blocks` adds are written or
gone: without `--allow-sample` the gate fails on them. `--deck` needs playwright and
its chromium; a bare `python3` without them fails as `browser-skipped`.
## Send path
| Trigger | Action |
|---|---|
| "send to customer", "external", "check before sending" | `scripts/check-anonymity.py deck.html`, resolve every hit (exit 1 on hits) |
| "as PDF", "print", "attachment" | `node scripts/render-pdf.cjs deck.html deck.pdf [--theme light]`, one 16:9 page per slide |
| "as PowerPoint", "PPTX", the recipient edits in PowerPoint (optional, PDF stays the default) | `uv run --with python-pptx --with playwright python scripts/render-pptx.py deck.html deck.pptx`: native text boxes and tables over a picture of each slide, notes on the notes pages; `--mode image` for pixel-exact pictures (`reference/output-formats.md` § PowerPoint) |
| Downloads in the deck itself ("PDF and PowerPoint in the page") | after `render-pdf.cjs` and `render-pptx.py`: `scripts/embed-downloads.py deck.html --pdf deck.pdf --pptx deck.pptx` (base64 inside, 14 MiB guard), or `--pdf-url` / `--pptx-url` for files hosted next to it (`reference/output-formats.md` § 5) |
| The deck loads local files (images, a stage page next to it) | `scripts/inline-assets.py deck.html deck-send.html`, which runs the shared `html-canvas/scripts/bundle.py` |
| Mail the deck | anonymity check, gate, bundle, PDF, then check the bundled copy again |
| Send it to readers, not an audience | build a reading copy from the same slides (`--with read --deck-attr data-read-default=`), then the same path |
| The deck has generated images | `gen-images.py place` (relative) while working; `inline-assets.py` or `place --embed` before the gate; say in the notes or on the closing slide that they are AI-generated |
An instance names its own wordlist in `bridge-config.yaml` under
`html_slides.anonymity_wordlist`, never in this skill. Order and options:
`reference/output-formats.md`.
## Files
| File | Read it when |
|---|---|
| `scripts/new-deck.py` | building or refreshing any deck |
| `reference/deck-build.md` | marker regions, preset choice, `--context` / `--persona`, the recorded design, the gate run, `--list`, fonts, refresh, writing a preset |
| `reference/blocks.md` | html-canvas blocks in a deck: `--blocks`, the token aliases, a block slide, density |
| `reference/slide-types.md` | writing slides; the Engine Contract (options, keys, API) |
| `reference/rules.md` | planning content: the DESIGN.md rule, anti-slop list, density limits |
| `reference/stage.md` | a live simulation inside a slide |
| `reference/modules.md` | deck modules: `--with`, the plugin API `SlideDeck.use()`, writing and testing one, motion |
| `reference/output-formats.md` | PDF, bundle, anonymity check, the package to send |
| `presets/_template.yaml` | the preset schema, before writing one |
| `assets/slide-engine.css`, `assets/slide-engine.js` | extending the engine (then add a test) |
| `assets/slide-stage.css`, `assets/slide-stage.js` | extending the stage (same) |
| `assets/modules/` | the deck modules (`draw`, `morph`, `motion`, `presenter`, `read`, `steps`), one `.js` and `.css` each |
| `assets/fonts/`, `scripts/font-face.py` | preset fonts (woff2 plus OFL licences) |
| `scripts/check-anonymity.py`, `scripts/render-pdf.cjs`, `scripts/inline-assets.py` | the send path |
| `scripts/embed-downloads.py` | PDF and PowerPoint as download buttons inside the deck |
| `html-canvas/scripts/gen-images.py` | image slots in a deck: plan, generate, place |
## Tests
```bash
PYTHONDONTWRITEBYTECODE=1 uv run --with pytest --with pyyaml --with playwright \
python -m pytest skills/html-slides/tests -q -rs
```
Browser tests need playwright and its chromium and skip without them; the
render-pdf tests also need node playwright. Changing the engine, a preset or a
count in these docs means running them; `tests/test_docs.py` holds the counts to
the tree.