{"id":"baoyu-cover-image","name":"baoyu-cover-image","summary":"11のカラーパレットと7つのレンダリングスタイルを組み合わせた5次元(タイプ、パレット、レンダリング、テキスト、ムード)を持つ記事表紙画像を生成します。","body":"# Cover Image Generator\n\nGenerate elegant cover images for articles with 5-dimensional customization.\n\n## User Input Tools\n\nWhen this skill prompts the user, follow this tool-selection rule (priority order):\n\n1. **Prefer built-in user-input tools** exposed by the current agent runtime — e.g., `AskUserQuestion`, `request_user_input`, `clarify`, `ask_user`, or any equivalent.\n2. **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.\n3. **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.\n\nConcrete `AskUserQuestion` references below are examples — substitute the local equivalent in other runtimes.\n\n## Image Generation Tools\n\nWhen this skill needs to render an image, resolve the backend in this order:\n\n1. **Current-request override** — if the user names a specific backend in the current message, use it.\n2. **Saved preference** — if `EXTEND.md` sets `preferred_image_backend` to a backend available right now, use it.\n3. **Auto-select** (when the preference is `auto`, unset, or the pinned backend isn't available):\n   - **Codex (`imagegen`)** — first, inspect your available-skills / tool inventory. If a skill named `imagegen` is listed, you are running inside Codex and MUST use it: invoke via the `Skill` tool with `skill: \"imagegen\"`, passing the saved prompt file's content (plus output path and aspect ratio per Codex `imagegen`'s own args). Codex `imagegen` is 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 different `preferred_image_backend`.\n   - **Codex via `codex exec` (`codex-imagegen`)** — if the current runtime exposes no native `imagegen` skill but the `codex` CLI is on `PATH` with an active `codex login`, route through `baoyu-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](references/codex-imagegen.md) — load that file only when this branch is selected.\n   - **Cursor (`GenerateImage`)** — if the runtime exposes a native `GenerateImage` tool, you are running inside Cursor and it outranks any non-native skill the same way Codex `imagegen` does. Two hard caveats: (a) it has no aspect-ratio parameter — state the target aspect ratio / dimensions explicitly in the prompt text passed as `description`; (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 in `reference_image_paths`.\n   - **Other runtime-native tools** — if the runtime exposes a different native image tool (e.g., Hermes `image_generate`), use it the same way.\n   - Otherwise, if exactly one non-native backend is installed (e.g., `baoyu-image-gen`), use it.\n   - Otherwise (multiple non-native backends with no runtime-native tool), ask the user once — batch with any other initial questions.\n4. **If none are available**, tell the user and ask how to proceed.\n\n**⛔ 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.\n\n**⛔ 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 title/subtitle text inside an already generated cover image. If text is wrong or unclear, regenerate from a corrected prompt, switch to a lower-text or no-title variant, or ask the user which imperfect candidate to keep.\n\nSetting `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.\n\n**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.\n\nConcrete tool names (`imagegen`, `GenerateImage`, `image_generate`, `baoyu-image-gen`) above are examples — substitute the local equivalents under the same rule.\n\n## Confirmation Policy\n\nDefault behavior: **confirm before generation**.\n\n- Treat explicit skill invocation, a file path, matched keywords/presets, `EXTEND.md` defaults, and any documented auto-selection as **recommendation inputs only**. None of them authorizes skipping confirmation.\n- Do **not** start Step 3 or Step 4 until the user confirms the dimensions / aspect / language / backend choices.\n- Skip confirmation only when the current request explicitly says to do so, for example: `--quick`, \"直接生成\", \"不用确认\", \"跳过确认\", \"按默认出图\", or equivalent wording. `quick_mode: true` in `EXTEND.md` counts as a standing explicit opt-out — set it only when you want every run to skip Step 2.\n- If confirmation is skipped explicitly, state the assumed dimensions / aspect / language / backend in the next user-facing update before generating.\n\n## Options\n\n| Option | Description |\n|--------|-------------|\n| `--type <name>` | hero, conceptual, typography, metaphor, scene, minimal |\n| `--palette <name>` | warm, elegant, cool, dark, earth, vivid, pastel, mono, retro, duotone, macaron |\n| `--rendering <name>` | flat-vector, hand-drawn, painterly, digital, pixel, chalk, screen-print |\n| `--style <name>` | Preset shorthand (see [Style Presets](references/style-presets.md)) |\n| `--text <level>` | none, title-only, title-subtitle, text-rich |\n| `--mood <level>` | subtle, balanced, bold |\n| `--font <name>` | clean, handwritten, serif, display |\n| `--aspect <ratio>` | 16:9 (default), 2.35:1, 4:3, 3:2, 1:1, 3:4 |\n| `--lang <code>` | Title language (en, zh, ja, etc.) |\n| `--no-title` | Alias for `--text none` |\n| `--quick` | Skip confirmation, use auto-selection |\n| `--ref <files...>` | Reference images for style/composition guidance |\n\n## Five Dimensions\n\n| Dimension | Values | Default |\n|-----------|--------|---------|\n| **Type** | hero, conceptual, typography, metaphor, scene, minimal | auto |\n| **Palette** | warm, elegant, cool, dark, earth, vivid, pastel, mono, retro, duotone, macaron | auto |\n| **Rendering** | flat-vector, hand-drawn, painterly, digital, pixel, chalk, screen-print | auto |\n| **Text** | none, title-only, title-subtitle, text-rich | title-only |\n| **Mood** | subtle, balanced, bold | balanced |\n| **Font** | clean, handwritten, serif, display | clean |\n\nAuto-selection rules: [references/auto-selection.md](references/auto-selection.md)\n\n## Galleries\n\n**Types**: hero, conceptual, typography, metaphor, scene, minimal\n→ Details: [references/types.md](references/types.md)\n\n**Palettes**: warm, elegant, cool, dark, earth, vivid, pastel, mono, retro, duotone, macaron\n→ Details: [references/palettes/](references/palettes/)\n\n**Renderings**: flat-vector, hand-drawn, painterly, digital, pixel, chalk, screen-print\n→ Details: [references/renderings/](references/renderings/)\n\n**Text Levels**: none (pure visual) | title-only (default) | title-subtitle | text-rich (with tags)\n→ Details: [references/dimensions/text.md](references/dimensions/text.md)\n\n**Mood Levels**: subtle (low contrast) | balanced (default) | bold (high contrast)\n→ Details: [references/dimensions/mood.md](references/dimensions/mood.md)\n\n**Fonts**: clean (sans-serif) | handwritten | serif | display (bold decorative)\n→ Details: [references/dimensions/font.md](references/dimensions/font.md)\n\n## File Structure\n\nOutput directory per `default_output_dir` preference:\n- `same-dir`: `{article-dir}/`\n- `imgs-subdir`: `{article-dir}/imgs/`\n- `independent` (default): `cover-image/{topic-slug}/`\n\n```\n<output-dir>/\n├── source-{slug}.{ext}    # Source files\n├── refs/                  # Reference images (if provided)\n│   ├── ref-01-{slug}.{ext}\n│   └── ref-01-{slug}.md   # Description file\n├── prompts/cover.md       # Generation prompt\n└── cover.png              # Output image\n```\n\n**Slug**: 2-4 words, kebab-case. Conflict: append `-YYYYMMDD-HHMMSS`\n\n## Workflow\n\n### Progress Checklist\n\n```\nCover Image Progress:\n- [ ] Step 0: Check preferences (EXTEND.md) ⛔ BLOCKING\n- [ ] Step 1: Analyze content + save refs + determine output dir\n- [ ] Step 2: Confirm options (6 dimensions) ⚠️ unless --quick\n- [ ] Step 3: Create prompt\n- [ ] Step 4: Generate image\n- [ ] Step 5: Completion report\n```\n\n### Flow\n\n```\nInput → [Step 0: Preferences] ─┬─ Found → Continue\n                               └─ Not found → First-Time Setup ⛔ BLOCKING → Save EXTEND.md → Continue\n        ↓\nAnalyze + Save Refs → [Output Dir] → [Confirm: 6 Dimensions] → Prompt → Generate → Complete\n                                              ↓\n                                     (skip if --quick or all specified)\n```\n\n### Step 0: Load Preferences ⛔ BLOCKING\n\nCheck EXTEND.md in priority order — the first one found wins:\n\n| Priority | Path | Scope |\n|----------|------|-------|\n| 1 | `.baoyu-skills/baoyu-cover-image/EXTEND.md` | Project |\n| 2 | `${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-cover-image/EXTEND.md` | XDG |\n| 3 | `$HOME/.baoyu-skills/baoyu-cover-image/EXTEND.md` | User home |\n\n| Result | Action |\n|--------|--------|\n| Found | Load, display summary → Continue |\n| Not found | ⛔ Run first-time setup ([references/config/first-time-setup.md](references/config/first-time-setup.md)) → Save → Continue |\n\n**CRITICAL**: If not found, complete setup BEFORE any other steps or questions.\n\n### Step 1: Analyze Content\n\n1. **Save reference images** (if provided) → [references/workflow/reference-images.md](references/workflow/reference-images.md)\n2. **Save source content** (if pasted, save to `source.md`)\n3. **Analyze content**: topic, tone, keywords, visual metaphors\n4. **Deep analyze references** ⚠️: Extract specific, concrete elements (see reference-images.md)\n5. **Detect language**: Compare source, user input, EXTEND.md preference\n6. **Determine output directory**: Per File Structure rules\n\n**⚠️ People in Reference Images:**\n\nIf reference images contain **people** who should appear in the cover:\n\n- **Model supports `--ref`** (default): Copy image to `refs/`, pass via `--ref` at generation. No description file needed — the model sees the face directly.\n- **Model does NOT support `--ref`** (Jimeng, Seedream 3.0): Create `refs/ref-NN-{slug}.md` with per-character description (hair, glasses, skin tone, clothing). Embed as MUST/REQUIRED instructions in prompt text.\n\nSee [reference-images.md](references/workflow/reference-images.md) for full decision table.\n\n### Step 2: Confirm Options ⚠️\n\n**Hard gate**: this step is mandatory per the [Confirmation Policy](#confirmation-policy) — Steps 3–4 cannot start until the user confirms here (or explicitly opts out with `--quick` / `quick_mode: true` / equivalent wording in the current request).\n\n**MUST use `AskUserQuestion` tool** to present options as interactive selection — NOT plain text tables. Present up to 4 questions in a single `AskUserQuestion` call (Type, Palette, Rendering, Font + Settings). Each question shows the recommended option first with reason, followed by alternatives.\n\nFull confirmation flow and question format: [references/workflow/confirm-options.md](references/workflow/confirm-options.md)\n\n| Condition | Skipped | Still Asked |\n|-----------|---------|-------------|\n| `--quick` or `quick_mode: true` | 6 dimensions | Aspect ratio (unless `--aspect`) |\n| All 6 + `--aspect` specified | All | None |\n\n### Step 3: Create Prompt\n\nSave to `prompts/cover.md`. Template: [references/workflow/prompt-template.md](references/workflow/prompt-template.md)\n\n**CRITICAL - References in Frontmatter**:\n- Files saved to `refs/` → Add to frontmatter `references` list\n- Style extracted verbally (no file) → Omit `references`, describe in body\n- Before writing → Verify: `test -f refs/ref-NN-{slug}.{ext}`\n\n**Reference elements in body** MUST be detailed, prefixed with \"MUST\"/\"REQUIRED\", with integration approach.\n\n### Step 4: Generate Image\n\n1. **Backup existing** `cover.png` if regenerating\n2. **Select backend** via the `## Image Generation Tools` rule at the top: use whatever is available; if multiple, ask the user once. Do this once per session before any generation.\n3. **Write the full final prompt** to `prompts/01-cover-[slug].md` (hard requirement) BEFORE invoking the backend.\n4. **Process references** from prompt frontmatter:\n   - `direct` usage → pass via `--ref` (use ref-capable backend)\n   - `style`/`palette` → extract traits, append to prompt\n5. **Generate**: Call the chosen backend with the prompt file, output path, aspect ratio.\n   - **`codex-imagegen`**: see [references/codex-imagegen.md](references/codex-imagegen.md) for the invocation contract (preferred `baoyu-image-gen --provider codex-cli` path, runtime wrapper discovery, parameter notes, stdout schema, batch semantics).\n   - **Codex `imagegen` (native)** or other runtime-native tools / `baoyu-image-gen` skill: per the rule in `## Image Generation Tools` above.\n6. On failure: auto-retry once\n\n### Step 5: Completion Report\n\n```\nCover Generated!\n\nTopic: [topic]\nType: [type] | Palette: [palette] | Rendering: [rendering]\nText: [text] | Mood: [mood] | Font: [font] | Aspect: [ratio]\nTitle: [title or \"visual only\"]\nLanguage: [lang] | Watermark: [enabled/disabled]\nReferences: [N images or \"extracted style\" or \"none\"]\nLocation: [directory path]\n\nFiles:\n✓ source-{slug}.{ext}\n✓ prompts/cover.md\n✓ cover.png\n```\n\n## Image Modification\n\n| Action | Steps |\n|--------|-------|\n| **Regenerate** | Backup → Update prompt file FIRST → Regenerate |\n| **Change dimension** | Backup → Confirm new value → Update prompt → Regenerate |\n\nText correction policy:\n\n- If the title/subtitle is misspelled, garbled, hard to read, or visually weak, do not patch the bitmap with code.\n- For text-correction regenerations, write a new prompt file and a new output path so the flawed candidate is preserved for comparison.\n- Post-processing is limited to crop, resize, compression, or format conversion that does not alter text or the main composition.\n\n## Composition Principles\n\n- **Whitespace**: 40-60% breathing room\n- **Visual anchor**: Main element centered or offset left\n- **Characters**: Simplified silhouettes; NO realistic humans\n- **Title**: Use exact title from user/source; never invent\n\n## Changing Preferences\n\nEXTEND.md lives at the path noted in **Step 0**. Three ways to change it:\n\n- **Edit directly** — open EXTEND.md and change fields. Full schema: [references/config/preferences-schema.md](references/config/preferences-schema.md).\n- **Reconfigure interactively** — delete EXTEND.md (or ask \"reconfigure baoyu-cover-image preferences\" / \"重新配置\"). The next run re-triggers first-time setup.\n- **Common one-line edits**:\n  - `preferred_image_backend: auto` — default; runtime-native tool wins, falls back to the only installed backend, asks only if multiple non-native are present.\n  - `preferred_image_backend: codex-imagegen` — pin to Codex's built-in.\n  - `preferred_image_backend: baoyu-image-gen` — pin to the baoyu-image-gen skill.\n  - `preferred_image_backend: ask` — confirm backend every run.\n  - `watermark.enabled: true`, `preferred_type`, `preferred_palette`, `preferred_rendering`, `default_aspect`, `quick_mode: true`, `language` — shift the auto-selection defaults and confirmation flow.\n\n## References\n\n**Dimensions**: [text.md](references/dimensions/text.md) | [mood.md](references/dimensions/mood.md) | [font.md](references/dimensions/font.md)\n**Palettes**: [references/palettes/](references/palettes/)\n**Renderings**: [references/renderings/](references/renderings/)\n**Types**: [references/types.md](references/types.md)\n**Auto-Selection**: [references/auto-selection.md](references/auto-selection.md)\n**Style Presets**: [references/style-presets.md](references/style-presets.md)\n**Compatibility**: [references/compatibility.md](references/compatibility.md)\n**Visual Elements**: [references/visual-elements.md](references/visual-elements.md)\n**Workflow**: [confirm-options.md](references/workflow/confirm-options.md) | [prompt-template.md](references/workflow/prompt-template.md) | [reference-images.md](references/workflow/reference-images.md)\n**Config**: [preferences-schema.md](references/config/preferences-schema.md) | [first-time-setup.md](references/config/first-time-setup.md) | [watermark-guide.md](references/config/watermark-guide.md)","author":"@JimLiu","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/JimLiu/baoyu-skills/tree/main/skills/baoyu-cover-image","license":"MIT","category":"writing","lang":"en","tokens":4235,"stars":0,"calls30d":2,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[{"path":"references/auto-selection.md","size":2837,"sha256":"c15c3434c30f6e47bbfb78a983f1cd96f525234280b547dcc7ffa87a2a81c400"},{"path":"references/base-prompt.md","size":5452,"sha256":"04bfa168192dc77efc13009694297bd1d9e80867d24dae0f1d5a1c5277216364"},{"path":"references/codex-imagegen.md","size":3715,"sha256":"64dae2b803186bcc8c66aa3457fbd0ddd434758c1b1962b63755cd07a3e90d9a"},{"path":"references/compatibility.md","size":2421,"sha256":"6c2f5ac24a6ce91f1a6508e5bbeb99cbade38f9397b174d7c8660abb587634ab"},{"path":"references/config/first-time-setup.md","size":5950,"sha256":"c532e78b81f3c4d4a41c94de633fb697ed2187fb5d662b80ee58685c3c7ee277"},{"path":"references/config/preferences-schema.md","size":8948,"sha256":"26b30d80afadcd1624d8b9c946fa2505881c3a6b3b46f1c01dc4fd3b7b38c082"},{"path":"references/config/watermark-guide.md","size":2217,"sha256":"d1034c560cb36e37740375e0b69b8d2be717410769c320fc8f3434ecc61f83e1"},{"path":"references/dimensions/font.md","size":4788,"sha256":"ad7762bcbadd64067da98fd113ab529c217148f5e5b26e6354a342b7dc5599b6"},{"path":"references/dimensions/mood.md","size":4366,"sha256":"d919d3a5b227200c7d22a5adaa63e49527563d75dc7706adb56857886d077604"},{"path":"references/dimensions/text.md","size":3167,"sha256":"0211f097cb0f2ddfff48825ab2dd9e5156e01e82d5246aeec282106e49e5de89"},{"path":"references/palettes/cool.md","size":743,"sha256":"51454e56fc2ce07e5122bd8ecb9f58b6dc82cc423e19d2aeaba0a604e6bcda08"},{"path":"references/palettes/dark.md","size":753,"sha256":"51e887eb17897c71e2b6ceed85e96543c11e7c4d26aaa7cd04304b1b961bcb4f"},{"path":"references/palettes/duotone.md","size":1407,"sha256":"5ce4cfcaeadedb0a32ae62c41a4c684f315e28cbc1cce4465a230b92a52b037c"},{"path":"references/palettes/earth.md","size":734,"sha256":"9b9fa379d537f379f425ca6af8a1be3284cf78dc51b931b02f531e0d0d8150b4"},{"path":"references/palettes/elegant.md","size":729,"sha256":"4f50232d1174597a4168b4bdd7fce48b8d65851a6a8ed0b10735f7d87bbf1256"},{"path":"references/palettes/macaron.md","size":769,"sha256":"23022d4aae936a3da1a495b1a4c5dccef7085e6e00e1747291bbe7cb4a71701d"},{"path":"references/palettes/mono.md","size":716,"sha256":"16823b0d882ec3e6e87cc0236429ca5a33faa282e5ebea377344a707914d7e59"},{"path":"references/palettes/pastel.md","size":715,"sha256":"14fc4e0e416c957980d4ee7cee3c97a956b82723b8303d946791e654fa7edf39"},{"path":"references/palettes/retro.md","size":933,"sha256":"da56ffe48a5f31b3b70f9cef7bb406da99c9d1d733fddcd6dd762bea5cb09132"},{"path":"references/palettes/vivid.md","size":751,"sha256":"7a459d73c3aef3006729d8b9438be2832e73b89455fc77e9f03f5a58442e7e8c"},{"path":"references/palettes/warm.md","size":721,"sha256":"a9bbcd59baa5a1c5a8bc201804c902805cb4f993cfcc174b2e02596c13d2092b"},{"path":"references/renderings/chalk.md","size":1086,"sha256":"3ecd1eda4a76405c1d69c97fe6ba7d2aa61910f85b0032be434c50c8501f7eab"},{"path":"references/renderings/digital.md","size":1080,"sha256":"ad24896fd8bf37cffb43fcb05c176283df01fad11b6f58b1959b1ef797d4e51f"},{"path":"references/renderings/flat-vector.md","size":1241,"sha256":"c7806bde5cd8b3ecd7d81b7f7e30d13ca90eba83e7ca5fa716689e383c61fc34"}],"requires":{"mcp":[],"tools":[]},"safety":{"flags":[{"code":"injection.preauthorise","kind":"injection","where":"references/config/preferences-schema.md:65","excerpt":"always confirm","message":"pre-authorises approvals on the user’s behalf","severity":"warn"}],"scannedAt":"2026-08-22","hasScripts":false,"networkEndpoints":[]}}