Communitygithub.com

favicon-setup

ウェブサイトやウェブアプリに、モダンブラウザ、iOS、Androidが実際に使用する必要最小限のファビコンセット(5ファイル)を導入します。ルートレイアウトに一度だけ追加するheadマークアップのブロックと、すべてのファイルが解決することを確認するチェックも含まれます。

favicon-setup とは?

このスキルは、あらゆるウェブサイトやウェブアプリに対して、現代的で完全なファビコンセットをインストールするための包括的なガイドを提供します。従来の多くのサイズやファイル(mstile-*、browserconfig.xml、57/72/114pxのAppleアイコンなど)は不要としてスキップし、最新のブラウザ、iOSホーム画面、Androidインストールで実際に使用される5つのファイル(favicon.svg、favicon-96x96.png、favicon.ico、apple-touch-icon.png、web-app-manifest-192x192.png、web-app-manifest-512x512.png、site.webmanifest)に焦点を当てています。Vite、Next.js、SvelteKit、Angular、Hugoなどの主要なフレームワークごとに公開フォルダを見つける方法、RealFaviconGeneratorのパッケージまたは単一のSVGからファイルを生成する方法、ルートレイアウトに一度だけ追加するヘッドマークアップ、SVGダークモード対応、マスク可能なマニフェストアイコン、キャッシュバスティング、そして検証手順をカバーしています。ファビコン、アプリアイコン、apple-touch-icon、ウェブマニフェストの追加、置き換え、監査を行う際に使用します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Adamparishspok/skills/tree/HEAD/skills/favicon-setup

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

ファビコンセットアップ

5つのファイルと5つのタグで、現在のすべてのブラウザ、iOSホーム画面、Androidインストールをカバーします。追加のサイズ(mstile-*、browserconfig.xml、57/72/114pxのAppleアイコン、mask-icon)はレガシーです:スキップしてください。

1. セット

ファイルサイズ用途
favicon.svgベクターモダンブラウザのタブ。シャープに拡大縮小し、ダークモードに切り替え可能。
favicon-96x96.png96×96SVGファビコンをサポートしないブラウザ、およびGoogle検索結果。
favicon.ico1ファイルに16、32、48レガシーブラウザや、HTMLを読まずに直接/favicon.icoを要求するツール。
apple-touch-icon.png180×180、不透明iOSおよびiPadOSのホーム画面。
web-app-manifest-192x192.png、web-app-manifest-512x512.png192、512Androidホーム画面、PWAインストール、スプラッシュ画面。
site.webmanifest—Androidに上記2つのPNGを指し示す。

2. ファイルを入手する

RealFaviconGeneratorパッケージから。 ダウンロードURLのセットが提供されます。各ファイルをPUBLIC_FOLDER(手順3を参照)に、正確な名前でダウンロードします。

base=https://realfavicongenerator.net/files/<package-id>
for f in favicon.svg favicon-96x96.png favicon.ico apple-touch-icon.png \
         web-app-manifest-192x192.png web-app-manifest-512x512.png site.webmanifest; do
  curl -fsSL "$base/$f" -o "PUBLIC_FOLDER/$f" || echo "FAILED: $f"
done

ダウンロードが失敗した場合は停止し、報告します。不完全なセットを出荷しないでください。ジェネレーターのバグは以下で報告してください: https://github.com/RealFaviconGenerator/realfavicongenerator/issues/new?template=ai_prompt_bug_report.yml

単一のソースSVGから (rsvg-convert と ImageMagick が必要。またはジェネレーターを使用):

