
favicon
Generate a complete set of favicons from a source image and update HTML. Use when setting up favicons for a web project.
- Installs
- 2.8K
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/brianlovin/agent-config --skill favicon- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads favicon automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Generate a complete set of favicons from the source image at $1 and update the project's HTML with the appropriate link tags.
Prerequisites
First, verify ImageMagick v7+ is installed by running:
which magick
If not found, stop and instruct the user to install it:
- macOS:
brew install imagemagick - Linux:
sudo apt install imagemagick
Step 1: Validate Source Image
- Verify the source image exists at the provided path:
$1 - Check the file extension is a supported format (PNG, JPG, JPEG, SVG, WEBP, GIF)
- If the file doesn't exist or isn't a valid image format, report the error and stop
Note whether the source is an SVG file - if so, it will also be copied as favicon.svg.
Step 2: Detect Project Type and Static Assets Directory
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.
Step 3: Determine App Name
Find the app name from these sources (in priority order):
- Existing
site.webmanifest- Check the detected static assets directory for an existing manifest and extract thenamefield package.json- Extract thenamefield if it exists- Rails
config/application.rb- Extract the module name (e.g.,module MyApp→ "MyApp") - Directory name - Use the current working directory name as fallback
Convert the name to title case if needed (e.g., "my-app" → "My App").
Step 4: Ensure Static Assets Directory Exists
Check if the detected static assets directory exists. If not, create it.
Step 5: Generate Favicon Files
Run these ImageMagick commands to generate all favicon files. Replace [STATIC_DIR] with the detected static assets directory from Step 2.
favicon.ico (multi-resolution: 16x16, 32x32, 48x48)
magick "$1" \
\( -clone 0 -resize 16x16 \) \
\( -clone 0 -resize 32x32 \) \
\( -clone 0 -resize 48x48 \) \
-delete 0 -alpha on -background none \
[STATIC_DIR]/favicon.ico
favicon-96x96.png
magick "$1" -resize 96x96 -background none -alpha on [STATIC_DIR]/favicon-96x96.png
apple-touch-icon.png (180x180)
magick "$1" -resize 180x180 -background none -alpha on [STATIC_DIR]/apple-touch-icon.png
web-app-manifest-192x192.png
magick "$1" -resize 192x192 -background none -alpha on [STATIC_DIR]/web-app-manifest-192x192.png
web-app-manifest-512x512.png
magick "$1" -resize 512x512 -background none -alpha on [STATIC_DIR]/web-app-manifest-512x512.png
favicon.svg (only if source is SVG)
If the source file has a .svg extension, copy it:
cp "$1" [STATIC_DIR]/favicon.svg
Step 6: Create/Update site.webmanifest
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.
Step 7: Update HTML/Layout Files
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:
- If static files are in
public/orstatic/and served from root → use/favicon.ico - If static files are in
src/assets/→ use/assets/favicon.ico - If static files are in the same directory as HTML → use
./favicon.icoor justfavicon.ico
For Rails Projects
Edit 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:
- If the source was NOT an SVG, omit the
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />line - Remove any existing
<link rel="icon",<link rel="shortcut icon",<link rel="apple-touch-icon", or<link rel="manifest"tags before adding the new ones - Place these tags near the top of the
<head>section, after<meta charset>and<meta name="viewport">if present
For Next.js Projects
Edit 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:
- If the source was NOT an SVG, omit the
{ url: '/favicon.svg', type: 'image/svg+xml' }entry from the icon array - If metadata export doesn't exist, create it with just the icons-related fields
- If metadata export exists, merge the icons configuration with existing fields
For Static HTML Projects
Edit the detected index.html file. Add the same HTML as Rails within the <head> section.
If No Project Detected
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" />
Step 8: Summary
Report completion with:
- Detected project type and framework
- Static assets directory used
- List of files generated
- App name used in manifest and HTML
- Layout file updated (or note if manual update is needed)
- Note if any existing files were overwritten
Error Handling
- If ImageMagick is not installed, provide installation instructions and stop
- If the source image doesn't exist, report the exact path that was tried and stop
- If ImageMagick commands fail, report the specific error message
- If the layout file cannot be found for HTML updates, generate files anyway and instruct on manual HTML addition
FAQ
What does the favicon skill do?
Generate a complete set of favicons from a source image and update HTML. Use when setting up favicons for a web project.
How do I install favicon?
Run npx skills add https://github.com/brianlovin/agent-config --skill favicon in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/favicon/ (personal) or .claude/skills/favicon/ (project).
Which AI agents can use favicon?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is favicon safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains favicon?
It is published by brianlovin in brianlovin/agent-config. It has 2,824 recorded installs.
More from brianlovin/agent-config
simplify
brianlovin/agent-config
Simplify and refine recently modified code for clarity and consistency. Use after writing code to improve readability without changing functionality.
deslop
brianlovin/agent-config
Remove AI-generated code slop from the current branch. Use after writing code to clean up unnecessary comments, defensive checks, and inconsistent style.
knip
brianlovin/agent-config
Run knip to find and remove unused files, dependencies, and exports. Use for cleaning up dead code and unused dependencies.
rams
brianlovin/agent-config
Run accessibility and visual design review on components. Use when reviewing UI code for WCAG compliance and design issues.
find-skills
brianlovin/agent-config
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
agent-browser
brianlovin/agent-config
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.