1实现原理 · 为什么它能做到
本目录零脚本、零可执行代码,全部能力由 SKILL.md 的流程指令 + references/ 里的模板与知识库构成——是『提示词工程 + 参考资料库』型 skill。
Two dimensions: **layout** (information structure) × **style** (visual aesthetics). Freely combine any layout with any style.
推荐算法是可执行的选择规则:命中关键词快捷方式时跳过内容推断、直接用映射的布局;否则按数据结构/语气/受众推荐 3-5 个 layout×style 组合。
Skip content-based layout inference for matched keywords.
有硬确认门禁:Step 4 必须由用户确认组合/比例/语言/后端,默认不允许 agent 直接开画。
**Hard gate**: this step is mandatory per the [Confirmation Policy](#confirmation-policy)
图像后端在运行时解析(原生 imagegen > codex CLI > Cursor 原生 > 其他原生 > 唯一非原生后端),并点名了 baoyu-image-gen 这条具体路径。
route through `baoyu-image-gen --provider codex-cli` (preferred)
提示词文件是强制产物:任何后端调用之前必须把完整 prompt 落到 prompts/NN-{type}-[slug].md,作为可复现记录。
**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.
内容保真是硬规则:只搬运不概括,且出图前必须剥离凭证类信息;分析阶段用教学设计框架(学习目标、认知负荷、数据完整性)。
**strip any credentials, API keys, tokens, or secrets** before including in outputs
模板是占位符化的:base-prompt.md 用 {{LAYOUT}}/{{STYLE}}/{{ASPECT_RATIO}}/{{LANGUAGE}}/{{LAYOUT_GUIDELINES}}/{{STYLE_GUIDELINES}}/{{CONTENT}}/{{TEXT_LABELS}} 组装最终 prompt。
- **Layout**: {{LAYOUT}}
产物与备份纪律明确:固定目录结构 infographic/{topic-slug}/,同名文件按时间戳备份,冲突时追加时间后缀。
infographic/{topic-slug}/
两条硬性『不许作弊』规则:不许用 SVG/HTML/canvas 代码渲染冒充栅格图,不许用代码在已生成位图上涂抹修字。
**⛔ Never substitute SVG, HTML, canvas, or other code-based rendering for raster image generation.**
2核心能力
3外部依赖
| 类型 | 依赖 |
|---|---|
| api | baoyu-image-gen(第三方 skill,--provider codex-cli 路径;会读该 skill 自己的 provider 凭据) |
| cli | Codex CLI(codex login 订阅态、codex exec) |
| api | Codex 运行时原生 imagegen skill(经由 Skill 工具调用) |
| api | Cursor 原生 GenerateImage 工具(无比例参数、无输出目录) |
| package | bundled codex-imagegen 包装脚本(免装 baoyu-image-gen 时的直调路径;其自身会 spawn codex,用 Codex 订阅而非 API key) |
| cli | bun(运行包装脚本;缺 bun 时 npx -y bun) |
4风险提醒 风险提醒:橙色 · 评估后使用
- 用户素材必然出网到外部生成后端 — 按 SKILL.md 执行时源文档内容与 prompt 会交给 Codex/baoyu-image-gen 等第三方图像模型(可能消耗账号额度)。敏感内容应在出图前自行删改,不能只依赖 SKILL.md 的『剥离凭证』要求(那是模型执行的软约束)。
- 下游后端可能带来红线级行为 — 当解析到 codex-imagegen/`baoyu-image-gen --provider codex-cli` 时,实际执行的是 `codex exec --sandbox danger-full-access`(该后端自身判红);本 skill 不改档,但用户在无原生 imagegen 的运行时里使用它会继承该行为。
- 图像上的文字不可控 — 信息图文字由图像模型绘制,可能出现错字/漏字(SKILL.md 对此只给『改 prompt 重生成』与『换低文字密度布局』两条出路,禁止代码修补),批量出图时需要人眼验收。
- EXTEND.md 可静默改变后端与默认组合 — preferred_image_backend 等键由本地文件控制;若该文件被他人改写,agent 会在『默认值』名义下使用非预期后端。SKILL.md 只要求未找到时询问,找到即直接沿用。
5第二遍独立确认
- [ok] 『21 布局 + 22 风格』数量属实 — references/layouts/ 实际 21 个 .md(linear-progression…dense-modules),references/styles/ 实际 22 个 .md(craft-handmade…retro-popup-pop);SKILL.md 两张 Gallery 表逐项对应。
- [ok] 本目录无脚本/无端点/无凭证 — 目录内文件全为 .md;token 扫描 fetch/http/spawn/exec/process.env/API_KEY 零命中。
- [ok] 点名的外部生成后端(判橙依据) — SKILL.md Image Generation Tools 段逐条给出 Codex imagegen、codex-imagegen(含 `baoyu-image-gen --provider codex-cli` 首选路径)、Cursor GenerateImage、其他原生工具;references/codex-imagegen.md 进一步给出直调包装脚本的命令与 'no OPENAI_API_KEY is read or sent' 说明。
- [ok] 确认门禁为硬门禁而非建议 — SKILL.md 'Hard gate: this step is mandatory…' 与 Confirmation Policy 段把显式调用/关键词/EXTEND.md 默认值一律降级为 recommendation inputs;Step 6 亦注明必须先落 prompt 文件。
- [ok] 内容保真与脱敏要求 — SKILL.md Core Principles 原文 'Preserve source data faithfully—no summarization or rephrasing' 与 '**strip any credentials, API keys, tokens, or secrets** before including in outputs';Step 2 Rules 重申。
- [ok] 反作弊条款(禁 SVG 替代 / 禁位图涂改) — 两段 ⛔ 文本均在 SKILL.md,且 Text correction policy 段限定后处理只能做裁切/缩放/压缩/转格式。
- [discrepancy] references 里 styles 定义的数量在 SKILL.md 自身文本中有笔误 — SKILL.md 末尾 References 列表写 'references/styles/<style>.md - 21 style definitions',但 Style Gallery 与目录实际均为 22 个(frontmatter 描述也写 '22 visual styles')。结论以目录/表格为准=22;此为文档小笔误,不影响判级。
- [ok] codex-imagegen 直调路径可能导致下游红档行为 — 本 skill 的 references/codex-imagegen.md 指示在无 baoyu-image-gen 时直调 bundled 包装脚本,而该包装脚本(skills/baoyu-image-gen/scripts/codex-imagegen/spawn.ts)以 codex exec --sandbox danger-full-access 运行——红线属被调后端,改写为本 skill 的判级不成立,但已写进 verdict.risks 供用户知情。
6结论
68d6840b2ed27261…1567581c26