Home / All Skills / Design & Motion / baoyu-slide-deck
Design & Motion · JimLiu/baoyu-skills

baoyu-slide-deck

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".

L4 High-Privilege · Graded auth & full auditV1 Commit-PinnedExecute CommandNetwork AccessWrite FileDual-pass Audit
Author JimLiuGitHub JimLiu/baoyu-skills ↗Stars 25926License MIT(仓库根 LICENSE:Copyright (c) 2026 Jim Liu;根 package.json 同声明 "license": "MIT")Commit 1567581c26
Control levels describe skill capabilities and suggested control measures; they do not represent quality or safety certifications, nor do they dictate usability. Usage decisions rest entirely with users and administrators. Different agent hosts apply varying constraints; do not assume hosts provide automatic protection. Third-party skill copyrights belong to their original authors. Use at your own risk.

1How It Works & Mechanism

It operates as a phased pipeline: Analysis → Mandatory Confirmation → Outline → Prompts → Image Generation → PPTX/PDF Merging. Artifacts at each stage are saved to disk, supporting resumable execution via flags like --outline-only / --prompts-only / --images-only.

skills/baoyu-slide-deck/SKILL.md
- [ ] Step 7: Generate images
The checklist-style workflow is defined in SKILL.md for the agent to check off; there is no implicit state between stages, as all progress is bridged via disk files (outline.md / prompts/ / PNG / pptx / pdf).

Image generation backends are not implemented directly in this repository, but resolved by priority: Current request specification > EXTEND.md preferences > Runtime native tools (Codex imagegen / Cursor GenerateImage / Hermes image_generate) > Only installed non-native backend (baoyu-image-gen) > Prompt the user.

skills/baoyu-slide-deck/SKILL.md
If a skill named `imagegen` is listed, you are running inside Codex and MUST use it
Design purpose: Decouples 'who generates the image' to the runtime environment, while the skill only defines the resolution order and calling contract; consequently, user content and prompts are sent to the selected image backend.

When following the codex-imagegen branch, it prioritizes routing via the repository's sibling baoyu-image-gen skill script rather than calling the wrapper directly.

skills/baoyu-slide-deck/SKILL.md
route through `baoyu-image-gen --provider codex-cli` (preferred)
The wrapper's calling contract (parameters, stdout JSON, error codes, n=1 semantics) is separately documented in references/codex-imagegen.md and loaded on demand.

Prompt files serve as rigid, reproducible records: Before invoking any backend, the complete final prompt for each slide must first be saved to prompts/NN-slide-[slug].md.

skills/baoyu-slide-deck/SKILL.md
**Prompt file requirement (hard)**: write each image's full, final prompt to a standalone file under `prompts/`
Benefits: Switching backends requires no prompt rewriting, and regenerating only requires modifying the file and running --regenerate; the PPTX merge script also writes this prompt into the speaker notes.

Merging is the only executable code in this repository and is strictly local: merge-to-pdf.ts embeds images page-by-page using pdf-lib, while merge-to-pptx.ts uses pptxgenjs to output 16:9 slides with base-prompt + per-page prompts embedded into the notes.

skills/baoyu-slide-deck/scripts/merge-to-pptx.ts
pptx.layout = "LAYOUT_16x9";
Neither script accesses the network, reads environment variables, or spawns child processes; images are embedded into the PPTX as base64 data URIs, making the deck fully self-contained.

Confirmation is a hard gate: Step 3 and subsequent steps must not be entered if Step 2 is incomplete, unless the user explicitly stated 'generate directly / no confirmation needed' in the current turn.

skills/baoyu-slide-deck/SKILL.md
Do **not** start Step 3 or later until the user completes Step 2.
Explicit skill invocations, matched styles, and EXTEND.md default values are all demoted to mere suggested inputs and grant no authority to bypass confirmation.

Style system = 17 presets × 4 dimensions (texture/mood/typography/density) with free combination; automatically selected when content signals match the keyword table, otherwise falling back to blueprint.

