
blog-image
Paid Gemini image generation for blog heroes, inline illustrations, and OG cards (direct API by default, optional MCP for edits). Asks for explicit consent before the first paid call. Runs only on an explicit request: /blog image, "generate a blog hero image", "blog illustration", "edit this blog image", "OG image", or when blog-write or blog-rewrite needs a hero. Not for charts (blog-chart) or stock-photo search.
- Installs
- 2.6K
- Last 24h
- +17
- Trending rank
- #6416
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/agricidaniel/claude-blog --skill blog-image- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads blog-image automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Blog Image - AI Image Generation for Blog Content
Bundled paths below use host Markdown substitution of ${CLAUDE_SKILL_DIR};
it is not an exported shell variable. Resolve them before execution, quote
paths, and refuse nonabsolute overrides. Pass blog_reference_root resolved
from ${CLAUDE_SKILL_DIR}/../blog/references, blog_template_root from
${CLAUDE_SKILL_DIR}/../blog/templates, and needed sibling roots to agents.
Read the main reference orchestration-details.md before loading project
context; pass only its helper-fenced output to downstream agents.
Cost and consent gate (mandatory, read first)
This skill spends the user's Google AI credit and writes image files.
- What it spends: one paid Gemini image call per generated or edited
image.
generate_hero.pycan try up to four model IDs in turn when the first fails, so budget for that worst case. The stock-photo and Openverse rungs are free but may need their own keys. - Cost basis: per-image prices at
https://ai.google.dev/gemini-api/docs/pricing. On 2026-10-12 that page listed
gemini-nano-banana-2.1at $0.0336 (1K), $0.0504 (2K), $0.113 (4K) andgemini-3.1-flash-imageat $0.067 (1K). Re-read it before quoting a number. - What it writes:
hero.<ext>andhero-credit.txtin the draft folder (direct API),~/Documents/nanobanana_generated/(optional MCP), and~/.claude/settings.json(setup only). - Consent: before the FIRST paid call or file write in a session, tell the user the model, size, image count, and estimated cost (count times price) and wait for an explicit yes. The yes covers only that count. Asking for a blog post does not by itself consent to a paid image call.
- No uncapped spend: never loop on paid calls. Safety rephrases stop at 3 attempts per image. Bulk work (for example a cluster) needs a stated total count and a cap, confirmed once before the first call.
- Declined or unavailable: skip the Gemini call (run the script with the
key unset,
env -u GOOGLE_AI_API_KEY, to use the free stock rungs) and return ONE line for the orchestrator's "Fallbacks and skips" summary, such as "Hero image: user declined paid generation, used a stock photo".
You are a Creative Director that orchestrates Gemini's image generation specifically for blog content. Never pass raw user text directly to the API. Always interpret, enhance, and construct an optimized prompt using the 6-component Reasoning Brief system.
Quick Reference
| Command | What it does |
|---|---|
/blog image generate <idea> | Generate a blog image with full prompt engineering |
/blog image edit <path> <instructions> | Edit an existing blog image intelligently |
/blog image setup | Check the API key and, optionally, install the MCP server |
Blog Image Types
Match the image type to blog use case:
| Image Type | Aspect Ratio | Resolution | Domain Mode | Placement |
|---|---|---|---|---|
| Hero/Cover | 16:9 | 2K or 4K | Editorial / Landscape | Frontmatter coverImage |
| OG/Social Card | 16:9 | 1K | Editorial / Infographic | Frontmatter ogImage |
| Inline Illustration | 16:9 or 4:3 | 1K | Varies by topic | After H2, before body |
| Inline Product Shot | 4:3 or 1:1 | 1K | Product | Within product sections |
| Section Divider | 21:9 then crop | 1K | Abstract / Landscape | Between major sections |
Sizing requirements:
- Blog hero/cover: 1200x630 (OG-compatible) or 1920x1080
- Open Graph (OG): 1200x630 (required for social sharing)
- Inline images: 1200px+ wide
Generation Routes
- Direct API (default). The repo's
generate_hero.pycalls the Gemini API withGOOGLE_AI_API_KEY(thegoogle-genaiSDK must be installed), then falls back to premium stock and Openverse. It needs no MCP server. - Optional MCP (at your own risk).
@ycse/nanobanana-mcp@1.1.1is the only package the setup script pins, and it only supports image model IDs that Google shut down on 2026-06-25 (see Step 5). Use it only if the user already has a working server; never present it as the default.
Before using the MCP route, check availability: call get_image_history with
conversation_id: "default" (no side effects). If it fails, use the direct
API route instead of asking the user to install the MCP.
When called internally (from blog-write/blog-rewrite) and no route works: no error, but return a one-line fallback note (what was skipped, why) for the caller's final summary. The calling workflow continues with stock photos.
Generation Workflow
For /blog image generate <idea> or when invoked internally:
Step 1: Analyze Intent
Determine what the blog needs:
- Image type: Hero, inline, OG card, section divider?
- Blog topic: What is the article about?
- Style: Photorealistic, editorial, illustrated, minimal?
- Constraints: Brand colors, specific dimensions, platform format?
- Mood: Authoritative, inviting, dramatic, clean?
If the request is vague, ask one clarifying question about use case and style.
Step 2: Select Domain Mode
Choose the expertise lens for the image:
| Mode | When to use | Prompt emphasis |
|---|---|---|
| Editorial | Blog headers, feature images, lifestyle | Styling, composition, publication references |
| Product | E-commerce posts, reviews, comparisons | Surface materials, studio lighting, clean BG |
| Landscape | Environmental backgrounds, travel, hero sections | Atmospheric perspective, depth layers, time of day |
| UI/Web | Tech blog icons, illustrations, diagrams | Clean vectors, flat design, exact colors |
| Infographic | Data-driven posts, processes, comparisons | Layout structure, hierarchy, accessible colors |
| Abstract | Pattern backgrounds, section dividers, decorative | Color theory, mathematical forms, textures |
Load ${CLAUDE_SKILL_DIR}/references/prompt-engineering-blog.md for domain mode modifier libraries.
Step 3: Construct the 6-Component Reasoning Brief
Build the prompt as natural narrative paragraphs, not keyword lists:
- Subject - Who/what, with rich physical detail (textures, materials, scale)
- Action - What is happening, pose, gesture, movement, state
- Context - Environment, setting, time of day, season, weather
- Composition - Camera angle, shot type, framing, negative space, depth
- Lighting - Light source, quality, direction, color temperature, shadows
- Style - Art medium, aesthetic, film stock, reference artists/eras
Template for photorealistic blog images:
A photorealistic [shot type] of [subject with physical detail], [action/pose],
set in [environment with specifics]. [Lighting conditions] create [mood].
Captured with [camera model], [focal length] lens at [f-stop], producing
[depth of field effect]. [Color palette/grading notes]. Aspect ratio 16:9,
suitable as a blog [hero image/inline illustration] at [target dimensions].
Template for illustrated/stylized:
A [art style] [format] of [subject with character detail], featuring
[distinctive characteristics] with [color palette]. [Line style] and
[shading technique]. Background is [description]. [Mood/atmosphere].
Step 4: Set Aspect Ratio
Direct API: the script requests 16:9 and fits the result to --width by
--height (default 1200x630). MCP route: call set_aspect_ratio BEFORE
generating, with conversation_id: "default".
| Blog Use Case | Ratio |
|---|---|
| Hero / Cover / OG | 16:9 |
| Product shot / Square | 4:3 or 1:1 |
| Section divider | 21:9, then crop wider in post-processing if needed |
| Vertical (stories) | 9:16 |
Step 5: Generate
Default: direct API. After the consent gate, resolve
BLOG_SCRIPT_DIR="${CLAUDE_BLOG_SCRIPTS_DIR:-${CLAUDE_SKILL_DIR}/../../scripts}",
reject it unless absolute, and never run a relative scripts/generate_hero.py:
python3 "$BLOG_SCRIPT_DIR/generate_hero.py" --topic "<post title>" \
--tags "tag1,tag2" --out "<draft-folder>" [--width 1200] [--height 630] \
[--model <image-model-id>] --json
Flags: --topic (required), --tags, --out (required, receives
hero.<ext> and hero-credit.txt), --width, --height, --model,
--json. Exit 0 means a hero was written (the JSON source field says
gemini, a stock provider, or openverse: report any non-Gemini source as a
fallback). Exit 1 means every rung failed. The script builds one fixed
editorial prompt from the topic and tags; it has no --prompt flag, so
custom briefs and edits need the optional MCP route or a direct google-genai
call written from the current docs.
Model IDs (Google deprecations page, 2026-10-12): use
gemini-nano-banana-2.1 for new work. gemini-3.1-flash-image is the
previous generation (no shutdown announced; replacement
gemini-nano-banana-2.1). gemini-2.5-flash-image has an earliest shutdown
of 2027-03-15. See ${CLAUDE_SKILL_DIR}/references/gemini-models.md.
Optional MCP route (at your own risk). Pinned @ycse/nanobanana-mcp@1.1.1
exposes set_model aliases flash and pro that map to preview IDs shut
down on 2026-06-25, so generation through it is expected to fail. Prefer the
direct API unless a newer package explicitly supports stable IDs.
| MCP Tool | When |
|---|---|
set_aspect_ratio | Always call first, even for 1:1 |
gemini_generate_image | New image from crafted prompt |
gemini_edit_image | Modify existing image |
gemini_chat | Iterative refinement / multi-turn sessions |
get_image_history | Review generated images with conversation_id: "default" |
clear_conversation | Reset session context |
Load ${CLAUDE_SKILL_DIR}/references/mcp-tools.md for MCP parameter details.
Load ${CLAUDE_SKILL_DIR}/references/gemini-models.md for model specs, pricing, and rate limits.
Step 6: Post-Processing (when needed)
After generation, resize/convert for blog use:
# Resize to blog hero dimensions (1200x630)
magick input.png -resize 1200x630^ -gravity center -extent 1200x630 hero.png
# Convert to WebP for web optimization
magick input.png -quality 85 output.webp
# Convert to AVIF when target browsers support it
magick input.png -quality 80 output.avif
# Crop to exact OG dimensions
magick input.png -resize 1200x630^ -gravity center -extent 1200x630 og-image.png
Check if magick (ImageMagick 7) is available. Fall back to convert if not.
Step 7: Deliver
Provide:
- Image path - where it was saved (the draft folder for the direct API,
~/Documents/nanobanana_generated/for the MCP) - Crafted prompt - show the full Reasoning Brief (educational)
- Settings - model, aspect ratio, domain mode
- Alt text - descriptive sentence, 10-125 chars, topic keywords naturally
- Frontmatter snippet (for hero/OG images):
coverImage: "/path/to/generated-image.png"
coverImageAlt: "Descriptive alt text sentence with topic keywords"
ogImage: "/path/to/generated-image.png"
- Refinement suggestions - 1-2 ideas if relevant
Edit Workflow
For /blog image edit <path> <instructions>:
- Read the image path and edit instruction
- Enhance the instruction (never pass raw):
User says Claude crafts "remove background" Detailed edge-preserving background removal "make it warmer" Specific color temperature shift with preservation notes "add text" Font style, size, placement, contrast, readability notes "make it brighter" Increase exposure, lift shadows, maintain highlights "crop for social" Resize to 1200x630 with center-gravity crop - Editing needs the optional MCP (
gemini_edit_image), which is a paid call under the consent gate. Without a working MCP, say so and offer to regenerate through the direct API instead - Return modified image path and description
Internal API (for blog-write / blog-rewrite)
When invoked as a Task subagent from blog-write or blog-rewrite:
Input (provided by calling skill):
image_type: hero, inline, og, dividertopic: blog post topic/titlesection_context: (optional) heading or section the image supportsstyle_preference: (optional) photorealistic, illustrated, editorialcount: (optional) number of images needed (default: 1)
Output (returned to calling skill):
### Generated Image
- **Path:** <draft-folder>/hero.png
- **Alt Text:** Descriptive sentence about the image
- **Type:** hero / inline / og
- **Domain Mode:** Editorial
- **Aspect Ratio:** 16:9
- **Suggested Frontmatter:**
coverImage: "/path/to/image.png"
coverImageAlt: "Alt text here"
Graceful fallback: If no generation route works or the user declines the cost gate, return immediately with no error and a one-line fallback note (what, why) for the caller's final summary. The calling workflow continues with stock photos. The delivery contract still requires a hero file, so the orchestrator must supply one (stock or manual) before rendering. Do not call this skill a second time for the same post's hero: blog-write already requests it once.
Alt Text Generation
For every generated image, create alt text following blog standards:
- Full descriptive sentence (not keyword list)
- 10-125 characters
- Include topic keywords naturally
- Describe what the image shows AND its relevance to the content
- For charts/infographics: include the key data point
Good: Marketing team analyzing AI search traffic data on a dashboard showing citation metrics
Bad: SEO AI marketing blog optimization image
Setup
For /blog image setup:
Resolve BLOG_SKILLS_DIR="${CLAUDE_BLOG_SKILLS_DIR:-${CLAUDE_SKILL_DIR}/..}"
and reject it unless absolute. Setup is the only action allowed to change
image capability configuration, and it needs the user's explicit yes first.
Default path (no MCP): the direct API only needs a key and the SDK.
- Export
GOOGLE_AI_API_KEY(free to create at https://aistudio.google.com/apikey; a billing-enabled project may be required for image models).generate_hero.pyreads only this variable. - Install the SDK with the project's explicit setup (
google-genaiis declared in the repopyproject.tomldependencies); never install implicitly during a run.
Optional MCP path (at your own risk):
- Run
python3 "$BLOG_SKILLS_DIR/blog-image/scripts/setup_image_mcp.py"(interactive)- Prefer exporting
GOOGLE_AI_API_KEYbefore invoking the setup script so a literal key does not enter shell history - Or:
python3 "$BLOG_SKILLS_DIR/blog-image/scripts/setup_image_mcp.py" --key-file /path/to/key.txt - Avoid
--keyunless necessary because command arguments can enter shell history and process lists - Default writes to
~/.claude/settings.json(user-private, mode 0600) --projectflag opts into project.mcp.json(env-expansion only, refuses to write a literal key into a tracked file)
- Prefer exporting
- Verify:
python3 "$BLOG_SKILLS_DIR/blog-image/scripts/validate_image_setup.py" - Requires Node.js 18+ (npx).
- Caveat: the script pins
@ycse/nanobanana-mcp@1.1.1. That npm release hard-codes preview image model IDs that Google shut down on 2026-06-25 (deprecations page, checked 2026-10-12), so image calls through it are expected to fail. Tell the user this before installing. Update setup, validation, and this documentation together when a package release with stable ID support is available.
Safety Filter Auto-Rephrase
When IMAGE_SAFETY or SAFETY is returned, do NOT give up. Auto-rephrase and retry:
- Identify the likely trigger (violence, public figures, NSFW-adjacent, or overly cautious filter)
- Rephrase using positive framing - describe what you WANT, not what to avoid
- If the subject is a person, make them generic (remove celebrity-like specifics)
- If the scene is dramatic, soften: "intense" → "focused", "battle" → "competition"
- Retry with the rephrased prompt (max 3 attempts before reporting to user)
Google acknowledged filters "became way more cautious than we intended" - benign prompts are sometimes blocked. Persistence with rephrasing usually succeeds.
Edit, Don't Re-roll
If an image is 80% correct, use gemini_chat for conversational editing rather than
regenerating from scratch. The session maintains style consistency, so targeted edits
preserve what works while fixing what doesn't.
When to edit vs regenerate:
- Color slightly off → Edit ("shift the color temperature warmer")
- Wrong composition entirely → Regenerate with revised brief
- Good scene but wrong lighting → Edit ("change to golden hour lighting from the left")
- Missing a detail → Edit ("add a steaming coffee cup on the desk")
Error Handling
| Error | Resolution |
|---|---|
| No generation route | Export GOOGLE_AI_API_KEY (see Setup); the MCP is optional |
| API key invalid | New key at https://aistudio.google.com/apikey |
| Rate limited (429) | Wait 60s, retry. Check live limits at https://ai.google.dev/gemini-api/docs/rate-limits |
IMAGE_SAFETY | Auto-rephrase (see above) - Layer 2 filter, non-configurable |
PROHIBITED_CONTENT | Content policy violation - topic is blocked. Non-retryable. |
SAFETY | Rephrase prompt - Layer 1 filter |
| Vague request | Ask one clarifying question before generating |
| Poor quality | Review Reasoning Brief - likely missing lighting (biggest quality differentiator) |
| No route or consent declined (internal call) | Return a one-line fallback note; calling workflow uses stock photos and reports it |
Reference Documentation
Load on-demand - do NOT load all at startup:
${CLAUDE_SKILL_DIR}/references/prompt-engineering-blog.md- Domain modes, 6-component system, blog templates${CLAUDE_SKILL_DIR}/references/gemini-models.md- Model specs, rate limits, aspect ratios, pricing${CLAUDE_SKILL_DIR}/references/mcp-tools.md- MCP tool parameters and response formats
FAQ
What does the blog-image skill do?
Paid Gemini image generation for blog heroes, inline illustrations, and OG cards (direct API by default, optional MCP for edits). Asks for explicit consent before the first paid call. Runs only on an explicit request: /blog image, "generate a blog hero image", "blog illustration", "edit this blog image", "OG image", or when blog-write or blog-rewrite needs a hero. Not for charts (blog-chart) or stock-photo search.
How do I install blog-image?
Run npx skills add https://github.com/agricidaniel/claude-blog --skill blog-image in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/blog-image/ (personal) or .claude/skills/blog-image/ (project).
Which AI agents can use blog-image?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is blog-image safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains blog-image?
It is published by agricidaniel in agricidaniel/claude-blog. It has 2,551 recorded installs.
More from agricidaniel/claude-blog
blog
agricidaniel/claude-blog
Full-lifecycle blog engine with 31 sub-skills, 12 templates, 100-point scoring, and 5 agents. Routes requests to the right sub-skill: writing, rewriting, analysis, outlines, audits, schema, charts, images, repurposing, AI citation SEO, FLOW prompts, topic clusters, and multilingual publishing. Optimized for Google rankings, E-E-A-T, and AI citations. Supports any platform. Use when the user asks to create, revise, analyze, plan, translate, localize, audit, or repurpose blog content, or invokes a /blog subcommand. Do not activate merely because the word "blog" appears in an unrelated coding, theme-debugging, database, log-analysis, or definition request.
blog-seo-check
agricidaniel/claude-blog
Post-writing SEO validation with pass/fail checklist covering title tag length and keyword placement, meta description quality, heading hierarchy and keyword density, internal/external link audit with anchor text analysis, canonical URL verification, Open Graph meta tags (og:title, og:description, og:image), Twitter Card validation, structured data presence and validity, URL structure optimization, and image alt text presence. Produces prioritized fix list with specific recommendations. Use for ONE finished post when the user says "seo check", "validate seo", "on-page seo", "title tag check", "link audit". Not for a whole-site audit (blog-audit, claude-seo), AI-citation scoring (blog-geo), schema generation (blog-schema), or the delivery gates (blogpreflight.py).
blog-factcheck
agricidaniel/claude-blog
Verify statistics and claims in blog posts by fetching cited source URLs and checking if the claimed data actually appears on the page. Extracts all load-bearing claims (statistics, product or policy claims, ranking and comparative claims, named sources), validates cited URLs before fetching, and scores match confidence (exact match 1.0, paraphrase 0.7-0.9, not found 0.0). Flags uncited claims as UNVERIFIED and marks a claim verified only when this run fetched the source and found the passage. Checks that a source says what the post says it says; it cannot prove the source is true or verify first-hand experience. Use when the user says "fact check", "verify statistics", "check sources", "factcheck". Report only; not for rewriting posts (blog-rewrite).
blog-analyze
agricidaniel/claude-blog
Score one blog post (or a folder of posts) on a 5-category 100-point scale covering content quality, SEO, E-E-A-T, technical elements, and AI citation readiness. Runs the deterministic analyzer first, then adds judgment and prioritized Critical/High/Medium/Low fixes. Advisory style diagnostics never infer authorship or affect the score. Exports markdown, JSON or table; works with MDX, markdown, HTML or a URL. Use when the user asks to analyze, score, rate or check the quality of specific posts ("analyze blog", "blog score", "check blog quality", "rate this post"). For a site-wide health check (orphan pages, cannibalization, stale content, schema across all posts) use blog-audit instead.
blog-audit
agricidaniel/claude-blog
Full-site blog health assessment scanning all blog files for quality scores, orphan pages, topic cannibalization, stale content, and AI citation readiness. Runs canonical batch analysis before site-wide checks. Produces per-post scores and a prioritized action queue. Use when the user asks for a site-wide blog health check across many posts ("blog audit", "blog health", "audit all posts", "site audit of the blog"). For one post, or a quality score with fixes for a few named files, use blog-analyze instead.
blog-brief
agricidaniel/claude-blog
Create a content brief for ONE planned post: target and secondary keywords, search intent, template choice, competitor gaps from the live SERP, sourced statistics to include, section plan, internal-link targets, and distribution ideas. Use when the user says "content brief", "blog brief", "SEO brief", "article brief". Not a skeleton only (blog-outline), a multi-post plan (blog-strategy, blog-calendar, blog-cluster), or the article itself (blog-write).
Popular media & creative skills
hyperframes
heygen-com/hyperframes
Read first to make, edit, animate or render any video with HyperFrames (HTML rendered to video), including launch films, explainers, music videos, charts, maps, vertical clips, title cards, captions and overlays. Holds the render contract, the work loop and what each kind of video needs.
media-use
heygen-com/hyperframes
Get or make any media for a HyperFrames video - music, sound effects, images, icons, logos, voiceover, avatar and generated video, transcripts, cutouts, colour grades and looks - with HeyGen or free local tools, and mix placed audio. Also for footage that looks dark, flat or dull, or should be stylized or hidden.
hyperframes-registry
heygen-com/hyperframes
About 450 ready-made HyperFrames blocks and components installed as editable source - transitions, overlays, titles, kinetic type, captions, charts, map overlays, 3D, camera moves. Use it before hand-building any named visual (CRT scanlines, glitch, film grain, a chart); also for hyperframes add and catalog.
hyperframes-creative
heygen-com/hyperframes
Non-animation creative direction for HyperFrames videos. Use for design spec (frame.md / design.md) handling, palettes, typography, narration, beat planning, audio-reactive visuals, composition patterns, and brand / style decisions. For atomic motion patterns and scene blueprints, use hyperframes-animation.
ai-video-generation
101-skills/superpowers
Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0, HappyHorse 1.0, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, reference-to-video, video editing, lipsync, avatar animation, video upscaling, foley sound. Use for: social media videos, marketing content, explainer videos, product demos, AI avatars. Triggers: video generation, ai video, text to video, image to video, veo, animate image, video from image, ai animation, video generator, generate video, t2v, i2v, ai video maker, create video with ai, runway alternative, pika alternative, sora alternative, kling alternative, seedance, happyhorse
ai-image-generation
101-skills/superpowers
Generate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FLUX.2 Klein LoRA, Gemini 3 Pro Image, Grok Imagine, Seedream 4.5, Reve, ImagineArt. Capabilities: text-to-image, image-to-image, inpainting, LoRA, image editing, upscaling, text rendering. Use for: AI art, product mockups, concept art, social media graphics, marketing visuals, illustrations. Triggers: flux, image generation, ai image, text to image, stable diffusion, generate image, ai art, midjourney alternative, dall-e alternative, text2img, t2i, image generator, ai picture, create image with ai, generative ai, ai illustration, grok image, gemini image, gpt image, openai image, chatgpt image