mcpField
G
generate-icon

generate-icon

github.com/b-open-ioデザイン・UI1276 回インストール5 週間前に更新
リポジトリ

generate-icon について

Generate Iconは、テキストプロンプトや参照画像からプラットフォーム別のアイコンセットを作るスキルです。Geminiによる画像生成に加え、背景除去、トリミング、リサイズ、形式別のバンドル作成を自動化します。

主な機能

  1. 01Geminiによるアイコン生成
  2. 02参照画像の入力
  3. 03背景の自動除去
  4. 04トリミング、中央配置、リサイズ
  5. 05プラットフォーム別プリセットとバンドル

活用シーン

  1. 01ウェブサイト用faviconの作成
  2. 02iOSまたはAndroidアプリ用アイコンセットの出力
  3. 03PWAまたはデスクトップ用アイコン素材の準備
  4. 04既存のマスター画像から複数サイズを生成

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/b-open-io/gemskills --skill generate-icon

インストール後、Claude Code で/generate-iconを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

.clawnet/
unsigned-skill.json
references/
platform-requirements.md
scripts/
generate.ts
presets.ts
process.ts

詳細

アイコン生成スキル

Gemini AI を使用してあらゆるプラットフォーム向けのプロフェッショナルなアイコンを生成し、背景の自動削除、トリミング、複数サイズへの書き出しを行います。

クイックスタート

# Favicon for website
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-icon/scripts/generate.ts "modern tech startup logo letter S" --preset favicon --output ./icons/favicon

# iOS App Store icons
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-icon/scripts/generate.ts "meditation app lotus flower" --preset apple-app-icon --output ./icons/ios

# Android Play Store + adaptive icons
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-icon/scripts/generate.ts "fitness tracker flame icon" --preset android-app-icon --output ./icons/android

# PWA manifest icons
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-icon/scripts/generate.ts "productivity app checkmark" --preset pwa --output ./icons/pwa

# macOS desktop app
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-icon/scripts/generate.ts "code editor brackets symbol" --preset macos-icns --output ./icons/macos

# Windows desktop app
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-icon/scripts/generate.ts "music player note icon" --preset windows-ico --output ./icons/windows

# General UI icons
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-icon/scripts/generate.ts "settings gear" --preset ui-icons --output ./icons/ui

プリセット

プリセット説明サイズバンドル
apple-app-iconiOS/iPadOS App Store18 サイズ(1024-20px)いいえ
android-app-iconGoogle Play + アダプティブレイヤー11 サイズ + 前景いいえ
faviconブラウザーのタブアイコン8 サイズ + ICOはい(.ico)
pwaプログレッシブウェブアプリ11 サイズ + マスカブルいいえ
macos-icnsmacOS デスクトップ10 サイズはい(.icns)
windows-icoWindows デスクトップ7 サイズはい(.ico)
ui-iconsアプリ内アイコン9 サイズ(512-16px)いいえ

パイプライン

  1. 生成 - Gemini を介して高解像度のマスターアイコンを作成します
  2. 背景の削除 - Replicate rembg を使用してエッジをきれいにします
  3. トリミングと中央配置 - 余白を切り取り、5% のパディングを設けて正方形のキャンバスの中央に配置します
  4. サイズ変更 - lanczos3 補間を使用して、すべてのプリセットサイズを書き出します
  5. バンドル - 必要に応じて ICO/ICNS バンドルを作成します

オプション

bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-icon/scripts/generate.ts "prompt" --preset <name> --output <dir> [options]

Required:
  --preset <name>       Platform preset (see table above)
  --output <dir>        Output directory

Optional:
  --input <image>       Reference image for style guidance
  --master-image <path> Use existing master instead of generating
  --skip-generate       Skip AI generation (requires --master-image)
  --skip-remove-bg      Skip background removal
  --bg-color <hex>      Background color for non-transparent presets

例

参照画像を使用する
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-icon/scripts/generate.ts "clean app icon version" --preset pwa --input ./existing-logo.png --output ./icons
既存のマスターを使用する
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-icon/scripts/generate.ts "" --preset ui-icons --master-image ./my-icon.png --skip-generate --output ./icons
カスタム背景色を使用した iOS
bun run --cwd ${CLAUDE_PLUGIN_ROOT} ${CLAUDE_PLUGIN_ROOT}/skills/generate-icon/scripts/generate.ts "weather app sun" --preset apple-app-icon --bg-color "#0066CC" --output ./icons/ios

アイコンデザインのヒント

推奨事項:

  • シンプルで大胆、ひと目で認識できるシルエットにする
  • 焦点を 1 つに絞る
  • コントラストを高くする
  • エッジをきれいにする
  • 16x16px でも機能するようにする

避けること:

  • 小さいサイズで消えてしまう細部
  • テキスト(アイコンサイズでは読めません)
  • 複雑なグラデーション(バンディングが発生します)
  • 競合する複数の要素
  • 写真やリアルな画像

環境変数

変数必須説明
GEMINI_API_KEYはいGoogle AI Studio API キー
REPLICATE_API_TOKENはい背景削除用の Replicate API トークン

出力構造

output/
├── master-raw.png        # Original generated image
├── master-nobg.png       # Background removed
├── master-cropped.png    # Cropped and centered
├── master-final.png      # With background (iOS only)
├── favicon.ico           # ICO bundle (favicon preset)
├── AppIcon.icns          # ICNS bundle (macos preset)
├── icon-512.png          # Size variants...
├── icon-256.png
└── ...

コンテキストの管理

生成したアイコン画像をコンテキストに読み戻さないでください。 スクリプトは、生成したすべてのサイズのファイルパスを出力します。ユーザーに結果を目視で確認するよう依頼してください。アイコンセットは複数のサイズで多数のファイルを生成するため、画像を読み戻すとコンテキストウィンドウをすぐに使い切ってしまいます。

トラブルシューティング

問題解決策
「GEMINI_API_KEY not set」API キーをエクスポートします:export GEMINI_API_KEY=your-key
「REPLICATE_API_TOKEN not set」トークンをエクスポートします:export REPLICATE_API_TOKEN=your-token
ICO が生成されないImageMagick をインストールします:brew install imagemagick
ICNS が生成されないmacOS でのみ動作します(iconutil が必要です)
背景がきれいに削除されない背景を単色にした、よりシンプルなプロンプトを試します
アイコンが複雑すぎるプロンプトをシンプルにし、「詳細な」または「リアルな」といった指定を避けます

コメント