Gemini SEO Image Assets
Overview
Generate image-first SEO assets with Gemini 3.1, then finish the exact typography, icon sizes, manifest, and metadata locally.
Core rule: let Gemini generate composition and texture; do not rely on Gemini for exact text rendering.
When to Use
- A site has missing or generic
favicon.ico, apple-touch-icon, or og-image.
- A web app needs route-level
title, description, og:*, twitter:*, and canonical wiring.
- The user explicitly wants Gemini or Google AI Studio involved in the asset creation flow.
Do not use this skill when:
- The project already has a strict vector logo or brand system that should be edited directly.
- The task is only to tweak existing metadata strings without generating new raster assets.
- Exact logotypes or multilingual text must come directly from the model output.
Workflow
1. Inspect the project surface
Confirm these before generating anything:
| Check |
Why it matters |
| Root layout / head entry |
Needed for icons, manifest, theme-color, global meta |
| Route metadata API |
Determines where title, description, robots, and canonical belong |
public/ assets |
Prevents accidental overwrite and reveals existing filenames |
| Build command |
Required for verification after wiring |
2. Load credentials and choose the model
- Read
.env.local first, then .env.
- Accept any one of these auth paths (see
gemini-image-generation skill for the full _make_client() helper):
- AI Studio:
GOOGLE_AI_STUDIO_API_KEY / GEMINI_API_KEY / GOOGLE_API_KEY
- Vertex Express:
VERTEX_AI_KEY
- Vertex ADC:
GOOGLE_GENAI_USE_VERTEXAI=true + GOOGLE_CLOUD_PROJECT/LOCATION
- Default model:
gemini-3.1-flash-image-preview (same name on both surfaces).
- If the user asks for a newer or latest Gemini image model, verify the current official name before use.
Minimal request shape:
{
"contents": [{ "parts": [{ "text": "..." }] }],
"generationConfig": {
"responseModalities": ["IMAGE"],
"imageConfig": {
"aspectRatio": "1:1",
"imageSize": "2K"
}
}
}
Vertex caveat: imageSize is not accepted on Vertex endpoints (raises ValidationError: Extra inputs are not permitted). Omit imageSize when routing through VERTEX_AI_KEY / Vertex ADC; the model returns its default resolution and you post-process to the target exports.
3. Generate two base images
Always generate background/base artwork, not final text-complete share cards.
| Asset |
Aspect ratio |
Purpose |
Rule |
| Favicon source |
1:1 |
Master square artwork for all icon exports |
No text, strong silhouette, readable at 16px |
| OG background |
16:9 |
Base for 1200x630 social preview |
Reserve calm negative space for local title overlay |
Use the prompt templates in references/prompts.md. Adapt the palette, mood, and product nouns to the project.
4. Post-process locally
Do the deterministic steps on the local machine:
- Crop/fit the favicon master to a square source such as
1024x1024.
- Export:
favicon.ico
favicon-16x16.png
favicon-32x32.png
apple-touch-icon.png
android-chrome-192x192.png
android-chrome-512x512.png
- Fit the OG base to
1200x630.
- Add title, subtitle, tagline, or other exact copy with local drawing tools or code.
- Prefer local fonts and color tokens from the project instead of asking Gemini to render exact text.
5. Wire SEO metadata
Preferred structure:
| Layer |
Responsibility |
| Root layout |
icons, manifest, theme-color, color-scheme, app name |
| Shared SEO helper |
builds title, description, robots, og:*, twitter:*, canonical |
| Route modules |
call the helper with route-specific values |
Recommended rules:
- Home or marketing entry pages may be
index,follow.
- Quiz, shell, preview, and result routes are usually
noindex,nofollow.
- If the deployment origin is known, use
VITE_SITE_URL to produce absolute canonical, og:url, and og:image.
- If the origin is unknown, keep paths root-relative and let the runtime origin resolve them.
6. Validate before claiming completion
Run all of the following:
| Verification |
Purpose |
| Visual self-check or model-based image inspection |
Confirms icon has no stray text and OG text is legible |
| Typecheck |
Confirms metadata helper and route integration compile |
| Production build |
Confirms asset links and route modules build successfully |
Guardrails
| Rule |
Reason |
| Do not trust Gemini for exact Chinese or brand text |
Text rendering is the least reliable part of the model output |
| Keep favicon imagery simple |
Browser icons collapse under detail very quickly |
| Keep OG imagery quieter than the UI |
Social previews need text contrast and scanability |
| Do not hardcode a production domain in source |
Canonical origin often differs by environment |
| Do not overwrite user-owned assets blindly |
Existing branding may already be in use |
Reference Files
1---2name: gemini-seo-image-assets3description: Use when a web project needs Google AI Studio or Gemini-generated favicon and Open Graph images, exported icon variants, and matching SEO metadata wiring.4---56# Gemini SEO Image Assets78## Overview910Generate image-first SEO assets with Gemini 3.1, then finish the exact typography, icon sizes, manifest, and metadata locally.1112Core rule: **let Gemini generate composition and texture; do not rely on Gemini for exact text rendering**.1314## When to Use1516- A site has missing or generic `favicon.ico`, `apple-touch-icon`, or `og-image`.17- A web app needs route-level `title`, `description`, `og:*`, `twitter:*`, and `canonical` wiring.18- The user explicitly wants Gemini or Google AI Studio involved in the asset creation flow.1920Do not use this skill when:2122- The project already has a strict vector logo or brand system that should be edited directly.23- The task is only to tweak existing metadata strings without generating new raster assets.24- Exact logotypes or multilingual text must come directly from the model output.2526## Workflow2728### 1. Inspect the project surface2930Confirm these before generating anything:3132| Check | Why it matters |33| --- | --- |34| Root layout / head entry | Needed for icons, manifest, theme-color, global meta |35| Route metadata API | Determines where `title`, `description`, `robots`, and `canonical` belong |36| `public/` assets | Prevents accidental overwrite and reveals existing filenames |37| Build command | Required for verification after wiring |3839### 2. Load credentials and choose the model4041- Read `.env.local` first, then `.env`.42- Accept any one of these auth paths (see `gemini-image-generation` skill for the full `_make_client()` helper):43 - AI Studio: `GOOGLE_AI_STUDIO_API_KEY` / `GEMINI_API_KEY` / `GOOGLE_API_KEY`44 - Vertex Express: `VERTEX_AI_KEY`45 - Vertex ADC: `GOOGLE_GENAI_USE_VERTEXAI=true` + `GOOGLE_CLOUD_PROJECT`/`LOCATION`46- Default model: `gemini-3.1-flash-image-preview` (same name on both surfaces).47- If the user asks for a newer or latest Gemini image model, verify the current official name before use.4849Minimal request shape:5051```json52{53 "contents": [{ "parts": [{ "text": "..." }] }],54 "generationConfig": {55 "responseModalities": ["IMAGE"],56 "imageConfig": {57 "aspectRatio": "1:1",58 "imageSize": "2K"59 }60 }61}62```6364> **Vertex caveat**: `imageSize` is not accepted on Vertex endpoints (raises `ValidationError: Extra inputs are not permitted`). Omit `imageSize` when routing through `VERTEX_AI_KEY` / Vertex ADC; the model returns its default resolution and you post-process to the target exports.6566### 3. Generate two base images6768Always generate **background/base artwork**, not final text-complete share cards.6970| Asset | Aspect ratio | Purpose | Rule |71| --- | --- | --- | --- |72| Favicon source | `1:1` | Master square artwork for all icon exports | No text, strong silhouette, readable at `16px` |73| OG background | `16:9` | Base for `1200x630` social preview | Reserve calm negative space for local title overlay |7475Use the prompt templates in [references/prompts.md](./references/prompts.md). Adapt the palette, mood, and product nouns to the project.7677### 4. Post-process locally7879Do the deterministic steps on the local machine:8081- Crop/fit the favicon master to a square source such as `1024x1024`.82- Export:83 - `favicon.ico`84 - `favicon-16x16.png`85 - `favicon-32x32.png`86 - `apple-touch-icon.png`87 - `android-chrome-192x192.png`88 - `android-chrome-512x512.png`89- Fit the OG base to `1200x630`.90- Add title, subtitle, tagline, or other exact copy with local drawing tools or code.91- Prefer local fonts and color tokens from the project instead of asking Gemini to render exact text.9293### 5. Wire SEO metadata9495Preferred structure:9697| Layer | Responsibility |98| --- | --- |99| Root layout | icons, manifest, `theme-color`, `color-scheme`, app name |100| Shared SEO helper | builds `title`, `description`, `robots`, `og:*`, `twitter:*`, `canonical` |101| Route modules | call the helper with route-specific values |102103Recommended rules:104105- Home or marketing entry pages may be `index,follow`.106- Quiz, shell, preview, and result routes are usually `noindex,nofollow`.107- If the deployment origin is known, use `VITE_SITE_URL` to produce absolute `canonical`, `og:url`, and `og:image`.108- If the origin is unknown, keep paths root-relative and let the runtime origin resolve them.109110### 6. Validate before claiming completion111112Run all of the following:113114| Verification | Purpose |115| --- | --- |116| Visual self-check or model-based image inspection | Confirms icon has no stray text and OG text is legible |117| Typecheck | Confirms metadata helper and route integration compile |118| Production build | Confirms asset links and route modules build successfully |119120## Guardrails121122| Rule | Reason |123| --- | --- |124| Do not trust Gemini for exact Chinese or brand text | Text rendering is the least reliable part of the model output |125| Keep favicon imagery simple | Browser icons collapse under detail very quickly |126| Keep OG imagery quieter than the UI | Social previews need text contrast and scanability |127| Do not hardcode a production domain in source | Canonical origin often differs by environment |128| Do not overwrite user-owned assets blindly | Existing branding may already be in use |129130## Reference Files131132- [references/prompts.md](./references/prompts.md): prompt templates for favicon and OG background generation.