baoyu-article-illustrator
Analyzes article structure, identifies positions requiring visual aids, generates illustrations with Type × Style × Palette three-dimension approach. Use when user asks to "illustrate article", "add images", "generate images for article", or "为文章配图".
1How It Works & Mechanism
Implemented purely through prompt orchestration: SKILL.md deconstructs illustration into three orthogonal dimensions: Type (information structure) × Style (rendering technique) × Palette (color scheme, optional override), then synthesizes the image prompt by combining these dimensions—the skill itself contains zero executable code.
Analyze articles, identify illustration positions, generate images with Type × Style × Palette consistency.
The first step is article structure analysis: determining content type, illustration intent, 2–5 core arguments, and "which positions deserve illustrations," with a strict prohibition against rendering metaphors literally.
| Visual opportunities | Positions where illustrations add value |
A non-skippable disk-persisting gate exists before generation: the complete prompt for each image must first be written into an independent file as a reproducible record and a reference for switching backends.
⛔ **BLOCKING: Prompt files MUST be saved before ANY image generation.**
Backend resolution follows explicit priority rules: explicit specification in current request > EXTEND.md's preferred_image_backend > automatic selection (Codex imagegen > codex CLI's codex-imagegen > Cursor GenerateImage > other host-native tools > sole installed backend > ask the user).
1. **Current-request override** — if the user names a specific backend in the current message, use it.
Two hard prohibitions rule out "faking images with code": using SVG/HTML/canvas instead of raster generation is forbidden, as is programmatically overlaying text onto generated bitmaps using ImageMagick/Pillow/OCR, etc.
**⛔ Never substitute SVG, HTML, canvas, or other code-based rendering for raster image generation.**
The generation phase defaults to batch processing: backend-native batch interfaces are prioritized, followed by host parallel tool calls (defaulting to 4 images per batch), with sequential processing used only as a last resort; failed items are retried only once, and already successful items are not regenerated.
dispatch up to `generation_batch_size` images at a time. Default: `4`.
Confirmation gates are enabled by default: explicit invocation of the skill, providing file paths, matching presets, and EXTEND.md default values are all treated as merely "recommended inputs"; the workflow cannot proceed to generation until user confirmation is completed.
Default behavior: **confirm before generation**.
Preferences in EXTEND.md undergo a 3-tier lookup (project > XDG > user home); if not found, execution blocks and runs first-time setup; the output directory is determined by default_output_dir, and images are finally reinjected into the article using relative paths.
Insert `` after paragraphs.
2Core Capabilities
3External Dependencies
| Kind | Dependency / Endpoint |
|---|---|
| cli | codex CLI(codex-imagegen 分支) |
| cli | baoyu-image-gen skill(--provider codex-cli,首选路径) |
| api | Codex 原生 imagegen skill(Skill 工具调用) |
| api | Cursor 原生 GenerateImage 工具 |
| network | codex-imagegen wrapper(自述:认证走用户 Codex 订阅,不读 OPENAI_API_KEY) |
4Recommended Governance & Evidence
- 本地工作目录: File I/O and artifact output: Agent writes to disk following SKILL.md instructions: outline.md, prompts/NN-{type}-{slug}.md, generated images, EXTEND
- SKILL.md: Declared invocation of host CLI interpreter or external execution environment
5Second-Pass Verification
- [ok] 自身目录无脚本/无网络端点/无凭证读取 — 目录内无任何可执行文件;全目录 URL 扫描只命中 github.com/JimLiu/baoyu-skills(frontmatter homepage),无请求端点、无 key/cookie/token 读取。
- [ok] SKILL.md 确实点名单一外部生成后端(orange 档依据) — 'Codex (`imagegen`)'、'route through `baoyu-image-gen --provider codex-cli` (preferred)'、Cursor `GenerateImage`、Hermes `image_generate` 四处均在 SKILL.md 正文,且被写成生成前的必经步骤(Do this once per session before any generation)。
- [ok] prompt 文件必须先落盘(BLOCKING) — SKILL.md Step 5 与 workflow.md 5.1 两处都写死;workflow.md 另有 Prompt Files 清单确认步骤。
- [ok] 禁用 SVG / 禁用位图涂改两条禁令 — SKILL.md 与 workflow 均含;Modification 段重申后处理仅限 crop/resize/compression/format conversion。
- [ok] 三维度与 preset 机制 — SKILL.md Three Dimensions 表 + 'Combine freely: `--type infographic --style vector-illustration --palette macaron`' + style-presets.md 均存在,无夸大。
- [ok] references 数量与按需加载 — 36 个 styles/*.md + 4 个 palettes/*.md + workflow/prompt-construction/styles/style-presets/usage/config/codex-imagegen 均在盘中;codex-imagegen.md 自述只在该分支被选中时加载。
- [ok] meta 元数据(license/stars/commit) — GitHub API:MIT、stargazers 25926、pushed_at 2026-09-10T15:13:43Z;本地镜像 HEAD 1567581c26ec29f4216c6e6835415bf30343b0e3 与任务 pin 一致;仓库根 LICENSE=MIT (c) 2026 Jim Liu。
6Verdict & Scenarios
842c4e88785ed928…