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

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

L4 High-Privilege · Graded auth & full auditV1 Commit-PinnedExecute CommandWrite FileDual-pass Audit
Author JimLiuGitHub JimLiu/baoyu-skills ↗Stars 25926License MIT(仓库根 LICENSE,Copyright (c) 2026 Jim Liu;GitHub API license.spdx_id=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

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.

skills/baoyu-comic/references/analysis-framework.md
Deep analysis framework for transforming source content into effective visual storytelling.
Page counts are tiered according to content complexity (short 5-8 pages, medium 9-15 pages, full biography 16-25 pages), and recommended values are recorded in the front matter of analysis.md for subsequent steps to reference.

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

skills/baoyu-comic/references/workflow.md
**Preset vs Art+Tone**: Presets include special rules beyond art+tone.
The four directories art-styles/, tones/, layouts/, and presets/ load definition files on demand; the ohmsha preset also pre-configures default characters like Nobita/Doraemon, forbidding ad-hoc character creation if unspecified by the user.

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.

skills/baoyu-comic/SKILL.md
| Exists | Supported | Pass sheet as `--ref` on every page |
Includes a failure recovery chain: compress reference images with sips/pngquant to avoid payload issues → retry → if it still fails, drop --ref and fall back to textual embedding.

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.

skills/baoyu-comic/SKILL.md
Honor workflow dependencies first: generate `characters/characters.png` before pages that use it as a reference.
The section explicitly mandates: Never start the first page batch until all selected page prompt files exist on disk; batch failures only retry the failed items.

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.

skills/baoyu-comic/scripts/merge-to-pdf.ts
const pdfDoc = await PDFDocument.create();
The script sorts by the NN filename prefix (00-cover-*.png, 01-page-*.png …) and exits with an error if pages are missing; default output is <dir>/<dirName>.pdf.

Supports partial workflows to avoid full re-runs: Generate only storyboards, only prompts, only images, or regenerate specified pages.

skills/baoyu-comic/SKILL.md
| `--regenerate N` | Regenerate specific page(s) only (e.g., `3` or `2,5,8`) |
Used in combination with --storyboard-only/--prompts-only/--images-only; details are documented in references/partial-workflows.md.

Mandatory backup before regeneration: Existing prompts and images are renamed with a -backup-YYYYMMDD-HHMMSS suffix to preserve comparable historical versions.

skills/baoyu-comic/references/workflow.md
**Backup rule**: If `characters/characters.png` exists, rename to `characters/characters-backup-YYYYMMDD-HHMMSS.png`
The same rule applies to pages and prompts; generation failures or retries do not overwrite original files.

Interaction language is maintained throughout the pipeline: Storyboards, prompts, options, and progress updates all use the user's input language or saved preferred language.

skills/baoyu-comic/SKILL.md
**Rule**: Use user's input language or saved language preference for ALL interactions:
Technical terms remain in English; language priority order is --lang > EXTEND.md > conversation language > source material language.

2Core Capabilities

01Deep content analysis → analysis.md (audience/value/theme/character arc/content signals)
02Storyboard + character design (storyboard.md, characters/characters.md), allowing review before image generation
03art × tone × layout × preset selection and automated recommendation (including ohmsha/wuxia/shoujo/concept-story/four-panel)
04Cross-page character consistency (character sheet as --ref / textual description fallback)
05Batch page generation + single-item retries + dependency ordering (character sheet precedes pages)
06Local PDF merging (bun + pdf-lib, sorted by NN prefix)
07Partial re-runs (--images-only / --prompts-only / --storyboard-only / --regenerate N) with backup rules
08Artifact compression to fit --ref payloads (sips / pngquant)

3External Dependencies

KindDependency / Endpoint
clibun / npx(${BUN_X} 运行时,跑 scripts/merge-to-pdf.ts)
packagepdf-lib(脚本内 import,用于建 PDF)
clisips / pngquant(压缩角色表,避免 --ref payload 失败)
clicodex CLI / baoyu-image-gen(图像生成后端,codex-imagegen 分支)
apiCodex 原生 imagegen / Cursor GenerateImage / Hermes image_generate(宿主原生图像工具)

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/: 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
Audit Notes: (a) SKILL.md specifies external image generation backends: '**Codex (`imagegen`)** — first, inspect your available-skills / tool inventory.' and 'route through `baoyu-image-gen --provider codex-cli` (preferred)'; following SKILL.md transmits user source text (biographies/tutorials) and entire storyboard prompts outbound to third-party image models, and multi-page batching substantially consumes user account quotas. (b) Heavy local disk writes: materials, analysis, storyboard, characters, prompts, page images, PDFs under comic/, as well as EXTEND.md. (c) The bundled script scripts/merge-to-pdf.ts is purely local (builds PDF via pdf-lib + Bun.write) with no network or credential access, fitting blue criteria; red tier criteria (reverse-engineered APIs/client impersonation/bypassing protections/arbitrary code execution) are not met. Following precedents like ai-image-generation / seedance, 'sending source materials to generation backends' is consistently categorized as orange.

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

  • Broad yet controllable style space: 6 art × 7 tone × 7 layout × 5 presets, with presets enforcing extra narrative rules (e.g., ohmsha's metaphor requirement, four-panel's Kishōtenketsu structure).
  • Long-form project friendly: Multiple review gates + partial re-runs + backup rules allow long comics to be delivered in stages and rolled back.
  • Engineered character consistency: Character sheets act as reusable reference assets across pages, with built-in fallbacks for backends lacking --ref support.
  • Complete deliverables: Instead of scattered images, an included script merges them into a PDF in NN order, ready for distribution.
  • Front-loaded content analysis framework avoids loose narrative caused by rushing straight into drawing.
  • Best for: Individuals or teams adapting long-form articles, biographies, or tutorials into educational comics, especially those needing cross-page character consistency and deliverable PDFs; also serves as a reference for skill authors studying storyboard → prompt → image pipeline design.
    Not for: Not suitable for single standalone illustrations (use baoyu-article-illustrator instead); not suitable for strictly offline environments or where data egress is forbidden; not suitable for rapid single-pass drafts that bypass multi-stage approvals.
    Install Agent-Ready
    ① Verified Mirror 2026-09-15
    Option A · Direct DownloadDownload baoyu-comic.tar.gz
    sha256: 0b7b74a684ebd49d…
    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.