图像生成
- 作者仓库星标 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
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: baoyu-infographic
description: Generate professional infographics with 21 layout types and 22 visual styles. Analyzes content…
category: 通用
runtime: 无特殊运行时
---
# baoyu-infographic 输出预览
## PART A: 任务判断
- 适用问题:通用任务拆解、检查和交付。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“User Input Tools / Image Generation Tools / Reference Images”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于通用任务拆解、检查和交付,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“User Input Tools / Image Generation Tools / Reference Images”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令。
先用一个小任务确认它会围绕“User Input Tools / Image Generation Tools / Reference Images”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: baoyu-infographic
description: Generate professional infographics with 21 layout types and 22 visual styles. Analyzes content…
category: 通用
source: JimLiu/baoyu-skills
---
# baoyu-infographic
## 什么时候使用
- 把一组数据 / 要点画成单图信息长图——纵向版式,可直接发公众号 / 微博 / 小红书 适合处理通用任务拆解、检查、交付和复盘,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查…
- 面向通用任务拆解、检查和交付,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「User Input Tools / Image Generation Tools / Reference Images」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "baoyu-infographic" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> User Input Tools / Image Generation Tools / Reference Images
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件、执行终端命令 | 主要在本地完成
安全层 -> 通常不需要额外 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-{type}-[slug].md)。后端接收提示文件(或其内容);该文件是可重现性记录,允许你在不重新生成提示的情况下切换后端。
上面具体的工具名称(imagegen、image_generate、baoyu-imagine)是示例——请在相同规则下替换为本地等效工具。
参考图像
用户可以提供参考图像来指导风格、调色板、构图或主题。
摄取:通过 --ref <files...> 接受,或者当用户在对话中提供文件路径/粘贴图像时接受。
- 文件路径 → 复制到输出旁边的
refs/NN-ref-{slug}.{ext} - 没有路径的粘贴图像 → 询问用户路径(根据上面的用户输入工具规则),或口头提取风格特征作为文本备用
- 无参考 → 跳过此部分
使用模式(每个参考):
| 用途 | 效果 |
|---|---|
direct |
将文件作为参考图像传递给后端 |
style |
提取风格特征(线条处理、纹理、情绪)并附加到提示主体 |
palette |
从图像中提取十六进制颜色并附加到提示主体 |
当存在参考时,记录在 prompts/infographic.md 的 Frontmatter 中:
references:
- ref_id: 01
filename: 01-ref-brand.png
usage: direct
生成时:
- 验证每个引用的文件是否存在于磁盘上
- 如果
usage: direct且所选后端接受参考图像(例如baoyu-imagine通过--ref)→ 通过后端的参考参数传递文件 - 否则 → 将提取的
style/palette特征嵌入到提示文本中
确认策略
默认行为:生成前确认。
- 将明确的技能调用、文件路径、匹配的关键词快捷方式、
EXTEND.md默认值以及文档化的默认组合视为仅推荐输入。它们都不能授权跳过确认。 - 在用户确认组合/方面/语言/后端选择之前,不要开始步骤 5 或步骤 6。
- 仅当当前请求明确要求跳过确认时才跳过,例如:
--no-confirm、「直接生成」、「不用确认」、「跳过确认」、「按默认出图」或等效措辞。 - 如果明确跳过确认,请在生成前在下一个面向用户的更新中说明假定的组合/方面/语言/后端。
选项
| 选项 | 值 |
|---|---|
--layout |
21 个选项(参见布局图库),默认值:bento-grid |
--style |
22 个选项(参见风格图库),默认值:craft-handmade |
--aspect |
命名:landscape (16:9)、portrait (9:16)、square (1:1)。自定义:任何 W:H 比例(例如 3:4、4:3、2.35:1) |
--lang |
en、zh、ja 等 |
--no-confirm |
仅当用户明确要求直接生成而无需确认时才跳过步骤 4 |
--ref <files...> |
用于风格/调色板/构图/主题指导的参考图像(文件路径) |
布局图库 (21)
| 布局 | 最适合 |
|---|---|
linear-progression |
时间线、流程、教程 |
binary-comparison |
A 对比 B、前后对比、优缺点 |
comparison-matrix |
多因素比较 |
hierarchical-layers |
金字塔、优先级 |
tree-branching |
类别、分类法 |
hub-spoke |
中心概念与相关项目 |
structural-breakdown |
爆炸图、剖面图 |
bento-grid |
多个主题、概述(默认) |
iceberg |
表面与隐藏方面 |
bridge |
问题-解决方案 |
funnel |
转化、筛选 |
isometric-map |
空间关系 |
dashboard |
指标、KPI |
periodic-table |
分类集合 |
comic-strip |
叙事、序列 |
story-mountain |
情节结构、张力弧 |
jigsaw |
相互关联的部分 |
venn-diagram |
重叠概念 |
winding-roadmap |
旅程、里程碑 |
circular-flow |
循环、重复过程 |
dense-modules |
高密度模块、数据丰富的指南 |
完整定义位于 references/layouts/<layout>.md。
风格图库 (22)
| 风格 | 描述 |
|---|---|
craft-handmade |
手绘、纸艺(默认) |
claymation |
3D 粘土人物、定格动画 |
kawaii |
日式可爱、柔和色调 |
storybook-watercolor |
柔和水彩、异想天开 |
chalkboard |
黑板粉笔画 |
cyberpunk-neon |
霓虹光效、未来感 |
bold-graphic |
漫画风格、半色调 |
aged-academia |
复古科学、棕褐色 |
corporate-memphis |
扁平矢量、鲜艳 |
technical-schematic |
蓝图、工程图 |
origami |
折纸、几何 |
pixel-art |
复古 8 位 |
ui-wireframe |
灰度界面线框图 |
subway-map |
地铁线路图 |
ikea-manual |
极简线条艺术 |
knolling |
有序平铺 |
lego-brick |
乐高积木结构 |
pop-laboratory |
蓝图网格、坐标标记、实验室精度 |
morandi-journal |
手绘涂鸦、温暖莫兰迪色调 |
retro-pop-grid |
1970 年代复古波普艺术、瑞士网格、粗线条 |
hand-drawn-edu |
马卡龙柔和色、手绘抖动、火柴人 |
retro-popup-pop |
复古弹出式拼贴、复古 UI、粗线条、扁平流行色 |
完整定义位于 references/styles/<style>.md。
推荐组合
| 内容类型 | 布局 + 风格 |
|---|---|
| 时间线/历史 | linear-progression + craft-handmade |
| 分步指南 | linear-progression + ikea-manual |
| A 对比 B | binary-comparison + corporate-memphis |
| 层次结构 | hierarchical-layers + craft-handmade |
| 重叠概念 | venn-diagram + craft-handmade |
| 转化流程 | funnel + corporate-memphis |
| 循环过程 | circular-flow + craft-handmade |
| 技术图解 | structural-breakdown + technical-schematic |
| 指标数据 | dashboard + corporate-memphis |
| 教育内容 | bento-grid + chalkboard |
| 旅程图 | winding-roadmap + storybook-watercolor |
| 分类集合 | periodic-table + bold-graphic |
| 产品指南 | dense-modules + morandi-journal |
| 技术指南 | dense-modules + pop-laboratory |
| 潮流指南 | dense-modules + retro-pop-grid |
| 复古流行指南 | dense-modules + retro-popup-pop |
| 教育图表 | hub-spoke + hand-drawn-edu |
| 流程教程 | linear-progression + hand-drawn-edu |
默认组合:bento-grid + craft-handmade(仅作为备用推荐——根据确认策略,默认值绝不会绕过步骤 4)。
关键词快捷方式
当用户输入包含这些关键词时,使用映射的布局作为步骤 3 的主要推荐,并将列出的风格提升到步骤 3 列表的顶部。对于匹配的关键词,跳过基于内容的布局推断。将任何「提示说明」附加到步骤 5 的提示中。
| 用户关键词 | 布局 | 推荐风格 | 默认宽高比 | 提示说明 |
|---|---|---|---|---|
| 高密度信息大图 / high-density-info | dense-modules |
morandi-journal, pop-laboratory, retro-pop-grid, retro-popup-pop |
portrait | — |
| 信息图 / infographic | bento-grid |
craft-handmade |
landscape | 极简主义:干净的画布,充足的留白,无复杂背景纹理。仅使用简单的卡通元素和图标。 |
输出结构
infographic/{topic-slug}/
├── source-{slug}.{ext}
├── analysis.md
├── structured-content.md
├── prompts/infographic.md
└── infographic.png
Slug:2-4 个单词的 kebab-case 形式,取自主题。冲突:追加 -YYYYMMDD-HHMMSS。
核心原则
- 忠实保留源数据——不进行总结或改写(但在输出中包含之前,剥离任何凭据、API 密钥、令牌或秘密)
- 在构建内容之前定义学习目标
- 为视觉传达构建结构(标题、标签、视觉元素)
工作流程
步骤 1:设置与分析
1.1 加载偏好设置 (EXTEND.md)
按优先级顺序检查 EXTEND.md——找到的第一个生效:
| 优先级 | 路径 | 范围 |
|---|---|---|
| 1 | .baoyu-skills/baoyu-infographic/EXTEND.md |
项目 |
| 2 | ${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-infographic/EXTEND.md |
XDG |
| 3 | $HOME/.baoyu-skills/baoyu-infographic/EXTEND.md |
用户主目录 |
| 结果 | 操作 |
|---|---|
| 找到 | 读取、解析、显示一行摘要 |
| 未找到 | 使用 AskUserQuestion 询问用户(参见 references/config/first-time-setup.md) |
EXTEND.md 支持:首选布局/风格、默认宽高比、语言偏好、首选图像后端、自定义风格定义。
Schema:references/config/preferences-schema.md
1.2 分析内容 → analysis.md
- 保存源内容(文件路径或粘贴 →
source.md)- 备份规则:如果
source.md存在,重命名为source-backup-YYYYMMDD-HHMMSS.md
- 备份规则:如果
- 分析:主题、数据类型、复杂性、语气、受众
- 检测源语言和用户语言
- 从用户输入中提取设计指令
- 保存分析
- 备份规则:如果
analysis.md存在,重命名为analysis-backup-YYYYMMDD-HHMMSS.md
- 备份规则:如果
详细格式参见 references/analysis-framework.md。
步骤 2:生成结构化内容 → structured-content.md
将内容转换为信息图结构:
- 标题和学习目标
- 包含以下内容的章节:核心概念、内容(逐字)、视觉元素、文本标签
- 数据点(所有统计数据/引文精确复制)
- 用户提供的设计指令
规则:仅限 Markdown。无新信息。忠实保留数据。从输出中剥离任何凭据或秘密。
详细格式参见 references/structured-content-template.md。
步骤 3:推荐组合
3.1 首先检查关键词快捷方式:如果用户输入与关键词快捷方式表中的关键词匹配,则使用关联的布局作为主要推荐,并将关联的风格优先作为顶部推荐。跳过基于内容的布局推断。
3.2 否则,根据以下因素推荐 3-5 种布局×风格组合:
- 数据结构 → 匹配布局
- 内容语气 → 匹配风格
- 受众期望
- 用户设计指令
步骤 4:确认选项
硬性门槛:根据确认策略,此步骤是强制性的——在用户在此处确认(或在当前请求中明确选择退出 --no-confirm / 等效措辞)之前,步骤 5-6 无法开始。
按照本文件顶部的用户输入工具规则,要求用户确认以下问题(如果运行时支持多个问题,则批量处理为一次调用;否则按优先级顺序逐一询问)。
| 优先级 | 问题 | 何时 | 选项 |
|---|---|---|---|
| 1 | 组合 | 始终 | 3+ 种布局×风格组合及理由 |
| 2 | 宽高比 | 始终 | 命名预设(landscape/portrait/square)或自定义 W:H 比例(例如 3:4、4:3、2.35:1) |
| 3 | 语言 | 仅当源语言 ≠ 用户语言时 | 文本内容的语言 |
| 4 | 图像后端 | 仅当「## 图像生成工具」规则的步骤 3 需要询问时(无运行时原生工具且有多个非原生后端,或 preferred_image_backend: ask) |
可用后端 |
步骤 5:生成提示 → prompts/infographic.md
备份规则:如果 prompts/infographic.md 存在,重命名为 prompts/infographic-backup-YYYYMMDD-HHMMSS.md
组合:
references/layouts/<layout>.md中的布局定义references/styles/<style>.md中的风格定义references/base-prompt.md中的基本模板- 步骤 2 中的结构化内容
- 确认语言中的所有文本
{{ASPECT_RATIO}} 的宽高比解析:
- 命名预设 → 比例字符串:landscape→
16:9,portrait→9:16,square→1:1 - 自定义 W:H 比例 → 按原样使用(例如
3:4、4:3、2.35:1)
步骤 6:生成图像
- 根据本文件顶部的「## 图像生成工具」规则解析后端。
- 在调用后端之前,确保完整的最终提示已持久化到
prompts/infographic.md(已在步骤 5 中写入)——该文件是可重现性记录。 - 检查现有文件:生成前,检查
infographic.png是否存在- 如果存在:重命名为
infographic-backup-YYYYMMDD-HHMMSS.png
- 如果存在:重命名为
- 使用提示文件和输出路径调用所选后端
- 失败时,自动重试一次
步骤 7:输出摘要
报告:主题、布局、风格、宽高比、语言、图像后端、输出路径、创建的文件。
参考资料
references/analysis-framework.md- 分析方法论references/structured-content-template.md- 内容格式references/base-prompt.md- 提示模板references/layouts/<layout>.md- 21 种布局定义references/styles/<style>.md- 21 种风格定义
更改偏好设置
EXTEND.md 位于步骤 1.1 中第一个匹配的路径。有三种方法可以更改它:
- 直接编辑——打开 EXTEND.md 并更改字段。完整 schema:
references/config/preferences-schema.md。 - 交互式重新配置——删除 EXTEND.md(或询问「reconfigure baoyu-infographic preferences」/「重新配置」)。下次运行将重新触发首次设置。
- 常见的一行编辑:
preferred_image_backend: auto——默认;运行时原生工具胜出,回退到唯一安装的后端,仅当存在多个非原生后端时才询问。preferred_image_backend: codex-imagegen——固定到 Codex 的内置工具。preferred_image_backend: baoyu-imagine——固定到 baoyu-imagine 技能。preferred_image_backend: ask——每次运行都确认后端。preferred_layout: dense-modules、preferred_style: morandi-journal、preferred_aspect: portrait、language: zh——改变步骤 3 的推荐和步骤 4 的默认值(根据确认策略,这些绝不会绕过步骤 4)。
Infographic Generator
Two dimensions: layout (information structure) × style (visual aesthetics). Freely combine any layout with any style.
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 labels, headings, callouts, data values, or any other text inside an already generated infographic. If text is wrong or unclear, regenerate from a corrected prompt, switch to a layout with less 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-{type}-[slug].md) BEFORE invoking any backend. The backend receives the prompt file (or its content); 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.
Reference Images
Users may supply reference images to guide style, palette, composition, or subject.
Intake: Accept via --ref <files...> or when the user provides file paths / pastes images in conversation.
- File path(s) → copy to
refs/NN-ref-{slug}.{ext}alongside the output - Pasted image with no path → ask the user for the path (per the User Input Tools rule above), or extract style traits verbally as a text fallback
- No reference → skip this section
Usage modes (per reference):
| Usage | Effect |
|---|---|
direct |
Pass the file to the backend as a reference image |
style |
Extract style traits (line treatment, texture, mood) and append to the prompt body |
palette |
Extract hex colors from the image and append to the prompt body |
Record in prompts/infographic.md frontmatter when refs exist:
references:
- ref_id: 01
filename: 01-ref-brand.png
usage: direct
At generation time:
- Verify each referenced file exists on disk
- If
usage: directAND the chosen backend accepts reference images (e.g.,baoyu-image-genvia--ref) → pass the file via the backend's ref parameter - Otherwise → embed extracted
style/palettetraits in the prompt text
Confirmation Policy
Default behavior: confirm before generation.
- Treat explicit skill invocation, a file path, a matched keyword shortcut,
EXTEND.mddefaults, and the documented default combination as recommendation inputs only. None of them authorizes skipping confirmation. - Do not start Step 5 or Step 6 until the user confirms the combination/aspect/language/backend choices.
- Skip confirmation only when the current request explicitly says to do so, for example:
--no-confirm, "直接生成", "不用确认", "跳过确认", "按默认出图", or equivalent wording. - If confirmation is skipped explicitly, state the assumed combination/aspect/language/backend in the next user-facing update before generating.
Options
| Option | Values |
|---|---|
--layout |
21 options (see Layout Gallery), default: bento-grid |
--style |
22 options (see Style Gallery), default: craft-handmade |
--aspect |
Named: landscape (16:9), portrait (9:16), square (1:1). Custom: any W:H ratio (e.g., 3:4, 4:3, 2.35:1) |
--lang |
en, zh, ja, etc. |
--no-confirm |
Skip Step 4 only when the user explicitly requests direct generation without confirmation |
--ref <files...> |
Reference images (file paths) for style / palette / composition / subject guidance |
Layout Gallery (21)
| Layout | Best For |
|---|---|
linear-progression |
Timelines, processes, tutorials |
binary-comparison |
A vs B, before-after, pros-cons |
comparison-matrix |
Multi-factor comparisons |
hierarchical-layers |
Pyramids, priority levels |
tree-branching |
Categories, taxonomies |
hub-spoke |
Central concept with related items |
structural-breakdown |
Exploded views, cross-sections |
bento-grid |
Multiple topics, overview (default) |
iceberg |
Surface vs hidden aspects |
bridge |
Problem-solution |
funnel |
Conversion, filtering |
isometric-map |
Spatial relationships |
dashboard |
Metrics, KPIs |
periodic-table |
Categorized collections |
comic-strip |
Narratives, sequences |
story-mountain |
Plot structure, tension arcs |
jigsaw |
Interconnected parts |
venn-diagram |
Overlapping concepts |
winding-roadmap |
Journey, milestones |
circular-flow |
Cycles, recurring processes |
dense-modules |
High-density modules, data-rich guides |
Full definitions live at references/layouts/<layout>.md.
Style Gallery (22)
| Style | Description |
|---|---|
craft-handmade |
Hand-drawn, paper craft (default) |
claymation |
3D clay figures, stop-motion |
kawaii |
Japanese cute, pastels |
storybook-watercolor |
Soft painted, whimsical |
chalkboard |
Chalk on black board |
cyberpunk-neon |
Neon glow, futuristic |
bold-graphic |
Comic style, halftone |
aged-academia |
Vintage science, sepia |
corporate-memphis |
Flat vector, vibrant |
technical-schematic |
Blueprint, engineering |
origami |
Folded paper, geometric |
pixel-art |
Retro 8-bit |
ui-wireframe |
Grayscale interface mockup |
subway-map |
Transit diagram |
ikea-manual |
Minimal line art |
knolling |
Organized flat-lay |
lego-brick |
Toy brick construction |
pop-laboratory |
Blueprint grid, coordinate markers, lab precision |
morandi-journal |
Hand-drawn doodle, warm Morandi tones |
retro-pop-grid |
1970s retro pop art, Swiss grid, thick outlines |
hand-drawn-edu |
Macaron pastels, hand-drawn wobble, stick figures |
retro-popup-pop |
Retro popup collage, vintage UI, thick outlines, flat pop colors |
Full definitions live at references/styles/<style>.md.
Recommended Combinations
| Content Type | Layout + Style |
|---|---|
| Timeline/History | linear-progression + craft-handmade |
| Step-by-step | linear-progression + ikea-manual |
| A vs B | binary-comparison + corporate-memphis |
| Hierarchy | hierarchical-layers + craft-handmade |
| Overlap | venn-diagram + craft-handmade |
| Conversion | funnel + corporate-memphis |
| Cycles | circular-flow + craft-handmade |
| Technical | structural-breakdown + technical-schematic |
| Metrics | dashboard + corporate-memphis |
| Educational | bento-grid + chalkboard |
| Journey | winding-roadmap + storybook-watercolor |
| Categories | periodic-table + bold-graphic |
| Product Guide | dense-modules + morandi-journal |
| Technical Guide | dense-modules + pop-laboratory |
| Trendy Guide | dense-modules + retro-pop-grid |
| Retro Pop Guide | dense-modules + retro-popup-pop |
| Educational Diagram | hub-spoke + hand-drawn-edu |
| Process Tutorial | linear-progression + hand-drawn-edu |
Default combination: bento-grid + craft-handmade (fallback recommendation only — per the Confirmation Policy, defaults never bypass Step 4).
Keyword Shortcuts
When the user's input contains these keywords, use the mapped layout as the leading Step 3 recommendation and promote the listed styles to the top of the Step 3 list. Skip content-based layout inference for matched keywords. Append any Prompt Notes to the Step 5 prompt.
| User Keyword | Layout | Recommended Styles | Default Aspect | Prompt Notes |
|---|---|---|---|---|
| 高密度信息大图 / high-density-info | dense-modules |
morandi-journal, pop-laboratory, retro-pop-grid, retro-popup-pop |
portrait | — |
| 信息图 / infographic | bento-grid |
craft-handmade |
landscape | Minimalist: clean canvas, ample whitespace, no complex background textures. Simple cartoon elements and icons only. |
Output Structure
infographic/{topic-slug}/
├── source-{slug}.{ext}
├── analysis.md
├── structured-content.md
├── prompts/infographic.md
└── infographic.png
Slug: 2-4 words kebab-case from topic. Conflict: append -YYYYMMDD-HHMMSS.
Core Principles
- Preserve source data faithfully—no summarization or rephrasing (but strip any credentials, API keys, tokens, or secrets before including in outputs)
- Define learning objectives before structuring content
- Structure for visual communication (headlines, labels, visual elements)
Workflow
Step 1: Setup & Analyze
1.1 Load Preferences (EXTEND.md)
Check EXTEND.md in priority order — the first one found wins:
| Priority | Path | Scope |
|---|---|---|
| 1 | .baoyu-skills/baoyu-infographic/EXTEND.md |
Project |
| 2 | ${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-infographic/EXTEND.md |
XDG |
| 3 | $HOME/.baoyu-skills/baoyu-infographic/EXTEND.md |
User home |
| Result | Action |
|---|---|
| Found | Read, parse, display a one-line summary |
| Not found | Ask the user with AskUserQuestion (see references/config/first-time-setup.md) |
EXTEND.md supports: preferred layout/style, default aspect ratio, language preference, preferred image backend, custom style definitions.
Schema: references/config/preferences-schema.md
1.2 Analyze Content → analysis.md
- Save source content (file path or paste →
source.md)- Backup rule: If
source.mdexists, rename tosource-backup-YYYYMMDD-HHMMSS.md
- Backup rule: If
- Analyze: topic, data type, complexity, tone, audience
- Detect source language and user language
- Extract design instructions from user input
- Save analysis
- Backup rule: If
analysis.mdexists, rename toanalysis-backup-YYYYMMDD-HHMMSS.md
- Backup rule: If
See references/analysis-framework.md for detailed format.
Step 2: Generate Structured Content → structured-content.md
Transform content into infographic structure:
- Title and learning objectives
- Sections with: key concept, content (verbatim), visual element, text labels
- Data points (all statistics/quotes copied exactly)
- Design instructions from user
Rules: Markdown only. No new information. Preserve data faithfully. Strip any credentials or secrets from output.
See references/structured-content-template.md for detailed format.
Step 3: Recommend Combinations
3.1 Check Keyword Shortcuts first: If user input matches a keyword from the Keyword Shortcuts table, use the associated layout as the leading recommendation and prioritize associated styles as top recommendations. Skip content-based layout inference.
3.2 Otherwise, recommend 3-5 layout×style combinations based on:
- Data structure → matching layout
- Content tone → matching style
- Audience expectations
- User design instructions
Step 4: Confirm Options
Hard gate: this step is mandatory per the Confirmation Policy — Steps 5–6 cannot start until the user confirms here (or explicitly opts out with --no-confirm / equivalent in the current request).
Ask the user to confirm the questions below following the User Input Tools rule at the top of this file (batch into one call if the runtime supports multiple questions; otherwise ask one at a time in priority order).
| Priority | Question | When | Options |
|---|---|---|---|
| 1 | Combination | Always | 3+ layout×style combos with rationale |
| 2 | Aspect | Always | Named presets (landscape/portrait/square) or custom W:H ratio (e.g., 3:4, 4:3, 2.35:1) |
| 3 | Language | Only if source ≠ user language | Language for text content |
| 4 | Image Backend | Only if step 3 of the ## Image Generation Tools rule needs to ask (no runtime-native tool AND multiple non-native backends, OR preferred_image_backend: ask) |
Available backends |
Step 5: Generate Prompt → prompts/infographic.md
Backup rule: If prompts/infographic.md exists, rename to prompts/infographic-backup-YYYYMMDD-HHMMSS.md
Combine:
- Layout definition from
references/layouts/<layout>.md - Style definition from
references/styles/<style>.md - Base template from
references/base-prompt.md - Structured content from Step 2
- All text in confirmed language
Aspect ratio resolution for {{ASPECT_RATIO}}:
- Named presets → ratio string: landscape→
16:9, portrait→9:16, square→1:1 - Custom W:H ratios → use as-is (e.g.,
3:4,4:3,2.35:1)
Step 6: Generate Image
- Resolve the backend per the
## Image Generation Toolsrule at the top of this file. - Ensure the full final prompt is persisted at
prompts/infographic.md(already written in Step 5) BEFORE invoking the backend — the file is the reproducibility record. - Check for existing file: Before generating, check if
infographic.pngexists- If exists: Rename to
infographic-backup-YYYYMMDD-HHMMSS.png
- If exists: Rename to
- Call the chosen backend with the prompt file and output path.
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).
- On failure, auto-retry once
Text correction policy:
- If labels, headings, callouts, data values, 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.
Step 7: Output Summary
Report: topic, layout, style, aspect, language, image backend, output path, files created.
References
references/analysis-framework.md- Analysis methodologyreferences/structured-content-template.md- Content formatreferences/base-prompt.md- Prompt templatereferences/layouts/<layout>.md- 21 layout definitionsreferences/styles/<style>.md- 21 style definitions
Changing Preferences
EXTEND.md lives at the first matching path in Step 1.1. Three ways to change it:
- Edit directly — open EXTEND.md and change fields. Full schema:
references/config/preferences-schema.md. - Reconfigure interactively — delete EXTEND.md (or ask "reconfigure baoyu-infographic preferences" / "重新配置"). The next run re-triggers first-time setup.
- 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.preferred_layout: dense-modules,preferred_style: morandi-journal,preferred_aspect: portrait,language: zh— shift the Step-3 recommendations and Step-4 defaults (per Confirmation Policy, these never bypass Step 4).
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核