Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ This skill uses **progressive disclosure** — the main `SKILL.md` is a concise
| `scripts/extract-pptx.py` | PPT content extraction | Phase 4 (conversion) |
| `scripts/deploy.sh` | Deploy to Vercel | Phase 6 (sharing) |
| `scripts/export-pdf.sh` | Export slides to PDF | Phase 6 (sharing) |
| `scripts/export-pptx.sh` | Export to editable PPTX | Phase 6 (sharing) |

This design follows [OpenAI's harness engineering](https://openai.com/index/harness-engineering/) principle: "give the agent a map, not a 1,000-page instruction manual."

Expand Down Expand Up @@ -164,12 +165,25 @@ bash scripts/export-pdf.sh ./presentation.html ./output.pdf

Uses [Playwright](https://playwright.dev) to screenshot each slide at 1920×1080 and combine into a PDF. Installs automatically if needed. Animations are not preserved (it's a static snapshot).

### Export to editable PPTX

Convert your slides to a native, editable PowerPoint file — for venues that require `.pptx`, for collaborators who want to edit text directly, or for repurposing slides in other decks:

```bash
bash scripts/export-pptx.sh ./my-deck/index.html
bash scripts/export-pptx.sh ./presentation.html ./output.pptx
```

Uses [Playwright](https://playwright.dev) + [dom-to-pptx](https://github.com/atharva9167/dom-to-pptx) to map each `.slide`'s computed styles to native PowerPoint shapes: text frames, vector gradients, real shadows, embedded images. Animations are not preserved.

Unlike PDF export this is **not a screenshot** — every text run remains directly editable in PowerPoint, Keynote, Google Slides, and WPS.

## Requirements

- [Claude Code](https://claude.ai/claude-code) CLI
- For PPT conversion: Python with `python-pptx` library
- For URL deployment: Node.js + Vercel account (free)
- For PDF export: Node.js (Playwright installs automatically)
- For PDF and PPTX export: Node.js (Playwright + dom-to-pptx install automatically)

## Credits

Expand Down
51 changes: 49 additions & 2 deletions SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,14 @@ When converting PowerPoint files:

## Phase 6: Share & Export (Optional)

After delivery, **ask the user:** _"Would you like to share this presentation? I can deploy it to a live URL (works on any device including phones) or export it as a PDF."_
After delivery, **ask the user:** _"Would you like to share this presentation? I can deploy it to a live URL (works on any device including phones), export it as a PDF, or export it as an editable PowerPoint file."_

Options:

- **Deploy to URL** — Shareable link that works on any device
- **Export to PDF** — Universal file for email, Slack, print
- **Both**
- **Export to PPTX** — Editable native PowerPoint file (text, gradients, images all editable)
- **Multiple**
- **No thanks**

If the user declines, stop here. If they choose one or both, proceed below.
Expand Down Expand Up @@ -307,6 +308,51 @@ This captures each slide as a screenshot and combines them into a PDF. Perfect f
```
This renders at 1280×720 instead of 1920×1080, typically cutting file size by 50-70% with minimal visual difference.

### 6C: Export to PPTX (Editable PowerPoint)

This produces a **native, editable** `.pptx` file — every text run is a real PowerPoint text frame; CSS gradients become vector SVGs; CSS box-shadows become real PowerPoint shadows; images embed as picture shapes. Useful when:

- The user has to upload to a conference / venue laptop that only supports PowerPoint
- The user wants to tweak text right before presenting without going back to HTML
- The user wants to repurpose individual slides in a different deck

PDF and PPTX answer different needs — PDF is a frozen snapshot anyone can read, PPTX stays editable. Offer both when relevant.

1. **Run the export script:**

```bash
bash scripts/export-pptx.sh <path-to-html> [output.pptx]
```

If no output path is given, the PPTX is saved next to the HTML file.

2. **What happens behind the scenes** (explain briefly to the user):
- A headless browser opens the presentation at 1920×1080 (16:9 widescreen, which maps cleanly to PowerPoint's 13.33"×7.5" canvas)
- The script injects [dom-to-pptx](https://github.com/atharva9167/dom-to-pptx) into the page
- For every `.slide` element, it reads the **computed style** of each descendant — bounding rect, color, font, gradient, shadow — and maps it to a native PowerPoint shape
- The result is a fully editable `.pptx` (open in PowerPoint, Keynote, Google Slides, WPS)
- Animations are not preserved (PPTX export is a static snapshot of the final visual state)

3. **If the install step fails:**
- First run downloads Playwright + Chromium + dom-to-pptx (~150 MB). Allow 30–60 seconds.
- On second-run failures, try: `npm install -g dom-to-pptx playwright && npx playwright install chromium`

4. **Deliver the PPTX** — The script auto-opens it. Tell the user:
- The file location and size
- That text is **directly editable** in PowerPoint/Keynote (click any text and type)
- That this is a one-way export — if they edit HTML again, they need to re-export
- The PPTX can be uploaded to Google Slides, projector laptops, etc.

**⚠ PPTX export gotchas:**

- **PPTX is a layout-from-computed-styles export, not a screenshot.** This is its main advantage (editable!) but also its biggest gotcha: dom-to-pptx maps each DOM element to a PowerPoint shape using `getBoundingClientRect()`. Decks that present cleanly to humans but rely on deeply nested flexbox / grid centering with `100vh` height inheritance may produce slides where only some content survives. **For maximum fidelity, structure each `.slide` as a fixed 1920×1080 absolute-positioned canvas.** The skill's default `viewport-base.css` works for most cases; if a slide comes out missing shapes, switch its children from flex/grid to `position: absolute` with explicit px coordinates.
- **First run is slow.** The script installs Playwright, dom-to-pptx, and downloads a Chromium browser (~150MB) into a temp directory. This happens once per run. Warn the user it may take 30-60 seconds the first time — subsequent exports within the same session are faster.
- **Slides must use `class="slide"`.** Same as PDF export — the script finds slides by `.slide`. All decks generated by this skill use it.
- **Animations / `.reveal` opacity tricks are auto-revealed before export.** The script force-shows every `.reveal` element so off-screen content is included. If the user uses a custom class for hidden-until-revealed, document that or open an issue.
- **CSS background-image gradients work; raster background-images may not.** Gradients are parsed and rendered as vector SVG. `background-image: url(...)` rasters are best avoided — use `<img>` tags so dom-to-pptx can place them as picture shapes.
- **Fonts:** the script tries to embed used fonts so the PPTX renders identically off the original machine. If a Google Fonts URL is CORS-blocked, PowerPoint falls back to Arial; add `crossorigin="anonymous"` to the `<link rel="stylesheet">` tag if this happens.
- **Large decks can produce 10MB+ PPTX files.** Each embedded image is stored at full resolution. If size matters, downscale images before referencing them.

---

## Supporting Files
Expand All @@ -320,3 +366,4 @@ This captures each slide as a screenshot and combines them into a PDF. Perfect f
| [scripts/extract-pptx.py](scripts/extract-pptx.py) | Python script for PPT content extraction | Phase 4 (conversion) |
| [scripts/deploy.sh](scripts/deploy.sh) | Deploy slides to Vercel for instant sharing | Phase 6 (sharing) |
| [scripts/export-pdf.sh](scripts/export-pdf.sh) | Export slides to PDF | Phase 6 (sharing) |
| [scripts/export-pptx.sh](scripts/export-pptx.sh) | Export slides to editable PPTX (native shapes, not screenshots) | Phase 6 (sharing) |
Loading