Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Analyze articles and generate contextual illustrations using Type × Style two-dimension approach across multiple AI providers.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
SKILL.md
1---2name: baoyu-article-illustrator3description: 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 "为文章配图".4version: 1.58.05metadata:6openclaw:7homepage: https://github.com/JimLiu/baoyu-skills#baoyu-article-illustrator8---910# Article Illustrator1112Analyze articles, identify illustration positions, generate images with Type × Style × Palette consistency.1314## User Input Tools1516When this skill prompts the user, follow this tool-selection rule (priority order):17181. **Prefer built-in user-input tools** exposed by the current agent runtime — e.g., `AskUserQuestion`, `request_user_input`, `clarify`, `ask_user`, or any equivalent.192. **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.203. **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.2122Concrete `AskUserQuestion` references below are examples — substitute the local equivalent in other runtimes.2324## Image Generation Tools2526When this skill needs to render an image, resolve the backend in this order:27281. **Current-request override** — if the user names a specific backend in the current message, use it.292. **Saved preference** — if `EXTEND.md` sets `preferred_image_backend` to a backend available right now, use it.303. **Auto-select** (when the preference is `auto`, unset, or the pinned backend isn't available):31- 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.32- Otherwise, if exactly one non-native backend is installed (e.g., `baoyu-imagine`), use it.33- Otherwise (multiple non-native backends with no runtime-native tool), ask the user once — batch with any other initial questions.344. **If none are available**, tell the user and ask how to proceed.3536Setting `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.3738**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.3940Concrete tool names (`imagegen`, `image_generate`, `baoyu-imagine`) above are examples — substitute the local equivalents under the same rule.4142## Confirmation Policy4344Default behavior: **confirm before generation**.4546- Treat explicit skill invocation, a file path, matched signals/presets, and `EXTEND.md` defaults as **recommendation inputs only**. None of them authorizes skipping confirmation.47- Do **not** start Step 4 or later until the user completes Step 3.48- Skip confirmation only when the current request explicitly says to do so, for example: "直接生成", "不用确认", "跳过确认", "按默认出图", or equivalent wording.49- If confirmation is skipped explicitly, state the assumed type / density / style / palette / language / backend in the next user-facing update before generating.5051## Reference Images5253Users may supply reference images via `--ref <files...>` or by providing file paths / pasting images in conversation. Refs guide style, palette, composition, or subject for specific illustrations.5455Full detection, storage, and processing rules are in [references/workflow.md](references/workflow.md) (Step 1.0 saves to `references/NN-ref-{slug}.{ext}`; Step 5.3 processes per-illustration usage `direct | style | palette`). When the chosen backend supports batch input, `direct`-usage entries in each prompt file's `references:` frontmatter should be propagated into its batch payload so backends can pass them through (e.g. `baoyu-imagine` accepts `ref` per task).5657## Three Dimensions5859| Dimension | Controls | Examples |60|-----------|----------|----------|61| **Type** | Information structure | infographic, scene, flowchart, comparison, framework, timeline |62| **Style** | Rendering approach | notion, warm, minimal, blueprint, watercolor, elegant |63| **Palette** | Color scheme (optional) | macaron, warm, neon — overrides style's default colors |6465Combine freely: `--type infographic --style vector-illustration --palette macaron`6667Or use presets: `--preset edu-visual` → type + style + palette in one flag. See [Style Presets](references/style-presets.md).6869## Types7071| Type | Best For |72|------|----------|73| `infographic` | Data, metrics, technical |74| `scene` | Narratives, emotional |75| `flowchart` | Processes, workflows |76| `comparison` | Side-by-side, options |77| `framework` | Models, architecture |78| `timeline` | History, evolution |7980## Styles8182See [references/styles.md](references/styles.md) for Core Styles, full gallery, and Type × Style compatibility.8384## Workflow8586```87- [ ] Step 1: Pre-check (EXTEND.md, references, config)88- [ ] Step 2: Analyze content89- [ ] Step 3: Confirm settings (AskUserQuestion)90- [ ] Step 4: Generate outline91- [ ] Step 5: Generate images92- [ ] Step 6: Finalize93```9495### Step 1: Pre-check9697**1.5 Load Preferences (EXTEND.md) ⛔ BLOCKING**9899Check EXTEND.md in priority order — the first one found wins:100101| Priority | Path | Scope |102|----------|------|-------|103| 1 | `.baoyu-skills/baoyu-article-illustrator/EXTEND.md` | Project |104| 2 | `${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-article-illustrator/EXTEND.md` | XDG |105| 3 | `$HOME/.baoyu-skills/baoyu-article-illustrator/EXTEND.md` | User home |106107| Result | Action |108|--------|--------|109| Found | Read, parse, display summary |110| Not found | ⛔ Run [first-time-setup](references/config/first-time-setup.md) |111112Full procedures: [references/workflow.md](references/workflow.md#step-1-pre-check)113114### Step 2: Analyze115116| Analysis | Output |117|----------|--------|118| Content type | Technical / Tutorial / Methodology / Narrative |119| Purpose | information / visualization / imagination |120| Core arguments | 2-5 main points |121| Positions | Where illustrations add value |122123**CRITICAL**: Metaphors → visualize underlying concept, NOT literal image.124125Full procedures: [references/workflow.md](references/workflow.md#step-2-setup--analyze)126127### Step 3: Confirm Settings ⚠️128129**Hard gate**: this step is mandatory per the [Confirmation Policy](#confirmation-policy) — Steps 4+ cannot start until the user confirms here (or explicitly opts out with "直接生成" / equivalent wording in the current request).130131**ONE AskUserQuestion, max 4 Qs. Q1-Q2 REQUIRED. Q3 required unless preset chosen.**132133| Q | Options |134|---|---------|135| **Q1: Preset or Type** | [Recommended preset], [alt preset], or manual: infographic, scene, flowchart, comparison, framework, timeline, mixed |136| **Q2: Density** | minimal (1-2), balanced (3-5), per-section (Recommended), rich (6+) |137| **Q3: Style** | [Recommended], minimal-flat, sci-fi, hand-drawn, editorial, scene, poster, Other — **skip if preset chosen** |138| Q4: Palette | Default (style colors), macaron, warm, neon — **skip if preset includes palette or preferred_palette set** |139| Q5: Language | When article language ≠ EXTEND.md setting |140141Full procedures: [references/workflow.md](references/workflow.md#step-3-confirm-settings-)142143### Step 4: Generate Outline144145Save `outline.md` with frontmatter (type, density, style, palette, image_count) and entries:146147```yaml148## Illustration 1149**Position**: [section/paragraph]150**Purpose**: [why]151**Visual Content**: [what]152**Filename**: 01-infographic-concept-name.png153```154155Full template: [references/workflow.md](references/workflow.md#step-4-generate-outline)156157### Step 5: Generate Images158159⛔ **BLOCKING: Prompt files MUST be saved before ANY image generation.** This is a hard requirement regardless of which backend is chosen — the prompt file is the reproducibility record.1601611. For each illustration, create a prompt file per [references/prompt-construction.md](references/prompt-construction.md)1622. Save to `prompts/NN-{type}-{slug}.md` with YAML frontmatter1633. Prompts **MUST** use type-specific templates with structured sections (ZONES / LABELS / COLORS / STYLE / ASPECT)1644. LABELS **MUST** include article-specific data: actual numbers, terms, metrics, quotes1655. **DO NOT** pass ad-hoc inline prompts to `--prompt` without saving prompt files first1666. 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 before any generation.1677. **Execution strategy**: When multiple illustrations have saved prompt files and the task is now plain generation, prefer the chosen backend's batch interface (if it offers one) over spawning subagents. Use subagents only when each image still needs separate prompt iteration or creative exploration. If the backend has no batch interface, generate sequentially.1688. Process references (`direct`/`style`/`palette`) per prompt frontmatter1699. Apply watermark if EXTEND.md enabled17010. Generate from saved prompt files; retry once on failure171172Full procedures: [references/workflow.md](references/workflow.md#step-5-generate-images)173174### Step 6: Finalize175176Insert `` after paragraphs. Path computed relative to article file based on output directory setting.177178```179Article Illustration Complete!180Article: [path] | Type: [type] | Density: [level] | Style: [style] | Palette: [palette or default]181Images: X/N generated182```183184## Output Directory185186Output directory is determined by `default_output_dir` in EXTEND.md (set during first-time setup):187188| `default_output_dir` | Output Path | Markdown Insert Path |189|----------------------|-------------|----------------------|190| `imgs-subdir` (default) | `{article-dir}/imgs/` | `imgs/NN-{type}-{slug}.png` |191| `same-dir` | `{article-dir}/` | `NN-{type}-{slug}.png` |192| `illustrations-subdir` | `{article-dir}/illustrations/` | `illustrations/NN-{type}-{slug}.png` |193| `independent` | `illustrations/{topic-slug}/` | `illustrations/{topic-slug}/NN-{type}-{slug}.png` (relative to cwd) |194195All auxiliary files (outline, prompts) are saved inside the output directory:196197```198{output-dir}/199├── outline.md200├── prompts/201│ └── NN-{type}-{slug}.md202└── NN-{type}-{slug}.png203```204205When input is **pasted content** (no file path), always uses `illustrations/{topic-slug}/` with `source-{slug}.{ext}` saved alongside.206207**Slug**: 2-4 words, kebab-case. **Conflict**: append `-YYYYMMDD-HHMMSS`.208209## Modification210211| Action | Steps |212|--------|-------|213| Edit | Update prompt → Regenerate → Update reference |214| Add | Position → Prompt → Generate → Update outline → Insert |215| Delete | Delete files → Remove reference → Update outline |216217## References218219| File | Content |220|------|---------|221| [references/workflow.md](references/workflow.md) | Detailed procedures |222| [references/usage.md](references/usage.md) | Command syntax |223| [references/styles.md](references/styles.md) | Style gallery + Palette gallery |224| [references/style-presets.md](references/style-presets.md) | Preset shortcuts (type + style + palette) |225| [references/prompt-construction.md](references/prompt-construction.md) | Prompt templates |226| [references/config/first-time-setup.md](references/config/first-time-setup.md) | First-time setup |227228## Changing Preferences229230EXTEND.md lives at the first matching path listed in Step 1.5. Three ways to change it:231232- **Edit directly** — open EXTEND.md and change fields. Full schema: `references/config/preferences-schema.md`.233- **Reconfigure interactively** — delete EXTEND.md (or ask "reconfigure baoyu-article-illustrator preferences" / "重新配置"). The next run re-triggers first-time setup.234- **Common one-line edits**:235- `preferred_image_backend: auto` — default; runtime-native tool wins, falls back to the only installed backend, asks only if multiple non-native are present.236- `preferred_image_backend: codex-imagegen` — pin to Codex's built-in.237- `preferred_image_backend: baoyu-imagine` — pin to the baoyu-imagine skill.238- `preferred_image_backend: ask` — confirm backend every run.239- `preferred_type: infographic`, `preferred_style: notion`, `preferred_palette: macaron`, `language: zh`.240- `default_output_dir: imgs-subdir` — where to write generated images relative to the article.241