diff --git a/docs/image-generation-tools.md b/docs/image-generation-tools.md index 750a558..121f05f 100644 --- a/docs/image-generation-tools.md +++ b/docs/image-generation-tools.md @@ -4,13 +4,29 @@ Skills in this repo are loaded by multiple agent runtimes (Claude Code, Codex, H ## The Rule -When a skill needs to render an image: +When a skill needs to render an image, resolve the backend in this order: -- **Use whatever image-generation tool or skill is available** in the current runtime — e.g., Codex `imagegen`, Hermes `image_generate`, `baoyu-imagine`, or any equivalent the user has installed. -- **If multiple are available**, ask the user **once** at the start which to use (batch with any other initial questions). -- **If none are available**, tell the user and ask how to proceed. +1. **Current-request override** — if the user names a specific backend in the current message, use it. +2. **Saved preference** — if the skill's `EXTEND.md` sets `preferred_image_backend` to a backend available right now, use it. +3. **Auto-select** (when the preference is `auto`, unset, or the pinned backend isn't available): + - If the current runtime exposes a native image tool (e.g., Codex `imagegen`, Hermes `image_generate`), use it. Runtime-native tools are preferred by default — agents that know their own tool inventory should surface the native one here. + - Otherwise, if exactly one non-native backend is installed (e.g., `baoyu-imagine`), use it. + - Otherwise (multiple non-native backends with no runtime-native tool), ask the user once — batch with any other initial questions. +4. **If none are available**, tell the user and ask how to proceed. -No explicit priority between runtime-native tools and repo skills — treat them equivalently and let the user decide when there's a choice. No persisted preference mechanism; the question is cheap, and the rule is stateless. +Setting `preferred_image_backend: ask` forces the step-3 prompt every run regardless of available backends. + +## The Preference Field + +Each image-consuming skill's `EXTEND.md` carries a single `preferred_image_backend` field: + +| Value | Meaning | +|---|---| +| `auto` (default) | Apply the auto-select rule — runtime-native preferred, fall back to only installed backend, ask if multiple non-native. | +| `ask` | Always confirm the backend on every run, even when a runtime-native tool exists. | +| `` (e.g., `codex-imagegen`, `baoyu-imagine`, `image_generate`) | Pin this backend when available; fall back to `auto` if it isn't. | + +The field is **absent-equals-auto**: older `EXTEND.md` files without this field behave exactly as if `preferred_image_backend: auto` were set. No schema version bump is needed to introduce it. ## Prompt File Requirement (hard) @@ -20,6 +36,8 @@ Regardless of which backend is chosen, every skill that renders images MUST writ Each `SKILL.md` that renders images includes **exactly one** `## Image Generation Tools` section (near the top, after `## User Input Tools` and before the main workflow) that **inlines** this rule. Skills are self-contained and cannot link to `docs/` — each skill folder must ship the rule inside its own `SKILL.md`. See [CLAUDE.md → Skill Self-Containment](../CLAUDE.md). +Each skill's `references/config/preferences-schema.md` (and its `EXTEND.md` template in `first-time-setup.md`) lists `preferred_image_backend` alongside other preference fields. First-time setup does NOT ask the user about the backend — `auto` is set silently. Users who want to pin a specific backend edit `EXTEND.md` later, and each skill's `## Changing Preferences` section documents the common one-line edits. + Concrete tool names (`imagegen`, `image_generate`, `baoyu-imagine`) in this document and in SKILL.md are **examples** — agents in other runtimes apply the rule above and substitute the local equivalent. Skill-specific parameters for these backends are illustrative; runtimes without those knobs can omit them. ## Backend Skills Are Exempt diff --git a/skills/baoyu-article-illustrator/SKILL.md b/skills/baoyu-article-illustrator/SKILL.md index 977015f..99b2228 100644 --- a/skills/baoyu-article-illustrator/SKILL.md +++ b/skills/baoyu-article-illustrator/SKILL.md @@ -23,11 +23,17 @@ Concrete `AskUserQuestion` references below are examples — substitute the loca ## Image Generation Tools -When this skill needs to render an image: +When this skill needs to render an image, resolve the backend in this order: -- **Use whatever image-generation tool or skill is available** in the current runtime — e.g., Codex `imagegen`, Hermes `image_generate`, `baoyu-imagine`, or any equivalent the user has installed. -- **If multiple are available**, ask the user **once** at the start which to use (batch with any other initial questions). -- **If none are available**, tell the user and ask how to proceed. +1. **Current-request override** — if the user names a specific backend in the current message, use it. +2. **Saved preference** — if `EXTEND.md` sets `preferred_image_backend` to a backend available right now, use it. +3. **Auto-select** (when the preference is `auto`, unset, or the pinned backend isn't available): + - If the current runtime exposes a native image tool (e.g., Codex `imagegen`, Hermes `image_generate`), use it. Runtime-native tools are preferred by default — agents that know their own tool inventory should surface the native one here. + - Otherwise, if exactly one non-native backend is installed (e.g., `baoyu-imagine`), use it. + - Otherwise (multiple non-native backends with no runtime-native tool), ask the user once — batch with any other initial questions. +4. **If none are available**, tell the user and ask how to proceed. + +Setting `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. **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. @@ -207,3 +213,17 @@ When input is **pasted content** (no file path), always uses `illustrations/{top | [references/style-presets.md](references/style-presets.md) | Preset shortcuts (type + style + palette) | | [references/prompt-construction.md](references/prompt-construction.md) | Prompt templates | | [references/config/first-time-setup.md](references/config/first-time-setup.md) | First-time setup | + +## Changing Preferences + +EXTEND.md lives at the first matching path listed in Step 1.5. Three ways to change it: + +- **Edit directly** — open EXTEND.md and change fields. Full schema: `references/config/preferences-schema.md`. +- **Reconfigure interactively** — delete EXTEND.md (or ask "reconfigure baoyu-article-illustrator preferences" / "重新配置"). The next run re-triggers first-time setup. +- **Common one-line edits**: + - `preferred_image_backend: auto` — default; runtime-native tool wins, falls back to the only installed backend, asks only if multiple non-native are present. + - `preferred_image_backend: codex-imagegen` — pin to Codex's built-in. + - `preferred_image_backend: baoyu-imagine` — pin to the baoyu-imagine skill. + - `preferred_image_backend: ask` — confirm backend every run. + - `preferred_type: infographic`, `preferred_style: notion`, `preferred_palette: macaron`, `language: zh`. + - `default_output_dir: imgs-subdir` — where to write generated images relative to the article. diff --git a/skills/baoyu-article-illustrator/references/config/first-time-setup.md b/skills/baoyu-article-illustrator/references/config/first-time-setup.md index bc2d79c..d768a0c 100644 --- a/skills/baoyu-article-illustrator/references/config/first-time-setup.md +++ b/skills/baoyu-article-illustrator/references/config/first-time-setup.md @@ -126,13 +126,13 @@ preferred_style: description: "" default_output_dir: imgs-subdir # same-dir | imgs-subdir | illustrations-subdir | independent language: null +preferred_image_backend: auto custom_styles: [] --- ``` +`preferred_image_backend: auto` is the baked-in default — first-time setup does not ask about it. The `## Image Generation Tools` rule in SKILL.md then picks the runtime-native tool (Codex `imagegen`, Hermes `image_generate`, etc.) when available, and falls back to installed backends. + ## Modifying Preferences Later -Users can edit EXTEND.md directly or run setup again: -- Delete EXTEND.md to trigger setup -- Edit YAML frontmatter for quick changes -- Full schema: `config/preferences-schema.md` +See the `## Changing Preferences` section in `SKILL.md` for the canonical list of common edits (pin backend, change defaults, retrigger setup). Full schema: `preferences-schema.md`. diff --git a/skills/baoyu-article-illustrator/references/config/preferences-schema.md b/skills/baoyu-article-illustrator/references/config/preferences-schema.md index 6b37faa..7201e2b 100644 --- a/skills/baoyu-article-illustrator/references/config/preferences-schema.md +++ b/skills/baoyu-article-illustrator/references/config/preferences-schema.md @@ -26,6 +26,8 @@ language: null # zh|en|ja|ko|auto default_output_dir: null # same-dir|illustrations-subdir|independent +preferred_image_backend: auto # auto|ask| + custom_styles: - name: my-style description: "Style description" @@ -52,6 +54,7 @@ custom_styles: | `preferred_palette` | string | null | Palette override (macaron, warm, neon, or null) | | `language` | string | null | Output language (null = auto-detect) | | `default_output_dir` | enum | null | Output directory preference (null = ask each time) | +| `preferred_image_backend` | string | `auto` | Image backend selection. `auto` = prefer runtime-native tool, fall back to the only installed backend, ask if multiple non-native are present. `ask` = always confirm on every run. `` (e.g., `codex-imagegen`, `baoyu-imagine`, `image_generate`) = pin this backend when available; fall back to `auto` when it isn't. Absent = `auto`. Resolution logic is documented in `SKILL.md`'s `## Image Generation Tools` section. | | `custom_styles` | array | [] | User-defined styles | ## Position Options @@ -113,6 +116,8 @@ preferred_style: language: zh +preferred_image_backend: codex-imagegen + custom_styles: - name: corporate description: "Professional B2B style" diff --git a/skills/baoyu-comic/SKILL.md b/skills/baoyu-comic/SKILL.md index c525e01..0c87ae6 100644 --- a/skills/baoyu-comic/SKILL.md +++ b/skills/baoyu-comic/SKILL.md @@ -27,11 +27,17 @@ Concrete `AskUserQuestion` references below are examples — substitute the loca ## Image Generation Tools -When this skill needs to render an image: +When this skill needs to render an image, resolve the backend in this order: -- **Use whatever image-generation tool or skill is available** in the current runtime — e.g., Codex `imagegen`, Hermes `image_generate`, `baoyu-imagine`, or any equivalent the user has installed. -- **If multiple are available**, ask the user **once** at the start which to use (batch with any other initial questions). -- **If none are available**, tell the user and ask how to proceed. +1. **Current-request override** — if the user names a specific backend in the current message, use it. +2. **Saved preference** — if `EXTEND.md` sets `preferred_image_backend` to a backend available right now, use it. +3. **Auto-select** (when the preference is `auto`, unset, or the pinned backend isn't available): + - If the current runtime exposes a native image tool (e.g., Codex `imagegen`, Hermes `image_generate`), use it. Runtime-native tools are preferred by default — agents that know their own tool inventory should surface the native one here. + - Otherwise, if exactly one non-native backend is installed (e.g., `baoyu-imagine`), use it. + - Otherwise (multiple non-native backends with no runtime-native tool), ask the user once — batch with any other initial questions. +4. **If none are available**, tell the user and ask how to proceed. + +Setting `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. **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. @@ -295,3 +301,16 @@ If EXTEND.md is not found, first-time setup is **blocking** — complete it befo - **Step 7.1 character sheet** - recommended for multi-page comics, optional for simple presets - **Step 7.2 character reference** - use `--ref` if sheet exists; compress/convert on failure; fall back to prompt-only - Watermark/language configured once in EXTEND.md + +## Changing Preferences + +EXTEND.md lives at `.baoyu-skills/baoyu-comic/EXTEND.md` (project) or `~/.baoyu-skills/baoyu-comic/EXTEND.md` (user). Three ways to change it: + +- **Edit directly** — open EXTEND.md and change fields. Full schema: `references/config/preferences-schema.md`. +- **Reconfigure interactively** — delete EXTEND.md (or ask "reconfigure baoyu-comic preferences" / "重新配置"). The next run re-triggers first-time setup. +- **Common one-line edits**: + - `preferred_image_backend: auto` — default; runtime-native tool wins, falls back to the only installed backend, asks only if multiple non-native are present. + - `preferred_image_backend: codex-imagegen` — pin to Codex's built-in. + - `preferred_image_backend: baoyu-imagine` — pin to the baoyu-imagine skill. + - `preferred_image_backend: ask` — confirm backend every run. + - `watermark.enabled: true`, `preferred_art`, `preferred_tone`, `preferred_layout`, `language` — shift the auto-selection defaults and cosmetic choices. diff --git a/skills/baoyu-comic/references/config/first-time-setup.md b/skills/baoyu-comic/references/config/first-time-setup.md index 66878bf..20fb8c3 100644 --- a/skills/baoyu-comic/references/config/first-time-setup.md +++ b/skills/baoyu-comic/references/config/first-time-setup.md @@ -142,13 +142,13 @@ preferred_tone: [selected tone or null] preferred_layout: null preferred_aspect: null language: [selected or null] +preferred_image_backend: auto character_presets: [] --- ``` +`preferred_image_backend: auto` is the baked-in default — first-time setup does not ask about it. The `## Image Generation Tools` rule in SKILL.md then picks the runtime-native tool (Codex `imagegen`, Hermes `image_generate`, etc.) when available, and falls back to installed backends. + ## Modifying Preferences Later -Users can edit EXTEND.md directly or run setup again: -- Delete EXTEND.md to trigger setup -- Edit YAML frontmatter for quick changes -- Full schema: `config/preferences-schema.md` +See the `## Changing Preferences` section in `SKILL.md` for the canonical list of common edits (pin backend, change defaults, retrigger setup). Full schema: `config/preferences-schema.md`. diff --git a/skills/baoyu-comic/references/config/preferences-schema.md b/skills/baoyu-comic/references/config/preferences-schema.md index b9ba376..76dd467 100644 --- a/skills/baoyu-comic/references/config/preferences-schema.md +++ b/skills/baoyu-comic/references/config/preferences-schema.md @@ -23,6 +23,8 @@ preferred_aspect: null # 3:4|4:3|16:9 language: null # zh|en|ja|ko|auto +preferred_image_backend: auto # auto|ask| + character_presets: - name: my-characters roles: @@ -46,6 +48,7 @@ character_presets: | `preferred_layout` | string | null | Layout preference or null | | `preferred_aspect` | string | null | Aspect ratio (3:4, 4:3, 16:9) | | `language` | string | null | Output language (null = auto-detect) | +| `preferred_image_backend` | string | `auto` | Image backend selection. `auto` = prefer runtime-native tool, fall back to the only installed backend, ask if multiple non-native are present. `ask` = always confirm on every run. `` (e.g., `codex-imagegen`, `baoyu-imagine`, `image_generate`) = pin this backend when available; fall back to `auto` when it isn't. Absent = `auto`. Resolution logic is documented in `SKILL.md`'s `## Image Generation Tools` section. | | `character_presets` | array | [] | Preset character roles for styles like ohmsha | ## Art Style Options @@ -122,6 +125,8 @@ preferred_aspect: "3:4" language: zh +preferred_image_backend: codex-imagegen + character_presets: - name: tech-tutorial roles: diff --git a/skills/baoyu-cover-image/SKILL.md b/skills/baoyu-cover-image/SKILL.md index 78872d5..b992763 100644 --- a/skills/baoyu-cover-image/SKILL.md +++ b/skills/baoyu-cover-image/SKILL.md @@ -23,11 +23,17 @@ Concrete `AskUserQuestion` references below are examples — substitute the loca ## Image Generation Tools -When this skill needs to render an image: +When this skill needs to render an image, resolve the backend in this order: -- **Use whatever image-generation tool or skill is available** in the current runtime — e.g., Codex `imagegen`, Hermes `image_generate`, `baoyu-imagine`, or any equivalent the user has installed. -- **If multiple are available**, ask the user **once** at the start which to use (batch with any other initial questions). -- **If none are available**, tell the user and ask how to proceed. +1. **Current-request override** — if the user names a specific backend in the current message, use it. +2. **Saved preference** — if `EXTEND.md` sets `preferred_image_backend` to a backend available right now, use it. +3. **Auto-select** (when the preference is `auto`, unset, or the pinned backend isn't available): + - If the current runtime exposes a native image tool (e.g., Codex `imagegen`, Hermes `image_generate`), use it. Runtime-native tools are preferred by default — agents that know their own tool inventory should surface the native one here. + - Otherwise, if exactly one non-native backend is installed (e.g., `baoyu-imagine`), use it. + - Otherwise (multiple non-native backends with no runtime-native tool), ask the user once — batch with any other initial questions. +4. **If none are available**, tell the user and ask how to proceed. + +Setting `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. **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. @@ -228,13 +234,18 @@ Files: - **Characters**: Simplified silhouettes; NO realistic humans - **Title**: Use exact title from user/source; never invent -## Extension Support +## Changing Preferences -Custom configurations via EXTEND.md. See **Step 0** for paths. +EXTEND.md lives at the path noted in **Step 0**. Three ways to change it: -Supports: Watermark | Preferred dimensions | Default aspect/output | Quick mode | Custom palettes | Language - -Schema: [references/config/preferences-schema.md](references/config/preferences-schema.md) +- **Edit directly** — open EXTEND.md and change fields. Full schema: [references/config/preferences-schema.md](references/config/preferences-schema.md). +- **Reconfigure interactively** — delete EXTEND.md (or ask "reconfigure baoyu-cover-image preferences" / "重新配置"). The next run re-triggers first-time setup. +- **Common one-line edits**: + - `preferred_image_backend: auto` — default; runtime-native tool wins, falls back to the only installed backend, asks only if multiple non-native are present. + - `preferred_image_backend: codex-imagegen` — pin to Codex's built-in. + - `preferred_image_backend: baoyu-imagine` — pin to the baoyu-imagine skill. + - `preferred_image_backend: ask` — confirm backend every run. + - `watermark.enabled: true`, `preferred_type`, `preferred_palette`, `preferred_rendering`, `default_aspect`, `quick_mode: true`, `language` — shift the auto-selection defaults and confirmation flow. ## References diff --git a/skills/baoyu-cover-image/references/config/first-time-setup.md b/skills/baoyu-cover-image/references/config/first-time-setup.md index 49015d6..a00c275 100644 --- a/skills/baoyu-cover-image/references/config/first-time-setup.md +++ b/skills/baoyu-cover-image/references/config/first-time-setup.md @@ -188,15 +188,15 @@ default_aspect: [16:9/2.35:1/1:1/3:4] default_output_dir: [independent/same-dir/imgs-subdir] quick_mode: [true/false] language: null +preferred_image_backend: auto custom_palettes: [] --- ``` +`preferred_image_backend: auto` is the baked-in default — first-time setup does not ask about it. The `## Image Generation Tools` rule in SKILL.md then picks the runtime-native tool (Codex `imagegen`, Hermes `image_generate`, etc.) when available, and falls back to installed backends. + ## Modifying Preferences Later -Users can edit EXTEND.md directly or run setup again: -- Delete EXTEND.md to trigger setup -- Edit YAML frontmatter for quick changes -- Full schema: `preferences-schema.md` +See the `## Changing Preferences` section in `SKILL.md` for the canonical list of common edits (pin backend, change defaults, retrigger setup). Full schema: `preferences-schema.md`. -**EXTEND.md Supports**: Watermark | Preferred type | Preferred palette | Preferred rendering | Preferred text | Preferred mood | Default aspect ratio | Default output directory | Quick mode | Custom palette definitions | Language preference +**EXTEND.md Supports**: Watermark | Preferred type | Preferred palette | Preferred rendering | Preferred text | Preferred mood | Default aspect ratio | Default output directory | Quick mode | Image backend preference | Custom palette definitions | Language preference diff --git a/skills/baoyu-cover-image/references/config/preferences-schema.md b/skills/baoyu-cover-image/references/config/preferences-schema.md index fe0ef30..ba69692 100644 --- a/skills/baoyu-cover-image/references/config/preferences-schema.md +++ b/skills/baoyu-cover-image/references/config/preferences-schema.md @@ -32,6 +32,8 @@ quick_mode: false # Skip confirmation when true language: null # zh|en|ja|ko|auto (null = auto-detect) +preferred_image_backend: auto # auto|ask| + custom_palettes: - name: my-palette description: "Palette description" @@ -60,6 +62,7 @@ custom_palettes: | `default_aspect` | string | "2.35:1" | Default aspect ratio | | `quick_mode` | bool | false | Skip confirmation step | | `language` | string | null | Output language (null = auto-detect) | +| `preferred_image_backend` | string | `auto` | Image backend selection. `auto` = prefer runtime-native tool, fall back to the only installed backend, ask if multiple non-native are present. `ask` = always confirm on every run. `` (e.g., `codex-imagegen`, `baoyu-imagine`, `image_generate`) = pin this backend when available; fall back to `auto` when it isn't. Absent = `auto`. Resolution logic is documented in `SKILL.md`'s `## Image Generation Tools` section. | | `custom_palettes` | array | [] | User-defined palettes | ## Type Options @@ -187,6 +190,8 @@ quick_mode: true language: en +preferred_image_backend: codex-imagegen + custom_palettes: - name: corporate-tech description: "Professional B2B tech palette" diff --git a/skills/baoyu-image-cards/SKILL.md b/skills/baoyu-image-cards/SKILL.md index bf57428..368e123 100644 --- a/skills/baoyu-image-cards/SKILL.md +++ b/skills/baoyu-image-cards/SKILL.md @@ -23,14 +23,22 @@ Concrete `AskUserQuestion` references below are examples — substitute the loca ## Image Generation Tools -When this skill needs to render an image: +When this skill needs to render an image, resolve the backend in this order: -- **Use whatever image-generation tool or skill is available** in the current runtime — e.g., Codex `imagegen`, Hermes `image_generate`, `baoyu-imagine`, or any equivalent the user has installed. -- **If multiple are available**, ask the user **once** at the start which to use (batch with any other initial questions). -- **If none are available**, tell the user and ask how to proceed. +1. **Current-request override** — if the user names a specific backend in the current message, use it. +2. **Saved preference** — if `EXTEND.md` sets `preferred_image_backend` to a backend available right now, use it. +3. **Auto-select** (when the preference is `auto`, unset, or the pinned backend isn't available): + - If the current runtime exposes a native image tool (e.g., Codex `imagegen`, Hermes `image_generate`), use it. Runtime-native tools are preferred by default — agents that know their own tool inventory should surface the native one here. + - Otherwise, if exactly one non-native backend is installed (e.g., `baoyu-imagine`), use it. + - Otherwise (multiple non-native backends with no runtime-native tool), ask the user once — batch with any other initial questions. +4. **If none are available**, tell the user and ask how to proceed. + +Setting `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. **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 file is the reproducibility record and lets you switch backends without regenerating prompts. +Concrete tool names (`imagegen`, `image_generate`, `baoyu-imagine`) above are examples — substitute the local equivalents under the same rule. + ## Language Respond in the user's language across questions, progress, errors, and completion summary. Keep technical tokens (style names, file paths, code) in English. @@ -417,4 +425,16 @@ Always update the prompt file before regenerating — it's the source of truth a - For sensitive public figures, use stylized cartoon alternatives. - Smart Confirm (Step 2) is required; Detailed mode adds a second confirmation (2a + 2c). -Custom configurations via EXTEND.md. See Step 0 for paths and schema. +## Changing Preferences + +EXTEND.md lives at the first matching path listed in Step 0. Three ways to change it: + +- **Edit directly** — open EXTEND.md and change fields. Full schema: `references/config/preferences-schema.md`. +- **Reconfigure interactively** — delete EXTEND.md (or ask "reconfigure baoyu-image-cards preferences" / "重新配置"). The next run re-triggers first-time setup. +- **Common one-line edits**: + - `preferred_image_backend: auto` — default; runtime-native tool wins, falls back to the only installed backend, asks only if multiple non-native are present. + - `preferred_image_backend: codex-imagegen` — pin to Codex's built-in. + - `preferred_image_backend: baoyu-imagine` — pin to the baoyu-imagine skill. + - `preferred_image_backend: ask` — confirm backend every run. + - `preferred_style: notion`, `preferred_layout: dense`, `preferred_palette: macaron`, `language: zh`. + - `watermark.enabled: true` + `watermark.content: "@handle"` — add a watermark. diff --git a/skills/baoyu-image-cards/references/config/first-time-setup.md b/skills/baoyu-image-cards/references/config/first-time-setup.md index 8e6df33..01742d7 100644 --- a/skills/baoyu-image-cards/references/config/first-time-setup.md +++ b/skills/baoyu-image-cards/references/config/first-time-setup.md @@ -110,13 +110,13 @@ preferred_style: description: "" preferred_layout: null language: null +preferred_image_backend: auto custom_styles: [] --- ``` +`preferred_image_backend: auto` is the baked-in default — first-time setup does not ask about it. The `## Image Generation Tools` rule in SKILL.md then picks the runtime-native tool (Codex `imagegen`, Hermes `image_generate`, etc.) when available, and falls back to installed backends. + ## Modifying Preferences Later -Users can edit EXTEND.md directly or run setup again: -- Delete EXTEND.md to trigger setup -- Edit YAML frontmatter for quick changes -- Full schema: `config/preferences-schema.md` +See the `## Changing Preferences` section in `SKILL.md` for the canonical list of common edits (pin backend, change defaults, retrigger setup). Full schema: `preferences-schema.md`. diff --git a/skills/baoyu-image-cards/references/config/preferences-schema.md b/skills/baoyu-image-cards/references/config/preferences-schema.md index c4e3b6c..71a639b 100644 --- a/skills/baoyu-image-cards/references/config/preferences-schema.md +++ b/skills/baoyu-image-cards/references/config/preferences-schema.md @@ -24,6 +24,8 @@ preferred_layout: null # sparse|balanced|dense|list|comparison|flow language: null # zh|en|ja|ko|auto +preferred_image_backend: auto # auto|ask| + custom_styles: - name: my-style description: "Style description" @@ -49,6 +51,7 @@ custom_styles: | `preferred_style.description` | string | "" | Custom notes/override | | `preferred_layout` | string | null | Layout preference or null | | `language` | string | null | Output language (null = auto-detect) | +| `preferred_image_backend` | string | `auto` | Image backend selection. `auto` = prefer runtime-native tool, fall back to the only installed backend, ask if multiple non-native are present. `ask` = always confirm on every run. `` (e.g., `codex-imagegen`, `baoyu-imagine`, `image_generate`) = pin this backend when available; fall back to `auto` when it isn't. Absent = `auto`. Resolution logic is documented in `SKILL.md`'s `## Image Generation Tools` section. | | `custom_styles` | array | [] | User-defined styles | ## Position Options @@ -104,6 +107,8 @@ preferred_layout: dense language: zh +preferred_image_backend: codex-imagegen + custom_styles: - name: corporate description: "Professional B2B style" diff --git a/skills/baoyu-infographic/SKILL.md b/skills/baoyu-infographic/SKILL.md index 977bb72..af7c04a 100644 --- a/skills/baoyu-infographic/SKILL.md +++ b/skills/baoyu-infographic/SKILL.md @@ -1,7 +1,7 @@ --- name: baoyu-infographic description: Generate professional infographics with 21 layout types and 21 visual styles. Analyzes content, recommends layout×style combinations, and generates publication-ready infographics. Use when user asks to create "infographic", "信息图", "visual summary", "可视化", or "高密度信息大图". -version: 1.56.1 +version: 1.57.0 metadata: openclaw: homepage: https://github.com/JimLiu/baoyu-skills#baoyu-infographic @@ -23,11 +23,17 @@ Concrete `AskUserQuestion` references below are examples — substitute the loca ## Image Generation Tools -When this skill needs to render an image: +When this skill needs to render an image, resolve the backend in this order: -- **Use whatever image-generation tool or skill is available** in the current runtime — e.g., Codex `imagegen`, Hermes `image_generate`, `baoyu-imagine`, or any equivalent the user has installed. -- **If multiple are available**, ask the user **once** at the start which to use (batch with any other initial questions). -- **If none are available**, tell the user and ask how to proceed. +1. **Current-request override** — if the user names a specific backend in the current message, use it. +2. **Saved preference** — if `EXTEND.md` sets `preferred_image_backend` to a backend available right now, use it. +3. **Auto-select** (when the preference is `auto`, unset, or the pinned backend isn't available): + - If the current runtime exposes a native image tool (e.g., Codex `imagegen`, Hermes `image_generate`), use it. Runtime-native tools are preferred by default — agents that know their own tool inventory should surface the native one here. + - Otherwise, if exactly one non-native backend is installed (e.g., `baoyu-imagine`), use it. + - Otherwise (multiple non-native backends with no runtime-native tool), ask the user once — batch with any other initial questions. +4. **If none are available**, tell the user and ask how to proceed. + +Setting `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. **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. @@ -201,7 +207,7 @@ Check EXTEND.md in priority order — the first one found wins: | Found | Read, parse, display a one-line summary | | Not found | Ask the user with `AskUserQuestion` (see `references/config/first-time-setup.md`) | -**EXTEND.md supports**: preferred layout/style, default aspect ratio, custom style definitions, language preference. +**EXTEND.md supports**: preferred layout/style, default aspect ratio, language preference, preferred image backend, custom style definitions. Schema: `references/config/preferences-schema.md` @@ -248,6 +254,7 @@ Ask the user to confirm the questions below following the [User Input Tools](#us | 1 | **Combination** | Always | 3+ layout×style combos with rationale | | 2 | **Aspect** | Always | Named presets (landscape/portrait/square) or custom W:H ratio (e.g., 3:4, 4:3, 2.35:1) | | 3 | **Language** | Only if source ≠ user language | Language for text content | +| 4 | **Image Backend** | Only if step 3 of the `## Image Generation Tools` rule needs to ask (no runtime-native tool AND multiple non-native backends, OR `preferred_image_backend: ask`) | Available backends | ### Step 5: Generate Prompt → `prompts/infographic.md` @@ -266,7 +273,7 @@ Combine: ### Step 6: Generate Image -1. Select the 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. +1. Resolve the backend per the `## Image Generation Tools` rule at the top of this file. 2. Ensure the full final prompt is persisted at `prompts/infographic.md` (already written in Step 5) BEFORE invoking the backend — the file is the reproducibility record. 3. **Check for existing file**: Before generating, check if `infographic.png` exists - If exists: Rename to `infographic-backup-YYYYMMDD-HHMMSS.png` @@ -275,7 +282,7 @@ Combine: ### Step 7: Output Summary -Report: topic, layout, style, aspect, language, output path, files created. +Report: topic, layout, style, aspect, language, image backend, output path, files created. ## References @@ -285,6 +292,15 @@ Report: topic, layout, style, aspect, language, output path, files created. - `references/layouts/.md` - 21 layout definitions - `references/styles/