Skip to content

Free, open source blog writer for Claude Code. Researches current sources, writes answer-first posts for Google and AI answers, has an independent reviewer score each one out of 100 and ships only after five delivery gates. 32 skills, 30 /blog commands, 5 agents. Active development at AI-Marketing-Hub/claude-blog; public releases ship here.

feat: add blog-image sub-skill for AI image generation via Gemini

Daniel5a8218211dd5
diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json
index f5ee95d..5266031 100644
--- a/.claude-plugin/plugin.json
+++ b/.claude-plugin/plugin.json
@@ -1,7 +1,7 @@
{
"name": "claude-blog",
- "description": "AI-powered blog creation and optimization skill with 12 commands, 5-category 100-point scoring, and 4 specialized agents. Optimized for Google rankings (December 2025 Core Update, E-E-A-T) and AI citations (GEO/AEO). Writes, rewrites, analyzes, outlines, audits, and repurposes blog content.",
- "version": "1.3.1",
+ "description": "AI-powered blog creation and optimization skill with 13 commands, 5-category 100-point scoring, 4 specialized agents, and AI image generation via Gemini. Optimized for Google rankings (December 2025 Core Update, E-E-A-T) and AI citations (GEO/AEO). Writes, rewrites, analyzes, outlines, audits, generates images, and repurposes blog content.",
+ "version": "1.4.0",
"author": {
"name": "AgriciDaniel"
},
@@ -21,6 +21,7 @@
{"name": "blog-repurpose", "path": "skills/blog-repurpose"},
{"name": "blog-geo", "path": "skills/blog-geo"},
{"name": "blog-audit", "path": "skills/blog-audit"},
- {"name": "blog-chart", "path": "skills/blog-chart", "user-invocable": false}
+ {"name": "blog-chart", "path": "skills/blog-chart", "user-invocable": false},
+ {"name": "blog-image", "path": "skills/blog-image"}
]
}
diff --git a/.gitignore b/.gitignore
index 6a4b140..505a14e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -48,6 +48,9 @@ credentials.json
# Firebase
firebase-debug.log
+# Generated output
+output/
+
# Working documents
definitive-resesarch-blueprint-for-claude-blog.md
.github-audit/
diff --git a/.mcp.json b/.mcp.json
index da39e4f..18ff344 100644
--- a/.mcp.json
+++ b/.mcp.json
@@ -1,3 +1,12 @@
{
- "mcpServers": {}
+ "mcpServers": {
+ "nanobanana-mcp": {
+ "command": "npx",
+ "args": ["-y", "@ycse/nanobanana-mcp"],
+ "env": {
+ "GOOGLE_AI_API_KEY": "${GOOGLE_AI_API_KEY}",
+ "NANOBANANA_MODEL": "gemini-3.1-flash-image-preview"
+ }
+ }
+ }
}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2165bd3..730325b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,23 +7,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+## [1.4.0] - 2026-03-14
+
### Added
-- **plugin.json**: `skills` array declaring all 14 skills (marketplace readiness per Anthropic plugin spec); `blog-chart` marked `user-invocable: false`
+- **blog-image sub-skill**: AI image generation and editing for blog content via Gemini MCP (`@ycse/nanobanana-mcp`)
+ - 6-component Reasoning Brief system (Subject, Action, Context, Composition, Lighting, Style)
+ - 6 blog-optimized domain modes (Editorial, Product, Landscape, UI/Web, Infographic, Abstract)
+ - Commands: `/blog image generate`, `/blog image edit`, `/blog image setup`
+ - 3 reference files: gemini-models.md, mcp-tools.md, prompt-engineering-blog.md
+ - 2 setup scripts: setup_image_mcp.py, validate_image_setup.py
+- **MCP integration**: nanobanana-mcp server config in `.mcp.json` for Gemini image generation
+- **blog-write**: AI image generation as alternative/supplement to stock photos in Phase 2 Research
+- **blog-rewrite**: AI image generation for missing/insufficient images in Phase 2 and Phase 4g
+- **blog-researcher**: AI image recommendation output when stock photos are insufficient
+- **visual-media.md**: Option 3 — AI-Generated Cover documentation with domain mode guidance
### Changed
-- **README.md**: Removed broken `/plugin install claude-blog@AgriciDaniel` (not yet registered in marketplace); corrected Python badge `3.12+` → `3.11+`; added inline note clarifying `blog-chart` is internal
-- **docs/INSTALLATION.md**: Removed "Plugin Install (Recommended)" section with broken command; corrected Python `3.12+` → `3.11+` (aligns with `pyproject.toml >=3.11` and CI matrix)
-- **docs/INSTALLATION.md**: Added `blog-chart` to manual `mkdir` brace expansion (was missing from 13-skill list)
-- **CLAUDE.md**: Corrected Python version reference `3.12+` → `3.11+`
-
-### Fixed
-- **install.ps1**: Removed dead `$dirs` variable block (declared but never used; directories created by the `foreach` loop below it)
-- **skills/blog/SKILL.md**: Corrected `compatibility` field Python version `3.12+` → `3.11+`
-- **skills/blog/SKILL.md**: Corrected `user-invocable` → `user-invokable` (correct Agent Skills spec spelling)
-- **skills/blog-chart/SKILL.md**: Added `user-invokable: false` to match plugin.json declaration; corrected attribute spelling
-
-### Security
-- Deleted `firebase-debug.log` (gitignored debug artifact); deleted stale remote branch `claude/review-plugin-testing-practices-eVVOU`
+- Updated install scripts (install.sh, install.ps1) to handle blog-image references and scripts
+- Updated orchestrator routing table, Quick Reference, and Sub-Skills table for blog-image
+- Updated docs: COMMANDS.md, MCP-INTEGRATION.md, INSTALLATION.md with image generation docs
+- Updated README.md: commands table, architecture diagram, feature descriptions, badge count (13→15)
+- Sub-skill count: 14 → 15 (13 user-facing + 1 internal chart + 1 image generation)
---
@@ -31,12 +35,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- **SKILL.md**: `license`, `compatibility`, and `metadata` fields per Agent Skills spec (agentskills.io)
-- **plugin.json**: `version`, `homepage`, `license` fields
+- **plugin.json**: `version`, `homepage`, `license` fields; `skills` array declaring all 14 skills (marketplace readiness); `blog-chart` marked `user-invocable: false`
- GitHub issue template and PR template (community health files)
+### Changed
+- **README.md**: Removed broken `/plugin install claude-blog@AgriciDaniel` (not yet registered in marketplace); corrected Python badge `3.12+` → `3.11+`; added inline note clarifying `blog-chart` is internal
+- **docs/INSTALLATION.md**: Removed "Plugin Install (Recommended)" section with broken command; corrected Python `3.12+` → `3.11+` (aligns with `pyproject.toml >=3.11` and CI matrix)
+- **docs/INSTALLATION.md**: Added `blog-chart` to manual `mkdir` brace expansion (was missing from 13-skill list)
+- **CLAUDE.md**: Corrected Python version reference `3.12+` → `3.11+`
+
### Fixed
-- **install.ps1**: Updated paths for `skills/blog/` restructure (Windows installer was broken since v1.3.0)
-- **install.ps1**: Added `blog` skip in sub-skill loop to prevent double-copy
+- **install.ps1**: Removed dead `$dirs` variable block (declared but never used); updated paths for `skills/blog/` restructure; added `blog` skip in sub-skill loop to prevent double-copy
+- **skills/blog/SKILL.md**: Corrected `compatibility` field Python version `3.12+` → `3.11+`; corrected `user-invocable` → `user-invokable` (correct Agent Skills spec spelling)
+- **skills/blog-chart/SKILL.md**: Added `user-invokable: false` to match plugin.json declaration; corrected attribute spelling
+
+### Security
+- Deleted `firebase-debug.log` (gitignored debug artifact); deleted stale remote branch `claude/review-plugin-testing-practices-eVVOU`
---
diff --git a/CITATION.cff b/CITATION.cff
index 2fedc9b..9a5de5e 100644
--- a/CITATION.cff
+++ b/CITATION.cff
@@ -11,8 +11,8 @@ authors:
repository-code: "https://github.com/AgriciDaniel/claude-blog"
url: "https://rankenstein.pro"
license: MIT
-version: 1.3.1
-date-released: "2026-03-06"
+version: 1.4.0
+date-released: "2026-03-14"
keywords:
- claude-code
- blog
diff --git a/CLAUDE.md b/CLAUDE.md
index 79aca10..26835d4 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -4,7 +4,7 @@
This repository contains **Claude Blog**, a Tier 4 Claude Code skill for blog content
creation, optimization, and management. It follows the Agent Skills open standard and the
-3-layer architecture (directive, orchestration, execution). 14 sub-skills, 4 specialized
+3-layer architecture (directive, orchestration, execution). 15 sub-skills, 4 specialized
subagents, and 12 content templates are dual-optimized for Google rankings (December 2025
Core Update, E-E-A-T) and AI citations (GEO/AEO).
@@ -13,10 +13,10 @@ Core Update, E-E-A-T) and AI citations (GEO/AEO).
```
claude-blog/
CLAUDE.md # Project instructions (this file)
- .claude-plugin/plugin.json # Plugin manifest (v1.3.1)
- .mcp.json # MCP server configuration
+ .claude-plugin/plugin.json # Plugin manifest (v1.4.0)
+ .mcp.json # MCP server configuration (nanobanana-mcp)
pyproject.toml # Python packaging (3.11+)
- skills/ # 14 sub-skills (blog/ is the orchestrator)
+ skills/ # 15 sub-skills (blog/ is the orchestrator)
blog/SKILL.md # Main orchestrator, routing, scoring
references/ # 12 on-demand knowledge files
templates/ # 12 content templates
@@ -34,6 +34,10 @@ claude-blog/
blog-repurpose/SKILL.md # Multi-platform repurposing
blog-geo/SKILL.md # AI citation optimization
blog-audit/SKILL.md # Full-site blog health assessment
+ blog-image/ # AI image generation via Gemini
+ SKILL.md # Image generation sub-skill
+ references/ # 3 reference docs (models, tools, prompts)
+ scripts/ # MCP setup and validation scripts
agents/ # 4 specialized subagents
blog-researcher.md # Statistics and source research
blog-writer.md # Content generation
@@ -58,6 +62,7 @@ claude-blog/
| `/blog chart` | Inline SVG data visualization charts |
| `/blog repurpose` | Multi-platform content repurposing |
| `/blog geo` | AI citation optimization audit |
+| `/blog image` | AI image generation and editing via Gemini |
| `/blog audit` | Full-site blog health assessment |
## Development Rules
diff --git a/README.md b/README.md
index 261b4a9..360bfe2 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@
![Claude Code Skill](https://img.shields.io/badge/Claude_Code-Skill-blueviolet)
![License: MIT](https://img.shields.io/badge/License-MIT-green)
![Python 3.11+](https://img.shields.io/badge/Python-3.11%2B-blue)
-![Sub-Skills](https://img.shields.io/badge/Sub--Skills-13-orange)
+![Sub-Skills](https://img.shields.io/badge/Sub--Skills-15-orange)
claude-blog is a Claude Code skill ecosystem for creating, optimizing, and managing blog content at scale. It generates complete articles, briefs, calendars, and schemas — dual-optimized for Google rankings and AI citation platforms (ChatGPT, Perplexity, AI Overviews).
@@ -71,9 +71,10 @@ Restart Claude Code after installation to activate.
| `/blog schema <file>` | Generate JSON-LD schema markup |
| `/blog repurpose <file>` | Repurpose for social, email, YouTube |
| `/blog geo <file>` | AI citation readiness audit |
+| `/blog image [generate\|edit\|setup]` | AI image generation via Gemini |
| `/blog audit [directory]` | Full-site blog health assessment |
-> **13 sub-skills total**: 12 user-facing commands above + `blog-chart` (internal SVG generation, invoked automatically by other commands).
+> **15 sub-skills total**: 13 user-facing commands above + `blog-chart` (internal SVG generation) + `blog-image` (also callable internally by write/rewrite).
## Features
@@ -101,6 +102,7 @@ Every article targets both Google rankings and AI citation platforms:
### Visual Media
- Pixabay/Unsplash/Pexels image sourcing with alt text
+- AI image generation via Gemini (hero images, inline illustrations, social cards) — optional, requires free Google AI API key
- Built-in SVG chart generation (bar, grouped bar, lollipop, donut, line, area, radar)
- Image density targets by content type
- Image URL verification (HTTP 200 check before embedding)
@@ -131,7 +133,11 @@ claude-blog/
│ ├── blog-repurpose/SKILL.md
│ ├── blog-geo/SKILL.md
│ ├── blog-audit/SKILL.md
-│ └── blog-chart/SKILL.md # Internal: SVG chart generation
+│ ├── blog-chart/SKILL.md # Internal: SVG chart generation
+│ └── blog-image/ # AI image generation via Gemini
+│ ├── SKILL.md
+│ ├── references/ # 3 reference docs (models, tools, prompts)
+│ └── scripts/ # MCP setup and validation scripts
├── agents/ # 4 specialized agents
│ ├── blog-researcher.md
│ ├── blog-writer.md
diff --git a/agents/blog-researcher.md b/agents/blog-researcher.md
index 0931f08..3a5c1df 100644
--- a/agents/blog-researcher.md
+++ b/agents/blog-researcher.md
@@ -67,6 +67,16 @@ After finding each candidate image URL:
4. Mark each image as Verified (HTTP 200) or Unverified in your output table
5. Never include more than 1 Unverified image in a research packet
+### When Stock Photos Are Insufficient
+
+If fewer than 3 suitable stock images are found, or the topic is too niche/abstract:
+
+1. Note in output: "AI image generation recommended for this topic"
+2. Suggest specific image concepts with domain mode hints:
+ - "Hero: Editorial mode — [description of ideal hero image]"
+ - "Section 3: Infographic mode — [description of data illustration]"
+3. Do NOT call MCP tools directly — the `blog-image` sub-skill handles generation
+
### When Analyzing Competition
1. Search for the target keyword
@@ -105,6 +115,12 @@ Return structured findings:
### Recommended Chart Data
[2-4 data sets suitable for visualization with chart type suggestions]
+
+### AI Image Recommendations (if stock insufficient)
+
+| # | Image Type | Domain Mode | Concept Description |
+|---|-----------|-------------|---------------------|
+| 1 | [hero/inline] | [Editorial/Product/etc.] | [description] |
```
## Cover Image Search
diff --git a/docs/COMMANDS.md b/docs/COMMANDS.md
index fe1e226..b8fc148 100644
--- a/docs/COMMANDS.md
+++ b/docs/COMMANDS.md
@@ -1,6 +1,6 @@
# Command Reference
-Complete reference for all 12 `/blog` slash commands. Every command is invoked
+Complete reference for all 13 `/blog` slash commands. Every command is invoked
through the main orchestrator (`skills/blog/SKILL.md`), which routes to the appropriate
sub-skill.
@@ -24,6 +24,7 @@ sub-skill.
| `repurpose <file>` | blog-repurpose | Repurpose content for other platforms |
| `geo <file>` | blog-geo | AI citation optimization audit |
| `audit [directory]` | blog-audit | Full-site blog health assessment |
+| `image [generate\|edit\|setup]` | blog-image | AI image generation and editing via Gemini |
| `update <file>` | blog-rewrite | Freshness update (alias for rewrite) |
---
@@ -542,6 +543,7 @@ User Input Routes To
/blog repurpose <file> --> blog-repurpose
/blog geo <file> --> blog-geo
/blog audit [directory] --> blog-audit
+/blog image [generate|edit] --> blog-image
/blog update <file> --> blog-rewrite (freshness mode)
```
diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md
index 5c6e580..ceea8f7 100644
--- a/docs/INSTALLATION.md
+++ b/docs/INSTALLATION.md
@@ -111,7 +111,17 @@ If you prefer not to run the installer, copy files to these paths manually.
│ ├── blog-schema/SKILL.md
│ ├── blog-repurpose/SKILL.md
│ ├── blog-geo/SKILL.md
-│ └── blog-audit/SKILL.md
+│ ├── blog-audit/SKILL.md
+│ ├── blog-chart/SKILL.md
+│ └── blog-image/
+│ ├── SKILL.md
+│ ├── references/
+│ │ ├── gemini-models.md
+│ │ ├── mcp-tools.md
+│ │ └── prompt-engineering-blog.md
+│ └── scripts/
+│ ├── setup_image_mcp.py
+│ └── validate_image_setup.py
└── agents/
├── blog-researcher.md
├── blog-writer.md
@@ -124,7 +134,8 @@ If you prefer not to run the installer, copy files to these paths manually.
```bash
# Create directories
mkdir -p ~/.claude/skills/blog/{references,templates,scripts}
-mkdir -p ~/.claude/skills/blog-{write,rewrite,analyze,brief,calendar,strategy,outline,seo-check,schema,repurpose,geo,audit,chart}
+mkdir -p ~/.claude/skills/blog-{write,rewrite,analyze,brief,calendar,strategy,outline,seo-check,schema,repurpose,geo,audit,chart,image}
+mkdir -p ~/.claude/skills/blog-image/{references,scripts}
mkdir -p ~/.claude/agents
# Main skill
@@ -148,10 +159,43 @@ cp agents/*.md ~/.claude/agents/
# Scripts
cp scripts/analyze_blog.py ~/.claude/skills/blog/scripts/
chmod +x ~/.claude/skills/blog/scripts/analyze_blog.py
+
+# Blog-image references and scripts
+cp skills/blog-image/references/*.md ~/.claude/skills/blog-image/references/
+cp skills/blog-image/scripts/*.py ~/.claude/skills/blog-image/scripts/
+chmod +x ~/.claude/skills/blog-image/scripts/*.py
```
---
+## Optional: AI Image Generation
+
+`claude-blog` can generate custom blog images via Gemini AI (hero images, inline
+illustrations, social cards). This requires the nanobanana-mcp server and a free
+Google AI API key.
+
+### Setup
+
+```bash
+# Get your free API key at: https://aistudio.google.com/apikey
+python3 skills/blog-image/scripts/setup_image_mcp.py --key YOUR_KEY
+
+# Verify setup
+python3 skills/blog-image/scripts/validate_image_setup.py
+```
+
+### Requirements
+
+| Requirement | Version | Purpose |
+|-------------|---------|---------|
+| Node.js | 18+ | Runs `npx @ycse/nanobanana-mcp` |
+| Google AI API key | Free tier | Image generation via Gemini |
+
+Without this setup, all `/blog` commands work normally using stock photos from
+Pixabay/Unsplash/Pexels. AI image generation is an optional enhancement.
+
+---
+
## Verification
After installation, verify everything is in place:
@@ -162,7 +206,7 @@ After installation, verify everything is in place:
# Main skill
ls ~/.claude/skills/blog/SKILL.md
-# Sub-skills (should list 12)
+# Sub-skills (should list 14)
ls ~/.claude/skills/blog-*/SKILL.md | wc -l
# Agents (should list 4)
@@ -247,14 +291,14 @@ chmod +x uninstall.sh
This removes:
- `~/.claude/skills/blog/` (main skill, references, templates, scripts)
-- `~/.claude/skills/blog-*/` (all 12 sub-skills)
+- `~/.claude/skills/blog-*/` (all 14 sub-skills including blog-chart and blog-image)
- `~/.claude/agents/blog-*.md` (all 4 agents)
### Manual Uninstall
```bash
rm -rf ~/.claude/skills/blog
-rm -rf ~/.claude/skills/blog-{write,rewrite,analyze,brief,calendar,strategy,outline,seo-check,schema,repurpose,geo,audit}
+rm -rf ~/.claude/skills/blog-{write,rewrite,analyze,brief,calendar,strategy,outline,seo-check,schema,repurpose,geo,audit,chart,image}
rm -f ~/.claude/agents/blog-{researcher,writer,seo,reviewer}.md
```
diff --git a/docs/MCP-INTEGRATION.md b/docs/MCP-INTEGRATION.md
index 48e2624..633a9ca 100644
--- a/docs/MCP-INTEGRATION.md
+++ b/docs/MCP-INTEGRATION.md
@@ -37,6 +37,50 @@ platforms.
---
+## Nano Banana MCP — AI Image Generation
+
+**The nanobanana-mcp server enables AI image generation** within blog workflows.
+When configured, `/blog write` and `/blog rewrite` can generate custom hero images,
+inline illustrations, and social preview cards via Gemini — in addition to stock
+photo sourcing from Pixabay/Unsplash/Pexels.
+
+### What It Enables
+
+| Feature | Without nanobanana-mcp | With nanobanana-mcp |
+|---------|----------------------|---------------------|
+| Hero/cover images | Stock photos only | Stock photos + AI-generated custom images |
+| Inline illustrations | Stock photos only | Stock photos + topic-specific AI illustrations |
+| OG/social cards | Stock photo crop | Custom AI-generated social preview images |
+| Image editing | Not available | Edit existing blog images (crop, enhance, restyle) |
+| Standalone use | Not available | `/blog image generate <idea>` for any image need |
+
+### Configuration
+
+The project `.mcp.json` is pre-configured. Set your API key:
+
+```bash
+# Option 1: Run the setup script
+python3 skills/blog-image/scripts/setup_image_mcp.py --key YOUR_KEY
+
+# Option 2: Set environment variable
+export GOOGLE_AI_API_KEY="your-key-from-aistudio.google.com"
+```
+
+Get a free API key at: https://aistudio.google.com/apikey
+
+### Verify Setup
+
+```bash
+python3 skills/blog-image/scripts/validate_image_setup.py
+```
+
+### Requirements
+
+- Node.js 18+ (for `npx`)
+- Google AI API key (free tier: ~10 RPM / ~500 images per day)
+
+---
+
## DataForSEO MCP (Recommended)
**DataForSEO is the recommended MCP integration for `claude-blog`.** It provides
@@ -549,6 +593,7 @@ Validate both content quality and technical readiness for AI crawlers:
| Integration | Status | Priority |
|------------|--------|----------|
+| Nano Banana (Gemini) | **Available** | AI image generation for blog content |
| DataForSEO | **Available** | Recommended — covers SERP, keywords, backlinks, on-page, domain, content, AI optimization |
| Google Search Console | Planned | High — for first-party traffic/CTR data |
| Google Analytics (GA4) | Future | Low |
diff --git a/install.ps1 b/install.ps1
index c92d935..9eb0a27 100644
--- a/install.ps1
+++ b/install.ps1
@@ -40,7 +40,7 @@ function Main {
New-Item -ItemType Directory -Force -Path (Join-Path $SkillDir "blog" "scripts") | Out-Null
New-Item -ItemType Directory -Force -Path $AgentDir | Out-Null
- foreach ($skill in @("blog-write", "blog-rewrite", "blog-analyze", "blog-brief", "blog-calendar", "blog-strategy", "blog-outline", "blog-seo-check", "blog-schema", "blog-repurpose", "blog-geo", "blog-audit", "blog-chart")) {
+ foreach ($skill in @("blog-write", "blog-rewrite", "blog-analyze", "blog-brief", "blog-calendar", "blog-strategy", "blog-outline", "blog-seo-check", "blog-schema", "blog-repurpose", "blog-geo", "blog-audit", "blog-chart", "blog-image")) {
New-Item -ItemType Directory -Force -Path (Join-Path $SkillDir $skill) | Out-Null
}
@@ -71,6 +71,20 @@ function Main {
}
}
+ # Copy blog-image references and scripts
+ $imgRefSrc = Join-Path $ScriptDir "skills" "blog-image" "references"
+ if (Test-Path $imgRefSrc) {
+ $imgRefDst = Join-Path $SkillDir "blog-image" "references"
+ New-Item -ItemType Directory -Force -Path $imgRefDst | Out-Null
+ Copy-Item (Join-Path $imgRefSrc "*.md") $imgRefDst -Force
+ }
+ $imgScriptSrc = Join-Path $ScriptDir "skills" "blog-image" "scripts"
+ if (Test-Path $imgScriptSrc) {
+ $imgScriptDst = Join-Path $SkillDir "blog-image" "scripts"
+ New-Item -ItemType Directory -Force -Path $imgScriptDst | Out-Null
+ Copy-Item (Join-Path $imgScriptSrc "*.py") $imgScriptDst -Force
+ }
+
# Copy agents
Write-Color White "Installing agents..."
Get-ChildItem -File (Join-Path $ScriptDir "agents" "*.md") | ForEach-Object {
@@ -110,7 +124,7 @@ function Main {
Write-Color White "Installed:"
Write-Color Green " Main skill: blog/ (orchestrator + 12 references + 12 templates)"
- Write-Color Green " Sub-skills: 13 (12 commands + 1 internal)"
+ Write-Color Green " Sub-skills: 15 (13 commands + 1 internal + 1 image generation)"
Write-Color Green " Agents: 4 specialists"
Write-Color Green " Scripts: analyze_blog.py"
Write-Color White ""
@@ -126,8 +140,13 @@ function Main {
Write-Color Cyan " /blog schema <file> Generate JSON-LD schema markup"
Write-Color Cyan " /blog repurpose <file> Repurpose content for other platforms"
Write-Color Cyan " /blog geo <file> AI citation optimization audit"
+ Write-Color Cyan " /blog image <idea> AI image generation via Gemini"
Write-Color Cyan " /blog audit [directory] Full-site blog health assessment"
Write-Color White ""
+ Write-Color White "Optional: AI Image Generation"
+ Write-Color Cyan " /blog image setup Configure Gemini image generation"
+ Write-Color White " Requires: Google AI API key (free at https://aistudio.google.com/apikey)"
+ Write-Color White ""
Write-Color Yellow "Restart Claude Code to activate the new skill."
}
diff --git a/install.sh b/install.sh
index 74f1a3f..ac8cb53 100755
--- a/install.sh
+++ b/install.sh
@@ -45,7 +45,7 @@ main() {
mkdir -p "${SKILL_DIR}/blog/references"
mkdir -p "${SKILL_DIR}/blog/templates"
mkdir -p "${SKILL_DIR}/blog/scripts"
- for skill in blog-write blog-rewrite blog-analyze blog-brief blog-calendar blog-strategy blog-outline blog-seo-check blog-schema blog-repurpose blog-geo blog-audit blog-chart; do
+ for skill in blog-write blog-rewrite blog-analyze blog-brief blog-calendar blog-strategy blog-outline blog-seo-check blog-schema blog-repurpose blog-geo blog-audit blog-chart blog-image; do
mkdir -p "${SKILL_DIR}/${skill}"
done
mkdir -p "${AGENT_DIR}"
@@ -77,6 +77,17 @@ main() {
fi
done
+ # Copy blog-image references and scripts
+ if [ -d "${SCRIPT_DIR}/skills/blog-image/references" ]; then
+ mkdir -p "${SKILL_DIR}/blog-image/references"
+ cp "${SCRIPT_DIR}/skills/blog-image/references/"*.md "${SKILL_DIR}/blog-image/references/"
+ fi
+ if [ -d "${SCRIPT_DIR}/skills/blog-image/scripts" ]; then
+ mkdir -p "${SKILL_DIR}/blog-image/scripts"
+ cp "${SCRIPT_DIR}/skills/blog-image/scripts/"*.py "${SKILL_DIR}/blog-image/scripts/"
+ chmod +x "${SKILL_DIR}/blog-image/scripts/"*.py 2>/dev/null || true
+ fi
+
# Copy agents
echo "→ Installing agents..."
for agent_file in "${SCRIPT_DIR}/agents/"*.md; do
@@ -107,7 +118,7 @@ main() {
echo ""
echo " Installed:"
echo " Main skill: blog/ (orchestrator + references + templates)"
- echo " Sub-skills: 13 (12 commands + 1 internal)"
+ echo " Sub-skills: 15 (13 commands + 1 internal + 1 image generation)"
echo " Agents: 4 specialists"
echo " Scripts: analyze_blog.py"
echo ""
@@ -123,8 +134,13 @@ main() {
echo " /blog schema <file> Generate JSON-LD schema markup"
echo " /blog repurpose <file> Repurpose for other platforms"
echo " /blog geo <file> AI citation optimization audit"
+ echo " /blog image <idea> AI image generation via Gemini"
echo " /blog audit [directory] Full-site blog health assessment"
echo ""
+ echo " Optional: AI Image Generation"
+ echo " /blog image setup Configure Gemini image generation"
+ echo " Requires: Google AI API key (free at https://aistudio.google.com/apikey)"
+ echo ""
echo " Restart Claude Code to activate the new skill."
}
diff --git a/pyproject.toml b/pyproject.toml
index e378434..5cd1568 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "claude-blog"
-version = "1.3.1"
+version = "1.4.0"
description = "AI-powered blog creation and optimization skill for Claude Code"
readme = "README.md"
license = {text = "MIT"}
diff --git a/skills/blog-image/SKILL.md b/skills/blog-image/SKILL.md
new file mode 100644
index 0000000..2dedab0
--- /dev/null
+++ b/skills/blog-image/SKILL.md
@@ -0,0 +1,308 @@
+---
+name: blog-image
+description: >
+ AI image generation and editing for blog content powered by Gemini via MCP.
+ Claude acts as Creative Director — interpreting intent, selecting domain expertise,
+ constructing optimized 6-component prompts (Subject + Action + Context + Composition
+ + Lighting + Style), and orchestrating Gemini for blog-quality results. Generates
+ hero images, inline illustrations, social preview cards, and OG images. Edits
+ existing blog images. Supports 6 blog-optimized domain modes (Editorial, Product,
+ Landscape, UI/Web, Infographic, Abstract). Works standalone via /blog image or
+ internally from blog-write and blog-rewrite workflows. Falls back gracefully when
+ MCP is not configured. Use when user says "blog image", "generate hero image",
+ "blog illustration", "social card", "generate blog image", "edit blog image",
+ "image generate", "blog cover image", "inline image", "OG image".
+user-invokable: true
+argument-hint: "[generate|edit|setup] [description-or-path]"
+allowed-tools:
+ - Read
+ - Write
+ - Edit
+ - Bash
+ - Glob
+ - Grep
+license: MIT
+metadata:
+ author: AgriciDaniel
+ version: "1.4.0"
+ mcp-package: "@ycse/nanobanana-mcp"
+---
+
+# Blog Image — AI Image Generation for Blog Content
+
+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` | Configure MCP server and API key |
+
+## 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 | `8:1` or `4:1` | 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
+
+## MCP Availability Check
+
+Before generating, check if nanobanana-mcp tools are available:
+
+1. Try calling `get_image_history` (lightweight, no side effects)
+2. If it succeeds: MCP is available, proceed with generation
+3. If it fails: MCP not configured — inform the user:
+ - "Image generation requires the nanobanana-mcp server. Run `/blog image setup` to configure it."
+ - When called internally (from blog-write/blog-rewrite): return silently, no error. 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 `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 — NEVER as keyword lists:
+
+1. **Subject** — Who/what, with rich physical detail (textures, materials, scale)
+2. **Action** — What is happening, pose, gesture, movement, state
+3. **Context** — Environment, setting, time of day, season, weather
+4. **Composition** — Camera angle, shot type, framing, negative space, depth
+5. **Lighting** — Light source, quality, direction, color temperature, shadows
+6. **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
+
+Call `set_aspect_ratio` BEFORE generating:
+
+| Blog Use Case | Ratio |
+|---------------|-------|
+| Hero / Cover / OG | `16:9` |
+| Product shot / Square | `4:3` or `1:1` |
+| Section divider | `8:1` or `4:1` |
+| Vertical (stories) | `9:16` |
+
+### Step 5: Generate via MCP
+
+| MCP Tool | When |
+|----------|------|
+| `set_aspect_ratio` | Always call first if ratio differs from 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 |
+| `clear_conversation` | Reset session context |
+
+**Model selection** (use `set_model` MCP tool if switching):
+- **NB2 Flash** (default): Best for most blog images — fast, 14 ratios, 4K, $0.067/img
+- **NB Pro**: Use for hero images with text overlays (94% text accuracy) or highest quality — $0.134/img
+- **Original**: Budget option at $0.039/img — 5 ratios, 1K max
+
+Load `references/mcp-tools.md` for parameter details.
+Load `references/gemini-models.md` for model specs, pricing, and rate limits.
+
+### Step 6: Post-Processing (when needed)
+
+After generation, resize/convert for blog use:
+
+```bash
+# 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 (smallest, modern)
+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:
+1. **Image path** — where it was saved (`~/Documents/nanobanana_generated/`)
+2. **Crafted prompt** — show the full Reasoning Brief (educational)
+3. **Settings** — model, aspect ratio, domain mode
+4. **Alt text** — descriptive sentence, 10-125 chars, topic keywords naturally
+5. **Frontmatter snippet** (for hero/OG images):
+```yaml
+coverImage: "/path/to/generated-image.png"
+coverImageAlt: "Descriptive alt text sentence with topic keywords"
+ogImage: "/path/to/generated-image.png"
+```
+6. **Refinement suggestions** — 1-2 ideas if relevant
+
+## Edit Workflow
+
+For `/blog image edit <path> <instructions>`:
+
+1. Read the image path and edit instruction
+2. 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 |
+3. Call `gemini_edit_image` with enhanced instruction
+4. 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, divider
+- `topic`: blog post topic/title
+- `section_context`: (optional) heading or section the image supports
+- `style_preference`: (optional) photorealistic, illustrated, editorial
+- `count`: (optional) number of images needed (default: 1)
+
+**Output** (returned to calling skill):
+```markdown
+### Generated Image
+- **Path:** ~/Documents/nanobanana_generated/image_timestamp.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 MCP is unavailable, return immediately with no error.
+The calling workflow continues with stock photos. Never block blog-write or
+blog-rewrite because image generation is unavailable.
+
+## 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`:
+
+1. Run `python3 scripts/setup_image_mcp.py` (interactive)
+ - Or: `python3 scripts/setup_image_mcp.py --key YOUR_KEY` (non-interactive)
+ - Writes to project `.mcp.json` by default
+ - Use `--global` flag for `~/.claude/settings.json`
+2. Verify: `python3 scripts/validate_image_setup.py`
+3. Requires:
+ - Node.js 18+ (npx)
+ - Google AI API key (free at https://aistudio.google.com/apikey)
+
+## Safety Filter Auto-Rephrase
+
+When `IMAGE_SAFETY` or `SAFETY` is returned, do NOT give up. Auto-rephrase and retry:
+
+1. Identify the likely trigger (violence, public figures, NSFW-adjacent, or overly cautious filter)
+2. Rephrase using positive framing — describe what you WANT, not what to avoid
+3. If the subject is a person, make them generic (remove celebrity-like specifics)
+4. If the scene is dramatic, soften: "intense" → "focused", "battle" → "competition"
+5. 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 |
+|-------|-----------|
+| MCP not configured | Run `/blog image setup` |
+| API key invalid | New key at https://aistudio.google.com/apikey |
+| Rate limited (429) | Wait 60s, retry. Free tier: ~5-15 RPM / ~20-500 RPD (varies by model and billing) |
+| `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) |
+| MCP unavailable (internal call) | Return silently — calling workflow uses stock photos |
+
+## Reference Documentation
+
+Load on-demand — do NOT load all at startup:
+- `references/prompt-engineering-blog.md` — Domain modes, 6-component system, blog templates
+- `references/gemini-models.md` — Model specs, rate limits, aspect ratios, pricing
+- `references/mcp-tools.md` — MCP tool parameters and response formats
diff --git a/skills/blog-image/references/gemini-models.md b/skills/blog-image/references/gemini-models.md
new file mode 100644
index 0000000..e548373
--- /dev/null
+++ b/skills/blog-image/references/gemini-models.md
@@ -0,0 +1,173 @@
+# Gemini Image Generation Models — Nano Banana
+
+> Last updated: 2026-03-14
+> Aligned with Google's March 2026 API state and pricing
+
+## Available Models
+
+### gemini-3.1-flash-image-preview (Recommended — Speed + Quality)
+| Property | Value |
+|----------|-------|
+| **Model ID** | `gemini-3.1-flash-image-preview` |
+| **Tier** | Nano Banana 2 (Flash) |
+| **Speed** | Fast — optimized for high-volume use |
+| **Aspect Ratios** | All 14 ratios (see table below) |
+| **Max Resolution** | Up to 4096×4096 (4K tier) |
+| **Features** | Google Search grounding (web + image), thinking levels, image-only output, extreme aspect ratios, 512px drafts |
+| **Rate Limits (Free)** | ~5-15 RPM / ~20-500 RPD (preview model — more restrictive than stable) |
+| **Output Tokens** | ~1,290 output tokens per image |
+| **Cost (1K)** | ~$0.067/image |
+| **Best For** | Most blog images, rapid iteration, batch generation |
+
+### gemini-3-pro-image-preview (Highest Quality — Text + Detail)
+| Property | Value |
+|----------|-------|
+| **Model ID** | `gemini-3-pro-image-preview` |
+| **Tier** | Nano Banana Pro |
+| **Speed** | Slower — uses reasoning before generating (generates interim images internally) |
+| **Aspect Ratios** | All 14 ratios |
+| **Max Resolution** | Up to 4096×4096 (4K tier) |
+| **Features** | 94% text accuracy (quoted text), 14 reference images, C2PA Content Credentials |
+| **Rate Limits (Free)** | ~5-10 RPM / ~20-100 RPD |
+| **Output Tokens** | Higher (reasoning + generation) |
+| **Cost (1K)** | ~$0.134/image (2× Flash) |
+| **Best For** | Hero images with text overlays, highest quality final assets, branded content |
+
+**Note:** The base text model `gemini-3-pro-preview` was deprecated March 9, 2026, but the **image variant** (`gemini-3-pro-image-preview`) remains active on AI Studio and Vertex AI.
+
+### gemini-2.5-flash-image (Stable Fallback)
+| Property | Value |
+|----------|-------|
+| **Model ID** | `gemini-2.5-flash-image` |
+| **Tier** | Nano Banana Original (stable) |
+| **Speed** | Fast |
+| **Aspect Ratios** | 1:1, 16:9, 9:16, 4:3, 3:4 (5 only) |
+| **Max Resolution** | Up to 1024×1024 (1K tier) |
+| **Rate Limits (Free)** | ~10-15 RPM / ~500 RPD (stable — more generous than preview models) |
+| **Cost (1K)** | ~$0.039/image |
+| **Best For** | Budget-conscious workflows, proven quality, stable fallback |
+
+## Deprecated Models (DO NOT USE)
+
+### gemini-2.5-flash-image-preview
+- **Status:** Shut down — use the stable `gemini-2.5-flash-image` variant
+
+### gemini-2.0-flash-exp
+- **Status:** Deprecated, shutdown June 1, 2026. Use `gemini-2.5-flash-image`
+
+## Model Selection for Blog Content
+
+| Blog Use Case | Recommended Model | Why |
+|---------------|-------------------|-----|
+| Quick draft / iteration | NB2 Flash (512px) | Fastest, cheapest, good enough for review |
+| Standard blog images | NB2 Flash (1K-2K) | Best speed/quality ratio |
+| Hero images with text | NB Pro | 94% text accuracy, reasoning mode |
+| Final hero / OG at 4K | NB2 Flash or Pro (4K) | Both support 4K output |
+| Budget batch generation | Original (2.5 Flash) | $0.039/img, proven quality |
+
+## Aspect Ratios
+
+All 14 supported ratios. Availability varies by model:
+
+| Ratio | Orientation | Blog Use Cases | NB2 Flash | Pro | Original |
+|-------|-------------|---------------|:---------:|:---:|:--------:|
+| `1:1` | Square | Social posts, thumbnails | ✅ | ✅ | ✅ |
+| `16:9` | Landscape | Blog headers, OG images | ✅ | ✅ | ✅ |
+| `9:16` | Portrait | Stories, Reels, mobile | ✅ | ✅ | ✅ |
+| `4:3` | Landscape | Product shots, inline | ✅ | ✅ | ✅ |
+| `3:4` | Portrait | Book covers, portrait | ✅ | ✅ | ✅ |
+| `2:3` | Portrait | Pinterest pins, posters | ✅ | ✅ | ❌ |
+| `3:2` | Landscape | DSLR standard, prints | ✅ | ✅ | ❌ |
+| `4:5` | Portrait | Instagram portrait | ✅ | ✅ | ❌ |
+| `5:4` | Landscape | Large format | ✅ | ✅ | ❌ |
+| `1:4` | Tall strip | Vertical banners | ✅ | ✅ | ❌ |
+| `4:1` | Wide strip | Section dividers, headers | ✅ | ✅ | ❌ |
+| `1:8` | Extreme tall | Narrow strips | ✅ | ✅ | ❌ |
+| `8:1` | Extreme wide | Ultra-wide banners | ✅ | ✅ | ❌ |
+| `21:9` | Ultra-wide | Cinematic headers | ✅ | ✅ | ❌ |
+
+## Resolution Tiers
+
+| `imageSize` | Pixel Range | Model Availability | Cost Multiplier | Blog Use |
+|-------------|-------------|-------------------|:---------------:|----------|
+| `512` | Up to 512×512 | All models | 0.5× | Drafts, quick iteration |
+| `1K` (default) | Up to 1024×1024 | All models | 1× | Standard web/social |
+| `2K` | Up to 2048×2048 | NB2 Flash, Pro | 2× | Quality inline images |
+| `4K` | Up to 4096×4096 | NB2 Flash, Pro | 4× | Print, hero images, final assets |
+
+**Notes:**
+- Actual pixel dimensions depend on aspect ratio (e.g., 4K at 16:9 = 4096×2304)
+- Default is `1K` if `imageSize` is not specified
+- Known bug: `imageSize` sometimes ignored through LiteLLM proxy and in image-to-image workflows
+
+## Rate Limits
+
+Google cut free-tier limits by ~92% in December 2025. Current structure:
+
+| Tier | RPM | RPD | How to Get |
+|------|-----|-----|-----------|
+| Free | ~5-15 | ~20-500 | Default (API key only, no billing) |
+| Tier 1 (Pay-as-you-go) | 150-300 | 1,500-10,000 | Enable billing on Google Cloud project |
+| Tier 2 ($250+ spend) | 1,000+ | Unlimited | Cumulative $250+ API spend |
+
+**Important:** Preview models (NB2, Pro) have more restrictive limits than stable models. Free tier for image generation may require billing to be enabled — some users report 0 IPM (images per minute) without billing.
+
+## Pricing (March 2026)
+
+| Model | Resolution | Cost per Image | Notes |
+|-------|-----------|---------------|-------|
+| NB2 Flash | 1K | ~$0.067 | Standard |
+| NB2 Flash | 2K | ~$0.134 | 2× standard |
+| NB2 Flash | 4K | ~$0.268 | 4× standard |
+| Pro | 1K | ~$0.134 | 2× Flash |
+| Pro | 4K | ~$0.536 | Premium quality |
+| Original (2.5) | 1K | ~$0.039 | Budget option |
+| Batch API | Any | 50% discount | Asynchronous, higher latency |
+
+**Cost optimization:** Use 512px for drafts (cheapest), 1K for standard blog images, reserve 2K-4K for hero images and final assets.
+
+## Multi-Image Input
+
+| Feature | Limit | Notes |
+|---------|-------|-------|
+| Object references | Up to 6 | Style, composition, visual matching |
+| Character references | Up to 5 | Assign names to preserve features |
+| Total references | Up to 14 | Combined across types |
+| Max input image size | 7 MB | Per image |
+
+Useful for brand-consistent blog imagery: provide brand style references to maintain visual identity across generated images.
+
+## Safety Filters — Dual Layer Architecture
+
+### Layer 1: Input Filters (Configurable)
+Standard harm category filtering via `safetySettings` API parameter. Covers hate speech, harassment, sexually explicit, and dangerous content.
+
+### Layer 2: Output Filters (NON-CONFIGURABLE)
+Server-side analysis of the **generated image itself**. Cannot be disabled through any API parameter.
+- Returns `finishReason: "IMAGE_SAFETY"` (distinct from `"SAFETY"`)
+- Known to be overly cautious — Google acknowledged "filters became way more cautious than we intended"
+- Benign prompts like "dog" or "bowl of cereal" have been blocked
+- Celebrity blocking tightened significantly with NB2
+
+| `finishReason` | Meaning | Layer | Retryable? |
+|----------------|---------|:-----:|:----------:|
+| `STOP` | Successful generation | — | N/A |
+| `IMAGE_SAFETY` | Output blocked by Layer 2 | 2 | Rephrase prompt |
+| `PROHIBITED_CONTENT` | Content policy violation | 1 | No — topic blocked |
+| `SAFETY` | General safety block | 1 | Rephrase prompt |
+| `RECITATION` | Detected copyrighted content | 2 | Rephrase prompt |
+
+**No workaround exists for Layer 2 blocks beyond rephrasing the prompt.**
+
+## Content Credentials
+
+- **SynthID watermarks** are always embedded (invisible, machine-readable). Survives rescaling, compression, and most edits — cannot be disabled
+- **C2PA Content Credentials** are embedded on Nano Banana Pro images from Gemini App, Vertex AI, and Google Ads
+
+## Key Limitations
+- No native transparent backgrounds (workaround: prompt green background, then chromakey removal)
+- Text rendering quality varies — keep text under 25 characters for best results (Pro achieves 94% accuracy with quoted text)
+- Safety filters may block benign prompts — use auto-rephrase workflow
+- Session context resets between Claude Code conversations
+- `imageSize` and thinking level depend on MCP package version support
+- No video generation (use Veo 3.1 for image-to-video workflows)
diff --git a/skills/blog-image/references/mcp-tools.md b/skills/blog-image/references/mcp-tools.md
new file mode 100644
index 0000000..c1c3b56
--- /dev/null
+++ b/skills/blog-image/references/mcp-tools.md
@@ -0,0 +1,115 @@
+# MCP Tools Reference — @ycse/nanobanana-mcp
+
+> Package: `@ycse/nanobanana-mcp`
+> GitHub: https://github.com/YCSE/nanobanana-mcp
+
+## Tools
+
+### gemini_generate_image
+Generate an image from a text prompt.
+
+**Parameters:**
+| Param | Type | Required | Description |
+|-------|------|----------|-------------|
+| `prompt` | string | Yes | Text description of the image to generate |
+
+**Returns:** Image data + file path (saved to `~/Documents/nanobanana_generated/`)
+
+**Example usage in Claude Code:**
+```
+User: "Generate a sunset over mountains in watercolor style"
+→ Claude calls gemini_generate_image with prompt
+→ Returns image path and description
+```
+
+### gemini_edit_image
+Edit an existing image with text instructions.
+
+**Parameters:**
+| Param | Type | Required | Description |
+|-------|------|----------|-------------|
+| `imagePath` | string | Yes | Path to the image file to edit |
+| `prompt` | string | Yes | Edit instructions |
+
+**Returns:** Modified image data + file path
+
+**Example:**
+```
+User: "Remove the background from ~/Documents/photo.png"
+→ Claude calls gemini_edit_image with path and instruction
+```
+
+### gemini_chat
+Multi-turn visual conversation maintaining session context.
+
+**Parameters:**
+| Param | Type | Required | Description |
+|-------|------|----------|-------------|
+| `message` | string | Yes | Chat message (can reference previous images) |
+
+**Returns:** Text response + optional image
+
+**Key feature:** Session consistency — maintains style, characters, and context across turns. Great for iterative refinement.
+
+### set_aspect_ratio
+Configure the aspect ratio for subsequent image generations.
+
+**Parameters:**
+| Param | Type | Required | Description |
+|-------|------|----------|-------------|
+| `ratio` | string | Yes | Aspect ratio (e.g., "16:9", "1:1", "9:16") |
+
+**Supported ratios:** 1:1, 16:9, 9:16, 4:3, 3:4, 2:3, 3:2, 4:5, 5:4, 1:4, 4:1, 1:8, 8:1, 21:9
+
+### set_model
+Switch the active Gemini model.
+
+**Parameters:**
+| Param | Type | Required | Description |
+|-------|------|----------|-------------|
+| `model` | string | Yes | Model identifier |
+
+**Available models:**
+- `gemini-3.1-flash-image-preview` (default, recommended)
+- `gemini-2.5-flash-image` (stable fallback)
+
+### get_image_history
+Retrieve list of images generated in the current session.
+
+**Parameters:** None
+
+**Returns:** Array of image entries with paths and prompts
+
+### clear_conversation
+Reset session context and conversation history.
+
+**Parameters:** None
+
+**Returns:** Confirmation of reset
+
+## Environment Variables
+
+| Variable | Required | Description |
+|----------|----------|-------------|
+| `GOOGLE_AI_API_KEY` | Yes | API key from https://aistudio.google.com/apikey |
+| `NANOBANANA_MODEL` | No | Override default model (default: `gemini-3.1-flash-image-preview`) |
+
+## Output Directory
+All generated images are saved to: `~/Documents/nanobanana_generated/`
+
+Images are named with timestamps for easy identification.
+
+## Feature Availability via MCP
+
+Some newer Gemini API features depend on the MCP package version of `@ycse/nanobanana-mcp`. Check the package version to confirm support:
+
+| Feature | API Status | MCP Support |
+|---------|-----------|-------------|
+| `imageSize` (resolution control) | Available | Depends on package version |
+| Thinking level (`thinkingConfig`) | Available | Depends on package version |
+| Search grounding (`googleSearch`) | Available | Depends on package version |
+| Image-only output (`responseModalities: ["IMAGE"]`) | Available | Depends on package version |
+| Multi-image input (up to 14 refs) | Available | Via `gemini_chat` with image paths |
+| All 14 aspect ratios | Available | Via `set_aspect_ratio` |
+
+If a feature is not yet supported by the MCP package, you can still use it via direct API calls with `curl` or the Google AI SDK.
diff --git a/skills/blog-image/references/prompt-engineering-blog.md b/skills/blog-image/references/prompt-engineering-blog.md
new file mode 100644
index 0000000..bb68ee7
--- /dev/null
+++ b/skills/blog-image/references/prompt-engineering-blog.md
@@ -0,0 +1,198 @@
+# Prompt Engineering Reference — Blog Image Generation
+
+> Load on-demand when constructing complex prompts for blog images.
+> Adapted from Claude Banana's prompt engineering system for blog-specific use cases.
+> Aligned with Google's March 2026 "Ultimate Prompting Guide" for Gemini image generation.
+
+## The 6-Component Reasoning Brief
+
+Every image prompt should contain these components, written as natural
+narrative paragraphs — NEVER as comma-separated keyword lists.
+
+### 1. Subject
+The main focus of the image. Describe with physical specificity.
+
+**Good:** "A weathered Japanese ceramicist in his 70s, deep sun-etched
+wrinkles mapping decades of kiln work, calloused hands cradling a
+freshly thrown tea bowl with an irregular, organic rim"
+
+**Bad:** "old man, ceramic, bowl"
+
+### 2. Action
+What is happening. Movement, pose, gesture, state of being.
+
+**Good:** "leaning forward with intense concentration, gently smoothing
+the rim with a wet thumb, a thin trail of slip running down his wrist"
+
+**Bad:** "making pottery"
+
+### 3. Context
+Environment, setting, temporal and spatial details.
+
+**Good:** "inside a traditional wood-fired anagama kiln workshop,
+stacked shelves of drying pots visible in the soft background, late
+afternoon light filtering through rice paper screens"
+
+**Bad:** "workshop, afternoon"
+
+### 4. Composition
+Camera angle, shot type, framing, spatial relationships.
+
+**Good:** "intimate close-up shot from slightly below eye level,
+shallow depth of field isolating the hands and bowl against the
+soft bokeh of the workshop behind"
+
+**Bad:** "close up"
+
+### 5. Lighting
+Light source, quality, direction, temperature, shadows.
+
+**Good:** "warm directional light from a single high window camera-left,
+creating gentle Rembrandt lighting on the face with a soft triangle
+of light on the shadow-side cheek, deep warm shadows in the workshop"
+
+**Bad:** "natural lighting"
+
+### 6. Style
+Art medium, aesthetic reference, technical photographic details.
+
+**Good:** "captured with a Sony A7R IV, 85mm f/1.4 GM lens, Kodak Portra
+400 color grading with lifted shadows and muted earth tones, reminiscent
+of Dorothea Lange's documentary portraiture"
+
+**Bad:** "photorealistic, 8K, masterpiece"
+
+## Blog Image Types
+
+Map blog use cases to domain modes and aspect ratios:
+
+| Image Type | Aspect Ratio | Domain Mode | Prompt Focus |
+|------------|-------------|-------------|-------------|
+| Hero/Cover | 16:9 | Editorial or Landscape | Wide composition, mood-setting, topic-relevant |
+| OG/Social Card | 16:9 (1200x630) | Editorial or Infographic | Clean, readable at small sizes, topic icon |
+| Inline Illustration | 16:9 or 4:3 | Varies by topic | Supports adjacent H2 content, contextual |
+| Inline Product Shot | 4:3 or 1:1 | Product | Clean background, product focus |
+| Section Divider | 8:1 or 4:1 | Abstract or Landscape | Wide strip, atmospheric, non-distracting |
+
+## Blog-Specific Prompt Templates
+
+### Hero/Cover Image
+```
+A [photorealistic/editorial] wide establishing shot of [topic-relevant scene],
+[action or state that conveys the article's core message]. Set in [environment
+with specifics that match blog topic]. [Wide, balanced composition with rule of
+thirds]. [Dramatic or inviting lighting] creating [mood that matches article tone].
+[Style reference appropriate to blog niche]. Aspect ratio 16:9, suitable as a
+blog hero image at 1200x630 or 1920x1080.
+```
+
+### Inline Illustration
+```
+A [style] [shot type] of [specific element from the blog section], [illustrating
+the concept of the adjacent heading]. [Contextual environment]. [Clear, well-lit
+composition that works at medium size]. [Color palette complementing blog design].
+```
+
+### Social/OG Card Image
+```
+A [clean, high-contrast] [format] showing [key visual concept of the article],
+[simplified for recognition at thumbnail size]. [Minimal background, strong focal
+point]. [Bold lighting that reads well at small sizes]. Text-free, designed for
+social sharing preview at 1200x630.
+```
+
+## Domain Mode Libraries (Blog-Relevant)
+
+### Editorial Mode
+Best for: Blog headers, feature images, lifestyle content, storytelling.
+**Publication refs:** National Geographic, Kinfolk, The Atlantic, Wired
+**Styling notes:** layered textures, clean compositions, atmospheric depth
+**Locations:** contextual to blog topic — offices, workshops, nature, urban
+**Mood:** authoritative, inviting, professional
+
+### Product Mode
+Best for: E-commerce blogs, product reviews, comparison articles, tech posts.
+**Surfaces:** polished marble, brushed concrete, raw linen, acrylic riser, gradient sweep
+**Lighting:** softbox diffused, hard key with fill card, rim separation, tent lighting
+**Angles:** 45-degree hero, flat lay, three-quarter, straight-on
+**Style refs:** Apple product photography, Aesop minimal, clean and modern
+
+### Landscape Mode
+Best for: Environmental backgrounds, travel blogs, atmospheric hero sections.
+**Depth layers:** foreground interest, midground subject, background atmosphere
+**Atmospherics:** fog, mist, haze, volumetric light rays, dust particles
+**Time of day:** blue hour (pre-dawn), golden hour, magic hour (post-sunset)
+**Weather:** dramatic storm clouds, clearing after rain, sun-dappled
+
+### UI/Web Mode
+Best for: Tech blog icons, feature illustrations, app screenshots, diagrams.
+**Styles:** flat vector, isometric 3D, line art, glassmorphism, material design
+**Colors:** specify exact hex or descriptive palette (e.g., "cool blues #2563EB to #1E40AF")
+**Sizing:** design at 2x for retina, specify exact pixel dimensions needed
+**Backgrounds:** transparent (request solid white then post-process), gradient, solid color
+
+### Infographic Mode
+Best for: Data-driven posts, process explanations, comparison visuals.
+**Layout:** modular sections, clear visual hierarchy, bento grid, flow top-to-bottom
+**Text:** use quotes for exact text, descriptive font style, specify size hierarchy
+**Data viz:** bar charts, pie charts, flow diagrams, timelines, comparison tables
+**Colors:** high-contrast, accessible palette, consistent with blog brand
+
+### Abstract Mode
+Best for: Pattern backgrounds, section dividers, decorative headers, mood pieces.
+**Geometry:** fractals, voronoi tessellation, spirals, organic flow, crystalline
+**Textures:** marble veining, fluid dynamics, smoke wisps, ink diffusion, watercolor bleed
+**Color palettes:** analogous harmony, complementary clash, monochromatic gradient
+**Styles:** generative art, procedural, macro photography of materials
+
+## Search-Grounded Generation (NB2 Feature)
+
+For blog images that need real-world accuracy (current products, real locations,
+data-driven infographics), use Google Search grounding with this 3-part formula:
+
+```
+[Source/Search request] + [Analytical task] + [Visual translation]
+```
+
+**Example:** "Search for the top 5 AI coding tools by GitHub stars in 2026, analyze their relative popularity, then generate a clean infographic comparison chart in a modern dark theme."
+
+Requires `googleSearch` tool enabled in the API call. MCP server handles this when available.
+
+## Advanced Techniques
+
+### Text-First Hack
+For images with text, establish the concept conversationally FIRST ("I need a header with 'AI Search 2026'"), then generate. Always enclose text in quotation marks. The model anchors on text mentioned early in the conversation.
+
+### Camera Hardware Naming
+Name real camera hardware for precise aesthetics: "Sony A7III, 85mm f/1.4 lens" locks precise bokeh better than "shallow depth of field with bokeh".
+
+### Character Consistency (Multi-turn)
+Use `gemini_chat` and maintain descriptive anchors:
+- First turn: Generate character with exhaustive physical description
+- Following turns: Reference "the same character" + repeat 2-3 key identifiers
+- Key identifiers: hair color/style, distinctive clothing, facial feature
+
+### Text Rendering Tips
+- Quote exact text: `with the text "OPEN DAILY" in bold condensed sans-serif`
+- **25 characters or less** — practical limit for reliable rendering
+- **2-3 distinct phrases max** — more text fragments degrade quality
+- Describe font characteristics, not font names
+- Specify placement: "centered at the top third", "along the bottom edge"
+- High contrast: light text on dark, or vice versa
+
+### Positive Framing (No Negative Prompts)
+Gemini does NOT support negative prompts. Rephrase exclusions:
+- Instead of "no blur" → "sharp, in-focus, tack-sharp detail"
+- Instead of "no people" → "empty, deserted, uninhabited"
+- Instead of "no text" → "clean, uncluttered, text-free"
+
+## Common Prompt Mistakes
+
+1. **Keyword stuffing** — "8K, masterpiece, best quality" adds nothing to Gemini
+2. **Tag lists instead of prose** — Gemini wants narrative, not "red car, sunset, cinematic"
+3. **Missing lighting** — Single biggest quality differentiator; always specify
+4. **No composition direction** — Results in generic centered framing
+5. **Ignoring aspect ratio** — Always call `set_aspect_ratio` before generating
+6. **Overlong prompts** — Diminishing returns past ~200 words; be precise
+7. **Text > 25 chars** — Rendering degrades; use text-first hack for accuracy
+8. **Not iterating** — Use `gemini_chat` for refinement instead of re-generating
diff --git a/skills/blog-image/scripts/setup_image_mcp.py b/skills/blog-image/scripts/setup_image_mcp.py
new file mode 100644
index 0000000..eb8f4e7
--- /dev/null
+++ b/skills/blog-image/scripts/setup_image_mcp.py
@@ -0,0 +1,204 @@
+#!/usr/bin/env python3
+"""
+Setup script for nanobanana-mcp in claude-blog.
+
+Configures @ycse/nanobanana-mcp in the project's .mcp.json (default)
+or Claude Code's global settings.json (with --global flag).
+
+Usage:
+ python3 setup_image_mcp.py # Interactive (prompts for key)
+ python3 setup_image_mcp.py --key YOUR_KEY # Non-interactive
+ python3 setup_image_mcp.py --check # Verify existing setup
+ python3 setup_image_mcp.py --remove # Remove MCP config
+ python3 setup_image_mcp.py --global # Write to ~/.claude/settings.json
+ python3 setup_image_mcp.py --help # Show usage
+"""
+
+import json
+import sys
+import os
+from pathlib import Path
+
+MCP_NAME = "nanobanana-mcp"
+MCP_PACKAGE = "@ycse/nanobanana-mcp"
+DEFAULT_MODEL = "gemini-3.1-flash-image-preview"
+GLOBAL_SETTINGS_PATH = Path.home() / ".claude" / "settings.json"
+
+
+def find_project_mcp_json() -> Path:
+ """Find the project-level .mcp.json by looking for .claude-plugin/plugin.json."""
+ current = Path(__file__).resolve().parent
+ for _ in range(10): # Max 10 levels up
+ candidate = current / ".claude-plugin" / "plugin.json"
+ if candidate.exists():
+ return current / ".mcp.json"
+ parent = current.parent
+ if parent == current:
+ break
+ current = parent
+ # Fallback: look from cwd
+ current = Path.cwd()
+ for _ in range(10):
+ candidate = current / ".claude-plugin" / "plugin.json"
+ if candidate.exists():
+ return current / ".mcp.json"
+ parent = current.parent
+ if parent == current:
+ break
+ current = parent
+ return None
+
+
+def get_config_path(use_global: bool) -> Path:
+ """Get the appropriate config file path."""
+ if use_global:
+ return GLOBAL_SETTINGS_PATH
+ project_path = find_project_mcp_json()
+ if project_path:
+ return project_path
+ print("Warning: Could not find project root (.claude-plugin/plugin.json).")
+ print("Falling back to global settings.")
+ return GLOBAL_SETTINGS_PATH
+
+
+def load_config(path: Path) -> dict:
+ """Load config file."""
+ if not path.exists():
+ return {}
+ with open(path, "r") as f:
+ return json.load(f)
+
+
+def save_config(path: Path, config: dict) -> None:
+ """Save config file."""
+ path.parent.mkdir(parents=True, exist_ok=True)
+ with open(path, "w") as f:
+ json.dump(config, f, indent=2)
+ f.write("\n")
+ print(f"Config saved to {path}")
+
+
+def check_setup(use_global: bool) -> bool:
+ """Check if MCP is already configured."""
+ # Check project-level first, then global
+ paths_to_check = []
+ if not use_global:
+ project_path = find_project_mcp_json()
+ if project_path:
+ paths_to_check.append(("Project .mcp.json", project_path))
+ paths_to_check.append(("Global settings.json", GLOBAL_SETTINGS_PATH))
+
+ for label, path in paths_to_check:
+ config = load_config(path)
+ servers = config.get("mcpServers", {})
+ if MCP_NAME in servers:
+ env = servers[MCP_NAME].get("env", {})
+ key = env.get("GOOGLE_AI_API_KEY", "")
+ masked = key[:8] + "..." + key[-4:] if len(key) > 12 else "(not set)"
+ print(f"MCP server '{MCP_NAME}' found in {label}.")
+ print(f" Path: {path}")
+ print(f" Package: {MCP_PACKAGE}")
+ print(f" API Key: {masked}")
+ print(f" Model: {env.get('NANOBANANA_MODEL', DEFAULT_MODEL)}")
+ return True
+
+ print(f"MCP server '{MCP_NAME}' is NOT configured.")
+ return False
+
+
+def remove_mcp(use_global: bool) -> None:
+ """Remove MCP configuration."""
+ path = get_config_path(use_global)
+ config = load_config(path)
+ servers = config.get("mcpServers", {})
+ if MCP_NAME in servers:
+ del servers[MCP_NAME]
+ config["mcpServers"] = servers
+ save_config(path, config)
+ print(f"Removed '{MCP_NAME}' from {path}.")
+ else:
+ print(f"'{MCP_NAME}' not found in {path}.")
+
+
+def setup_mcp(api_key: str, use_global: bool) -> None:
+ """Configure MCP server."""
+ if not api_key or not api_key.strip():
+ print("Error: API key cannot be empty.")
+ sys.exit(1)
+
+ api_key = api_key.strip()
+ path = get_config_path(use_global)
+ config = load_config(path)
+
+ if "mcpServers" not in config:
+ config["mcpServers"] = {}
+
+ config["mcpServers"][MCP_NAME] = {
+ "command": "npx",
+ "args": ["-y", MCP_PACKAGE],
+ "env": {
+ "GOOGLE_AI_API_KEY": api_key,
+ "NANOBANANA_MODEL": DEFAULT_MODEL,
+ },
+ }
+
+ save_config(path, config)
+ print(f"\nMCP server '{MCP_NAME}' configured successfully!")
+ print(f" Package: {MCP_PACKAGE}")
+ print(f" Model: {DEFAULT_MODEL}")
+ print(f" Config: {path}")
+ print(f"\nRestart Claude Code for changes to take effect.")
+ print(f"Generated images will be saved to: ~/Documents/nanobanana_generated/")
+
+
+def main() -> None:
+ args = sys.argv[1:]
+ use_global = "--global" in args
+
+ if "--help" in args or "-h" in args:
+ print("Usage: python3 setup_image_mcp.py [OPTIONS]")
+ print()
+ print("Options:")
+ print(" --key KEY Provide API key non-interactively")
+ print(" --check Verify existing setup")
+ print(" --remove Remove MCP configuration")
+ print(" --global Write to ~/.claude/settings.json (default: project .mcp.json)")
+ print(" --help, -h Show this help message")
+ print()
+ print("Get a free API key at: https://aistudio.google.com/apikey")
+ sys.exit(0)
+
+ if "--check" in args:
+ check_setup(use_global)
+ return
+
+ if "--remove" in args:
+ remove_mcp(use_global)
+ return
+
+ # Get API key
+ api_key = None
+ for i, arg in enumerate(args):
+ if arg == "--key" and i + 1 < len(args):
+ api_key = args[i + 1]
+ break
+
+ if not api_key:
+ api_key = os.environ.get("GOOGLE_AI_API_KEY")
+
+ if not api_key:
+ print("claude-blog — Image Generation MCP Setup")
+ print("=" * 45)
+ print(f"\nGet your free API key at: https://aistudio.google.com/apikey")
+ print()
+ try:
+ api_key = input("Enter your Google AI API key: ")
+ except (EOFError, KeyboardInterrupt):
+ print("\nError: No input received. Provide a key with --key or set GOOGLE_AI_API_KEY env var.")
+ sys.exit(1)
+
+ setup_mcp(api_key, use_global)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/skills/blog-image/scripts/validate_image_setup.py b/skills/blog-image/scripts/validate_image_setup.py
new file mode 100644
index 0000000..7b4b709
--- /dev/null
+++ b/skills/blog-image/scripts/validate_image_setup.py
@@ -0,0 +1,189 @@
+#!/usr/bin/env python3
+"""
+Validate that nanobanana-mcp is properly configured for claude-blog.
+
+Checks project .mcp.json first, then falls back to global ~/.claude/settings.json.
+
+Checks:
+1. Config file has the MCP entry
+2. API key is present
+3. Node.js/npx is available
+4. Output directory exists or can be created
+
+Usage:
+ python3 validate_image_setup.py
+"""
+
+import json
+import shutil
+import sys
+from pathlib import Path
+
+MCP_NAME = "nanobanana-mcp"
+OUTPUT_DIR = Path.home() / "Documents" / "nanobanana_generated"
+GLOBAL_SETTINGS_PATH = Path.home() / ".claude" / "settings.json"
+
+
+def find_project_mcp_json() -> Path:
+ """Find the project-level .mcp.json by looking for .claude-plugin/plugin.json."""
+ current = Path(__file__).resolve().parent
+ for _ in range(10):
+ candidate = current / ".claude-plugin" / "plugin.json"
+ if candidate.exists():
+ return current / ".mcp.json"
+ parent = current.parent
+ if parent == current:
+ break
+ current = parent
+ current = Path.cwd()
+ for _ in range(10):
+ candidate = current / ".claude-plugin" / "plugin.json"
+ if candidate.exists():
+ return current / ".mcp.json"
+ parent = current.parent
+ if parent == current:
+ break
+ current = parent
+ return None
+
+
+def check(label: str, passed: bool, detail: str = "") -> bool:
+ status = "PASS" if passed else "FAIL"
+ msg = f" [{status}] {label}"
+ if detail:
+ msg += f" — {detail}"
+ print(msg)
+ return passed
+
+
+def find_mcp_config() -> tuple:
+ """Find MCP config in project or global settings. Returns (config_dict, path_label)."""
+ # Try project .mcp.json first
+ project_path = find_project_mcp_json()
+ if project_path and project_path.exists():
+ try:
+ with open(project_path) as f:
+ config = json.load(f)
+ if MCP_NAME in config.get("mcpServers", {}):
+ return config, f"project .mcp.json ({project_path})"
+ except (json.JSONDecodeError, OSError):
+ pass
+
+ # Fallback to global settings
+ if GLOBAL_SETTINGS_PATH.exists():
+ try:
+ with open(GLOBAL_SETTINGS_PATH) as f:
+ config = json.load(f)
+ if MCP_NAME in config.get("mcpServers", {}):
+ return config, f"global settings ({GLOBAL_SETTINGS_PATH})"
+ except (json.JSONDecodeError, OSError):
+ pass
+
+ return None, None
+
+
+def main() -> int:
+ print("claude-blog — Image Generation Setup Validation")
+ print("=" * 48)
+ results = []
+
+ # 1-2. Find and load config
+ config, config_label = find_mcp_config()
+
+ if config is None:
+ results.append(check(
+ "MCP config found",
+ False,
+ "Not found in project .mcp.json or global settings.json",
+ ))
+ print(f"\nRun: python3 scripts/setup_image_mcp.py --key YOUR_KEY")
+ return 1
+
+ results.append(check("MCP config found", True, config_label))
+
+ # 3. MCP entry exists
+ servers = config.get("mcpServers", {})
+ has_mcp = MCP_NAME in servers
+ results.append(check(f"MCP server '{MCP_NAME}' configured", has_mcp))
+
+ if has_mcp:
+ mcp = servers[MCP_NAME]
+
+ # 4. Command is npx
+ results.append(check(
+ "Command is 'npx'",
+ mcp.get("command") == "npx",
+ mcp.get("command", "(missing)"),
+ ))
+
+ # 5. Package is correct
+ args = mcp.get("args", [])
+ has_pkg = "@ycse/nanobanana-mcp" in args
+ results.append(check(
+ "Package is @ycse/nanobanana-mcp",
+ has_pkg,
+ str(args),
+ ))
+
+ # 6. API key present
+ env = mcp.get("env", {})
+ key = env.get("GOOGLE_AI_API_KEY", "")
+ # Accept env var placeholders as configured, but warn about ${} syntax
+ key_set = bool(key) and key != ""
+ is_placeholder = key.startswith("${") and key.endswith("}")
+ if is_placeholder:
+ results.append(check(
+ "GOOGLE_AI_API_KEY is set",
+ True,
+ f"{key} (env var placeholder — ensure this variable is exported in your shell)",
+ ))
+ else:
+ results.append(check(
+ "GOOGLE_AI_API_KEY is set",
+ key_set,
+ f"{key[:8]}...{key[-4:]}" if len(key) > 12 else key or "(empty)",
+ ))
+
+ # 7. Model configured (optional — package has a default)
+ model = env.get("NANOBANANA_MODEL", "")
+ results.append(check(
+ "NANOBANANA_MODEL is set",
+ True, # Always pass — model is optional, package defaults to gemini-3.1-flash
+ model or "(not set — package will use default model)",
+ ))
+
+ # 8. Node.js/npx available
+ has_npx = shutil.which("npx") is not None
+ results.append(check(
+ "npx is available in PATH",
+ has_npx,
+ shutil.which("npx") or "not found — install Node.js 18+",
+ ))
+
+ # 9. Output directory
+ if OUTPUT_DIR.exists():
+ results.append(check("Output directory exists", True, str(OUTPUT_DIR)))
+ else:
+ try:
+ OUTPUT_DIR.mkdir(parents=True, exist_ok=True)
+ results.append(check("Output directory created", True, str(OUTPUT_DIR)))
+ except OSError as e:
+ results.append(check("Output directory writable", False, str(e)))
+
+ # Summary
+ passed = sum(1 for r in results if r)
+ total = len(results)
+ print(f"\n{'=' * 48}")
+ print(f"Results: {passed}/{total} checks passed")
+
+ if passed == total:
+ print("Status: Ready to generate blog images!")
+ return 0
+ else:
+ print("Status: Some checks failed. Fix the issues above.")
+ print("Setup: python3 scripts/setup_image_mcp.py --key YOUR_KEY")
+ return 1
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/skills/blog-rewrite/SKILL.md b/skills/blog-rewrite/SKILL.md
index 021b923..dbec429 100644
--- a/skills/blog-rewrite/SKILL.md
+++ b/skills/blog-rewrite/SKILL.md
@@ -92,6 +92,7 @@ Wait for user approval before proceeding.
- Pixabay: `site:pixabay.com [topic keywords]`
- Unsplash: `site:unsplash.com [topic keywords]`
- Verify each URL returns HTTP 200
+ - If nanobanana-mcp is configured, offer AI generation for missing/insufficient images via `blog-image`
4. **Plan charts** if post has fewer than 2:
- Identify data suitable for visualization
- Select diverse chart types
@@ -124,6 +125,7 @@ Apply changes in this order:
- Add `coverImage` + `coverImageAlt` + `ogImage` if missing
- Search Pixabay/Unsplash/Pexels for wide hero image (1200x630)
- Or generate custom SVG cover via `blog-chart` (text-on-gradient with key stat)
+ - Or generate custom AI image via `blog-image` sub-skill (if nanobanana-mcp configured)
- Verify tags/categories are appropriate
#### 4c. Apply Answer-First Formatting
@@ -149,6 +151,7 @@ Every H2 section MUST open with a 40-60 word paragraph containing:
#### 4g. Add Visual Elements
- Embed new images after H2 headings, spaced evenly
- Embed charts within relevant sections
+- If nanobanana-mcp configured: generate custom images for sections lacking good stock matches (invoke `blog-image` sub-skill via Task)
- Adapt embed format to detected platform (MDX vs markdown vs HTML)
#### 4h. Add/Improve FAQ
diff --git a/skills/blog-write/SKILL.md b/skills/blog-write/SKILL.md
index 4ad9c5c..77e1479 100644
--- a/skills/blog-write/SKILL.md
+++ b/skills/blog-write/SKILL.md
@@ -86,6 +86,7 @@ Spawn a `blog-researcher` agent (or do inline research with WebSearch):
- Fallback: `site:pexels.com [topic] wide banner`
- Target dimensions: 1200x630 (OG-compatible) or 1920x1080
- Or generate a custom SVG cover via `blog-chart` (text-on-gradient with key stat)
+ - Or generate a custom AI image via `blog-image` sub-skill (if nanobanana-mcp configured)
- See `references/visual-media.md` for cover image sizing details
3. **Find 3-5 inline images** from open-source platforms:
- **Pixabay** (preferred): Search `site:pixabay.com [topic keywords]`
@@ -98,6 +99,10 @@ Spawn a `blog-researcher` agent (or do inline research with WebSearch):
4. **Plan 2-4 data visualizations** from researched statistics
- Select diverse chart types (see `references/visual-media.md`)
- Map data points to chart formats
+5. **AI image generation** (optional, if nanobanana-mcp configured):
+ - If stock photo results are insufficient (< 3 good matches) or topic is too niche
+ - Generate custom hero image and/or inline illustrations via `blog-image` sub-skill
+ - Stock photos remain default — AI generation supplements, never replaces
### Phase 3: Outline Generation
diff --git a/skills/blog/SKILL.md b/skills/blog/SKILL.md
index e9ac6e4..11730e9 100644
--- a/skills/blog/SKILL.md
+++ b/skills/blog/SKILL.md
@@ -6,7 +6,8 @@ description: >
(December 2025 Core Update, E-E-A-T) and AI citations (GEO/AEO). Writes,
rewrites, analyzes, outlines, audits, and repurposes blog content with
answer-first formatting, sourced statistics, Pixabay/Unsplash/Pexels images,
- built-in SVG chart generation, JSON-LD schema generation, and freshness signals.
+ AI image generation via Gemini, built-in SVG chart generation, JSON-LD schema
+ generation, and freshness signals.
Supports any platform (WordPress, Next.js MDX, Hugo, Ghost, Astro, Jekyll,
11ty, Gatsby, HTML). Use when user says "blog", "write blog", "blog post",
"blog strategy", "content brief", "editorial calendar", "analyze blog",
@@ -17,9 +18,9 @@ license: MIT
compatibility: Requires Claude Code and Python 3.11+ for quality scoring
metadata:
author: AgriciDaniel
- version: "1.3.1"
+ version: "1.4.0"
user-invokable: true
-argument-hint: "[write|rewrite|analyze|brief|calendar|strategy|outline|seo-check|schema|repurpose|geo|audit] [topic-or-file]"
+argument-hint: "[write|rewrite|analyze|brief|calendar|strategy|outline|seo-check|schema|repurpose|geo|image|audit] [topic-or-file]"
allowed-tools:
- Read
- Write
@@ -55,6 +56,7 @@ Perplexity, Google AI Overviews, Gemini).
| `/blog repurpose <file>` | Repurpose content for other platforms |
| `/blog geo <file>` | AI citation readiness audit |
| `/blog audit [directory]` | Full-site blog health assessment |
+| `/blog image [generate\|edit\|setup]` | AI image generation and editing via Gemini |
| `/blog update <file>` | Update existing post with fresh stats (routes to rewrite) |
## Orchestration Logic
@@ -76,6 +78,7 @@ Perplexity, Google AI Overviews, Gemini).
- `repurpose` → `blog-repurpose` (cross-platform content)
- `geo` / `aeo` / `citation` → `blog-geo` (AI citation audit)
- `audit` / `health` → `blog-audit` (site-wide assessment)
+ - `image` → `blog-image` (AI image generation and editing)
- `update` → `blog-rewrite` (with freshness-update mode)
### Platform Detection
@@ -104,7 +107,7 @@ Every blog post targets these 6 optimization pillars:
|--------|--------|---------------|
| Answer-First Formatting | +340% AI citations | Every H2 opens with 40-60 word stat-rich paragraph |
| Real Sourced Data | E-E-A-T trust | Tier 1-3 sources only, inline attribution |
-| Visual Media | Engagement + citations | Pixabay/Unsplash images + built-in SVG chart generation |
+| Visual Media | Engagement + citations | Pixabay/Unsplash images + AI generation via Gemini + built-in SVG charts |
| FAQ Schema | +28% AI citations | Structured FAQ with 40-60 word answers |
| Content Structure | AI extractability | 50-150 word chunks, question headings, proper H hierarchy |
| Freshness Signals | 76% of top citations | Updated within 30 days, dateModified schema |
@@ -152,7 +155,7 @@ Load on-demand as needed (12 references):
- `references/google-landscape-2026.md` -- December 2025 Core Update, E-E-A-T, algorithm changes
- `references/geo-optimization.md` -- GEO/AEO techniques, AI citation factors
- `references/content-rules.md` -- Structure, readability, answer-first formatting
-- `references/visual-media.md` -- Image sourcing (Pixabay, Unsplash, Pexels) + SVG chart integration
+- `references/visual-media.md` -- Image sourcing (Pixabay, Unsplash, Pexels), AI image generation, SVG chart integration
- `references/quality-scoring.md` -- Full 5-category scoring checklist (100 points)
- `references/platform-guides.md` -- Platform-specific output formatting (9 platforms)
- `references/distribution-playbook.md` -- Content distribution strategy (Reddit, YouTube, LinkedIn, etc.)
@@ -200,6 +203,7 @@ Templates are in `templates/` and contain section structure, markers, and checkl
| `blog-geo` | AI citation readiness audit with 0-100 GEO score |
| `blog-audit` | Full-site blog health assessment with parallel subagents |
| `blog-chart` | Generate inline SVG data visualization charts with dark-mode styling |
+| `blog-image` | AI image generation and editing for blog content via Gemini MCP |
## Agents
@@ -249,7 +253,11 @@ For `/blog audit`, step 6 runs in parallel across all posts in the directory.
The `blog-chart` sub-skill is invoked internally by `blog-write` and `blog-rewrite`
when chart-worthy data is identified. It is not a standalone slash command.
-Users do not need to call it directly.
+
+The `blog-image` sub-skill is both user-invocable (`/blog image generate`) and
+callable internally by `blog-write` and `blog-rewrite` when AI-generated images
+are needed (requires nanobanana-mcp configured). Falls back gracefully when MCP
+is not available.
## Integration
diff --git a/skills/blog/references/visual-media.md b/skills/blog/references/visual-media.md
index 55b21cc..1ce3cd2 100644
--- a/skills/blog/references/visual-media.md
+++ b/skills/blog/references/visual-media.md
@@ -29,6 +29,17 @@ For branded or data-driven covers, generate via `blog-chart`:
- Include blog name/author subtle branding
- ViewBox: `0 0 1200 630` for OG compatibility
+### Option 3: AI-Generated Cover (via blog-image)
+
+For custom, topic-specific covers when stock photos don't match:
+1. Requires nanobanana-mcp configured (see `/blog image setup`)
+2. Uses 6-component Reasoning Brief for optimized Gemini prompts
+3. Supports 14 aspect ratios (16:9 for hero, 1.91:1 for OG)
+4. Up to 4K resolution via Gemini 3.1 Flash
+5. Post-processing: auto-resize to 1200x630, convert to WebP/AVIF
+
+Best for: Abstract topics, branded imagery, niche subjects with poor stock results.
+
### Frontmatter Fields
```yaml
@@ -54,6 +65,7 @@ date: "YYYY-MM-DD"
| General topic | Photo cover from Pixabay/Unsplash/Pexels |
| Data-heavy article | Generated SVG with key stat highlight |
| Brand-focused | Generated SVG with brand colors |
+| Abstract/niche topic | AI-generated via `blog-image` (Gemini) |
| Tutorial/how-to | Screenshot or relevant photo |
---
diff --git a/uninstall.ps1 b/uninstall.ps1
index 88b1965..f1932e8 100644
--- a/uninstall.ps1
+++ b/uninstall.ps1
@@ -26,7 +26,7 @@ function Main {
$subSkills = @(
"blog-write", "blog-rewrite", "blog-analyze", "blog-brief",
"blog-calendar", "blog-strategy", "blog-outline", "blog-seo-check",
- "blog-schema", "blog-repurpose", "blog-geo", "blog-audit", "blog-chart"
+ "blog-schema", "blog-repurpose", "blog-geo", "blog-audit", "blog-chart", "blog-image"
)
foreach ($skill in $subSkills) {
$skillPath = Join-Path $SkillDir $skill
diff --git a/uninstall.sh b/uninstall.sh
index d2de785..638b14b 100755
--- a/uninstall.sh
+++ b/uninstall.sh
@@ -18,7 +18,7 @@ main() {
fi
# Remove sub-skills
- for skill in blog-write blog-rewrite blog-analyze blog-brief blog-calendar blog-strategy blog-outline blog-seo-check blog-schema blog-repurpose blog-geo blog-audit blog-chart; do
+ for skill in blog-write blog-rewrite blog-analyze blog-brief blog-calendar blog-strategy blog-outline blog-seo-check blog-schema blog-repurpose blog-geo blog-audit blog-chart blog-image; do
if [ -d "${SKILL_DIR}/${skill}" ]; then
rm -rf "${SKILL_DIR}/${skill}"
echo " Removed: ${SKILL_DIR}/${skill}/"