Cover Image Generator
Generate elegant cover images for articles with 5-dimensional customization.
Usage
# Auto-select all dimensions based on content
/baoyu-cover-image path/to/article.md
# Quick mode: skip confirmation, use auto-selection
/baoyu-cover-image article.md --quick
# Specify dimensions (new 5D system)
/baoyu-cover-image article.md --type conceptual --palette warm --rendering flat-vector
/baoyu-cover-image article.md --text title-subtitle --mood bold
# Style presets (backward-compatible shorthand for palette + rendering)
/baoyu-cover-image article.md --style blueprint
/baoyu-cover-image article.md --style blueprint --rendering hand-drawn # override rendering
# Visual only (no title text)
/baoyu-cover-image article.md --no-title
# Direct content input
/baoyu-cover-image
[paste content]
# Direct input with options
/baoyu-cover-image --palette mono --rendering digital --aspect 1:1 --quick
[paste content]
# With reference images
/baoyu-cover-image article.md --ref style-ref.png
/baoyu-cover-image article.md --ref ref1.png ref2.png --quick
Options
| Option |
Description |
--type <name> |
Cover type: hero, conceptual, typography, metaphor, scene, minimal |
--palette <name> |
Color palette: warm, elegant, cool, dark, earth, vivid, pastel, mono, retro |
--rendering <name> |
Rendering style: flat-vector, hand-drawn, painterly, digital, pixel, chalk |
--style <name> |
Preset shorthand (expands to palette + rendering, see Style Presets) |
--text <level> |
Text density: none, title-only, title-subtitle, text-rich |
--mood <level> |
Emotional intensity: subtle, balanced, bold |
--aspect <ratio> |
16:9 (default), 2.35:1, 4:3, 3:2, 1:1, 3:4 |
--lang <code> |
Title language (en, zh, ja, etc.) |
--no-title |
Alias for --text none |
--quick |
Skip confirmation, use auto-selection for missing dimensions |
--ref <files...> |
Reference images for style/composition guidance |
Five Dimensions
| Dimension |
Controls |
Values |
Default |
| Type |
Visual composition, information structure |
hero, conceptual, typography, metaphor, scene, minimal |
auto |
| Palette |
Colors, color scheme, decorative hints |
warm, elegant, cool, dark, earth, vivid, pastel, mono, retro |
auto |
| Rendering |
Line quality, texture, depth, element style |
flat-vector, hand-drawn, painterly, digital, pixel, chalk |
auto |
| Text |
Text density, information hierarchy |
none, title-only, title-subtitle, text-rich |
title-only |
| Mood |
Emotional intensity, visual weight |
subtle, balanced, bold |
balanced |
Dimensions can be freely combined. Auto-selection rules: references/auto-selection.md
Type Gallery
| Type |
Description |
Best For |
hero |
Large visual impact, title overlay |
Product launch, brand promotion, major announcements |
conceptual |
Concept visualization, abstract core ideas |
Technical articles, methodology, architecture design |
typography |
Text-focused layout, prominent title |
Opinion pieces, quotes, insights |
metaphor |
Visual metaphor, concrete expressing abstract |
Philosophy, growth, personal development |
scene |
Atmospheric scene, narrative feel |
Stories, travel, lifestyle |
minimal |
Minimalist composition, generous whitespace |
Zen, focus, core concepts |
Type composition details: references/types.md
Palette Gallery
| Palette |
Vibe |
Primary Colors |
warm |
Friendly, approachable |
Orange, golden yellow, terracotta |
elegant |
Sophisticated, refined |
Soft coral, muted teal, dusty rose |
cool |
Technical, professional |
Engineering blue, navy, cyan |
dark |
Cinematic, premium |
Electric purple, cyan, magenta |
earth |
Natural, organic |
Forest green, sage, earth brown |
vivid |
Energetic, bold |
Bright red, neon green, electric blue |
pastel |
Gentle, whimsical |
Soft pink, mint, lavender |
mono |
Clean, focused |
Black, near-black, white |
retro |
Nostalgic, vintage |
Muted orange, dusty pink, maroon |
Palette definitions: references/palettes/
Rendering Gallery
| Rendering |
Description |
Key Characteristics |
flat-vector |
Clean modern vector |
Uniform outlines, flat fills, geometric icons |
hand-drawn |
Sketchy organic illustration |
Imperfect strokes, paper texture, doodles |
painterly |
Soft watercolor/paint |
Brush strokes, color bleeds, soft edges |
digital |
Polished modern digital |
Precise edges, subtle gradients, UI components |
pixel |
Retro 8-bit pixel art |
Pixel grid, dithering, chunky shapes |
chalk |
Chalk on blackboard |
Chalk strokes, dust effects, board texture |
Rendering definitions: references/renderings/
Text & Mood
| Text Level |
Title |
Subtitle |
Tags |
Use Case |
none |
- |
- |
- |
Pure visual, no text |
title-only |
✓ |
- |
- |
Simple headline (default) |
title-subtitle |
✓ |
✓ |
- |
Title + supporting context |
text-rich |
✓ |
✓ |
✓ (2-4) |
Information-dense |
| Mood |
Contrast |
Saturation |
Weight |
Use Case |
subtle |
Low |
Muted |
Light |
Corporate, thought leadership |
balanced |
Medium |
Normal |
Medium |
General articles (default) |
bold |
High |
Vivid |
Heavy |
Announcements, promotions |
Full guides: references/dimensions/text.md | references/dimensions/mood.md
Style Presets & Compatibility
- Style Presets:
--style X expands to palette + rendering. See references/style-presets.md
- Compatibility Matrices: Palette×Rendering, Type×Rendering, Type×Text, Type×Mood. See references/compatibility.md
- ✓✓ = highly recommended | ✓ = compatible | ✗ = not recommended
File Structure
Output directory depends on default_output_dir preference:
| Preference |
Output Path |
same-dir |
{article-dir}/ |
imgs-subdir |
{article-dir}/imgs/ |
independent (default) |
cover-image/{topic-slug}/ |
| Pasted content |
cover-image/{topic-slug}/ (always) |
<output-dir>/
├── source-{slug}.{ext} # Source files (text, images, etc.)
├── refs/ # Reference images (if provided)
│ ├── ref-01-{slug}.{ext}
│ ├── ref-01-{slug}.md # Description file (optional)
│ ├── ref-02-{slug}.{ext}
│ ├── ref-02-{slug}.md # Description file (optional)
│ └── extracted-style.md # Verbally extracted style (if no file path)
├── prompts/cover.md # Generation prompt
└── cover.png # Output image
Slug: Extract main topic (2-4 words, kebab-case). Example: "The Future of AI" → future-of-ai
Conflict: If directory exists, append timestamp: {topic-slug}-YYYYMMDD-HHMMSS
Source Files: Copy all sources with naming source-{slug}.{ext} (multiple supported)
Workflow
Progress Checklist
Cover Image Progress:
- [ ] Step 0: Check preferences (EXTEND.md) ⛔ BLOCKING
- [ ] Found → load preferences → continue
- [ ] Not found → run first-time setup → MUST complete before Step 1
- [ ] Step 1: Analyze content + determine output directory
- [ ] 1.1 Reference images ⚠️ (if provided)
- [ ] File path given → saved to refs/ ✓
- [ ] No path → asked user OR extracted verbally
- [ ] 1.2 Output directory determined
- [ ] Step 2: Confirm options (5 dimensions) ⚠️ REQUIRED unless --quick or all specified
- [ ] Step 3: Create prompt
- [ ] References in prompt ONLY if files exist in refs/
- [ ] Extracted style/palette appended to prompt body (if no file)
- [ ] Step 3.5: Confirm prompt with user ⛔ BLOCKING
- [ ] Step 4: Generate image
- [ ] 4.1 References verified before generation
- [ ] 4.2 Pass refs via --ref if skill supports AND files exist
- [ ] Step 5: Completion report
Flow
Input → [Step 0: Preferences] ─┬─ Found → Continue
│
└─ Not found → First-Time Setup ⛔ BLOCKING
│
└─ Complete setup → Save EXTEND.md → Continue
│
┌───────────────────────────────────────────────────────────────────────────┘
↓
Analyze + Save Refs → [Output Dir ⚠️] → [Confirm: 5 Dimensions] → Prompt → Generate → Complete
↓
(skip if --quick or all specified)
Step 0: Load Preferences (EXTEND.md) ⛔ BLOCKING
Purpose: Load user preferences or run first-time setup.
CRITICAL: If EXTEND.md not found, MUST complete first-time setup before ANY other questions or steps. Do NOT proceed to content analysis, do NOT ask about reference images, do NOT ask about dimensions — ONLY complete the preferences setup first.
Use Bash to check EXTEND.md existence (priority order):
# Check project-level first
test -f .baoyu-skills/baoyu-cover-image/EXTEND.md && echo "project"
# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
test -f "$HOME/.baoyu-skills/baoyu-cover-image/EXTEND.md" && echo "user"
| Result |
Action |
| Found |
Read, parse, display preferences summary → Continue to Step 1 |
| Not found |
⛔ BLOCKING: Run first-time setup ONLY (references/config/first-time-setup.md) → Complete and save EXTEND.md → Then continue to Step 1 |
Preferences Summary (when found):
Preferences loaded from [project/user]:
• Watermark: [enabled/disabled] [content if enabled]
• Type/Palette/Rendering: [value or "auto"]
• Text: [value or "title-only"] | Mood: [value or "balanced"]
• Aspect: [default_aspect] | Output: [dir or "not set — will ask in Step 1.5"]
• Quick mode: [enabled/disabled] | Language: [value or "auto"]
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
Schema: references/config/preferences-schema.md
Step 1: Analyze Content
1.0 Detect & Save Reference Images ⚠️ REQUIRED if images provided
Check if user provided reference images. Handle based on input type:
| Input Type |
Action |
| Image file path provided |
Copy to refs/ subdirectory → can use --ref |
| Image in conversation (no path) |
ASK user for file path with AskUserQuestion |
| User can't provide path |
Extract style/palette verbally → append to prompt (NO frontmatter references) |
CRITICAL: Only add references to prompt frontmatter if files are ACTUALLY SAVED to refs/ directory.
If user provides file path:
- Copy to
refs/ref-NN-{slug}.{ext} (NN = 01, 02, ...)
- Create description:
refs/ref-NN-{slug}.md
- Verify files exist before proceeding
If user can't provide path (extracted verbally):
- Analyze image visually, extract: colors, style, composition
- Create
refs/extracted-style.md with extracted info
- DO NOT add
references to prompt frontmatter
- Instead, append extracted style/colors directly to prompt text
Description File Format (only when file saved):
---
ref_id: NN
filename: ref-NN-{slug}.{ext}
usage: direct | style | palette
---
[User's description or auto-generated description]
| Usage |
When to Use |
direct |
Reference matches desired output closely |
style |
Extract visual style characteristics only |
palette |
Extract color scheme only |
Verification (only for saved files):
Reference Images Saved:
- ref-01-{slug}.png ✓ (can use --ref)
- ref-02-{slug}.png ✓ (can use --ref)
Or for extracted style:
Reference Style Extracted (no file):
- Colors: #E8756D coral, #7ECFC0 mint...
- Style: minimal flat vector, clean lines...
→ Will append to prompt text (not --ref)
1.1 Save Source Content
- If pasted, save to
source.md in target directory; if file path, use as-is
- Backup rule: If
source.md exists, rename to source-backup-YYYYMMDD-HHMMSS.md
1.2 Content Analysis
- Extract topic, core message, tone, keywords
- Identify visual metaphors
- Detect content type
1.3 Reference Image Analysis (if provided in Step 1.0)
For each reference image:
| Analysis |
Description |
| Visual characteristics |
Style, colors, composition |
| Content/subject |
What the reference depicts |
| Style match |
Which type/palette/rendering align |
| Usage recommendation |
direct / style / palette |
1.4 Language Detection
- Detect source language
- Note user's input language
- Compare with EXTEND.md preference
1.5 Determine Output Directory
- Per File Structure rules
- If no
default_output_dir preference + file path input, include in Step 2 Q4
Step 2: Confirm Options ⚠️
Validate all 5 dimensions + aspect ratio. Full confirmation flow: references/workflow/confirm-options.md
Skip Conditions:
| Condition |
Skipped |
Still Asked |
--quick or quick_mode: true |
5 dimensions |
Aspect ratio (unless --aspect) |
All 5 + --aspect specified |
All |
None |
Step 3: Create Prompt
Backup rule: If prompts/cover.md exists, rename to prompts/cover-backup-YYYYMMDD-HHMMSS.md
Save to prompts/cover.md. Full template: references/workflow/prompt-template.md
CRITICAL - References in YAML Frontmatter:
When reference files are saved to refs/, MUST add references field in frontmatter:
---
type: cover
palette: warm
rendering: flat-vector
references:
- ref_id: 01
filename: refs/ref-01-podcast-thumbnail.jpg
usage: style
---
| Rule |
Action |
Files saved to refs/ |
Add to frontmatter references list |
| Style extracted verbally (no file) |
Omit references field, describe in body |
| Before writing |
Verify: test -f refs/ref-NN-{slug}.{ext} |
Reference Embedding:
| Situation |
Frontmatter |
Body |
Reference file saved to refs/ |
Add to references ✓ |
Brief style note |
| Style extracted verbally (no file) |
Omit references |
Full style description |
| File in frontmatter but doesn't exist |
ERROR - fix or remove |
— |
Step 4: Generate Image
4.1 Backup existing cover.png → cover-backup-YYYYMMDD-HHMMSS.png (if regenerating)
4.2 Check available image generation skills; if multiple, ask user preference
4.3 Process References ⚠️ REQUIRED if references in frontmatter
Read references from prompt frontmatter and process each entry:
Parse frontmatter to get references list:
references:
- ref_id: 01
filename: refs/ref-01-podcast-thumbnail.jpg
usage: style
VERIFY each file exists:
test -f refs/ref-NN-{slug}.{ext} && echo "exists" || echo "MISSING"
- If file MISSING → ERROR, fix prompt or remove from references
- If file exists → proceed with processing
Process based on usage type:
| Usage |
Action |
Example |
direct |
Add reference path to --ref parameter |
--ref refs/ref-01-brand.png |
style |
Analyze reference, append style traits to prompt |
"Style: clean lines, gradient backgrounds..." |
palette |
Extract colors from reference, append to prompt |
"Colors: #E8756D coral, #7ECFC0 mint..." |
- Check image generation skill capability:
Skill Supports --ref |
Action |
| Yes (e.g., baoyu-image-gen with Google) |
Pass reference images via --ref |
| No |
Convert to text description, append to prompt |
Verification: Before generating, confirm reference processing:
Reference Processing:
- ref-01-brand.png: using as direct reference ✓
- ref-02-style.png: extracted palette ✓
4.4 Generate
- Call selected skill with prompt file path, output path (
cover.png), aspect ratio
- If references with
direct usage AND skill supports --ref: include --ref parameter
- On failure: auto-retry once before reporting error
Step 5: Completion Report
Cover Generated!
Topic: [topic]
Type: [type] | Palette: [palette] | Rendering: [rendering]
Text: [text] | Mood: [mood] | Aspect: [ratio]
Title: [title text or "visual only"]
Language: [lang] | Watermark: [enabled/disabled]
References: [N images (direct/style/palette) or "extracted style" or "none"]
Location: [directory path]
Files:
✓ source-{slug}.{ext}
[✓ refs/ref-01-{slug}.{ext} ... (if references saved)]
[✓ refs/ref-01-{slug}.md ... (description files)]
[✓ refs/extracted-style.md (if style extracted verbally)]
✓ prompts/cover.md
✓ cover.png
[✓ cover-backup-{timestamp}.png (if regenerated)]
Image Modification
| Action |
Steps |
| Regenerate |
Backup existing → Update prompt file FIRST → Regenerate with same settings |
| Change dimension |
Backup existing → Confirm new value → Update prompt file FIRST → Regenerate |
IMPORTANT: When regenerating, ALWAYS update the prompt file (prompts/cover.md) FIRST before regenerating. This ensures changes are documented and reproducible.
All modifications automatically backup existing cover.png before regenerating.
Notes
- Cover must be readable at small preview sizes
- Visual metaphors > literal representations
- Title: readable, impactful
- Two confirmation points: Step 0 (first-time setup) + Step 2 (options) - skip Step 2 with
--quick
- Use confirmed language for title text
- Maintain watermark consistency if enabled
- Check compatibility matrices when selecting combinations
--no-title is alias for --text none
--style presets are backward-compatible; explicit --palette/--rendering override preset values
Composition Principles
- Generous whitespace: 40-60% breathing room; avoid cluttered layouts
- Visual anchor: Main element centered or offset left (reserve right for title)
- Character handling: Simplified silhouettes or icon-style figures; NO realistic humans
- Icon vocabulary: Use simple, recognizable symbols (see references/visual-elements.md)
Title Handling
- Source: Use the exact title provided by user, or extract from source content
- Do NOT invent titles: Stay faithful to the original
- If no title in source and user doesn't provide one, ask user to specify
References
Dimensions: text.md | mood.md
Palettes: references/palettes/
Renderings: references/renderings/
Auto-Selection: references/auto-selection.md
Style Presets: references/style-presets.md
Compatibility: references/compatibility.md
Types: references/types.md
Visual Elements: references/visual-elements.md
Workflow: confirm-options.md | prompt-template.md
Config: preferences-schema.md | first-time-setup.md | watermark-guide.md
1---2name: baoyu-cover-image3description: Generates article cover images with 5 dimensions (type, palette, rendering, text, mood) combining 9 color palettes and 6 rendering styles. Supports cinematic (2.35:1), widescreen (16:9), and square (1:1) aspects. Use when user asks to "generate cover image", "create article cover", or "make cover".4---56# Cover Image Generator78Generate elegant cover images for articles with 5-dimensional customization.910## Usage1112```bash13# Auto-select all dimensions based on content14/baoyu-cover-image path/to/article.md1516# Quick mode: skip confirmation, use auto-selection17/baoyu-cover-image article.md --quick1819# Specify dimensions (new 5D system)20/baoyu-cover-image article.md --type conceptual --palette warm --rendering flat-vector21/baoyu-cover-image article.md --text title-subtitle --mood bold2223# Style presets (backward-compatible shorthand for palette + rendering)24/baoyu-cover-image article.md --style blueprint25/baoyu-cover-image article.md --style blueprint --rendering hand-drawn # override rendering2627# Visual only (no title text)28/baoyu-cover-image article.md --no-title2930# Direct content input31/baoyu-cover-image32[paste content]3334# Direct input with options35/baoyu-cover-image --palette mono --rendering digital --aspect 1:1 --quick36[paste content]3738# With reference images39/baoyu-cover-image article.md --ref style-ref.png40/baoyu-cover-image article.md --ref ref1.png ref2.png --quick41```4243## Options4445| Option | Description |46|--------|-------------|47| `--type <name>` | Cover type: hero, conceptual, typography, metaphor, scene, minimal |48| `--palette <name>` | Color palette: warm, elegant, cool, dark, earth, vivid, pastel, mono, retro |49| `--rendering <name>` | Rendering style: flat-vector, hand-drawn, painterly, digital, pixel, chalk |50| `--style <name>` | Preset shorthand (expands to palette + rendering, see [Style Presets](references/style-presets.md)) |51| `--text <level>` | Text density: none, title-only, title-subtitle, text-rich |52| `--mood <level>` | Emotional intensity: subtle, balanced, bold |53| `--aspect <ratio>` | 16:9 (default), 2.35:1, 4:3, 3:2, 1:1, 3:4 |54| `--lang <code>` | Title language (en, zh, ja, etc.) |55| `--no-title` | Alias for `--text none` |56| `--quick` | Skip confirmation, use auto-selection for missing dimensions |57| `--ref <files...>` | Reference images for style/composition guidance |5859## Five Dimensions6061| Dimension | Controls | Values | Default |62|-----------|----------|--------|---------|63| **Type** | Visual composition, information structure | hero, conceptual, typography, metaphor, scene, minimal | auto |64| **Palette** | Colors, color scheme, decorative hints | warm, elegant, cool, dark, earth, vivid, pastel, mono, retro | auto |65| **Rendering** | Line quality, texture, depth, element style | flat-vector, hand-drawn, painterly, digital, pixel, chalk | auto |66| **Text** | Text density, information hierarchy | none, title-only, title-subtitle, text-rich | title-only |67| **Mood** | Emotional intensity, visual weight | subtle, balanced, bold | balanced |6869Dimensions can be freely combined. Auto-selection rules: [references/auto-selection.md](references/auto-selection.md)7071## Type Gallery7273| Type | Description | Best For |74|------|-------------|----------|75| `hero` | Large visual impact, title overlay | Product launch, brand promotion, major announcements |76| `conceptual` | Concept visualization, abstract core ideas | Technical articles, methodology, architecture design |77| `typography` | Text-focused layout, prominent title | Opinion pieces, quotes, insights |78| `metaphor` | Visual metaphor, concrete expressing abstract | Philosophy, growth, personal development |79| `scene` | Atmospheric scene, narrative feel | Stories, travel, lifestyle |80| `minimal` | Minimalist composition, generous whitespace | Zen, focus, core concepts |8182Type composition details: [references/types.md](references/types.md)8384## Palette Gallery8586| Palette | Vibe | Primary Colors |87|---------|------|----------------|88| `warm` | Friendly, approachable | Orange, golden yellow, terracotta |89| `elegant` | Sophisticated, refined | Soft coral, muted teal, dusty rose |90| `cool` | Technical, professional | Engineering blue, navy, cyan |91| `dark` | Cinematic, premium | Electric purple, cyan, magenta |92| `earth` | Natural, organic | Forest green, sage, earth brown |93| `vivid` | Energetic, bold | Bright red, neon green, electric blue |94| `pastel` | Gentle, whimsical | Soft pink, mint, lavender |95| `mono` | Clean, focused | Black, near-black, white |96| `retro` | Nostalgic, vintage | Muted orange, dusty pink, maroon |9798Palette definitions: [references/palettes/](references/palettes/)99100## Rendering Gallery101102| Rendering | Description | Key Characteristics |103|-----------|-------------|---------------------|104| `flat-vector` | Clean modern vector | Uniform outlines, flat fills, geometric icons |105| `hand-drawn` | Sketchy organic illustration | Imperfect strokes, paper texture, doodles |106| `painterly` | Soft watercolor/paint | Brush strokes, color bleeds, soft edges |107| `digital` | Polished modern digital | Precise edges, subtle gradients, UI components |108| `pixel` | Retro 8-bit pixel art | Pixel grid, dithering, chunky shapes |109| `chalk` | Chalk on blackboard | Chalk strokes, dust effects, board texture |110111Rendering definitions: [references/renderings/](references/renderings/)112113## Text & Mood114115| Text Level | Title | Subtitle | Tags | Use Case |116|------------|:-----:|:--------:|:----:|----------|117| `none` | - | - | - | Pure visual, no text |118| `title-only` | ✓ | - | - | Simple headline (default) |119| `title-subtitle` | ✓ | ✓ | - | Title + supporting context |120| `text-rich` | ✓ | ✓ | ✓ (2-4) | Information-dense |121122| Mood | Contrast | Saturation | Weight | Use Case |123|------|:--------:|:----------:|:------:|----------|124| `subtle` | Low | Muted | Light | Corporate, thought leadership |125| `balanced` | Medium | Normal | Medium | General articles (default) |126| `bold` | High | Vivid | Heavy | Announcements, promotions |127128Full guides: [references/dimensions/text.md](references/dimensions/text.md) | [references/dimensions/mood.md](references/dimensions/mood.md)129130## Style Presets & Compatibility131132- **Style Presets**: `--style X` expands to palette + rendering. See [references/style-presets.md](references/style-presets.md)133- **Compatibility Matrices**: Palette×Rendering, Type×Rendering, Type×Text, Type×Mood. See [references/compatibility.md](references/compatibility.md)134 - ✓✓ = highly recommended | ✓ = compatible | ✗ = not recommended135136## File Structure137138Output directory depends on `default_output_dir` preference:139140| Preference | Output Path |141|------------|-------------|142| `same-dir` | `{article-dir}/` |143| `imgs-subdir` | `{article-dir}/imgs/` |144| `independent` (default) | `cover-image/{topic-slug}/` |145| Pasted content | `cover-image/{topic-slug}/` (always) |146147```148<output-dir>/149├── source-{slug}.{ext} # Source files (text, images, etc.)150├── refs/ # Reference images (if provided)151│ ├── ref-01-{slug}.{ext}152│ ├── ref-01-{slug}.md # Description file (optional)153│ ├── ref-02-{slug}.{ext}154│ ├── ref-02-{slug}.md # Description file (optional)155│ └── extracted-style.md # Verbally extracted style (if no file path)156├── prompts/cover.md # Generation prompt157└── cover.png # Output image158```159160**Slug**: Extract main topic (2-4 words, kebab-case). Example: "The Future of AI" → `future-of-ai`161**Conflict**: If directory exists, append timestamp: `{topic-slug}-YYYYMMDD-HHMMSS`162**Source Files**: Copy all sources with naming `source-{slug}.{ext}` (multiple supported)163164## Workflow165166### Progress Checklist167168```169Cover Image Progress:170- [ ] Step 0: Check preferences (EXTEND.md) ⛔ BLOCKING171 - [ ] Found → load preferences → continue172 - [ ] Not found → run first-time setup → MUST complete before Step 1173- [ ] Step 1: Analyze content + determine output directory174 - [ ] 1.1 Reference images ⚠️ (if provided)175 - [ ] File path given → saved to refs/ ✓176 - [ ] No path → asked user OR extracted verbally177 - [ ] 1.2 Output directory determined178- [ ] Step 2: Confirm options (5 dimensions) ⚠️ REQUIRED unless --quick or all specified179- [ ] Step 3: Create prompt180 - [ ] References in prompt ONLY if files exist in refs/181 - [ ] Extracted style/palette appended to prompt body (if no file)182- [ ] Step 3.5: Confirm prompt with user ⛔ BLOCKING183- [ ] Step 4: Generate image184 - [ ] 4.1 References verified before generation185 - [ ] 4.2 Pass refs via --ref if skill supports AND files exist186- [ ] Step 5: Completion report187```188189### Flow190191```192Input → [Step 0: Preferences] ─┬─ Found → Continue193 │194 └─ Not found → First-Time Setup ⛔ BLOCKING195 │196 └─ Complete setup → Save EXTEND.md → Continue197 │198 ┌───────────────────────────────────────────────────────────────────────────┘199 ↓200Analyze + Save Refs → [Output Dir ⚠️] → [Confirm: 5 Dimensions] → Prompt → Generate → Complete201 ↓202 (skip if --quick or all specified)203```204205### Step 0: Load Preferences (EXTEND.md) ⛔ BLOCKING206207**Purpose**: Load user preferences or run first-time setup.208209**CRITICAL**: If EXTEND.md not found, MUST complete first-time setup before ANY other questions or steps. Do NOT proceed to content analysis, do NOT ask about reference images, do NOT ask about dimensions — ONLY complete the preferences setup first.210211Use Bash to check EXTEND.md existence (priority order):212213```bash214# Check project-level first215test -f .baoyu-skills/baoyu-cover-image/EXTEND.md && echo "project"216217# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)218test -f "$HOME/.baoyu-skills/baoyu-cover-image/EXTEND.md" && echo "user"219```220221| Result | Action |222|--------|--------|223| Found | Read, parse, display preferences summary → Continue to Step 1 |224| Not found | ⛔ **BLOCKING**: Run first-time setup ONLY ([references/config/first-time-setup.md](references/config/first-time-setup.md)) → Complete and save EXTEND.md → Then continue to Step 1 |225226**Preferences Summary** (when found):227228```229Preferences loaded from [project/user]:230• Watermark: [enabled/disabled] [content if enabled]231• Type/Palette/Rendering: [value or "auto"]232• Text: [value or "title-only"] | Mood: [value or "balanced"]233• Aspect: [default_aspect] | Output: [dir or "not set — will ask in Step 1.5"]234• Quick mode: [enabled/disabled] | Language: [value or "auto"]235```236237**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 preference238239Schema: [references/config/preferences-schema.md](references/config/preferences-schema.md)240241### Step 1: Analyze Content242243**1.0 Detect & Save Reference Images** ⚠️ REQUIRED if images provided244245Check if user provided reference images. Handle based on input type:246247| Input Type | Action |248|------------|--------|249| Image file path provided | Copy to `refs/` subdirectory → can use `--ref` |250| Image in conversation (no path) | **ASK user for file path** with AskUserQuestion |251| User can't provide path | Extract style/palette verbally → append to prompt (NO frontmatter references) |252253**CRITICAL**: Only add `references` to prompt frontmatter if files are ACTUALLY SAVED to `refs/` directory.254255**If user provides file path**:2561. Copy to `refs/ref-NN-{slug}.{ext}` (NN = 01, 02, ...)2572. Create description: `refs/ref-NN-{slug}.md`2583. Verify files exist before proceeding259260**If user can't provide path** (extracted verbally):2611. Analyze image visually, extract: colors, style, composition2622. Create `refs/extracted-style.md` with extracted info2633. DO NOT add `references` to prompt frontmatter2644. Instead, append extracted style/colors directly to prompt text265266**Description File Format** (only when file saved):267```yaml268---269ref_id: NN270filename: ref-NN-{slug}.{ext}271usage: direct | style | palette272---273[User's description or auto-generated description]274```275276| Usage | When to Use |277|-------|-------------|278| `direct` | Reference matches desired output closely |279| `style` | Extract visual style characteristics only |280| `palette` | Extract color scheme only |281282**Verification** (only for saved files):283```284Reference Images Saved:285- ref-01-{slug}.png ✓ (can use --ref)286- ref-02-{slug}.png ✓ (can use --ref)287```288289**Or for extracted style**:290```291Reference Style Extracted (no file):292- Colors: #E8756D coral, #7ECFC0 mint...293- Style: minimal flat vector, clean lines...294→ Will append to prompt text (not --ref)295```296297---298299**1.1 Save Source Content**300- If pasted, save to `source.md` in target directory; if file path, use as-is301- **Backup rule**: If `source.md` exists, rename to `source-backup-YYYYMMDD-HHMMSS.md`302303**1.2 Content Analysis**304- Extract topic, core message, tone, keywords305- Identify visual metaphors306- Detect content type307308**1.3 Reference Image Analysis** (if provided in Step 1.0)309310For each reference image:311312| Analysis | Description |313|----------|-------------|314| Visual characteristics | Style, colors, composition |315| Content/subject | What the reference depicts |316| Style match | Which type/palette/rendering align |317| Usage recommendation | `direct` / `style` / `palette` |318319**1.4 Language Detection**320- Detect source language321- Note user's input language322- Compare with EXTEND.md preference323324**1.5 Determine Output Directory**325- Per File Structure rules326- If no `default_output_dir` preference + file path input, include in Step 2 Q4327328### Step 2: Confirm Options ⚠️329330Validate all 5 dimensions + aspect ratio. Full confirmation flow: [references/workflow/confirm-options.md](references/workflow/confirm-options.md)331332**Skip Conditions**:333334| Condition | Skipped | Still Asked |335|-----------|---------|-------------|336| `--quick` or `quick_mode: true` | 5 dimensions | Aspect ratio (unless `--aspect`) |337| All 5 + `--aspect` specified | All | None |338339### Step 3: Create Prompt340341**Backup rule**: If `prompts/cover.md` exists, rename to `prompts/cover-backup-YYYYMMDD-HHMMSS.md`342343Save to `prompts/cover.md`. Full template: [references/workflow/prompt-template.md](references/workflow/prompt-template.md)344345**CRITICAL - References in YAML Frontmatter**:346347When reference files are saved to `refs/`, **MUST add `references` field in frontmatter**:348349```yaml350---351type: cover352palette: warm353rendering: flat-vector354references:355 - ref_id: 01356 filename: refs/ref-01-podcast-thumbnail.jpg357 usage: style358---359```360361| Rule | Action |362|------|--------|363| Files saved to `refs/` | Add to frontmatter `references` list |364| Style extracted verbally (no file) | Omit `references` field, describe in body |365| Before writing | Verify: `test -f refs/ref-NN-{slug}.{ext}` |366367**Reference Embedding**:368369| Situation | Frontmatter | Body |370|-----------|-------------|------|371| Reference file saved to `refs/` | Add to `references` ✓ | Brief style note |372| Style extracted verbally (no file) | Omit `references` | Full style description |373| File in frontmatter but doesn't exist | ERROR - fix or remove | — |374375### Step 4: Generate Image376377**4.1 Backup existing** `cover.png` → `cover-backup-YYYYMMDD-HHMMSS.png` (if regenerating)378379**4.2 Check available image generation skills**; if multiple, ask user preference380381**4.3 Process References** ⚠️ REQUIRED if references in frontmatter382383**Read `references` from prompt frontmatter** and process each entry:3843851. **Parse frontmatter** to get references list:386 ```yaml387 references:388 - ref_id: 01389 filename: refs/ref-01-podcast-thumbnail.jpg390 usage: style391 ```3923932. **VERIFY each file exists**:394 ```bash395 test -f refs/ref-NN-{slug}.{ext} && echo "exists" || echo "MISSING"396 ```397 - If file MISSING → ERROR, fix prompt or remove from references398 - If file exists → proceed with processing3994003. Process based on `usage` type:401402| Usage | Action | Example |403|-------|--------|---------|404| `direct` | Add reference path to `--ref` parameter | `--ref refs/ref-01-brand.png` |405| `style` | Analyze reference, append style traits to prompt | "Style: clean lines, gradient backgrounds..." |406| `palette` | Extract colors from reference, append to prompt | "Colors: #E8756D coral, #7ECFC0 mint..." |4074083. Check image generation skill capability:409410| Skill Supports `--ref` | Action |411|------------------------|--------|412| Yes (e.g., baoyu-image-gen with Google) | Pass reference images via `--ref` |413| No | Convert to text description, append to prompt |414415**Verification**: Before generating, confirm reference processing:416```417Reference Processing:418- ref-01-brand.png: using as direct reference ✓419- ref-02-style.png: extracted palette ✓420```421422**4.4 Generate**4234241. Call selected skill with prompt file path, output path (`cover.png`), aspect ratio4252. If references with `direct` usage AND skill supports `--ref`: include `--ref` parameter4263. On failure: auto-retry once before reporting error427428### Step 5: Completion Report429430```431Cover Generated!432433Topic: [topic]434Type: [type] | Palette: [palette] | Rendering: [rendering]435Text: [text] | Mood: [mood] | Aspect: [ratio]436Title: [title text or "visual only"]437Language: [lang] | Watermark: [enabled/disabled]438References: [N images (direct/style/palette) or "extracted style" or "none"]439Location: [directory path]440441Files:442✓ source-{slug}.{ext}443[✓ refs/ref-01-{slug}.{ext} ... (if references saved)]444[✓ refs/ref-01-{slug}.md ... (description files)]445[✓ refs/extracted-style.md (if style extracted verbally)]446✓ prompts/cover.md447✓ cover.png448[✓ cover-backup-{timestamp}.png (if regenerated)]449```450451## Image Modification452453| Action | Steps |454|--------|-------|455| **Regenerate** | Backup existing → **Update prompt file FIRST** → Regenerate with same settings |456| **Change dimension** | Backup existing → Confirm new value → **Update prompt file FIRST** → Regenerate |457458**IMPORTANT**: When regenerating, ALWAYS update the prompt file (`prompts/cover.md`) FIRST before regenerating. This ensures changes are documented and reproducible.459460All modifications automatically backup existing `cover.png` before regenerating.461462## Notes463464- Cover must be readable at small preview sizes465- Visual metaphors > literal representations466- Title: readable, impactful467- Two confirmation points: Step 0 (first-time setup) + Step 2 (options) - skip Step 2 with `--quick`468- Use confirmed language for title text469- Maintain watermark consistency if enabled470- Check compatibility matrices when selecting combinations471- `--no-title` is alias for `--text none`472- `--style` presets are backward-compatible; explicit `--palette`/`--rendering` override preset values473474### Composition Principles475476- **Generous whitespace**: 40-60% breathing room; avoid cluttered layouts477- **Visual anchor**: Main element centered or offset left (reserve right for title)478- **Character handling**: Simplified silhouettes or icon-style figures; NO realistic humans479- **Icon vocabulary**: Use simple, recognizable symbols (see [references/visual-elements.md](references/visual-elements.md))480481### Title Handling482483- **Source**: Use the exact title provided by user, or extract from source content484- **Do NOT invent titles**: Stay faithful to the original485- If no title in source and user doesn't provide one, ask user to specify486487## References488489**Dimensions**: [text.md](references/dimensions/text.md) | [mood.md](references/dimensions/mood.md)490**Palettes**: [references/palettes/](references/palettes/)491**Renderings**: [references/renderings/](references/renderings/)492**Auto-Selection**: [references/auto-selection.md](references/auto-selection.md)493**Style Presets**: [references/style-presets.md](references/style-presets.md)494**Compatibility**: [references/compatibility.md](references/compatibility.md)495**Types**: [references/types.md](references/types.md)496**Visual Elements**: [references/visual-elements.md](references/visual-elements.md)497**Workflow**: [confirm-options.md](references/workflow/confirm-options.md) | [prompt-template.md](references/workflow/prompt-template.md)498**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)