skills/baoyu-slide-deck/SKILL.md
17 presets covering technical / educational / lifestyle / editorial use cases.
Each preset has a references/styles/<preset>.md file, and each dimension has references/dimensions/*.md; selection rules and page count heuristics are tabulated in SKILL.md.

Batch image generation follows a strict priority: Backend native batch > Runtime parallel tool calls (default 4, overridable via --batch-size) > Serial; furthermore, 'all prompt files must be saved to disk' before the first batch may begin.

skills/baoyu-slide-deck/SKILL.md
- Never start the first batch until all selected slide prompt files exist on disk.
Failures retry only the failed items once without regenerating successful ones; merging must wait until all slide images are fully generated.

2Core Capabilities

01Generate complete slide image decks from articles/topics (including cover and back cover)
0217 preset styles + 4-dimensional customization (texture/mood/typography/density)
03Automatic style selection based on content signals + recommended page count based on text length (<1000 words → 5-10 pages ... >5000 words → 20-30 pages)
04Three reference image usage modes (direct passthrough / style extraction / palette extraction)
05Optional review branching for outlines and prompts (skip_outline_review / skip_prompt_review)
06Batch parallel image generation (default 4, configurable via --batch-size, clamped between 1-8) and failure retries
07Local merging into PPTX / PDF (preserving per-page prompts in speaker notes)
08Image modification discipline: update the prompt file first, then run --regenerate on specified pages; text patching on already generated bitmap images is strictly forbidden

3External Dependencies

KindDependency / Endpoint
api运行时图像生成后端(Codex imagegen Skill / Cursor GenerateImage / Hermes image_generate)——用户内容与提示词由此出网
clicodex CLI(无原生 imagegen 时的 codex exec 后端,需 codex login)
clibaoyu-image-gen 技能脚本(--provider codex-cli,首选路径)
clibun / npx -y bun(跑合并脚本与包装器)
packagepdf-lib ^1.17.1(PDF 合并)
packagepptxgenjs ^4.0.1(PPTX 合并,声明于仓库根 package.json)
packagesharp ^0.34.5(根依赖,两个合并脚本均未 import)
networkhomepage 元数据 URL(静态 frontmatter,任何步骤都不抓取)

4Recommended Governance & Evidence

Suggested Controls for Safe Operation
For Agent Runtime
Graded/per-use authorization, sandbox recommended
For Administrators
Approval workflow, rollback support, full audit
Evidence & Triggers (File Paths & Excerpts)
  • scripts/: Execute local script or command: ${BUN_X} {baseDir}/scripts/merge-to-pptx.ts <slide-deck-dir> (bun or npx -y b
  • 网络端点: Declare external network access: The skill's own scripts make zero network calls (both merge scripts only import fs/path + pdf-lib / pptxgenjs)
  • 本地工作目录: File read/write and artifact output: slide-deck/{topic-slug}/source-*.{ext} and analysis.md
Audit Notes: According to the Batch 4 final adjudication standard (sending user content to an external generative backend = Orange), this skill demonstrates this in two aspects: (1) [Explicitly names runtime generative backends] SKILL.md's 'Image Generation Tools' section explicitly enumerates Codex `imagegen` ('If a skill named `imagegen` is listed, you are running inside Codex and MUST use it'), the codex-imagegen route ('route through `baoyu-image-gen --provider codex-cli` (preferred)'), Cursor `GenerateImage`, and Hermes `image_generate`, with references/codex-imagegen.md further specifying calling contracts; as a result, user materials and per-page prompts (including reference images passed directly via --ref) exit the network to third-party models and consume account quota, matching the site's Orange assessment for ai-image-generation. (2) [Local disk writes] prompts/NN-*.md, PNG, outline.md, analysis.md, PPTX/PDF, and EXTEND.md are all written to the user's directory. Why not Yellow: The outbound traffic is not read-only queries to fixed public endpoints, but sending user content into generative services. Why not Red: No reverse engineering, no spoofing, no security downgrades (no sandbox disabling instructions), no credential harvesting (explicitly does not read OPENAI_API_KEY), and its own scripts are strictly limited to local PDF/PPTX merging and disk writing.

5Second-Pass Verification

  • [ok] 两个合并脚本无网络、无 env、无 spawn — merge-to-pdf.ts 只 import fs/path + pdf-lib,merge-to-pptx.ts 只 import fs/path + pptxgenjs;全目录 grep process.env/fetch/http/child_process 零命中。
  • [ok] 出图后端解析阶梯与 SKILL.md 一致 — 阶梯为 当前请求 > EXTEND.md preferred_image_backend > 运行时原生(imagegen/GenerateImage/image_generate)> 唯一非原生后端 > 问用户;codex-imagegen 分支的调用契约在 references/codex-imagegen.md。
  • [ok] 不读 API key(认证走用户订阅) — codex-imagegen.md 明写 'no `OPENAI_API_KEY` is read or sent';脚本零 env 读取,唯一的 env 覆盖是 $BAOYU_CODEX_IMAGEGEN_BIN(后端可执行文件路径)。
  • [ok] prompt 文件先行是硬要求 — SKILL.md 标注 (hard),且合并脚本把 base-prompt + 每页 prompt 写进 PPTX 备注,形成可复现双通道。
  • [ok] 依赖与声明一致性 — pdf-lib/pptxgenjs 由仓库根 package.json 提供(skill 内无 package.json);根依赖 sharp 未被这两个脚本 import(属未使用依赖)。
  • [ok] EXTEND.md 路径文档不一致(轻微) — SKILL.md 列三条路径(含 XDG),references/config/preferences-schema.md 只列项目与家目录两条;另 slide-deck 的首次设置明确不阻塞(与 translate/xhs-images 相反),已在正文引用中如实标注。
  • [ok] base-prompt.md 的模型定向指令 — 文件结尾确有 'Please use nano banana pro to generate the slide image based on the content provided above.' 与 'DO NOT refuse to generate' 类措辞;因它把用户文本与模型指令混在同一通道,已写入 injection_surface 与 risks。
  • [ok] 档位复核(批4 终裁) — 按 Main『生成後端類先例=orange』与点名后端+素材出网的判法落 orange;自身脚本仅有本地 pdf/pptx 合并与写盘,不升红。

6Verdict & Scenarios

  • Turns 'reproducibility' into a hard constraint: prompt files written upfront + backup renaming + speaker notes containing prompts, eliminating the need to rewrite prompts when changing backends.
  • Backend-agnostic design, usable across hosts (dedicated branches for Codex / Cursor / Claude Code without hardcoding models).
  • Comprehensive style system: 17 presets + 4 dimensions + selection keyword tables + page count heuristics, organized across small, specialized reference files.
  • Explicit anti-cutting-corners discipline: forbids using SVG/HTML to substitute for bitmaps, forbids overlaying text onto generated images, and permits only cropping/compression post-processing.
  • Balanced interaction with checkpoints and escapes: requires confirmation by default, but supports --outline-only / --prompts-only / --images-only / --regenerate to keep the process controllable and resumable.
  • Best for: Ideal for content creators and technical or business presenters looking to quickly transform long-form content or topics into shareable slide decks: those who require unified styles, local archiving, and reproducible prompts, need to produce consistent visual decks without dedicated design resources, and accept delegating image generation to external services.
    Not for: Not suitable for environments where outbound data transfer is prohibited or subject to strict compliance requirements; not suitable for cases requiring editable native PPTs (outputs are image-based slides with uneditable text); not suitable for formal business presentations requiring exact typography/precise text (generative models may produce flawed text, and policy forbids post-hoc text patching); and not suitable for environments lacking an available image backend (will halt at the user prompt stage).
    Install Agent-Ready
    ① Verified Mirror 2026-09-15
    Option A · Direct DownloadDownload baoyu-slide-deck.tar.gz
    sha256: 9867805610b81b26…
    Option B · Copy Guide for Agent
    install.json
    Agents automatically download and verify mirrors from this JSON guide.
    ② Upstream GitHub
    GitHub Repo ↗
    Pinned to commit 1567581c26.