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 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
if [ -f .baoyu-skills/baoyu-cover-image/EXTEND.md ]; then
echo "project"
elif [ -f "$HOME/.baoyu-skills/baoyu-cover-image/EXTEND.md" ]; then
echo "user"
fi
| 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 to frontmatter references list:
---
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 ✓ |
| 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
Post-Processing Optimization
After image generation, run the following command to optimize storage efficiency:
python scripts/image_optimizer.py
This will apply advanced compression techniques to reduce file sizes while maintaining visual quality.
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".4metadata:5 source: https://skillmd.com/skills/bishal-pdmsft/baoyu-cover-image6---78# Cover Image Generator910Generate elegant cover images for articles with 5-dimensional customization.1112## Usage1314```bash15# Auto-select all dimensions based on content16/baoyu-cover-image path/to/article.md1718# Quick mode: skip confirmation, use auto-selection19/baoyu-cover-image article.md --quick2021# Specify dimensions (new 5D system)22/baoyu-cover-image article.md --type conceptual --palette warm --rendering flat-vector23/baoyu-cover-image article.md --text title-subtitle --mood bold2425# Style presets (backward-compatible shorthand for palette + rendering)26/baoyu-cover-image article.md --style blueprint27/baoyu-cover-image article.md --style blueprint --rendering hand-drawn # override rendering2829# Visual only (no title text)30/baoyu-cover-image article.md --no-title3132# Direct content input33/baoyu-cover-image34[paste content]3536# Direct input with options37/baoyu-cover-image --palette mono --rendering digital --aspect 1:1 --quick38[paste content]3940# With reference images41/baoyu-cover-image article.md --ref style-ref.png42/baoyu-cover-image article.md --ref ref1.png ref2.png --quick43```4445## Options4647| Option | Description |48|--------|-------------|49| `--type <name>` | Cover type: hero, conceptual, typography, metaphor, scene, minimal |50| `--palette <name>` | Color palette: warm, elegant, cool, dark, earth, vivid, pastel, mono, retro |51| `--rendering <name>` | Rendering style: flat-vector, hand-drawn, painterly, digital, pixel, chalk |52| `--style <name>` | Preset shorthand (expands to palette + rendering, see [Style Presets](references/style-presets.md)) |53| `--text <level>` | Text density: none, title-only, title-subtitle, text-rich |54| `--mood <level>` | Emotional intensity: subtle, balanced, bold |55| `--aspect <ratio>` | 16:9 (default), 2.35:1, 4:3, 3:2, 1:1, 3:4 |56| `--lang <code>` | Title language (en, zh, ja, etc.) |57| `--no-title` | Alias for `--text none` |58| `--quick` | Skip confirmation, use auto-selection for missing dimensions |59| `--ref <files...>` | Reference images for style/composition guidance |6061## Five Dimensions6263| Dimension | Controls | Values | Default |64|-----------|----------|--------|---------|65| **Type** | Visual composition, information structure | hero, conceptual, typography, metaphor, scene, minimal | auto |66| **Palette** | Colors, color scheme, decorative hints | warm, elegant, cool, dark, earth, vivid, pastel, mono, retro | auto |67| **Rendering** | Line quality, texture, depth, element style | flat-vector, hand-drawn, painterly, digital, pixel, chalk | auto |68| **Text** | Text density, information hierarchy | none, title-only, title-subtitle, text-rich | title-only |69| **Mood** | Emotional intensity, visual weight | subtle, balanced, bold | balanced |7071Dimensions can be freely combined. Auto-selection rules: [references/auto-selection.md](references/auto-selection.md)7273## Type Gallery7475| Type | Description | Best For |76|------|-------------|----------|77| `hero` | Large visual impact, title overlay | Product launch, brand promotion, major announcements |78| `conceptual` | Concept visualization, abstract core ideas | Technical articles, methodology, architecture design |79| `typography` | Text-focused layout, prominent title | Opinion pieces, quotes, insights |80| `metaphor` | Visual metaphor, concrete expressing abstract | Philosophy, growth, personal development |81| `scene` | Atmospheric scene, narrative feel | Stories, travel, lifestyle |82| `minimal` | Minimalist composition, generous whitespace | Zen, focus, core concepts |8384Type composition details: [references/types.md](references/types.md)8586## Palette Gallery8788| Palette | Vibe | Primary Colors |89|---------|------|----------------|90| `warm` | Friendly, approachable | Orange, golden yellow, terracotta |91| `elegant` | Sophisticated, refined | Soft coral, muted teal, dusty rose |92| `cool` | Technical, professional | Engineering blue, navy, cyan |93| `dark` | Cinematic, premium | Electric purple, cyan, magenta |94| `earth` | Natural, organic | Forest green, sage, earth brown |95| `vivid` | Energetic, bold | Bright red, neon green, electric blue |96| `pastel` | Gentle, whimsical | Soft pink, mint, lavender |97| `mono` | Clean, focused | Black, near-black, white |98| `retro` | Nostalgic, vintage | Muted orange, dusty pink, maroon |99100Palette definitions: [references/palettes/](references/palettes/)101102## Rendering Gallery103104| Rendering | Description | Key Characteristics |105|-----------|-------------|---------------------|106| `flat-vector` | Clean modern vector | Uniform outlines, flat fills, geometric icons |107| `hand-drawn` | Sketchy organic illustration | Imperfect strokes, paper texture, doodles |108| `painterly` | Soft watercolor/paint | Brush strokes, color bleeds, soft edges |109| `digital` | Polished modern digital | Precise edges, subtle gradients, UI components |110| `pixel` | Retro 8-bit pixel art | Pixel grid, dithering, chunky shapes |111| `chalk` | Chalk on blackboard | Chalk strokes, dust effects, board texture |112113Rendering definitions: [references/renderings/](references/renderings/)114115## Text & Mood116117| Text Level | Title | Subtitle | Tags | Use Case |118|------------|:-----:|:--------:|:----:|----------|119| `none` | - | - | - | Pure visual, no text |120| `title-only` | ✓ | - | - | Simple headline (default) |121| `title-subtitle` | ✓ | ✓ | - | Title + supporting context |122| `text-rich` | ✓ | ✓ | ✓ (2-4) | Information-dense |123124| Mood | Contrast | Saturation | Weight | Use Case |125|------|:--------:|:----------:|:------:|----------|126| `subtle` | Low | Muted | Light | Corporate, thought leadership |127| `balanced` | Medium | Normal | Medium | General articles (default) |128| `bold` | High | Vivid | Heavy | Announcements, promotions |129130Full guides: [references/dimensions/text.md](references/dimensions/text.md) | [references/dimensions/mood.md](references/dimensions/mood.md)131132## Style Presets & Compatibility133134- **Style Presets**: `--style X` expands to palette + rendering. See [references/style-presets.md](references/style-presets.md)135- **Compatibility Matrices**: Palette×Rendering, Type×Rendering, Type×Text, Type×Mood. See [references/compatibility.md](references/compatibility.md)136 - ✓✓ = highly recommended | ✓ = compatible | ✗ = not recommended137138## File Structure139140Output directory depends on `default_output_dir` preference:141142| Preference | Output Path |143|------------|-------------|144| `same-dir` | `{article-dir}/` |145| `imgs-subdir` | `{article-dir}/imgs/` |146| `independent` (default) | `cover-image/{topic-slug}/` |147| Pasted content | `cover-image/{topic-slug}/` (always) |148149```150<output-dir>/151├── source-{slug}.{ext} # Source files (text, images, etc.)152├── refs/ # Reference images (if provided)153│ ├── ref-01-{slug}.{ext}154│ ├── ref-01-{slug}.md # Description file (optional)155│ ├── ref-02-{slug}.{ext}156│ ├── ref-02-{slug}.md # Description file (optional)157│ └── extracted-style.md # Verbally extracted style (if no file path)158├── prompts/cover.md # Generation prompt159└── cover.png # Output image160```161162**Slug**: Extract main topic (2-4 words, kebab-case). Example: "The Future of AI" → `future-of-ai`163**Conflict**: If directory exists, append timestamp: `{topic-slug}-YYYYMMDD-HHMMSS`164**Source Files**: Copy all sources with naming `source-{slug}.{ext}` (multiple supported)165166## Workflow167168### Progress Checklist169170```171Cover Image Progress:172- [ ] Step 0: Check preferences (EXTEND.md) ⛔ BLOCKING173 - [ ] Found → load preferences → continue174 - [ ] Not found → run first-time setup → MUST complete before Step 1175- [ ] Step 1: Analyze content + determine output directory176 - [ ] 1.1 Reference images ⚠️ (if provided)177 - [ ] File path given → saved to refs/ ✓178 - [ ] No path → asked user OR extracted verbally179 - [ ] 1.2 Output directory determined180- [ ] Step 2: Confirm options (5 dimensions) ⚠️ REQUIRED unless --quick or all specified181- [ ] Step 3: Create prompt182 - [ ] References in prompt ONLY if files exist in refs/183 - [ ] Extracted style/palette appended to prompt body (if no file)184- [ ] Step 4: Generate image185 - [ ] 4.1 References verified before generation186 - [ ] 4.2 Pass refs via --ref if skill supports AND files exist187- [ ] Step 5: Completion report188```189190### Flow191192```193Input → [Step 0: Preferences] ─┬─ Found → Continue194 │195 └─ Not found → First-Time Setup ⛔ BLOCKING196 │197 └─ Complete setup → Save EXTEND.md → Continue198 199 ┌───────────────────────────────────────────────────────────────────────────┘200 ↓201Analyze + Save Refs → [Output Dir ⚠️] → [Confirm: 5 Dimensions] → Prompt → Generate → Complete202 ↓203 (skip if --quick or all specified)204```205206### Step 0: Load Preferences (EXTEND.md) ⛔ BLOCKING207208**Purpose**: Load user preferences or run first-time setup.209210**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.211212Use Bash to check EXTEND.md existence (priority order):213214```bash215# Check project-level first216if [ -f .baoyu-skills/baoyu-cover-image/EXTEND.md ]; then217 echo "project"218elif [ -f "$HOME/.baoyu-skills/baoyu-cover-image/EXTEND.md" ]; then219 echo "user"220fi221```222223| Result | Action |224|--------|--------|225| Found | Read, parse, display preferences summary → Continue to Step 1 |226| 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 |227228**Preferences Summary** (when found):229230```231Preferences loaded from [project/user]:232• Watermark: [enabled/disabled] [content if enabled]233• Type/Palette/Rendering: [value or "auto"]234• Text: [value or "title-only"] | Mood: [value or "balanced"]235• Aspect: [default_aspect] | Output: [dir or "not set — will ask in Step 1.5"]236• Quick mode: [enabled/disabled] | Language: [value or "auto"]237```238239**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 preference240241Schema: [references/config/preferences-schema.md](references/config/preferences-schema.md)242243### Step 1: Analyze Content244245**1.0 Detect & Save Reference Images** ⚠️ REQUIRED if images provided246247Check if user provided reference images. Handle based on input type:248249| Input Type | Action |250|------------|--------|251| Image file path provided | Copy to `refs/` subdirectory → can use `--ref` |252| Image in conversation (no path) | **ASK user for file path** with AskUserQuestion |253| User can't provide path | Extract style/palette verbally → append to prompt (NO frontmatter references) |254255**CRITICAL**: Only add `references` to prompt frontmatter if files are ACTUALLY SAVED to `refs/` directory.256257**If user provides file path**:2581. Copy to `refs/ref-NN-{slug}.{ext}` (NN = 01, 02, ...)2592. Create description: `refs/ref-NN-{slug}.md`2603. Verify files exist before proceeding261262**If user can't provide path** (extracted verbally):2631. Analyze image visually, extract: colors, style, composition2642. Create `refs/extracted-style.md` with extracted info2653. DO NOT add `references` to prompt frontmatter2664. Instead, append extracted style/colors directly to prompt text267268**Description File Format** (only when file saved):269```yaml270---271ref_id: NN272filename: ref-NN-{slug}.{ext}273usage: direct | style | palette274---275[User's description or auto-generated description]276```277278| Usage | When to Use |279|-------|-------------|280| `direct` | Reference matches desired output closely |281| `style` | Extract visual style characteristics only |282| `palette` | Extract color scheme only |283284**Verification** (only for saved files):285```286Reference Images Saved:287- ref-01-{slug}.png ✓ (can use --ref)288- ref-02-{slug}.png ✓ (can use --ref)289```290291**Or for extracted style**:292```293Reference Style Extracted (no file):294- Colors: #E8756D coral, #7ECFC0 mint...295- Style: minimal flat vector, clean lines...296→ Will append to prompt text (not --ref)297```298299---300301**1.1 Save Source Content**302- If pasted, save to `source.md` in target directory; if file path, use as-is303- **Backup rule**: If `source.md` exists, rename to `source-backup-YYYYMMDD-HHMMSS.md`304305**1.2 Content Analysis**306- Extract topic, core message, tone, keywords307- Identify visual metaphors308- Detect content type309310**1.3 Reference Image Analysis** (if provided in Step 1.0)311312For each reference image:313314| Analysis | Description |315|----------|-------------|316| Visual characteristics | Style, colors, composition |317| Content/subject | What the reference depicts |318| Style match | Which type/palette/rendering align |319| Usage recommendation | `direct` / `style` / `palette` |320321**1.4 Language Detection**322- Detect source language323- Note user's input language324- Compare with EXTEND.md preference325326**1.5 Determine Output Directory**327- Per File Structure rules328- If no `default_output_dir` preference + file path input, include in Step 2 Q4329330### Step 2: Confirm Options ⚠️331332Validate all 5 dimensions + aspect ratio. Full confirmation flow: [references/workflow/confirm-options.md](references/workflow/confirm-options.md)333334**Skip Conditions**:335336| Condition | Skipped | Still Asked |337|-----------|---------|-------------|338| `--quick` or `quick_mode: true` | 5 dimensions | Aspect ratio (unless `--aspect`) |339| All 5 + `--aspect` specified | All | None |340341### Step 3: Create Prompt342343**Backup rule**: If `prompts/cover.md` exists, rename to `prompts/cover-backup-YYYYMMDD-HHMMSS.md`344345Save to `prompts/cover.md`. Full template: [references/workflow/prompt-template.md](references/workflow/prompt-template.md)346347**CRITICAL - References in YAML Frontmatter**:348349When reference files are saved to `refs/`, **MUST add to frontmatter `references` list**:350351```yaml352---353type: cover354palette: warm355rendering: flat-vector356references:357 - ref_id: 01358 filename: refs/ref-01-podcast-thumbnail.jpg359 usage: style360---361```362363| Rule | Action |364|------|--------|365| Files saved to `refs/` | Add to frontmatter `references` ✓ |366| Style extracted verbally (no file) | Omit `references` field, describe in body |367| Before writing | Verify: `test -f refs/ref-NN-{slug}.{ext}` |368369**Reference Embedding**:370371| Situation | Frontmatter | Body |372|-----------|-------------|------|373| Reference file saved to `refs/` | Add to `references` ✓ | Brief style note |374| Style extracted verbally (no file) | Omit `references` | Full style description |375| File in frontmatter but doesn't exist | ERROR - fix or remove | - |376377### Step 4: Generate Image378379**4.1 Backup existing** `cover.png` → `cover-backup-YYYYMMDD-HHMMSS.png` (if regenerating)380381**4.2 Check available image generation skills**; if multiple, ask user preference382383**4.3 Process References** ⚠️ REQUIRED if references in frontmatter384385**Read `references` from prompt frontmatter** and process each entry:3863871. **Parse frontmatter** to get references list:388 ```yaml389 references:390 - ref_id: 01391 filename: refs/ref-01-podcast-thumbnail.jpg392 usage: style393 ```3943952. **VERIFY each file exists**:396 ```bash397 test -f refs/ref-NN-{slug}.{ext} && echo "exists" || echo "MISSING"398 ```399 - If file MISSING → ERROR, fix prompt or remove from references400 - If file exists → proceed with processing4014023. Process based on `usage` type:403404| Usage | Action | Example |405|-------|--------|---------|406| `direct` | Add reference path to `--ref` parameter | `--ref refs/ref-01-brand.png` |407| `style` | Analyze reference, append style traits to prompt | "Style: clean lines, gradient backgrounds..." |408| `palette` | Extract colors from reference, append to prompt | "Colors: #E8756D coral, #7ECFC0 mint..." |4094103. Check image generation skill capability:411412| Skill Supports `--ref` | Action |413|------------------------|--------|414| Yes (e.g., baoyu-image-gen with Google) | Pass reference images via `--ref` |415| No | Convert to text description, append to prompt |416417**Verification**: Before generating, confirm reference processing:418```419Reference Processing:420- ref-01-brand.png: using as direct reference ✓421- ref-02-style.png: extracted palette ✓422```423424**4.4 Generate**4254261. Call selected skill with prompt file path, output path (`cover.png`), aspect ratio4272. If references with `direct` usage AND skill supports `--ref`: include `--ref` parameter4283. On failure: auto-retry once before reporting error429430### Step 5: Completion Report431432```433Cover Generated!434435Topic: [topic]436Type: [type] | Palette: [palette] | Rendering: [rendering]437Text: [text] | Mood: [mood] | Aspect: [ratio]438Title: [title text or "visual only"]439Language: [lang] | Watermark: [enabled/disabled]440References: [N images (direct/style/palette) or "extracted style" or "none"]441Location: [directory path]442443Files:444✓ source-{slug}.{ext}445[✓ refs/ref-01-{slug}.{ext} ... (if references saved)]446[✓ refs/ref-01-{slug}.md ... (description files)]447[✓ refs/extracted-style.md (if style extracted verbally)]448✓ prompts/cover.md449✓ cover.png450[✓ cover-backup-{timestamp}.png (if regenerated)]451```452453## Image Modification454455| Action | Steps |456|--------|-------|457| **Regenerate** | Backup existing → **Update prompt file FIRST** → Regenerate with same settings |458| **Change dimension** | Backup existing → Confirm new value → **Update prompt file FIRST** → Regenerate |459460**IMPORTANT**: When regenerating, ALWAYS update the prompt file (`prompts/cover.md`) FIRST before regenerating. This ensures changes are documented and reproducible.461462All modifications automatically backup existing `cover.png` before regenerating.463464## Notes465466- Cover must be readable at small preview sizes467- Visual metaphors > literal representations468- Title: readable, impactful469- Two confirmation points: Step 0 (first-time setup) + Step 2 (options) - skip Step 2 with `--quick`470- Use confirmed language for title text471- Maintain watermark consistency if enabled472- Check compatibility matrices when selecting combinations473- `--no-title` is alias for `--text none`474- `--style` presets are backward-compatible; explicit `--palette`/`--rendering` override preset values475476### Composition Principles477478- **Generous whitespace**: 40-60% breathing room; avoid cluttered layouts479- **Visual anchor**: Main element centered or offset left (reserve right for title)480- **Character handling**: Simplified silhouettes or icon-style figures; NO realistic humans481- **Icon vocabulary**: Use simple, recognizable symbols (see [references/visual-elements.md](references/visual-elements.md))482483### Title Handling484485- **Source**: Use the exact title provided by user, or extract from source content486- **Do NOT invent titles**: Stay faithful to the original487- If no title in source and user doesn't provide one, ask user to specify488489## References490491**Dimensions**: [text.md](references/dimensions/text.md) | [mood.md](references/dimensions/mood.md)492**Palettes**: [references/palettes/](references/palettes/)493**Renderings**: [references/renderings/](references/renderings/)494**Auto-Selection**: [references/auto-selection.md](references/auto-selection.md)495**Style Presets**: [references/style-presets.md](references/style-presets.md)496**Compatibility**: [references/compatibility.md](references/compatibility.md)497**Types**: [references/types.md](references/types.md)498**Visual Elements**: [references/visual-elements.md](references/visual-elements.md)499**Workflow**: [confirm-options.md](references/workflow/confirm-options.md) | [prompt-template.md](references/workflow/prompt-template.md)500**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)501502## Post-Processing Optimization503504After image generation, run the following command to optimize storage efficiency:505```bash506python scripts/image_optimizer.py507```508509This will apply advanced compression techniques to reduce file sizes while maintaining visual quality.