Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Generate professional slide deck images from content with 9 visual style presets and configurable slide counts.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
SKILL.md
1---2name: baoyu-slide-deck3description: Generates professional slide deck images from content. Creates outlines with style instructions, then generates individual slide images. Use when user asks to "create slides", "make a presentation", "generate deck", "slide deck", or "PPT".4version: 1.56.25metadata:6openclaw:7homepage: https://github.com/JimLiu/baoyu-skills#baoyu-slide-deck8requires:9anyBins:10- bun11- npx12---1314# Slide Deck Generator1516Transform content into professional slide deck images. The deck is designed for **reading and sharing** (self-explanatory slides, logical scroll flow, social-media-friendly) rather than live presentation — that assumption drives every layout and density decision below.1718## User Input Tools1920When this skill prompts the user, follow this tool-selection rule (priority order):21221. **Prefer built-in user-input tools** exposed by the current agent runtime — e.g., `AskUserQuestion`, `request_user_input`, `clarify`, `ask_user`, or any equivalent.232. **Fallback**: if no such tool exists, emit a numbered plain-text message and ask the user to reply with the chosen number/answer for each question.243. **Batching**: if the tool supports multiple questions per call, combine all applicable questions into a single call; if only single-question, ask them one at a time in priority order.2526Concrete `AskUserQuestion` references below are examples — substitute the local equivalent in other runtimes.2728## Image Generation Tools2930When this skill needs to render an image, resolve the backend in this order:31321. **Current-request override** — if the user names a specific backend in the current message, use it.332. **Saved preference** — if `EXTEND.md` sets `preferred_image_backend` to a backend available right now, use it.343. **Auto-select** (when the preference is `auto`, unset, or the pinned backend isn't available):35- If the current runtime exposes a native image tool (e.g., Codex `imagegen`, Hermes `image_generate`), use it. Runtime-native tools are preferred by default — agents that know their own tool inventory should surface the native one here.36- Otherwise, if exactly one non-native backend is installed (e.g., `baoyu-imagine`), use it.37- Otherwise (multiple non-native backends with no runtime-native tool), ask the user once — batch with any other initial questions.384. **If none are available**, tell the user and ask how to proceed.3940Setting `preferred_image_backend: ask` forces the step-3 prompt every run regardless of available backends. Users change the pinned backend via the `## Changing Preferences` section below.4142**Prompt file requirement (hard)**: write each image's full, final prompt to a standalone file under `prompts/` (naming: `NN-slide-[slug].md`) BEFORE invoking any backend. The file is the reproducibility record and lets you switch backends without regenerating prompts.4344Concrete tool names (`imagegen`, `image_generate`, `baoyu-imagine`) above are examples — substitute the local equivalents under the same rule.4546## Confirmation Policy4748Default behavior: **confirm before generation**.4950- Treat explicit skill invocation, a file path, matched signals/presets, and `EXTEND.md` defaults as **recommendation inputs only**. None of them authorizes skipping confirmation.51- Do **not** start Step 3 or later until the user completes Step 2.52- Skip confirmation only when the current request explicitly says to do so, for example: "直接生成", "不用确认", "跳过确认", "按默认出幻灯片", or equivalent wording.53- If confirmation is skipped explicitly, state the assumed style / audience / slide-count / language / backend in the next user-facing update before generating.5455## Language5657Respond in the user's language across questions, progress reports, error messages, and the completion summary. Keep technical tokens (style names, file paths, code) in English.5859## Script Directory6061`{baseDir}` = this SKILL.md's directory. Resolve `${BUN_X}`: prefer `bun`; else `npx -y bun`; else suggest `brew install oven-sh/bun/bun`.6263| Script | Purpose |64|--------|---------|65| `scripts/merge-to-pptx.ts` | Merge slides into PowerPoint |66| `scripts/merge-to-pdf.ts` | Merge slides into PDF |6768## Options6970| Option | Description |71|--------|-------------|72| `--style <name>` | Preset (see Presets below), `custom`, or custom style name |73| `--audience <type>` | beginners / intermediate / experts / executives / general |74| `--lang <code>` | Output language (en, zh, ja, ...) |75| `--slides <N>` | Target slide count (8-25 recommended, max 30) |76| `--ref <files...>` | Reference images applied per slide (style / palette / composition / subject) |77| `--outline-only` | Stop after outline |78| `--prompts-only` | Stop after prompts (skip image generation) |79| `--images-only` | Skip to Step 7; requires existing `prompts/` |80| `--regenerate <N>` | Regenerate specific slide(s): `3` or `2,5,8` |8182## Style System838417 presets covering technical / educational / lifestyle / editorial use cases. Every preset is a combination of four dimensions (texture / mood / typography / density). If the user picks "Custom dimensions" in Round 1, Round 2 of the confirmation asks one question per dimension — options and verbatim copy live in `references/confirmation.md`.8586### Presets (17)8788| Preset | Dimensions | Best For |89|--------|------------|----------|90| `blueprint` (Default) | grid + cool + technical + balanced | Architecture, system design |91| `chalkboard` | organic + warm + handwritten + balanced | Education, tutorials |92| `corporate` | clean + professional + geometric + balanced | Investor decks, proposals |93| `minimal` | clean + neutral + geometric + minimal | Executive briefings |94| `sketch-notes` | organic + warm + handwritten + balanced | Educational, tutorials |95| `hand-drawn-edu` | organic + macaron + handwritten + balanced | Educational diagrams, process explainers |96| `watercolor` | organic + warm + humanist + minimal | Lifestyle, wellness |97| `dark-atmospheric` | clean + dark + editorial + balanced | Entertainment, gaming |98| `notion` | clean + neutral + geometric + dense | Product demos, SaaS |99| `bold-editorial` | clean + vibrant + editorial + balanced | Product launches, keynotes |100| `editorial-infographic` | clean + cool + editorial + dense | Tech explainers, research |101| `fantasy-animation` | organic + vibrant + handwritten + minimal | Educational storytelling |102| `intuition-machine` | clean + cool + technical + dense | Technical docs, academic |103| `pixel-art` | pixel + vibrant + technical + balanced | Gaming, developer talks |104| `scientific` | clean + cool + technical + dense | Biology, chemistry, medical |105| `vector-illustration` | clean + vibrant + humanist + balanced | Creative, children's content |106| `vintage` | paper + warm + editorial + balanced | Historical, heritage |107108Per-preset specs: `references/styles/<preset>.md`. Preset → dimension mapping: `references/dimensions/presets.md`.109110### Dimensions (when "Custom dimensions" picked)111112| Dimension | Options | Purpose |113|-----------|---------|---------|114| **Texture** | clean, grid, organic, pixel, paper | Background treatment |115| **Mood** | professional, warm, cool, vibrant, dark, neutral, macaron | Color temperature |116| **Typography** | geometric, humanist, handwritten, editorial, technical | Headline/body styling |117| **Density** | minimal, balanced, dense | Information per slide |118119Full per-dimension specs: `references/dimensions/*.md`.120121### Auto-Selection122123Match content signals to a preset. Pick the first row whose signal keywords appear in the source; fall back to `blueprint` if nothing matches.124125| Signals in source | Preset |126|-------------------|--------|127| tutorial, learn, education, guide, beginner | `sketch-notes` |128| hand-drawn, infographic, diagram, process, onboarding | `hand-drawn-edu` |129| classroom, teaching, school, chalkboard | `chalkboard` |130| architecture, system, data, analysis, technical | `blueprint` |131| creative, children, kids, cute | `vector-illustration` |132| briefing, academic, research, bilingual | `intuition-machine` |133| executive, minimal, clean, simple | `minimal` |134| saas, product, dashboard, metrics | `notion` |135| investor, quarterly, business, corporate | `corporate` |136| launch, marketing, keynote, magazine | `bold-editorial` |137| entertainment, music, gaming, atmospheric | `dark-atmospheric` |138| explainer, journalism, science communication | `editorial-infographic` |139| story, fantasy, animation, magical | `fantasy-animation` |140| gaming, retro, pixel, developer | `pixel-art` |141| biology, chemistry, medical, scientific | `scientific` |142| history, heritage, vintage, expedition | `vintage` |143| lifestyle, wellness, travel, artistic | `watercolor` |144145### Slide Count Heuristic146147| Source length | Recommended slides |148|---------------|--------------------|149| < 1000 words | 5-10 |150| 1000-3000 words | 10-18 |151| 3000-5000 words | 15-25 |152| > 5000 words | 20-30 (consider splitting) |153154## Reference Images155156Users may supply reference images to guide style, palette, layout, or subject.157158**Intake**: Accept via `--ref <files...>` or when the user provides file paths / pastes images in conversation.159- File path → copy to `{slide-deck-dir}/refs/NN-ref-{slug}.{ext}`160- Pasted image with no path → ask for the path, or extract style traits verbally as a text fallback161162**Usage modes** (per reference):163164| Usage | Effect |165|-------|--------|166| `direct` | Pass the file to the backend as a reference image for each slide |167| `style` | Extract style traits (line treatment, texture, mood) and append to every slide's prompt body |168| `palette` | Extract hex colors and append to every slide's prompt body |169170Record refs in each slide's prompt frontmatter:171172```yaml173references:174- ref_id: 01175filename: 01-ref-brand.png176usage: direct177```178179At generation time, verify files exist. If `usage: direct` and the backend accepts refs (e.g., `baoyu-imagine --ref`), pass the file on every slide. Otherwise embed extracted `style`/`palette` traits in the prompt text.180181## File Layout182183```184slide-deck/{topic-slug}/185├── source-{slug}.{ext}186├── outline.md187├── prompts/NN-slide-{slug}.md188├── NN-slide-{slug}.png189├── {topic-slug}.pptx190└── {topic-slug}.pdf191```192193**Slug**: 2-4 words, kebab-case, extracted from topic. "Introduction to Machine Learning" → `intro-machine-learning`.194195**Backup rule** (applies across steps): if a file about to be written already exists, rename it to `<name>-backup-YYYYMMDD-HHMMSS.<ext>` before writing the new one. This protects user edits and enables rollback.196197## Workflow198199Copy this checklist and check off items as you complete them:200201```202- [ ] Step 1: Setup & analyze203- [ ] Step 2: Confirmation ⚠️ REQUIRED (Round 1; Round 2 only if "Custom dimensions")204- [ ] Step 3: Generate outline205- [ ] Step 4: Review outline (conditional)206- [ ] Step 5: Generate prompts207- [ ] Step 6: Review prompts (conditional)208- [ ] Step 7: Generate images209- [ ] Step 8: Merge to PPTX/PDF210- [ ] Step 9: Output summary211```212213### Step 1: Setup & Analyze214215**1.1 Load EXTEND.md** — check these paths in order; first hit wins:216217| Path | Scope |218|------|-------|219| `.baoyu-skills/baoyu-slide-deck/EXTEND.md` | Project |220| `${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-slide-deck/EXTEND.md` | XDG |221| `$HOME/.baoyu-skills/baoyu-slide-deck/EXTEND.md` | User home |222223If found, read, parse, and print a summary (style / audience / language / review). If not, proceed with defaults — first-time setup is not blocking for this skill. Schema: `references/config/preferences-schema.md`.224225**1.2 Analyze content** — follow `references/analysis-framework.md`: classify content, detect language, note signals for style selection, estimate slide count from length (see the **Slide Count Heuristic** in Style System above), generate topic slug. Save source as `source.md` (honor backup rule if one exists).226227**1.3 Check existing output** ⚠️ REQUIRED before Step 2. If `slide-deck/{topic-slug}/` exists, ask how to proceed — four options (regenerate outline / regenerate images / backup and regenerate / exit), verbatim copy in `references/confirmation.md`.228229Save findings to `analysis.md`: topic, audience, signals, recommended style and slide count, language detection.230231### Step 2: Confirmation ⚠️ REQUIRED232233**Hard gate**: this step is mandatory per the [Confirmation Policy](#confirmation-policy) — Steps 3+ cannot start until the user confirms here (or explicitly opts out with "直接生成" / equivalent wording in the current request).234235**Round 1 (always)** — batch five questions in one `AskUserQuestion` call: style, audience, slide count, review-outline?, review-prompts?. Verbatim options in `references/confirmation.md`.236237Summary displayed before the questions:238- Content type + topic239- Detected language240- Recommended style (based on signals)241- Recommended slide count (based on length)242243**Round 2 (only if "Custom dimensions" in Round 1)** — batch four questions: texture, mood, typography, density. Verbatim options in `references/confirmation.md`. The four answers replace the preset.244245**After confirmation**: update `analysis.md` with final choices and store `skip_outline_review` / `skip_prompt_review` flags from Q4/Q5.246247### Step 3: Generate Outline248249Resolve style: preset → `references/styles/{preset}.md`; custom dimensions → combine files in `references/dimensions/`. Build `STYLE_INSTRUCTIONS` from the resolved style, apply confirmed audience + language + slide count, follow `references/outline-template.md`, and save as `outline.md`.250251Stop here if `--outline-only`. Skip Step 4 if `skip_outline_review`.252253### Step 4: Review Outline (Conditional)254255Display a slide-by-slide table (`# | Title | Type | Layout`) along with total count and resolved style. Ask: proceed / edit outline first / regenerate — verbatim in `references/confirmation.md`.256257On "Edit outline first", tell the user to edit `outline.md` and ask again when ready. On "Regenerate outline", return to Step 3.258259### Step 5: Generate Prompts260261For each slide in outline:2621. Read `references/base-prompt.md`2632. Extract `STYLE_INSTRUCTIONS` from the outline (don't re-read the style file)2643. Add the slide's content2654. If a `Layout:` is specified, include guidance from `references/layouts.md`2665. Save to `prompts/NN-slide-{slug}.md` (backup rule applies)267268Stop here if `--prompts-only`. Skip Step 6 if `skip_prompt_review`.269270### Step 6: Review Prompts (Conditional)271272Display the prompts index (`# | Filename | Slide Title`) and ask: proceed / edit prompts first / regenerate — verbatim in `references/confirmation.md`. Branches mirror Step 4.273274### Step 7: Generate Images2752761. Resolve the image backend via the Image Generation Tools rule at the top — ask once if multiple are installed.2772. Confirm every `prompts/NN-slide-{slug}.md` exists (hard requirement; prompt files are the reproducibility record regardless of backend).2783. Session ID: `slides-{topic-slug}-{timestamp}` — pass to the backend only if it supports sessions.2794. For each slide: generate sequentially, reusing the session ID. Backup rule applies to PNG files. Report progress as `Generated X/N`. Auto-retry once on failure before reporting an error.280281`--regenerate N` jumps to this step for the named slides only. `--images-only` starts here with existing prompts.282283### Step 8: Merge284285```bash286${BUN_X} {baseDir}/scripts/merge-to-pptx.ts <slide-deck-dir>287${BUN_X} {baseDir}/scripts/merge-to-pdf.ts <slide-deck-dir>288```289290### Step 9: Summary291292```293Slide Deck Complete!294Topic: [topic]295Style: [preset or "custom: texture+mood+typography+density"]296Location: [directory]297Slides: N298299- 01-slide-cover.png300- ...301- NN-slide-back-cover.png302303Outline: outline.md304PPTX: {topic-slug}.pptx305PDF: {topic-slug}.pdf306```307308## Slide Modification309310| Action | How |311|--------|-----|312| Edit | Update `prompts/NN-slide-{slug}.md` **first**, then `--regenerate N` |313| Add | Create new prompt at position, generate image, renumber subsequent `NN` (slugs unchanged), update `outline.md`, re-merge |314| Delete | Remove PNG + prompt, renumber subsequent, update `outline.md`, re-merge |315316Always update the prompt file before regenerating the image — this keeps the prompts directory as the source of truth and makes changes reproducible. Only `NN` changes on renumber; slugs stay stable so references remain valid.317318See `references/modification-guide.md` for full details.319320## References321322| File | Content |323|------|---------|324| `references/confirmation.md` | Verbatim AskUserQuestion option copy for every confirmation |325| `references/analysis-framework.md` | Content analysis framework |326| `references/outline-template.md` | Outline structure |327| `references/base-prompt.md` | Base prompt body for image generation |328| `references/layouts.md` | Layout options |329| `references/design-guidelines.md` | Audience, typography, color selection |330| `references/content-rules.md` | Content guidelines |331| `references/modification-guide.md` | Edit/add/delete workflows |332| `references/styles/<preset>.md` | Per-preset specifications |333| `references/dimensions/*.md` | Per-dimension specifications |334| `references/config/preferences-schema.md` | EXTEND.md schema |335336## Notes337338- Image generation takes ~10-30s per slide; report progress between them.339- For sensitive public figures, prefer stylized alternatives to avoid likeness issues.340- Maintain visual consistency via the session ID when the backend supports it.341342## Changing Preferences343344EXTEND.md lives at the first matching path listed in Step 1.1. Two ways to change it:345346- **Edit directly** — open EXTEND.md and change fields. Full schema: `references/config/preferences-schema.md`.347- **Common one-line edits**:348- `preferred_image_backend: auto` — default; runtime-native tool wins, falls back to the only installed backend, asks only if multiple non-native are present.349- `preferred_image_backend: codex-imagegen` — pin to Codex's built-in.350- `preferred_image_backend: baoyu-imagine` — pin to the baoyu-imagine skill.351- `preferred_image_backend: ask` — confirm backend every run.352- `preferred_style: blueprint`, `preferred_audience: experts`, `language: zh`.353