cp logo.svg PUBLIC_FOLDER/favicon.svg
rsvg-convert -w 96  -h 96  logo.svg -o PUBLIC_FOLDER/favicon-96x96.png
rsvg-convert -w 192 -h 192 logo.svg -o PUBLIC_FOLDER/web-app-manifest-192x192.png
rsvg-convert -w 512 -h 512 logo.svg -o PUBLIC_FOLDER/web-app-manifest-512x512.png
# iOSは透明部分を黒で塗りつぶす:ブランド背景に平坦化し、約10%のパディングを追加
rsvg-convert -w 144 -h 144 logo.svg | magick - -background '#ffffff' -gravity center -extent 180x180 -flatten PUBLIC_FOLDER/apple-touch-icon.png
magick -background none logo.svg -define icon:auto-resize=48,32,16 PUBLIC_FOLDER/favicon.ico

3. PUBLIC_FOLDER を見つける

サイトルートで提供されるフォルダです。つまり PUBLIC_FOLDER/favicon.ico が /favicon.ico として読み込まれます。

スタックフォルダ
Vite, Next.js, Create React App, Astro, Remix, Nuxt 3public/
SvelteKitstatic/
Angularpublic/ (v17+) または src/(ファイルを angular.json の assets にリスト)
Hugo, Jekyll, Eleventystatic/、サイトルート、またはパススルーコピーフォルダ
プレーンHTMLindex.html と同じ場所

Next.js App Router: デフォルトの app/favicon.ico を削除します。これは public/favicon.ico よりも優先され、通常はNext.jsのロゴです。

4. マークアップを一度だけ追加する

このコードを、ルートの <html> タグをレンダリングする1つのファイルの <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" />
<link rel="manifest" href="/site.webmanifest" />
スタックルートファイル
Vite, CRA, プレーンHTMLindex.html
Next.js App Routerapp/layout.tsx、metadata エクスポート経由(生タグではなく以下参照)
Next.js Pages Routerpages/_document.tsx 内の <Head> 内
Astroベースレイアウト(例:src/layouts/Layout.astro)
SvelteKitsrc/app.html
Remix / React Router 7app/root.tsx の links エクスポート
Nuxtnuxt.config.ts の app.head.link

Next.js App Router の同等のコード:

export const metadata = {
  icons: {
    icon: [
      { url: "/favicon-96x96.png", sizes: "96x96", type: "image/png" },
      { url: "/favicon.svg", type: "image/svg+xml" },
    ],
    shortcut: "/favicon.ico",
    apple: { url: "/apple-touch-icon.png", sizes: "180x180" },
  },
  manifest: "/site.webmanifest",
};

マークアップを追加する前に、プロジェクト内で既存の rel="icon"、apple-touch-icon、manifest タグを検索してください。それらを置き換え、2番目のセットを追加しないでください。サイトがサブパス(base / basePath)で提供されている場合は、すべての href にプレフィックスを付けます。

