baoyu-comic
Knowledge comic creator supporting multiple art styles and tones. Creates original educational comics with detailed panel layouts and batch-capable image generation. Use when user asks to create "知识漫画", "教育漫画", "biography comic", "tutorial comic", or "Logicomix-style comic".
1How It Works & Mechanism
Perform "deep content analysis" before drawing: Produce analysis.md following the analytical framework (audience, value proposition, core themes, characters & story arcs, content signals), and recommend art/tone/layout and page count based on these signals.
Deep analysis framework for transforming source content into effective visual storytelling.
Style operates in three dimensions—art(6) × tone(7) × layout(7)—plus a preset layer: Presets are not just aliases for art+tone, but also enforce additional rules (e.g., ohmsha bans "talking heads" and mandates visual metaphors).
**Preset vs Art+Tone**: Presets include special rules beyond art+tone.
Character consistency is engineered via "character sheet + reference image": First generate characters/characters.png to serve as a cross-page --ref; if the backend does not support --ref, it falls back to embedding character descriptions into each page's prompt.
| Exists | Supported | Pass sheet as `--ref` on every page |
Page-by-page generation follows a strict dependency order and batching strategy: Produce the character sheet first, then dispatch pages in batches; each page's prompt must be persisted to disk before invoking the backend.
Honor workflow dependencies first: generate `characters/characters.png` before pages that use it as a reference.
Includes an executable script to merge pages into a PDF: Run merge-to-pdf.ts via bun, build the document with pdf-lib according to actual image dimensions, and save to disk via Bun.write.
const pdfDoc = await PDFDocument.create();
Supports partial workflows to avoid full re-runs: Generate only storyboards, only prompts, only images, or regenerate specified pages.
| `--regenerate N` | Regenerate specific page(s) only (e.g., `3` or `2,5,8`) |
Mandatory backup before regeneration: Existing prompts and images are renamed with a -backup-YYYYMMDD-HHMMSS suffix to preserve comparable historical versions.
**Backup rule**: If `characters/characters.png` exists, rename to `characters/characters-backup-YYYYMMDD-HHMMSS.png`
Interaction language is maintained throughout the pipeline: Storyboards, prompts, options, and progress updates all use the user's input language or saved preferred language.
**Rule**: Use user's input language or saved language preference for ALL interactions:
2Core Capabilities
3External Dependencies
| Kind | Dependency / Endpoint |
|---|---|
| cli | bun / npx(${BUN_X} 运行时,跑 scripts/merge-to-pdf.ts) |
| package | pdf-lib(脚本内 import,用于建 PDF) |
| cli | sips / pngquant(压缩角色表,避免 --ref payload 失败) |
| cli | codex CLI / baoyu-image-gen(图像生成后端,codex-imagegen 分支) |
| api | Codex 原生 imagegen / Cursor GenerateImage / Hermes image_generate(宿主原生图像工具) |
4Recommended Governance & Evidence
- scripts/: Executes local scripts or commands: scripts/merge-to-pdf.ts (run with bun; reads local page images only, writes PDF)
- 本地工作目录: File I/O and artifact output: Under comic/{topic-slug}/: source-{slug}, analysis.md, storyboard.md, characters/ch
5Second-Pass Verification
- [ok] 自带脚本只有 merge-to-pdf.ts,且仅本地行为 — 逐行核对:import fs/path/pdf-lib,createPdf() 里 readFileSync 页面图 → embedPng/embedJpg → Bun.write(outputPath);无网络调用、无 env 读取、无子进程。
- [ok] pdf-lib 依赖来源(无自带 package.json) — skill 目录确无 package.json;依赖靠仓库根 workspace 的 dependencies(pdf-lib ^1.17.1)或运行环境解析。这一点写进 risks,不影响档位。
- [ok] SKILL.md 点名单一生成后端(orange 依据) — Codex imagegen / codex CLI (baoyu-image-gen --provider codex-cli) / Cursor GenerateImage / Hermes image_generate 均在 SKILL.md 正文,且 7.2 要求“生成任何页面前先读后端 SKILL.md 判断 --ref 能力”。
- [ok] 角色一致性三策略与失败恢复 — SKILL.md 7.2 表(Exists/Supported、Exists/Not supported、Skipped)与 workflow.md 的 Strategy A/B/C 一一对应,另有 --ref 失败时的压缩→重试→降级链。
- [ok] 预设与默认角色 — workflow.md 列出 ohmsha 默认四角色(大雄/哆啦A梦/胖虎/静香)并写明不得为 ohmsha 自造角色;presets/ 5 个文件均在盘。
- [ok] 备份与局部重跑规则 — workflow.md 7.1 备份规则、SKILL.md Partial Workflow Options 表与 partial-workflows.md 均存在。
- [ok] meta 元数据 — GitHub API:MIT、25926 stars、pushed_at 2026-09-10T15:13:43Z;本地 HEAD 与任务 pin 1567581c26ec… 一致。
6Verdict & Scenarios
0b7b74a684ebd49d…