/image-optimization
When the user wants to optimize images for search engines and performance. Also use when the user mentions "image SEO," "alt text," "image captions," "figcaption," "image optimization," "WebP," "lazy loading," "LCP," "image sitemap," "responsive images," "srcset," "image
$ npx -y skills add kostja94/marketing-skills --skill image-optimization --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/image-optimization
Context preview
The summary Claude sees to decide when to auto-load this skill.
When the user wants to optimize images for search engines and performance. Also use when the user mentions "image SEO," "alt text," "image captions," "figcaption," "image optimization," "WebP," "lazy loading," "LCP," "image sitemap," "responsive images," "srcset," "image
SKILL.md
image-optimization.SKILL.mdname: image-optimization
description: When the user wants to optimize images for search engines and performance. Also use when the user mentions "image SEO," "alt text," "image captions," "figcaption," "image optimization," "WebP," "lazy loading," "LCP," "image sitemap," "responsive images," "srcset," "image format," or "hero image optimization." For CWV, use core-web-vitals.
metadata:
version: 1.2.1
SEO On-Page: Image Optimization
Guides image optimization for Google Search (text results, Image Pack, Google Images, Discover), Core Web Vitals (LCP), and accessibility. Consolidates image-related best practices from components (hero, trust-badges) and pages (landing-page). References: [Google Image SEO](https://developers.google.com/search/docs/appearance/google-images), [Semrush Image SEO](https://www.semrush.com/blog/image-seo/).
**When invoking**: On **first use**, if helpful, open with 1–2 sentences on what this skill covers and why it matters, then provide the main output. On **subsequent use** or when the user asks to skip, go directly to the main output.
Scope
- **Discovery & indexing**: HTML img elements, image sitemap
- **Format & performance**: WebP, responsive images, lazy loading, LCP; full CWV optimization in **core-web-vitals**
- **Metadata**: Alt text, file names, captions
- **Preferred image**: primaryImageOfPage, og:image; thumbnail next to title/description in search results
- **Structured data**: ImageObject, image in Article/Product/etc.
Initial Assessment
**Check for project context first:** If `.claude/project-context.md` or `.cursor/project-context.md` exists, read it for brand and page context.
Identify: 1. **Context**: Hero, content page, product, trust badge, social preview 2. **Above vs below fold**: LCP candidate (hero) vs lazy-loadable 3. **Image count**: Single hero vs gallery, programmatic pages
---
1. Discovery & Indexing
Use HTML Image Elements
Google finds images in the `src` attribute of `<img>` (including inside `<picture>`). **CSS background images are not indexed.**
| Do | Don't | |----|-------| | `<img src="puppy.jpg" alt="Golden retriever puppy" />` | `<div style="background-image:url(puppy.jpg)">` |
Image Sitemap
Submit an [image sitemap](https://developers.google.com/search/docs/crawling-indexing/sitemaps/image-sitemaps) to help Google discover images it might otherwise miss. Image sitemaps can include URLs from CDNs (other domains); verify CDN domain in Search Console for crawl error reporting.
**Structure** (from Google):
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
<url>
<loc>https://example.com/page</loc>
<image:image>
<image:loc>https://example.com/image.jpg</image:loc>
</image:image>
</url>
</urlset>See **xml-sitemap** for sitemap index and submission. Image sitemap is an extension; can be standalone or combined with page sitemap.
---
2. Format & Performance
Supported Formats
Google supports: **BMP, GIF, JPEG, PNG, WebP, SVG, AVIF**. Match filename extension to format.
| Format | Best for | Notes | |--------|----------|-------| | **WebP** | Photos, graphics | Smaller files, faster load; lossy + lossless; transparency, animation | | **AVIF** | Modern browsers | Even smaller than WebP; check support | | **JPEG** | Standard photos | Fallback; widely supported | | **PNG** | Transparency, detail | Larger; use when needed | | **SVG** | Icons, logos | Scalable; use `<title>` for inline SVG alt | | **GIF** | Simple animation | First frame only for preview |
Responsive Images
Use `<picture>` or `srcset` for different screen sizes. **Always provide fallback `src`**—some crawlers don't understand srcset.
<img
srcset="image-320w.jpg 320w, image-480w.jpg 480w, image-800w.jpg 800w"
sizes="(max-width: 320px) 280px, (max-width: 480px) 440px, 800px"
src="image-800w.jpg"
alt="Descriptive alt text">
**Picture element** (format fallback, e.g. WebP → PNG):
<picture>
<source type="image/webp" srcset="image.webp">
<img src="image.png" alt="Descriptive alt text">
</picture>
Data URI (Inline Images)
Base64 data URIs (`data:image/...;base64,...`) reduce HTTP requests but increase HTML size. Use sparingly for small icons; avoid for large images. See [web.dev](https://web.dev/articles/embedding-images-and-video#data_uris).
Resize & Compress
- **Max width**: Generally ≤2,500px; match container max-width
- **Compression**: WebP preferred; quality 75–85 for lossy; 72dpi for web
- **LCP**: Hero/above-fold images are LCP candidates; optimize aggressively
Lazy Loading
Use `loading="lazy"` **only for below-fold images**. Above-fold images (hero) must load immediately—lazy loading them hurts LCP.
<img src="hero.jpg" alt="..." loading="eager">
<img src="below-fold.jpg" alt="..." loading="lazy">
---
3. Alt Text
Alt text improves **accessibility** (screen readers, low bandwidth) and **SEO** (Google uses it with computer vision to understand images). It also serves as anchor text if the image is a link.
Best Practices
| Do | Don't | |----|-------| | Useful, information-rich description | Keyword stuffing | | Context of page content | "image of" or "photo of" (redundant) | | Max ~125 characters (some assistive tech truncates) | Empty alt on meaningful images | | Descriptive for functional images | Alt on purely decorative images (use `alt=""`) |
**Examples** (from Google):
- ❌ Missing: `<img src="puppy.jpg"/>`
- ❌ Stuffing: `alt="puppy dog baby dog pup pups puppies..."`
- ✅ Better: `alt="puppy"`
- ✅ Best: `alt="Dalmatian puppy playing fetch"`
Captions
Google extracts image context from captions and nearby text. Use `<figcaption>` or descriptive text near the image.
| Use | Purpose | |-----|---------| | **Topic relevance** | Caption describes image subject; supports indexing
Read more
name: image-optimization description: When the user wants to optimize images for search engines and performance. Also use when the user mentions "image SEO," "alt text," "image captions," "figcaption," "image optimization," "WebP," "lazy loading," "LCP," "image sitemap," "responsive images," "srcset," "image format," or "hero image optimization." For CWV, use core-web-vitals. metadata: version: 1.2.1
SEO On-Page: Image Optimization
Guides image optimization for Google Search (text results, Image Pack, Google Images, Discover), Core Web Vitals (LCP), and accessibility. Consolidates image-related best practices from components (hero, trust-badges) and pages (landing-page). References: [Google Image SEO](https://developers.google.com/search/docs/appearance/google-images), [Semrush Image SEO](https://www.semrush.com/blog/image-seo/).
**When invoking**: On **first use**, if helpful, open with 1–2 sentences on what this skill covers and why it matters, then provide the main output. On **subsequent use** or when the user asks to skip, go directly to the main output.
Scope
- **Discovery & indexing**: HTML img elements, image sitemap
- **Format & performance**: WebP, responsive images, lazy loading, LCP; full CWV optimization in **core-web-vitals**
- **Metadata**: Alt text, file names, captions
- **Preferred image**: primaryImageOfPage, og:image; thumbnail next to title/description in search results
- **Structured data**: ImageObject, image in Article/Product/etc.
Initial Assessment
**Check for project context first:** If `.claude/project-context.md` or `.cursor/project-context.md` exists, read it for brand and page context.
Identify: 1. **Context**: Hero, content page, product, trust badge, social preview 2. **Above vs below fold**: LCP candidate (hero) vs lazy-loadable 3. **Image count**: Single hero vs gallery, programmatic pages
---
1. Discovery & Indexing
Use HTML Image Elements
Google finds images in the `src` attribute of `<img>` (including inside `<picture>`). **CSS background images are not indexed.**
| Do | Don't | |----|-------| | `<img src="puppy.jpg" alt="Golden retriever puppy" />` | `<div style="background-image:url(puppy.jpg)">` |
Image Sitemap
Submit an [image sitemap](https://developers.google.com/search/docs/crawling-indexing/sitemaps/image-sitemaps) to help Google discover images it might otherwise miss. Image sitemaps can include URLs from CDNs (other domains); verify CDN domain in Search Console for crawl error reporting.
**Structure** (from Google):
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
<url>
<loc>https://example.com/page</loc>
<image:image>
<image:loc>https://example.com/image.jpg</image:loc>
</image:image>
</url>
</urlset>See **xml-sitemap** for sitemap index and submission. Image sitemap is an extension; can be standalone or combined with page sitemap.
---
2. Format & Performance
Supported Formats
Google supports: **BMP, GIF, JPEG, PNG, WebP, SVG, AVIF**. Match filename extension to format.
| Format | Best for | Notes | |--------|----------|-------| | **WebP** | Photos, graphics | Smaller files, faster load; lossy + lossless; transparency, animation | | **AVIF** | Modern browsers | Even smaller than WebP; check support | | **JPEG** | Standard photos | Fallback; widely supported | | **PNG** | Transparency, detail | Larger; use when needed | | **SVG** | Icons, logos | Scalable; use `<title>` for inline SVG alt | | **GIF** | Simple animation | First frame only for preview |
Responsive Images
Use `<picture>` or `srcset` for different screen sizes. **Always provide fallback `src`**—some crawlers don't understand srcset.
<img srcset="image-320w.jpg 320w, image-480w.jpg 480w, image-800w.jpg 800w" sizes="(max-width: 320px) 280px, (max-width: 480px) 440px, 800px" src="image-800w.jpg" alt="Descriptive alt text">
**Picture element** (format fallback, e.g. WebP → PNG):
<picture> <source type="image/webp" srcset="image.webp"> <img src="image.png" alt="Descriptive alt text"> </picture>
Data URI (Inline Images)
Base64 data URIs (`data:image/...;base64,...`) reduce HTTP requests but increase HTML size. Use sparingly for small icons; avoid for large images. See [web.dev](https://web.dev/articles/embedding-images-and-video#data_uris).
Resize & Compress
- **Max width**: Generally ≤2,500px; match container max-width
- **Compression**: WebP preferred; quality 75–85 for lossy; 72dpi for web
- **LCP**: Hero/above-fold images are LCP candidates; optimize aggressively
Lazy Loading
Use `loading="lazy"` **only for below-fold images**. Above-fold images (hero) must load immediately—lazy loading them hurts LCP.
<img src="hero.jpg" alt="..." loading="eager"> <img src="below-fold.jpg" alt="..." loading="lazy">
---
3. Alt Text
Alt text improves **accessibility** (screen readers, low bandwidth) and **SEO** (Google uses it with computer vision to understand images). It also serves as anchor text if the image is a link.
Best Practices
| Do | Don't | |----|-------| | Useful, information-rich description | Keyword stuffing | | Context of page content | "image of" or "photo of" (redundant) | | Max ~125 characters (some assistive tech truncates) | Empty alt on meaningful images | | Descriptive for functional images | Alt on purely decorative images (use `alt=""`) |
**Examples** (from Google):
- ❌ Missing: `<img src="puppy.jpg"/>`
- ❌ Stuffing: `alt="puppy dog baby dog pup pups puppies..."`
- ✅ Better: `alt="puppy"`
- ✅ Best: `alt="Dalmatian puppy playing fetch"`
Captions
Google extracts image context from captions and nearby text. Use `<figcaption>` or descriptive text near the image.
| Use | Purpose | |-----|---------| | **Topic relevance** | Caption describes image subject; supports indexing
Markdown skill library for AI agents - SEO, content, pages, paid ads, channels, strategies. Add project context + skills; your agent delivers tailored, production-ready output. Works with Cursor, Claude Code, OpenClaw, Lovable, and any AI that reads markdown.
Repo: kostja94/marketing-skills
Other skills on kostja94-marketing-skills.
- /google-search-console
When the user wants to analyze Google Search Console data, use the GSC API, or interpret search performance. Also use when the user mentions "GSC," "Search Console," "indexing report," "Core Web Vitals," "Enhancements," "Insights report," "search performance," "search queries,"
Open skill - /seo-monitoring
When the user wants to build an SEO data analysis system, monitor indexing/traffic/keywords/backlinks, or set up benchmarks. Also use when the user mentions "SEO data analysis," "SEO monitoring," "article database," "traffic benchmark," "penalty recovery," "SEO work document,"
Open skill - /ai-traffic
When the user wants to track AI search traffic in GA4 or GSC. Also use when the user mentions "AI traffic," "ChatGPT referral," "Perplexity traffic," "AI Overviews," "GA4 AI sources," "AI search analytics," "track AI referrals," "AI search traffic," "Claude traffic," or "how to
Open skill - /traffic
When the user wants to analyze website traffic sources, attribution, or dark traffic. Also use when the user mentions "traffic sources," "dark traffic," "direct traffic," "UTM parameters," "traffic attribution," "channel attribution," "attribution optimization," "channel
Open skill - /tracking
When the user wants to set up, audit, or optimize analytics tracking (GA4, events, conversions). Also use when the user mentions "Google Analytics," "GA4," "event tracking," "conversions," "attribution model," "gtag," "data layer," "GA4 setup," "conversion tracking," "event
Open skill - /community-forum
When the user wants to promote via forums, communities, or invite users to join a community. Also use when the user mentions "forum promotion," "Indie Hacker," "Hacker News," "community growth," "Discord promotion," "vertical community," "brand encyclopedia," "Wikipedia,"
Open skill

