PPT生成
- 作者仓库星标 21,713
- 叉子 2,492
- 作者更新于 2026年6月13日 05:00
- 作者仓库 baoyu-skills
- 领域
- 通用
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 92 / 100 · 已通过审计
- 作者 / 版本 / 许可
- @JimLiu · v1.117.4 · 未声明 license
- Token 消耗评级
- 较高消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- macOS · Linux · Windows
- 底层运行要求
- Bun
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: baoyu-slide-deck
description: Generates professional slide deck images from content. Creates outlines with style instructions…
category: 通用
runtime: Bun
---
# baoyu-slide-deck 输出预览
## PART A: 任务判断
- 适用问题:通用任务拆解、检查和交付。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“User Input Tools / Image Generation Tools / Batch Generation Policy”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于通用任务拆解、检查和交付,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“User Input Tools / Image Generation Tools / Batch Generation Policy”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令。
先用一个小任务确认它会围绕“User Input Tools / Image Generation Tools / Batch Generation Policy”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: baoyu-slide-deck
description: Generates professional slide deck images from content. Creates outlines with style instructions…
category: 通用
source: JimLiu/baoyu-skills
---
# baoyu-slide-deck
## 什么时候使用
- 一段内容自动生成专业幻灯片图片——版式、文字层级、配色一并完成 适合处理通用任务拆解、检查、交付和复盘,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步骤;通常…
- 面向通用任务拆解、检查和交付,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「User Input Tools / Image Generation Tools / Batch Generation Policy」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "baoyu-slide-deck" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> User Input Tools / Image Generation Tools / Batch Generation Policy
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> Bun | 读取文件、写入/修改文件、执行终端命令 | 主要在本地完成
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} 幻灯片生成器
将内容转换为专业的幻灯片图像。幻灯片设计用于「阅读和分享」(自解释幻灯片、逻辑滚动流、社交媒体友好),而非现场演示——这一假设驱动了以下所有布局和密度决策。
用户输入工具
当此技能提示用户时,请遵循此工具选择规则(优先级顺序):
- 优先使用当前 Agent 运行时公开的内置用户输入工具——例如
AskUserQuestion、request_user_input、clarify、ask_user或任何等效工具。 - 回退方案:如果不存在此类工具,则发出带编号的纯文本消息,并要求用户回复所选编号/答案以回答每个问题。
- 批处理:如果工具支持每次调用多个问题,则将所有适用问题合并到一次调用中;如果只支持单个问题,则按优先级顺序逐个提问。
下面具体的 AskUserQuestion 引用是示例——在其他运行时中请替换为本地等效工具。
图像生成工具
当此技能需要渲染图像时,请按此顺序解析后端:
- 当前请求覆盖——如果用户在当前消息中指定了特定后端,则使用该后端。
- 已保存偏好——如果
EXTEND.md将preferred_image_backend设置为当前可用的后端,则使用该后端。 - 自动选择(当偏好为
auto、未设置或固定后端不可用时):- Codex (
imagegen)——首先,检查您可用的技能/工具清单。如果列出了名为imagegen的技能,则您正在 Codex 内部运行,并且「必须」使用它:通过Skill工具调用,skill: "imagegen",传递已保存的提示文件内容(以及 Codeximagegen自身参数指定的输出路径和宽高比)。Codeximagegen是该运行时中的官方光栅后端,其优先级高于任何非原生技能(例如baoyu-imagine),除非用户已明确固定了不同的preferred_image_backend。 - 其他运行时原生工具——如果运行时公开了不同的原生图像工具(例如 Hermes
image_generate),则以相同方式使用它。 - 否则,如果只安装了一个非原生后端(例如
baoyu-imagine),则使用它。 - 否则(多个非原生后端且没有运行时原生工具),询问用户一次——与其他初始问题一起批处理。
- Codex (
- 如果均不可用,请告知用户并询问如何继续。
⛔ 绝不要用 SVG、HTML、canvas 或其他基于代码的渲染来替代光栅图像生成。 Codex imagegen 自己的描述指出,它应该用于“当输出应该是位图资产而不是仓库原生代码或矢量时”。如果您无法通过步骤 3 解析光栅后端,请跳到步骤 4 并询问用户——「不要」静默输出 SVG、写入内联 <svg> 标记或生成 HTML/CSS 艺术作为替代。即使文章/部分看起来“像图表”也适用:调用此规则的消费者技能已经决定它需要光栅图像。
设置 preferred_image_backend: ask 会强制每次运行都进行步骤 3 提示,无论可用后端如何。用户通过下面「## 更改偏好设置」部分更改固定后端。
提示文件要求(硬性):在调用任何后端之前,将每个图像的完整、最终提示写入 prompts/ 下的独立文件(命名:NN-slide-[slug].md)。该文件是可重现性记录,允许您在不重新生成提示的情况下切换后端。
上面具体的工具名称(imagegen、image_generate、baoyu-imagine)是示例——请根据相同规则替换为本地等效工具。
确认策略
默认行为:「生成前确认」。
- 将明确的技能调用、文件路径、匹配的信号/预设以及
EXTEND.md默认值视为「仅推荐输入」。它们都不能授权跳过确认。 - 在用户完成步骤 2 之前,「不要」开始步骤 3 或更晚的步骤。
- 仅当当前请求明确表示跳过确认时才跳过,例如:“直接生成”、“不用确认”、“跳过确认”、“按默认出幻灯片”或等效措辞。
- 如果明确跳过确认,请在生成前在下一次面向用户的更新中说明假定的样式/受众/幻灯片数量/语言/后端。
语言
在问题、进度报告、错误消息和完成摘要中,以用户的语言进行响应。技术标记(样式名称、文件路径、代码)保持英文。
脚本目录
{baseDir} = 此 SKILL.md 的目录。解析 ${BUN_X}:优先使用 bun;否则 npx -y bun;否则建议 brew install oven-sh/bun/bun。
| 脚本 | 用途 |
|---|---|
scripts/merge-to-pptx.ts |
将幻灯片合并到 PowerPoint |
scripts/merge-to-pdf.ts |
将幻灯片合并到 PDF |
选项
| 选项 | 描述 |
|---|---|
--style <name> |
预设(见下文预设)、custom 或自定义样式名称 |
--audience <type> |
beginners / intermediate / experts / executives / general |
--lang <code> |
输出语言 (en, zh, ja, ...) |
--slides <N> |
目标幻灯片数量(推荐 8-25 张,最多 30 张) |
--ref <files...> |
每张幻灯片应用的参考图像(样式/调色板/构图/主题) |
--outline-only |
仅在生成大纲后停止 |
--prompts-only |
仅在生成提示后停止(跳过图像生成) |
--images-only |
跳到步骤 7;需要现有的 prompts/ |
--regenerate <N> |
重新生成特定幻灯片:3 或 2,5,8 |
样式系统
17 种预设涵盖技术/教育/生活方式/编辑用例。每个预设都是四个维度(纹理/情绪/排版/密度)的组合。如果用户在第一轮选择“自定义维度”,则确认的第二轮会针对每个维度提出一个问题——选项和逐字副本位于 references/confirmation.md 中。
预设 (17)
| 预设 | 维度 | 最适合 |
|---|---|---|
blueprint (默认) |
grid + cool + technical + balanced | 架构、系统设计 |
chalkboard |
organic + warm + handwritten + balanced | 教育、教程 |
corporate |
clean + professional + geometric + balanced | 投资者演示、提案 |
minimal |
clean + neutral + geometric + minimal | 高管简报 |
sketch-notes |
organic + warm + handwritten + balanced | 教育、教程 |
hand-drawn-edu |
organic + macaron + handwritten + balanced | 教育图表、流程说明 |
watercolor |
organic + warm + humanist + minimal | 生活方式、健康 |
dark-atmospheric |
clean + dark + editorial + balanced | 娱乐、游戏 |
notion |
clean + neutral + geometric + dense | 产品演示、SaaS |
bold-editorial |
clean + vibrant + editorial + balanced | 产品发布、主题演讲 |
editorial-infographic |
clean + cool + editorial + dense | 技术说明、研究 |
fantasy-animation |
organic + vibrant + handwritten + minimal | 教育故事讲述 |
intuition-machine |
clean + cool + technical + dense | 技术文档、学术 |
pixel-art |
pixel + vibrant + technical + balanced | 游戏、开发者演讲 |
scientific |
clean + cool + technical + dense | 生物学、化学、医学 |
vector-illustration |
clean + vibrant + humanist + balanced | 创意、儿童内容 |
vintage |
paper + warm + editorial + balanced | 历史、遗产 |
每个预设的规格:references/styles/<preset>.md。预设 → 维度映射:references/dimensions/presets.md。
维度(选择“自定义维度”时)
| 维度 | 选项 | 用途 |
|---|---|---|
| Texture | clean, grid, organic, pixel, paper | 背景处理 |
| Mood | professional, warm, cool, vibrant, dark, neutral, macaron | 色温 |
| Typography | geometric, humanist, handwritten, editorial, technical | 标题/正文样式 |
| Density | minimal, balanced, dense | 每张幻灯片的信息量 |
完整的每个维度规格:references/dimensions/*.md。
自动选择
将内容信号与预设匹配。选择源中出现信号关键字的第一行;如果没有匹配,则回退到 blueprint。
| 源中的信号 | 预设 |
|---|---|
| tutorial, learn, education, guide, beginner | sketch-notes |
| hand-drawn, infographic, diagram, process, onboarding | hand-drawn-edu |
| classroom, teaching, school, chalkboard | chalkboard |
| architecture, system, data, analysis, technical | blueprint |
| creative, children, kids, cute | vector-illustration |
| briefing, academic, research, bilingual | intuition-machine |
| executive, minimal, clean, simple | minimal |
| saas, product, dashboard, metrics | notion |
| investor, quarterly, business, corporate | corporate |
| launch, marketing, keynote, magazine | bold-editorial |
| entertainment, music, gaming, atmospheric | dark-atmospheric |
| explainer, journalism, science communication | editorial-infographic |
| story, fantasy, animation, magical | fantasy-animation |
| gaming, retro, pixel, developer | pixel-art |
| biology, chemistry, medical, scientific | scientific |
| history, heritage, vintage, expedition | vintage |
| lifestyle, wellness, travel, artistic | watercolor |
幻灯片数量启发式
| 源长度 | 推荐幻灯片数量 |
|---|---|
| < 1000 字 | 5-10 |
| 1000-3000 字 | 10-18 |
| 3000-5000 字 | 15-25 |
| > 5000 字 | 20-30(考虑拆分) |
参考图像
用户可以提供参考图像来指导样式、调色板、布局或主题。
摄取:通过 --ref <files...> 或用户在对话中提供文件路径/粘贴图像来接受。
- 文件路径 → 复制到
{slide-deck-dir}/refs/NN-ref-{slug}.{ext} - 没有路径的粘贴图像 → 要求提供路径,或口头提取样式特征作为文本回退
使用模式(每个参考):
| 用途 | 效果 |
|---|---|
direct |
将文件作为参考图像传递给后端,用于每张幻灯片 |
style |
提取样式特征(线条处理、纹理、情绪)并附加到每张幻灯片的提示正文 |
palette |
提取十六进制颜色并附加到每张幻灯片的提示正文 |
在每张幻灯片的提示前置内容中记录参考:
references:
- ref_id: 01
filename: 01-ref-brand.png
usage: direct
生成时,验证文件是否存在。如果 usage: direct 且后端接受参考(例如 baoyu-imagine --ref),则在每张幻灯片上传递文件。否则,将提取的 style/palette 特征嵌入到提示文本中。
文件布局
slide-deck/{topic-slug}/
├── source-{slug}.{ext}
├── outline.md
├── prompts/NN-slide-{slug}.md
├── NN-slide-{slug}.png
├── {topic-slug}.pptx
└── {topic-slug}.pdf
Slug:2-4 个单词,kebab-case,从主题中提取。“Introduction to Machine Learning” → intro-machine-learning。
备份规则(适用于所有步骤):如果即将写入的文件已存在,则在写入新文件之前将其重命名为 <name>-backup-YYYYMMDD-HHMMSS.<ext>。这可以保护用户编辑并支持回滚。
工作流程
复制此清单并在完成时勾选项目:
- [ ] 步骤 1:设置与分析
- [ ] 步骤 2:确认 ⚠️ 必需(第一轮;第二轮仅在“自定义维度”时)
- [ ] 步骤 3:生成大纲
- [ ] 步骤 4:审查大纲(有条件)
- [ ] 步骤 5:生成提示
- [ ] 步骤 6:审查提示(有条件)
- [ ] 步骤 7:生成图像
- [ ] 步骤 8:合并到 PPTX/PDF
- [ ] 步骤 9:输出摘要
步骤 1:设置与分析
1.1 加载 EXTEND.md——按顺序检查这些路径;第一个匹配的路径获胜:
| 路径 | 范围 |
|---|---|
.baoyu-skills/baoyu-slide-deck/EXTEND.md |
项目 |
${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-slide-deck/EXTEND.md |
XDG |
$HOME/.baoyu-skills/baoyu-slide-deck/EXTEND.md |
用户主目录 |
如果找到,读取、解析并打印摘要(样式/受众/语言/审查)。如果未找到,则使用默认值继续——首次设置对此技能不构成障碍。Schema:references/config/preferences-schema.md。
1.2 分析内容——遵循 references/analysis-framework.md:分类内容,检测语言,注意样式选择信号,根据长度估算幻灯片数量(参见上面样式系统中的「幻灯片数量启发式」),生成主题 slug。将源保存为 source.md(如果存在,请遵守备份规则)。
1.3 检查现有输出 ⚠️ 步骤 2 之前必需。如果 slide-deck/{topic-slug}/ 存在,询问如何继续——四个选项(重新生成大纲/重新生成图像/备份并重新生成/退出),逐字副本在 references/confirmation.md 中。
将发现保存到 analysis.md:主题、受众、信号、推荐样式和幻灯片数量、语言检测。
2:确认 ⚠️ 必需
硬性门槛:根据确认策略,此步骤是强制性的——步骤 3+ 无法开始,直到用户在此处确认(或在当前请求中明确选择“直接生成”/等效措辞)。
第一轮(始终)——在一个 AskUserQuestion 调用中批处理五个问题:样式、受众、幻灯片数量、审查大纲?、审查提示?。逐字选项在 references/confirmation.md 中。
问题前显示的摘要:
- 内容类型 + 主题
- 检测到的语言
- 推荐样式(基于信号)
- 推荐幻灯片数量(基于长度)
第二轮(仅当第一轮选择“自定义维度”时)——批处理四个问题:纹理、情绪、排版、密度。逐字选项在 references/confirmation.md 中。这四个答案将替换预设。
确认后:使用最终选择更新 analysis.md,并存储来自 Q4/Q5 的 skip_outline_review / skip_prompt_review 标志。
步骤 3:生成大纲
解析样式:预设 → references/styles/{preset}.md;自定义维度 → 组合 references/dimensions/ 中的文件。根据解析的样式构建 STYLE_INSTRUCTIONS,应用已确认的受众 + 语言 + 幻灯片数量,遵循 references/outline-template.md,并保存为 outline.md。
如果 --outline-only,则在此处停止。如果 skip_outline_review,则跳过步骤 4。
步骤 4:审查大纲(有条件)
显示逐张幻灯片的表格(# | 标题 | 类型 | 布局)以及总数和已解析的样式。询问:继续/先编辑大纲/重新生成——逐字副本在 references/confirmation.md 中。
选择“先编辑大纲”时,告知用户编辑 outline.md 并在准备好后再次询问。选择“重新生成大纲”时,返回步骤 3。
步骤 5:生成提示
对于大纲中的每张幻灯片:
- 读取
references/base-prompt.md - 从大纲中提取
STYLE_INSTRUCTIONS(不要重新读取样式文件) - 添加幻灯片内容
- 如果指定了
Layout:,则包含references/layouts.md中的指导 - 保存到
prompts/NN-slide-{slug}.md(适用备份规则)
如果 --prompts-only,则在此处停止。如果 skip_prompt_review,则跳过步骤 6。
步骤 6:审查提示(有条件)
显示提示索引(# | 文件名 | 幻灯片标题)并询问:继续/先编辑提示/重新生成——逐字副本在 references/confirmation.md 中。分支镜像步骤 4。
步骤 7:生成图像
- 通过顶部的图像生成工具规则解析图像后端——如果安装了多个,则询问一次。
- 确认每个
prompts/NN-slide-{slug}.md都存在(硬性要求;提示文件是可重现性记录,无论后端如何)。 - 会话 ID:
slides-{topic-slug}-{timestamp}——仅当后端支持会话时才传递给后端。 - 对于每张幻灯片:按顺序生成,重用会话 ID。备份规则适用于 PNG 文件。报告进度为
已生成 X/N。在报告错误之前自动重试一次。
--regenerate N 仅针对指定幻灯片跳转到此步骤。--images-only 从此处开始,使用现有提示。
步骤 8:合并
${BUN_X} {baseDir}/scripts/merge-to-pptx.ts <slide-deck-dir>
${BUN_X} {baseDir}/scripts/merge-to-pdf.ts <slide-deck-dir>
步骤 9:摘要
幻灯片制作完成!
主题:[主题]
样式:[预设或“自定义:纹理+情绪+排版+密度”]
位置:[目录]
幻灯片数量:N
- 01-slide-cover.png
- ...
- NN-slide-back-cover.png
大纲:outline.md
PPTX:{topic-slug}.pptx
PDF:{topic-slug}.pdf
幻灯片修改
| 操作 | 如何操作 |
|---|---|
| 编辑 | 首先更新 prompts/NN-slide-{slug}.md,然后 --regenerate N |
| 添加 | 在指定位置创建新提示,生成图像,重新编号后续的 NN(slug 不变),更新 outline.md,重新合并 |
| 删除 | 删除 PNG + 提示,重新编号后续,更新 outline.md,重新合并 |
在重新生成图像之前,务必更新提示文件——这使得提示目录成为事实的来源,并使更改可重现。重新编号时只有 NN 更改;slug 保持稳定,以便引用仍然有效。
有关完整详细信息,请参阅 references/modification-guide.md。
参考资料
| 文件 | 内容 |
|---|---|
references/confirmation.md |
每个确认的 AskUserQuestion 选项的逐字副本 |
references/analysis-framework.md |
内容分析框架 |
references/outline-template.md |
大纲结构 |
references/base-prompt.md |
图像生成的基本提示正文 |
references/layouts.md |
布局选项 |
references/design-guidelines.md |
受众、排版、颜色选择 |
references/content-rules.md |
内容指南 |
references/modification-guide.md |
编辑/添加/删除工作流程 |
references/styles/<preset>.md |
每个预设的规格 |
references/dimensions/*.md |
每个维度的规格 |
references/config/preferences-schema.md |
EXTEND.md 模式 |
注意事项
- 图像生成每张幻灯片大约需要 10-30 秒;在它们之间报告进度。
- 对于敏感的公众人物,优先选择风格化的替代方案,以避免肖像权问题。
- 当后端支持时,通过会话 ID 保持视觉一致性。
更改偏好设置
EXTEND.md 位于步骤 1.1 中列出的第一个匹配路径。有两种方法可以更改它:
- 直接编辑——打开 EXTEND.md 并更改字段。完整模式:
references/config/preferences-schema.md。 - 常见的一行编辑:
preferred_image_backend: auto——默认;运行时原生工具获胜,回退到唯一安装的后端,仅当存在多个非原生后端时才询问。preferred_image_backend: codex-imagegen——固定到 Codex 的内置工具。preferred_image_backend: baoyu-imagine——固定到 baoyu-imagine 技能。preferred_image_backend: ask——每次运行都确认后端。preferred_style: blueprint、preferred_audience: experts、language: zh。
Slide Deck Generator
Transform 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.
User Input Tools
When this skill prompts the user, follow this tool-selection rule (priority order):
- Prefer built-in user-input tools exposed by the current agent runtime — e.g.,
AskUserQuestion,request_user_input,clarify,ask_user, or any equivalent. - 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.
- 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.
Concrete AskUserQuestion references below are examples — substitute the local equivalent in other runtimes.
Image Generation Tools
When this skill needs to render an image, resolve the backend in this order:
- Current-request override — if the user names a specific backend in the current message, use it.
- Saved preference — if
EXTEND.mdsetspreferred_image_backendto a backend available right now, use it. - Auto-select (when the preference is
auto, unset, or the pinned backend isn't available):- Codex (
imagegen) — first, inspect your available-skills / tool inventory. If a skill namedimagegenis listed, you are running inside Codex and MUST use it: invoke via theSkilltool withskill: "imagegen", passing the saved prompt file's content (plus output path and aspect ratio per Codeximagegen's own args). Codeximagegenis the official raster backend in that runtime and outranks any non-native skill (e.g.,baoyu-image-gen) unless the user has explicitly pinned a differentpreferred_image_backend. - Codex via
codex exec(codex-imagegen) — if the current runtime exposes no nativeimagegenskill but thecodexCLI is onPATHwith an activecodex login, route throughbaoyu-image-gen --provider codex-cli(preferred), or — if baoyu-image-gen is unavailable — invoke the bundled wrapper directly. Details, parameters, and the runtime-discovery procedure live in references/codex-imagegen.md — load that file only when this branch is selected. - Cursor (
GenerateImage) — if the runtime exposes a nativeGenerateImagetool, you are running inside Cursor and it outranks any non-native skill the same way Codeximagegendoes. Two hard caveats: (a) it has no aspect-ratio parameter — state the target aspect ratio / dimensions explicitly in the prompt text passed asdescription; (b) it does not accept an output directory — it saves to a tool-managed location, so after generation copy/move the file to the skill's expected output path (e.g.,outputs/.../NN-xxx.png). Reference images go inreference_image_paths. - Other runtime-native tools — if the runtime exposes a different native image tool (e.g., Hermes
image_generate), use it the same way. - Otherwise, if exactly one non-native backend is installed (e.g.,
baoyu-image-gen), use it. - Otherwise (multiple non-native backends with no runtime-native tool), ask the user once — batch with any other initial questions.
- Codex (
- If none are available, tell the user and ask how to proceed.
⛔ Never substitute SVG, HTML, canvas, or other code-based rendering for raster image generation. Codex imagegen's own description says it should be used "when the output should be a bitmap asset rather than repo-native code or vector." If you cannot resolve a raster backend via step 3, fall through to step 4 and ask the user — do not silently emit SVG, write inline <svg> markup, or produce HTML/CSS art as a substitute. This applies even if the article/section seems "diagram-like": the consumer skill calling this rule has already decided that a raster image is what it needs.
⛔ Never repair rendered text by painting over a generated bitmap. Do not use ImageMagick, Pillow, Canvas, SVG, HTML/CSS, OCR scripts, or any other programmatic overlay to cover, rewrite, erase, stroke, or replace slide titles, bullets, or any other text inside an already generated slide image. If text is wrong or unclear, regenerate from a corrected prompt, simplify the slide's on-image text, or ask the user which imperfect candidate to keep.
Setting 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.
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.
Concrete tool names (imagegen, GenerateImage, image_generate, baoyu-image-gen) above are examples — substitute the local equivalents under the same rule.
Batch Generation Policy
After every prompt file for the current generation group has been saved and verified, generate slide images in batches by default.
Priority order:
- Use the chosen backend's native batch / multi-task interface if it exists. Each task must keep its own prompt file, output path, aspect ratio, session ID, and direct reference images.
- If no native batch interface exists but the runtime can issue parallel tool calls, dispatch up to
generation_batch_sizeslide images at a time. Default:4. An explicit user request in the current message, such as--batch-size 4or "并行4张一起生成", overrides EXTEND.md. - If neither native batch nor parallel tool calls are available, generate sequentially.
Rules:
- Never start the first batch until all selected slide prompt files exist on disk.
- Retry failed items once without regenerating successful items.
- Do not use subagents merely to parallelize image rendering. Use subagents only for separate prompt iteration or creative exploration.
- Merge PPTX/PDF only after all selected slide images are generated.
Confirmation Policy
Default behavior: confirm before generation.
- Treat explicit skill invocation, a file path, matched signals/presets, and
EXTEND.mddefaults as recommendation inputs only. None of them authorizes skipping confirmation. - Do not start Step 3 or later until the user completes Step 2.
- Skip confirmation only when the current request explicitly says to do so, for example: "直接生成", "不用确认", "跳过确认", "按默认出幻灯片", or equivalent wording.
- If confirmation is skipped explicitly, state the assumed style / audience / slide-count / language / backend in the next user-facing update before generating.
Language
Respond 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.
Script Directory
{baseDir} = this SKILL.md's directory. Resolve ${BUN_X}: prefer bun; else npx -y bun; else suggest brew install oven-sh/bun/bun.
| Script | Purpose |
|---|---|
scripts/merge-to-pptx.ts |
Merge slides into PowerPoint |
scripts/merge-to-pdf.ts |
Merge slides into PDF |
Options
| Option | Description |
|---|---|
--style <name> |
Preset (see Presets below), custom, or custom style name |
--audience <type> |
beginners / intermediate / experts / executives / general |
--lang <code> |
Output language (en, zh, ja, ...) |
--slides <N> |
Target slide count (8-25 recommended, max 30) |
--ref <files...> |
Reference images applied per slide (style / palette / composition / subject) |
--batch-size <n> |
Temporary slide image generation batch size for this run. Default: generation_batch_size from EXTEND.md, otherwise 4. Clamp to 1-8. |
--outline-only |
Stop after outline |
--prompts-only |
Stop after prompts (skip image generation) |
--images-only |
Skip to Step 7; requires existing prompts/ |
--regenerate <N> |
Regenerate specific slide(s): 3 or 2,5,8 |
Style System
17 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.
Presets (17)
| Preset | Dimensions | Best For |
|---|---|---|
blueprint (Default) |
grid + cool + technical + balanced | Architecture, system design |
chalkboard |
organic + warm + handwritten + balanced | Education, tutorials |
corporate |
clean + professional + geometric + balanced | Investor decks, proposals |
minimal |
clean + neutral + geometric + minimal | Executive briefings |
sketch-notes |
organic + warm + handwritten + balanced | Educational, tutorials |
hand-drawn-edu |
organic + macaron + handwritten + balanced | Educational diagrams, process explainers |
watercolor |
organic + warm + humanist + minimal | Lifestyle, wellness |
dark-atmospheric |
clean + dark + editorial + balanced | Entertainment, gaming |
notion |
clean + neutral + geometric + dense | Product demos, SaaS |
bold-editorial |
clean + vibrant + editorial + balanced | Product launches, keynotes |
editorial-infographic |
clean + cool + editorial + dense | Tech explainers, research |
fantasy-animation |
organic + vibrant + handwritten + minimal | Educational storytelling |
intuition-machine |
clean + cool + technical + dense | Technical docs, academic |
pixel-art |
pixel + vibrant + technical + balanced | Gaming, developer talks |
scientific |
clean + cool + technical + dense | Biology, chemistry, medical |
vector-illustration |
clean + vibrant + humanist + balanced | Creative, children's content |
vintage |
paper + warm + editorial + balanced | Historical, heritage |
Per-preset specs: references/styles/<preset>.md. Preset → dimension mapping: references/dimensions/presets.md.
Dimensions (when "Custom dimensions" picked)
| Dimension | Options | Purpose |
|---|---|---|
| Texture | clean, grid, organic, pixel, paper | Background treatment |
| Mood | professional, warm, cool, vibrant, dark, neutral, macaron | Color temperature |
| Typography | geometric, humanist, handwritten, editorial, technical | Headline/body styling |
| Density | minimal, balanced, dense | Information per slide |
Full per-dimension specs: references/dimensions/*.md.
Auto-Selection
Match content signals to a preset. Pick the first row whose signal keywords appear in the source; fall back to blueprint if nothing matches.
| Signals in source | Preset |
|---|---|
| tutorial, learn, education, guide, beginner | sketch-notes |
| hand-drawn, infographic, diagram, process, onboarding | hand-drawn-edu |
| classroom, teaching, school, chalkboard | chalkboard |
| architecture, system, data, analysis, technical | blueprint |
| creative, children, kids, cute | vector-illustration |
| briefing, academic, research, bilingual | intuition-machine |
| executive, minimal, clean, simple | minimal |
| saas, product, dashboard, metrics | notion |
| investor, quarterly, business, corporate | corporate |
| launch, marketing, keynote, magazine | bold-editorial |
| entertainment, music, gaming, atmospheric | dark-atmospheric |
| explainer, journalism, science communication | editorial-infographic |
| story, fantasy, animation, magical | fantasy-animation |
| gaming, retro, pixel, developer | pixel-art |
| biology, chemistry, medical, scientific | scientific |
| history, heritage, vintage, expedition | vintage |
| lifestyle, wellness, travel, artistic | watercolor |
Slide Count Heuristic
| Source length | Recommended slides |
|---|---|
| < 1000 words | 5-10 |
| 1000-3000 words | 10-18 |
| 3000-5000 words | 15-25 |
| > 5000 words | 20-30 (consider splitting) |
Reference Images
Users may supply reference images to guide style, palette, layout, or subject.
Intake: Accept via --ref <files...> or when the user provides file paths / pastes images in conversation.
- File path → copy to
{slide-deck-dir}/refs/NN-ref-{slug}.{ext} - Pasted image with no path → ask for the path, or extract style traits verbally as a text fallback
Usage modes (per reference):
| Usage | Effect |
|---|---|
direct |
Pass the file to the backend as a reference image for each slide |
style |
Extract style traits (line treatment, texture, mood) and append to every slide's prompt body |
palette |
Extract hex colors and append to every slide's prompt body |
Record refs in each slide's prompt frontmatter:
references:
- ref_id: 01
filename: 01-ref-brand.png
usage: direct
At generation time, verify files exist. If usage: direct and the backend accepts refs (e.g., baoyu-image-gen --ref), pass the file on every slide. Otherwise embed extracted style/palette traits in the prompt text.
File Layout
slide-deck/{topic-slug}/
├── source-{slug}.{ext}
├── outline.md
├── prompts/NN-slide-{slug}.md
├── NN-slide-{slug}.png
├── {topic-slug}.pptx
└── {topic-slug}.pdf
Slug: 2-4 words, kebab-case, extracted from topic. "Introduction to Machine Learning" → intro-machine-learning.
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.
Workflow
Copy this checklist and check off items as you complete them:
- [ ] Step 1: Setup & analyze
- [ ] Step 2: Confirmation ⚠️ REQUIRED (Round 1; Round 2 only if "Custom dimensions")
- [ ] Step 3: Generate outline
- [ ] Step 4: Review outline (conditional)
- [ ] Step 5: Generate prompts
- [ ] Step 6: Review prompts (conditional)
- [ ] Step 7: Generate images
- [ ] Step 8: Merge to PPTX/PDF
- [ ] Step 9: Output summary
Step 1: Setup & Analyze
1.1 Load EXTEND.md — check these paths in order; first hit wins:
| Path | Scope |
|---|---|
.baoyu-skills/baoyu-slide-deck/EXTEND.md |
Project |
${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-slide-deck/EXTEND.md |
XDG |
$HOME/.baoyu-skills/baoyu-slide-deck/EXTEND.md |
User home |
If found, read, parse, and print a summary (style / audience / language / review / generation batch size). If not, proceed with defaults — first-time setup is not blocking for this skill. Schema: references/config/preferences-schema.md.
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).
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.
Save findings to analysis.md: topic, audience, signals, recommended style and slide count, language detection.
Step 2: Confirmation ⚠️ REQUIRED
Hard gate: this step is mandatory per the Confirmation Policy — Steps 3+ cannot start until the user confirms here (or explicitly opts out with "直接生成" / equivalent wording in the current request).
Round 1 (always) — batch five questions in one AskUserQuestion call: style, audience, slide count, review-outline?, review-prompts?. Verbatim options in references/confirmation.md.
Summary displayed before the questions:
- Content type + topic
- Detected language
- Recommended style (based on signals)
- Recommended slide count (based on length)
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.
After confirmation: update analysis.md with final choices and store skip_outline_review / skip_prompt_review flags from Q4/Q5.
Step 3: Generate Outline
Resolve 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.
Stop here if --outline-only. Skip Step 4 if skip_outline_review.
Step 4: Review Outline (Conditional)
Display 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.
On "Edit outline first", tell the user to edit outline.md and ask again when ready. On "Regenerate outline", return to Step 3.
Step 5: Generate Prompts
For each slide in outline:
- Read
references/base-prompt.md - Extract
STYLE_INSTRUCTIONSfrom the outline (don't re-read the style file) - Add the slide's content
- If a
Layout:is specified, include guidance fromreferences/layouts.md - Save to
prompts/NN-slide-{slug}.md(backup rule applies)
Stop here if --prompts-only. Skip Step 6 if skip_prompt_review.
Step 6: Review Prompts (Conditional)
Display the prompts index (# | Filename | Slide Title) and ask: proceed / edit prompts first / regenerate — verbatim in references/confirmation.md. Branches mirror Step 4.
Step 7: Generate Images
- Resolve the image backend via the Image Generation Tools rule at the top — ask once if multiple are installed.
codex-imagegeninvocation: when the rule resolves tocodex-imagegen, see references/codex-imagegen.md for the invocation contract (preferredbaoyu-image-gen --provider codex-clipath, runtime wrapper discovery, parameter notes, stdout schema, batch semantics — n=1 per call so slide batches must dispatch one wrapper call per slide).
- Confirm every
prompts/NN-slide-{slug}.mdexists (hard requirement; prompt files are the reproducibility record regardless of backend). - Session ID:
slides-{topic-slug}-{timestamp}— pass to the backend only if it supports sessions. - Build a task list for selected slides with each slide's prompt file, output PNG path, aspect ratio, session ID, and verified direct references.
- Dispatch slide images in batches per the
## Batch Generation Policy: backend native batch first, runtime parallel tool calls second, sequential only as fallback. Backup rule applies to PNG files before dispatch. Report progress asGenerated X/N. Retry only failed items once before reporting an error.
--regenerate N jumps to this step for the named slides only. --images-only starts here with existing prompts.
Step 8: Merge
${BUN_X} {baseDir}/scripts/merge-to-pptx.ts <slide-deck-dir>
${BUN_X} {baseDir}/scripts/merge-to-pdf.ts <slide-deck-dir>
Step 9: Summary
Slide Deck Complete!
Topic: [topic]
Style: [preset or "custom: texture+mood+typography+density"]
Location: [directory]
Slides: N
- 01-slide-cover.png
- ...
- NN-slide-back-cover.png
Outline: outline.md
PPTX: {topic-slug}.pptx
PDF: {topic-slug}.pdf
Slide Modification
| Action | How |
|---|---|
| Edit | Update prompts/NN-slide-{slug}.md first, then --regenerate N |
| Add | Create new prompt at position, generate image, renumber subsequent NN (slugs unchanged), update outline.md, re-merge |
| Delete | Remove PNG + prompt, renumber subsequent, update outline.md, re-merge |
Always 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.
Text correction policy:
- If a slide's title, bullets, or any other rendered text is misspelled, garbled, hard to read, or visually weak, do not patch the bitmap with code.
- For text-correction regenerations, write a new prompt file and a new output path so the flawed candidate is preserved for comparison.
- Post-processing is limited to crop, resize, compression, or format conversion that does not alter text or the main composition.
See references/modification-guide.md for full details.
References
| File | Content |
|---|---|
references/confirmation.md |
Verbatim AskUserQuestion option copy for every confirmation |
references/analysis-framework.md |
Content analysis framework |
references/outline-template.md |
Outline structure |
references/base-prompt.md |
Base prompt body for image generation |
references/layouts.md |
Layout options |
references/design-guidelines.md |
Audience, typography, color selection |
references/content-rules.md |
Content guidelines |
references/modification-guide.md |
Edit/add/delete workflows |
references/styles/<preset>.md |
Per-preset specifications |
references/dimensions/*.md |
Per-dimension specifications |
references/config/preferences-schema.md |
EXTEND.md schema |
Notes
- Image generation takes ~10-30s per slide; report progress between them.
- For sensitive public figures, prefer stylized alternatives to avoid likeness issues.
- Maintain visual consistency via the session ID when the backend supports it.
Changing Preferences
EXTEND.md lives at the first matching path listed in Step 1.1. Two ways to change it:
- Edit directly — open EXTEND.md and change fields. Full schema:
references/config/preferences-schema.md. - Common one-line edits:
preferred_image_backend: auto— default; runtime-native tool wins, falls back to the only installed backend, asks only if multiple non-native are present.preferred_image_backend: codex-imagegen— pin to Codex's built-in.preferred_image_backend: baoyu-image-gen— pin to the baoyu-image-gen skill.preferred_image_backend: ask— confirm backend every run.generation_batch_size: 4— default number of slide images to render concurrently when the backend/runtime supports batch or parallel generation.preferred_style: blueprint,preferred_audience: experts,language: zh.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核