ai/skills/favicon/SKILL.md
Generates a complete set of favicons from a source image and updates project HTML with appropriate link tags. Use when creating favicons, app icons, or touch icons from a logo or source image. Triggers on "favicon", "app icon", "touch icon", "site icon".
npx skillsauth add steveclarke/dotfiles faviconInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate a complete set of favicons from the source image at $1 and update the project's HTML with the appropriate link tags.
First, verify ImageMagick v7+ is installed by running:
which magick
If not found, stop and instruct the user to install it:
brew install imagemagicksudo apt install imagemagickIf the source is an SVG, also check for rsvg-convert:
which rsvg-convert
If not found, instruct the user to install it:
brew install librsvgsudo apt install librsvg2-binWhy: ImageMagick's SVG rasterizer ignores -background none and renders a white canvas behind SVGs, destroying transparency. rsvg-convert handles SVG transparency correctly.
$1Note whether the source is an SVG file - if so, it will also be copied as favicon.svg.
Detect the project type and determine where static assets should be placed. Check in this order:
| Framework | Detection | Static Assets Directory |
|-----------|-----------|------------------------|
| Rails | config/routes.rb exists | public/ |
| Next.js | next.config.* exists | public/ |
| Gatsby | gatsby-config.* exists | static/ |
| SvelteKit | svelte.config.* exists | static/ |
| Astro | astro.config.* exists | public/ |
| Hugo | hugo.toml or config.toml with Hugo markers | static/ |
| Jekyll | _config.yml with Jekyll markers | Root directory (same as index.html) |
| Vite | vite.config.* exists | public/ |
| Create React App | package.json has react-scripts dependency | public/ |
| Vue CLI | vue.config.* exists | public/ |
| Angular | angular.json exists | src/assets/ |
| Eleventy | .eleventy.js or eleventy.config.* exists | Check _site output or root |
| Static HTML | index.html in root | Same directory as index.html |
Important: If existing favicon files are found (e.g., favicon.ico, apple-touch-icon.png), use their location as the target directory regardless of framework detection.
Report the detected project type and the static assets directory that will be used.
When in doubt, ask: If you are not 100% confident about where static assets should be placed (e.g., ambiguous project structure, multiple potential locations, unfamiliar framework), use AskUserQuestionTool to confirm the target directory before proceeding. It's better to ask than to put files in the wrong place.
Find the app name from these sources (in priority order):
site.webmanifest - Check the detected static assets directory for an existing manifest and extract the name fieldpackage.json - Extract the name field if it existsconfig/application.rb - Extract the module name (e.g., module MyApp → "MyApp")Convert the name to title case if needed (e.g., "my-app" → "My App").
Check if the detected static assets directory exists. If not, create it.
Replace [STATIC_DIR] with the detected static assets directory from Step 2.
IMPORTANT — SVG sources: If the source is an SVG, you MUST use rsvg-convert for all PNG generation. ImageMagick's SVG rasterizer produces opaque white backgrounds even with -background none. Only use ImageMagick for the final ICO assembly from the already-rasterized PNGs.
rsvg-convert -w 96 -h 96 --background-color transparent "$1" -o [STATIC_DIR]/favicon-96x96.png
rsvg-convert -w 180 -h 180 --background-color transparent "$1" -o [STATIC_DIR]/apple-touch-icon.png
rsvg-convert -w 192 -h 192 --background-color transparent "$1" -o [STATIC_DIR]/web-app-manifest-192x192.png
rsvg-convert -w 512 -h 512 --background-color transparent "$1" -o [STATIC_DIR]/web-app-manifest-512x512.png
Then generate ICO from the transparent PNGs (not directly from SVG):
rsvg-convert -w 16 -h 16 --background-color transparent "$1" -o /tmp/fav16.png
rsvg-convert -w 32 -h 32 --background-color transparent "$1" -o /tmp/fav32.png
rsvg-convert -w 48 -h 48 --background-color transparent "$1" -o /tmp/fav48.png
magick /tmp/fav16.png /tmp/fav32.png /tmp/fav48.png [STATIC_DIR]/favicon.ico
rm /tmp/fav16.png /tmp/fav32.png /tmp/fav48.png
Copy the SVG as favicon.svg:
cp "$1" [STATIC_DIR]/favicon.svg
magick "$1" \
\( -clone 0 -resize 16x16 \) \
\( -clone 0 -resize 32x32 \) \
\( -clone 0 -resize 48x48 \) \
-delete 0 -alpha on -background none \
[STATIC_DIR]/favicon.ico
magick "$1" -resize 96x96 -background none -alpha on [STATIC_DIR]/favicon-96x96.png
magick "$1" -resize 180x180 -background none -alpha on [STATIC_DIR]/apple-touch-icon.png
magick "$1" -resize 192x192 -background none -alpha on [STATIC_DIR]/web-app-manifest-192x192.png
magick "$1" -resize 512x512 -background none -alpha on [STATIC_DIR]/web-app-manifest-512x512.png
Create or update [STATIC_DIR]/site.webmanifest with this content (substitute the detected app name):
{
"name": "[APP_NAME]",
"short_name": "[APP_NAME]",
"icons": [
{
"src": "/web-app-manifest-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/web-app-manifest-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
If site.webmanifest already exists in the static directory, preserve the existing theme_color, background_color, and display values while updating the name, short_name, and icons array.
Based on the detected project type, update the appropriate file. Adjust the href paths based on where the static assets directory is relative to the web root:
public/ or static/ and served from root → use /favicon.icosrc/assets/ → use /assets/favicon.ico./favicon.ico or just favicon.icoEdit app/views/layouts/application.html.erb. Find the <head> section and add/replace favicon-related tags with:
<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<meta name="apple-mobile-web-app-title" content="[APP_NAME]" />
<link rel="manifest" href="/site.webmanifest" />
Important:
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> line<link rel="icon", <link rel="shortcut icon", <link rel="apple-touch-icon", or <link rel="manifest" tags before adding the new ones<head> section, after <meta charset> and <meta name="viewport"> if presentEdit the detected layout file (app/layout.tsx or src/app/layout.tsx). Update or add the metadata export to include icons configuration:
export const metadata: Metadata = {
// ... keep existing metadata fields
icons: {
icon: [
{ url: '/favicon.ico' },
{ url: '/favicon-96x96.png', sizes: '96x96', type: 'image/png' },
{ url: '/favicon.svg', type: 'image/svg+xml' },
],
shortcut: '/favicon.ico',
apple: '/apple-touch-icon.png',
},
manifest: '/site.webmanifest',
appleWebApp: {
title: '[APP_NAME]',
},
};
Important:
{ url: '/favicon.svg', type: 'image/svg+xml' } entry from the icon arrayEdit the detected index.html file. Add the same HTML as Rails within the <head> section.
Skip HTML updates and inform the user they need to manually add the following to their HTML <head>:
<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<meta name="apple-mobile-web-app-title" content="[APP_NAME]" />
<link rel="manifest" href="/site.webmanifest" />
Report completion with:
content-media
Download content from YouTube including transcripts, captions, subtitles, music, MP3s, and playlists. Use when the user provides a YouTube URL or asks to download, transcribe, or get content from YouTube videos or playlists.
development
Apply VueUse composables where appropriate to build concise, maintainable Vue.js / Nuxt features.
development
Review UI for visual consistency, layout structure, and design system compliance. Two modes — code review (check view files against patterns) and visual audit (screenshot all routes and analyze). Use when reviewing UI code, checking consistency, auditing views, or when user says "review the UI", "check consistency", "UI audit", "design review".
tools
Improves typography by fixing font choices, hierarchy, sizing, weight, and readability so text feels intentional. Use when the user mentions fonts, type, readability, text hierarchy, sizing looks off, or wants more polished, intentional typography.