# `graphe:slides`

Get a talk deck ready to present: start from the starter web deck, write it for someone who has never heard the terms, build the figures in steps, write the script to read aloud on each slide, gate it, render it on a desktop and a phone, publish it on GitHub Pages, and brief the presenter.

Part of [graphe](<https://ajbarea.github.io/techne/plugins/graphe/index.md>): `/plugin install graphe@techne`, then `/graphe:setup`.

## When to use

- "Make a deck for Friday's talk," or "turn this paper into a talk."
- An animated deck to present from a browser, with the link as the handout.
- Showing how the work differs from related work, as a map and a timeline drawn from data.
- "Is this deck ready?" before it goes to a room, a recording, or a teammate.
- A recorded talk or video that needs a script to read from, slide by slide.
- Checking an existing `.pptx` or a Typst or Beamer PDF deck.

## Usage

Invoke by name in Claude Code:

```text
/graphe:slides
```

Or run the checks directly from a techne checkout:

```text
B="uv run --no-project --quiet --with playwright==1.63.0 --with axe-playwright-python==0.1.8 --with pillow --with python-pptx==1.0.2"
$B python plugins/graphe/skills/slides/scripts/slides.py check <deck/index.html|deck.pptx|deck.pdf> [--jargon "term,term"] [--backup-from N] [--level {AAA,AA}] [--min-pt N] [--dense-words N] [--title-words N] [--allow-dark]
$B python plugins/graphe/skills/slides/scripts/slides.py render <deck/index.html|deck.pptx|deck.pdf> <out-dir> [--renderer {auto,powerpoint,libreoffice}] [--dpi N]
$B python plugins/graphe/skills/slides/scripts/slides.py script <deck/index.html|deck.pptx> [--wpm N] > script.md
$B python plugins/graphe/skills/slides/scripts/slides.py pptx <deck/index.html> <out.pptx> [--images <dir>] [--editable]
$B python plugins/graphe/skills/slides/scripts/slides.py pdf <deck/index.html> <out.pdf>
uv run --no-project --quiet --with colorspacious==1.1.2 --with numpy python plugins/graphe/skills/slides/scripts/slides.py palette "#6a1b6e,#e66100,#33bbee" [--ground "#ffffff"] [--room 0.3]
```

A web deck is checked and rendered in Chromium through Playwright; install it once with `uv run --no-project --with playwright==1.63.0 playwright install chromium`. `script` reads a web deck in the same browser; a `.pptx` or PDF needs none. `script` exits 1 for a `--wpm` of zero or less, and prints `No script on this slide.` for a slide with no notes. Run the script it writes through `_shared/prose_check.py` (exit 0 clean, 1 when skipped); the slide text and the script follow `_shared/plain-prose.md`.

`check` takes `--level` (default `AAA`), `--min-pt` (14), `--dense-words` (60) and `--title-words` (14). `render` takes `--renderer` (default `auto`) and `--dpi` (80) for a `.pptx` or PDF. `script` takes `--wpm` (140).

`check` exits 0 when every gate passed, 1 when the file is not a readable deck, and 2 on a blocker. On a web deck, `render` writes one PNG per slide at 1920x1080 with every fragment shown, one per slide on a 390px-wide phone, contact sheets of both, and the print PDF; `--renderer` and `--dpi` apply to a `.pptx` or PDF only. A `.pptx` is exported through PowerPoint when it is installed and LibreOffice otherwise. Give `render` a folder of its own: it refuses a non-empty folder it did not create. `script` prints the speaker notes as one Markdown script with the talk length; backup slides come after the talk and are left out of the length. `pptx` exports a web deck for PowerPoint: one 1920x1080 picture per slide with every fragment shown, the script in the speaker notes, and the slide's title kept in the title placeholder just above the slide for the outline and screen readers; `--images` also writes the PNGs. `pptx --editable` makes a deck you can edit in PowerPoint or Google Slides instead: native text boxes and tables placed where Chromium lays them out, figures and display equations as pictures with alt text, inline TeX as Unicode, decoration in the slide background, notes carried over. It reads a reveal.js deck or a custom deck of `section.slide` elements and lists the fonts to install where the deck is presented. `pdf` exports a web deck as a vector PDF: one page per slide with every fragment shown, selectable text and working links, from reveal.js's print layout printed by Chromium; `web-only` text is left out.

## What it checks

| Severity | Gate | Catches |
| --- | --- | --- |
| BLOCK | `phone-clip` | Content drawn past the slide's edge on a 390px or 360px-wide phone. |
| BLOCK | `no-title` | A slide with no heading (web) or no title placeholder (`.pptx`). |
| BLOCK | `contrast` | Text below 7:1, or 4.5:1 for large text (`--level AA` relaxes both). Web decks are measured with axe-core against each slide's own background. |
| BLOCK | `alt-text` | An image or figure with no text alternative. |
| BLOCK | `em-dash` | An em-dash in slide text. |
| BLOCK | `asset`, `script` | A web deck that cannot load a file it asks for, or logs a console error, including a value with no data behind it. |
| BLOCK | `contribution` | A web deck with no slide marked `data-contribution`, more than one, the marked slide after slide 5, or no script on it. Every talk states what was done and why this audience should care on that slide; `check` verifies where it is, and the agent checks the wording by hand. |
| BLOCK | `conclusion` | A web deck with no slide marked `data-conclusion`, more than one, or the marked slide anywhere but right before the closing slide. Every talk ends on a short conclusion: the main point restated as a claim, two to four results the talk showed, one or two open problems, and a script that ends "That's my talk." A title that is only `Conclusion` or `Summary` warns. |
| WARN | `dark-slides` | A web deck whose talk slides are mostly dark; title, closing and backup slides do not count, and a slide over a picture never counts as dark. `--allow-dark` is for a deck the presenter asked to be dark. |
| WARN | `small-text`, `overflow`, `nested-section`, `phone`, `motion`, `offline` | Text under 14pt; anything drawn past the slide's edge; a `<section>` inside slide content, which reveal.js shows as separate slides; text under 12px on a phone; animation that ignores reduced-motion settings; a deck that needs the network to present. |
| WARN | `unbound-data` | A value in the deck's data file that no slide or script binds; the file is published with the deck, so cut what no slide shows. |
| WARN | `font`, `no-notes`, `duplicate-title` | A font that will be substituted in PowerPoint or Google Slides (`.pptx`), talk slides with no script, titles a screen reader cannot tell apart. |
| REVIEW | `jargon` | A term from `--jargon` on a talk slide. |
| REVIEW | `footnotes` | A `class="footnote"` on more than half the talk slides. Footnotes are optional: keep one only when the room would miss it (a source behind a number, a term they need, a caveat on the figure). |
| REVIEW | `own-look` | A deck still wearing the starter's colours, a placeholder title illustration, or a title slide with no picture of its own. |
| REVIEW | `figures`, `dense`, `long-title` | Numbers and walls of text on talk slides (slide 1 and everything after a divider titled `Backup`, `Backup slides` or `Appendix`, or from `--backup-from`, are exempt), and headlines that stopped being headlines. |

The `pdf` export never carries speaker notes, even in a deck that sets reveal.js's `showNotes`.

A PDF deck gets the gates its text can answer, read with `pdftotext`. A figure that reads wrong is invisible to `check`. That is what `render` is for.

## The starter deck

`plugins/graphe/skills/slides/templates/web/` is a reveal.js 6.0.2 skeleton, not a look, that passes `check` with only `own-look` to review: title, agenda, what we did and why this audience should care, a claim whose figure builds step by step, a concrete case, a quick bet answered with dots, method steps, a related-work map and timeline, limits, a conclusion, Thank you, and backup slides that open with a discussion prompt for a quiet Q&amp;A. Copy the folder and open `index.html` in a browser; `S` opens the speaker view. Figures and related work are read from `data/deck-data.js`, so a repo can generate them from its results. A chapter rail and the agenda come from each slide's `data-chapter`. A slide binds a value with `data-value="results.failShare"` (add `data-format="pct"` for a share), draws a share as dots with `data-dots`, builds the related-work map from `data-source="related"`, and shows wording only when a result holds with `data-if` and `data-unless`. `data-notes` or an `<aside class="notes">` carries the script, `class="fragment"` builds a figure step by step, and `class="web-only"` text is hidden from a `.pptx` export. A key with no data behind it is a console error, which `check` blocks. On a phone the deck switches to a portrait scroll view.

`plugins/graphe/skills/slides/templates/pages.yml` publishes the deck folder to GitHub Pages. Its actions are pinned to the same commit SHAs as techne's own workflows, and `make guards` fails when they drift. A repository has one Pages site, but the site serves folders, so the skill recommends one public talks repo with a folder per talk, each at its own address; [ajbarea/talks](<https://github.com/ajbarea/talks>) is the worked example. The template is for a deck that must stay in a repo of its own.

## Testing it

`make test-unit` covers the `.pptx` gates against decks built in-test as minimal OOXML packages, and the web gates against copies of the starter deck in a real Chromium, each broken in one way: a missing heading, faint text, an image with no alt text, a missing file, a value with no data, an em-dash, a network font, a line wider than the slide, small text, motion that ignores reduced-motion settings, a slide with no script, and a conclusion slide that is missing, doubled, out of place or titled only "Conclusion". The look gates get the same treatment: a deck whose talk slides are mostly dark, read through every layer behind a slide; a deck that kept the starter's colours or has no title illustration; a chapter rail that loses its current state or its 44px touch target; and `palette`, which must reproduce two published scores. It also renders the starter and counts the slides, phone views and PDF pages, and reads the exported PDF text back with poppler, which CI installs. The editable export is tested on a custom deck fixture: text stays text with its formatting and place, lists keep native bullets, the table is native, figures and equations are pictures with alt text, and the background holds no glyphs; each slide is then opened in PowerPoint or LibreOffice and compared with the browser's picture of it. A machine without Chromium sets `TECHNE_NO_BROWSER=1` to say so, one without poppler sets `TECHNE_NO_POPPLER=1`, and one with neither PowerPoint nor LibreOffice sets `TECHNE_NO_OFFICE=1`; otherwise the suite fails rather than skipping those cases.

## Full instructions

[`SKILL.md` on GitHub](<https://github.com/ajbarea/techne/blob/main/plugins/graphe/skills/slides/SKILL.md>) holds the full instructions Claude follows for this skill.
