SKILL.md
SKILL.mdBrowse 35 files
2,458 tokens
10,131 bytes
Token encoding: o200k_base
Snapshot 24fd22b
1---2name: baoyu-article-illustrator3description: "Article illustrations: type × style × palette consistency."4version: 1.57.05author: 宝玉 (JimLiu)6license: MIT7platforms: [linux, macos, windows]8metadata:9 hermes:10 tags: [article-illustration, creative, image-generation]11 category: creative12 homepage: https://github.com/JimLiu/baoyu-skills#baoyu-article-illustrator13---14 15# Article Illustrator16 17Adapted from [baoyu-article-illustrator](https://github.com/JimLiu/baoyu-skills) for Hermes Agent's tool ecosystem.18 19Analyze articles, identify illustration positions, generate images with **Type × Style × Palette** consistency.20 21## When to Use22 23Trigger this skill when the user asks to illustrate an article, add images to an article, generate illustrations for content, or uses phrases like "为文章配图", "illustrate article", or "add images". The user provides an article (file path or pasted content) and optionally specifies type, style, palette, or density.24 25## Three Dimensions26 27| Dimension | Controls | Examples |28|-----------|----------|----------|29| **Type** | Information structure | infographic, scene, flowchart, comparison, framework, timeline |30| **Style** | Rendering approach | notion, warm, minimal, blueprint, watercolor, elegant |31| **Palette** | Color scheme (optional) | macaron, warm, neon — overrides style's default colors |32 33Combine freely: `type=infographic, style=vector-illustration, palette=macaron`.34 35Or use presets: `edu-visual` → type + style + palette in one shot. See [style-presets.md](references/style-presets.md).36 37## Types38 39| Type | Best For |40|------|----------|41| `infographic` | Data, metrics, technical |42| `scene` | Narratives, emotional |43| `flowchart` | Processes, workflows |44| `comparison` | Side-by-side, options |45| `framework` | Models, architecture |46| `timeline` | History, evolution |47 48## Styles49 50See [references/styles.md](references/styles.md) for Core Styles, the full gallery, and Type × Style compatibility.51 52## Output Structure53 54```55{output-dir}/56├── source-{slug}.{ext} # Only for pasted content57├── outline.md58├── prompts/59│ └── NN-{type}-{slug}.md60└── NN-{type}-{slug}.png61```62 63**Default output directory**:64 65| Input | Output Directory | Markdown Insert Path |66|-------|------------------|----------------------|67| Article file path | `{article-dir}/imgs/` | `imgs/NN-{type}-{slug}.png` |68| Pasted content | `illustrations/{topic-slug}/` (cwd) | `illustrations/{topic-slug}/NN-{type}-{slug}.png` |69 70If the user asks for a different layout (e.g., images alongside the article, or a `illustrations/` subdirectory), honor that.71 72**Slug**: 2-4 words, kebab-case. **Conflict**: append `-YYYYMMDD-HHMMSS`.73 74## Core Principles75 76- **Visualize concepts, not metaphors** — if the article uses a metaphor (e.g., "电锯切西瓜"), illustrate the underlying concept, not the literal image.77- **Labels use article data** — actual numbers, terms, and quotes from the article, not generic placeholders.78- **Prompt files are reproducibility records** — every illustration must have a saved prompt file under `prompts/` before any image is generated.79- **Strip secrets** — scan source content for API keys, tokens, or credentials before writing anything to disk.80 81## Workflow82 83```84- [ ] Step 1: Detect reference images (if provided)85- [ ] Step 2: Analyze content86- [ ] Step 3: Confirm settings (clarify tool, one question at a time)87- [ ] Step 4: Generate outline88- [ ] Step 5: Generate prompts89- [ ] Step 6: Generate images (image_generate)90- [ ] Step 7: Finalize91```92 93### Step 1: Detect Reference Images94 95If the user supplies reference images (paths pasted inline, attachments, or a URL):96 971. For each reference, call `vision_analyze` with the path/URL and a question asking for style, palette, composition, and subject. Record the returned description in `{output-dir}/references/NN-ref-{slug}.md` via `write_file`.982. **Do not** try to copy the binary via `write_file` / `read_file` — those are text-only. If you want a local copy for the record, use `terminal` (`cp "$src" "{output-dir}/references/NN-ref-{slug}.{ext}"`). The skill itself never needs to read the binary; it works off the vision description.993. Since `image_generate` doesn't take image inputs, the vision description is what gets embedded in prompts during Step 5.100 101Full procedures: [references/workflow.md](references/workflow.md#step-1-detect-reference-images).102 103### Step 2: Analyze104 105| Analysis | Output |106|----------|--------|107| Content type | Technical / Tutorial / Methodology / Narrative |108| Purpose | information / visualization / imagination |109| Core arguments | 2-5 main points |110| Positions | Where illustrations add value |111 112Read source (file path → `read_file`, or pasted text) and write the analysis to `{output-dir}/analysis.md` using `write_file`.113 114Full procedures: [references/workflow.md](references/workflow.md#step-2-analyze).115 116### Step 3: Confirm Settings117 118Use the `clarify` tool. Since `clarify` handles one question at a time, ask the most important question first. Skip any question whose answer is already present in the user's request.119 120| Order | Question | Options |121|-------|----------|---------|122| Q1 | **Preset or Type** | [Recommended preset], [alt preset], or manual: infographic, scene, flowchart, comparison, framework, timeline, mixed |123| Q2 | **Density** | minimal (1-2), balanced (3-5), per-section (Recommended), rich (6+) |124| Q3 | **Style** *(skip if preset chosen in Q1)* | [Recommended], minimal-flat, sci-fi, hand-drawn, editorial, scene, poster |125| Q4 | **Palette** *(optional)* | Default (style colors), macaron, warm, neon |126| Q5 | **Language** *(only if article language is ambiguous)* | article language / user language |127 128Don't ask more than 2-3 `clarify` questions in a row. If the user already specified these in their request, skip entirely.129 130Full procedures: [references/workflow.md](references/workflow.md#step-3-confirm-settings).131 132### Step 4: Generate Outline → `outline.md`133 134Save `{output-dir}/outline.md` using `write_file` with frontmatter (type, density, style, palette, image_count) and one entry per illustration:135 136```yaml137## Illustration 1138**Position**: [section/paragraph]139**Purpose**: [why]140**Visual Content**: [what to show]141**Filename**: 01-infographic-concept-name.png142```143 144Full template: [references/workflow.md](references/workflow.md#step-4-generate-outline).145 146### Step 5: Generate Prompts147 148**BLOCKING**: Every illustration must have a saved prompt file before any image is generated — the prompt file is the reproducibility record.149 150For each illustration:151 1521. Create a prompt file per [references/prompt-construction.md](references/prompt-construction.md).1532. Save to `{output-dir}/prompts/NN-{type}-{slug}.md` using `write_file` with YAML frontmatter.1543. Prompts MUST use type-specific templates with structured sections (ZONES / LABELS / COLORS / STYLE / ASPECT).1554. LABELS MUST include article-specific data: actual numbers, terms, metrics, quotes.1565. Process references (`direct`/`style`/`palette`) per prompt frontmatter — for `direct` usage, embed a textual description of the reference in the prompt (since `image_generate` doesn't take reference-image inputs).157 158### Step 6: Generate Images159 160For each prompt file:161 1621. Call `image_generate(prompt=..., aspect_ratio=...)`. `image_generate` returns a JSON result containing an image URL; it does NOT write to disk and does NOT accept an output path.1632. Map the prompt's `ASPECT` to `image_generate`'s enum: `16:9` → `landscape`, `9:16` → `portrait`, `1:1` → `square`. Custom ratios → nearest named aspect.1643. Download the returned URL to `{output-dir}/NN-{type}-{slug}.png` via `terminal` (e.g. `curl -sSL -o "{output-dir}/NN-{type}-{slug}.png" "{url}"`).1654. On generation failure, auto-retry once.166 167Note: the underlying image-generation backend is user-configured (default: FAL FLUX 2 Klein 9B) and is NOT agent-selectable via `image_generate`. Do not write model names into prompts expecting them to route.168 169### Step 7: Finalize170 171Insert `` after the corresponding paragraph. Alt text: concise description in the article's language.172 173Report:174 175```176Article Illustration Complete!177Article: [path] | Type: [type] | Density: [level] | Style: [style] | Palette: [palette or default]178Images: X/N generated179```180 181## Modification182 183| Action | Steps |184|--------|-------|185| Edit | Update prompt → Regenerate → Update reference |186| Add | Position → Prompt → Generate → Update outline → Insert |187| Delete | Delete files → Remove reference → Update outline |188 189## References190 191| File | Content |192|------|---------|193| [references/workflow.md](references/workflow.md) | Detailed procedures |194| [references/usage.md](references/usage.md) | Invocation examples |195| [references/styles.md](references/styles.md) | Style gallery + Palette gallery |196| [references/style-presets.md](references/style-presets.md) | Preset shortcuts (type + style + palette) |197| [references/prompt-construction.md](references/prompt-construction.md) | Prompt templates |198 199## Pitfalls200 2011. **Data integrity is paramount** — never summarize, paraphrase, or alter source statistics. "73% increase" stays "73% increase".2022. **Strip secrets** — scan source content for API keys, tokens, or credentials before including in any output file.2033. **Don't illustrate metaphors literally** — visualize the underlying concept.2044. **Prompt files are mandatory** — no image generation without a saved prompt file. The file is what lets you regenerate or switch backends later.2055. **`image_generate` aspect ratios** — the tool supports `landscape`, `portrait`, and `square`. Custom ratios map to the nearest option.2066. **`image_generate` returns a URL, not a local file** — always download via `terminal` (`curl`) before inserting local image paths into the article.2077. **No backend selection from the agent** — `image_generate` uses whatever model the user configured (default: FAL FLUX 2 Klein 9B). Don't write `"use <model> to generate this"` into prompts expecting it to route.208 Discovery context
Discovered by repository scan. No exact path reference found in the snapshot’s root AGENTS.md.