---
id: daily-slides
name: "slides"
url: https://skills.yangsir.net/skill/daily-slides
author: openai
domain: content-creation
tags: ["content-creation", "presentation", "automation"]
install_count: 589
rating: 4.20 (20 reviews)
github: https://github.com/openai/skills
---

# slides

> 使用JavaScript代码生成PowerPoint幻灯片，支持数据驱动和批量创建

**Stats**: 589 installs · 4.2/5 (20 reviews)

## Before / After 对比

### 幻灯片批量生成

**Before**:

PowerPoint模板限制多，手动调整繁琐，每次更新数据都要重新设计页面，设计团队往往需要花费大量时间在基础布局调整上。

**After**:

使用JavaScript代码直接生成幻灯片，数据驱动自动更新页面，保持设计一致性，支持批量生成报表，大幅减少重复劳动。

| Metric | Before | After | Change |
|---|---|---|---|
| 幻灯片生成时间 | 120分钟 | 20分钟 | -83% |

## Readme

# slides

# Slides

## Overview

Use PptxGenJS for slide authoring. Do not use `python-pptx` for deck generation unless the task is inspection-only; keep editable output in JavaScript and deliver both the `.pptx` and the source `.js`.

Keep work in a task-local directory. Only copy final artifacts to the requested destination after rendering and validation pass.

## Bundled Resources

- `assets/pptxgenjs_helpers/`: Copy this folder into the deck workspace and import it locally instead of reimplementing helper logic.

- `scripts/render_slides.py`: Rasterize a `.pptx` or `.pdf` to per-slide PNGs.

- `scripts/slides_test.py`: Detect content that overflows the slide canvas.

- `scripts/create_montage.py`: Build a contact-sheet style montage of rendered slides.

- `scripts/detect_font.py`: Report missing or substituted fonts as LibreOffice resolves them.

- `scripts/ensure_raster_image.py`: Convert SVG/EMF/HEIC/PDF-like assets into PNGs for quick inspection.

- `references/pptxgenjs-helpers.md`: Load only when you need API details or dependency notes.

## Workflow

- Inspect the request and determine whether you are creating a new deck, recreating an existing deck, or editing one.

- Set the slide size up front. Default to 16:9 (`LAYOUT_WIDE`) unless the source material clearly uses another aspect ratio.

- Copy `assets/pptxgenjs_helpers/` into the working directory and import the helpers from there.

- Build the deck in JavaScript with an explicit theme font, stable spacing, and editable PowerPoint-native elements when practical.

- Run the bundled scripts from this skill directory or copy the needed ones into the task workspace. Render the result with `render_slides.py`, review the PNGs, and fix layout issues before delivery.

- Run `slides_test.py` for overflow checks when slide edges are tight or the deck is dense.

- Deliver the `.pptx`, the authoring `.js`, and any generated assets that are required to rebuild the deck.

## Authoring Rules

- Set theme fonts explicitly. Do not rely on PowerPoint defaults if typography matters.

- Use `autoFontSize`, `calcTextBox`, and related helpers to size text boxes; do not use PptxGenJS `fit` or `autoFit`.

- Use bullet options, not literal `•` characters.

- Use `imageSizingCrop` or `imageSizingContain` instead of PptxGenJS built-in image sizing.

- Use `latexToSvgDataUri()` for equations and `codeToRuns()` for syntax-highlighted code blocks.

- Prefer native PowerPoint charts for simple bar/line/pie/histogram style visuals so reviewers can edit them later.

- For charts or diagrams that PptxGenJS cannot express well, render SVG externally and place the SVG in the slide.

- Include both `warnIfSlideHasOverlaps(slide, pptx)` and `warnIfSlideElementsOutOfBounds(slide, pptx)` in the submitted JavaScript whenever you generate or substantially edit slides.

- Fix all unintentional overlap and out-of-bounds warnings before delivering. If an overlap is intentional, leave a short code comment near the relevant element.

## Recreate Or Edit Existing Slides

- Render the source deck or reference PDF first so you can compare slide geometry visually.

- Match the original aspect ratio before rebuilding layout.

- Preserve editability where possible: text should stay text, and simple charts should stay native charts.

- If a reference slide uses raster artwork, use `ensure_raster_image.py` to generate debug PNGs from vector or odd image formats before placing them.

## Validation Commands

Examples below assume you copied the needed scripts into the working directory. If not, invoke the same script paths relative to this skill folder.

```
# Render slides to PNGs for review
python3 scripts/render_slides.py deck.pptx --output_dir rendered

# Build a montage for quick scanning
python3 scripts/create_montage.py --input_dir rendered --output_file montage.png

# Check for overflow beyond the original slide canvas
python3 scripts/slides_test.py deck.pptx

# Detect missing or substituted fonts
python3 scripts/detect_font.py deck.pptx --json

```

Load `references/pptxgenjs-helpers.md` if you need the helper API summary or dependency details.
Weekly Installs251Repository[openai/skills](https://github.com/openai/skills)GitHub Stars15.3KFirst SeenMar 5, 2026Security Audits[Gen Agent Trust HubPass](/openai/skills/slides/security/agent-trust-hub)[SocketPass](/openai/skills/slides/security/socket)[SnykPass](/openai/skills/slides/security/snyk)Installed oncodex232opencode222gemini-cli221cursor220github-copilot220kimi-cli219

---
*Source: https://skills.yangsir.net/skill/daily-slides*
*Markdown mirror: https://skills.yangsir.net/api/skill/daily-slides/markdown*