5. 最適化

  • SVGダークモード。 暗いロゴは暗いタブバーで見えなくなります。SVG内にメディアクエリを追加します:
    <style>path{fill:#111}@media (prefers-color-scheme:dark){path{fill:#fff}}</style>
    
  • 小さなサイズ。 16pxでは、細かいディテールやテキストは省略します。ワードマークではなくロゴマークを使用します。
  • SVGの軽量化。 npx svgo favicon.svg を実行し、ファイルを約2KB未満に保ちます。
  • マニフェスト。 name、short_name、theme_color、background_color を入力します。512アイコンをマスク可能にします:マークを中央80%のセーフゾーン内に保ち、単色の背景を使用し、"purpose": "maskable" を設定します。マークがセーフゾーンに収まらない場合は、代わりに別のマスク可能アイコンを追加します。
    {
      "name": "My App",
      "short_name": "App",
      "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"
    }
    
  • キャッシング。 ブラウザはファビコンを強力にキャッシュします。アイコンを置き換える場合は、ファイル名を変更するか、すべての href とマニフェストの src 値に ?v=2 を追加します。

6. 検証

  1. すべてのファイルが正しいタイプで200を返すことを確認します。開発サーバーに対して以下を実行します:
    for f in favicon.svg favicon-96x96.png favicon.ico apple-touch-icon.png \
             web-app-manifest-192x192.png web-app-manifest-512x512.png site.webmanifest; do
      printf '%s ' "$f"; curl -s -o /dev/null -w '%{http_code} %{content_type}\n' "http://localhost:PORT/$f"
    done
    
  2. レンダリングされたHTMLにはタグのセットが正確に1つだけ含まれています:curl -s http://localhost:PORT/ | grep -cE 'rel="(icon|shortcut icon|apple-touch-icon|manifest)"' は 5 を出力します。
  3. DevToolsで、Application → Manifest を開きます:エラーがなく、両方のアイコンがレンダリングされていることを確認します。
  4. ライトモードとダークモードでハードリフレッシュしたタブを開き、アイコンが両方で表示されることを確認します。
  5. デプロイされたURLで、RealFaviconGeneratorチェッカー(https://realfavicongenerator.net/favicon-checker)を実行します。

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

Adamparishspok/skills

Make a website, web app or online store ready for AI agents. Scan it with Cloudflare's Agent Readiness checks, decide which checks apply to this kind of site, ship the discovery files and headers in priority order, and add the AI-first basics the scanner does not score (server-rendered content, JSON-LD, llms.txt). Covers robots.txt AI rules, Content Signals, sitemap, Markdown for Agents (Accept text/markdown), Link headers, API catalog, OAuth discovery, auth.md, MCP server card, A2A agent card, agent skills index, WebMCP, and commerce protocols (ACP, UCP, AP2, MPP, x402). Use when making a site AI-ready, agent-ready or AI-first, or fixing an isitagentready.com or Cloudflare Agent Readiness report. Triggers on: AI ready, agent ready, AI-first, agent readiness, isitagentready, AI Crawl Control, Markdown for Agents, text/markdown, llms.txt, GPTBot, ClaudeBot, AI crawlers, Content-Signal, ai-train, api-catalog, .well-known, oauth-protected-resource, auth.md, MCP server card, agent card, agent skills, WebMCP, a...

Adamparishspok/skills

Give an interface one shared tempo and a small vocabulary of hover and state micro-interactions: duration tiers (tap/pop/hover/card/layout) for CSS and Motion, swap hand-offs, rows whose highlight grows in, trailing arrows, chevron nudges, card lifts without translate, scroll-edge fades, and icon/label swaps for copy and toggle buttons. Use when animations feel inconsistent, durations are scattered magic numbers, hovers only change colour, or a product feels flat or unfinished. Triggers on: animation duration, transition timing, hover state, micro-interaction, polish, copy button feedback, menu icon to close, back arrow, card hover, scroll fade, motion tokens, Framer Motion durations.

Adamparishspok/skills

Consolidate several apps or prototypes onto one shared component library without flattening their looks. Covers finding duplicated local components (buttons, selects, fields, modals, pagers, toasts), making shared components token-sized so each suite or app sets its own measurements, mapping variant names, deciding what stays app-specific, and the tailwind-merge traps that silently break custom tokens. Use when several apps each grew their own Btn/Select/Modal, when a design system's components "don't fit" a second product, or when retheming a family of apps. Triggers on: shared component library, design system consolidation, duplicate components, retheme, suite of apps, shadcn retokened, token-driven components, cn tailwind-merge custom tokens, variant mapping.

Adamparishspok/skills

Build or migrate a UI's neutral palette (grounds, surfaces, lines, ink/text) as an OKLCH formula driven by a few inputs instead of dozens of hand-picked hex values, with light and dark themes, per-step ladder overrides, a fit script that reproduces existing colours, and a browser contrast audit. Use when creating a theme, adding dark mode, retinting a product, auditing text contrast, or consolidating several apps' palettes. Triggers on: palette, neutrals, grey ramp, dark mode, theme tokens, oklch, retint, hue, contrast audit, design tokens, Tailwind @theme colours.

関連スキル