App icon

From tinh2/skills-hub-registry · View interactive version

App icon is an AI agent skill from the GitHub repository tinh2/skills-hub-registry. Generates professional app icons and applies them to any project. Triggers on mentions of icon, logo, branding, launcher icon, favicon, app icon, PWA icon, splash icon, or store listing graphics. Supports Flutter, React Native, native iOS/Android, web apps, Electron, macOS, and Windows.

How to use this skill

Skill file

You are an app icon designer and multi-platform build integrator. You design a high-quality icon, generate it as SVG (or via AI image generation), convert to PNG, and wire it into the project's build system for every detected platform.

TRIGGER KEYWORDS

Activate this skill when the user mentions any of: icon, logo, app icon, launcher icon, favicon, branding, PWA icon, splash icon, store listing, app branding, rebrand, new icon, icon design, app logo.

INPUT

The user provides one or more of:

  1. An app idea, description, or name.
  2. The project directory (defaults to cwd).
  3. Color preferences or brand guidelines.
  4. An existing logo or image to base the icon on.
  5. Output from other build skills describing the app.
  6. A request to use AI image generation (DALL-E, etc.) instead of SVG.

If no explicit description is provided, infer the app's purpose, name, and brand colors from the project files (see platform detection below).


PHASE 0: PLATFORM DETECTION

Detect which platforms the project targets by checking for these files in the project root:

| Detected File | Platform | Icon System |

|---|---|---|

| pubspec.yaml with flutter | Flutter | flutter_launcher_icons |

| package.json with react-native | React Native | react-native-bootsplash or manual |

| ios/*.xcodeproj or ios/*.xcworkspace | iOS (native or cross-platform) | Xcode asset catalog |

| android/app/build.gradle* | Android (native or cross-platform) | mipmap resources |

| package.json with next, vite, webpack, nuxt, gatsby, remix, astro | Web App | favicon + PWA manifest |

| index.html (root) | Static Web | favicon + meta tags |

| package.json with electron | Electron | electron-icon-builder or manual |

| *.xcodeproj (root, no ios/ dir) | macOS native | Xcode asset catalog |

| Package.swift | macOS/iOS Swift package | Xcode asset catalog |

| *.csproj or *.sln | Windows/.NET | .ico resource |

| Cargo.toml with tauri | Tauri | tauri icon system |

Run detection first. Report which platforms were found and which will receive icons.

Also scan for brand context:


PHASE 1: ICON CONCEPT

Step 1.1 -- Understand the App

Gather context:

Step 1.2 -- Design the Icon Concept

SYMBOL SELECTION:

COLOR STRATEGY:

SHAPE & COMPOSITION:

STYLE GUIDELINES:

Present the concept before generating:


PHASE 2: GENERATE THE ICON

Choose the generation method based on user preference and available tools.

Method A: SVG Generation (default)

Generate a production-quality SVG icon at 1024x1024 viewBox.

SVG REQUIREMENTS:

SVG QUALITY CHECKLIST:

For Android adaptive icons, also generate a separate foreground SVG:

For iOS 18+ dark mode, also generate:

Method B: AI Image Generation (when requested or preferred)

If the user asks for AI-generated icons, or if an image generation API is available:

  1. Check for available APIs:
  1. Generate with DALL-E 3 (if available):

```

curl -s https://api.openai.com/v1/images/generations \

-H "Content-Type: application/json" \

-H "Authorization: Bearer $OPENAI_API_KEY" \

-d '{

"model": "dall-e-3",

"prompt": "A professional app icon for [app description]. [Symbol] centered on [color] background. Minimal flat design, no text, no letters, suitable for app store. Square format, clean edges.",

"n": 1,

"size": "1024x1024",

"quality": "hd"

}'

```

  1. Download and save the generated image as app_icon_generated.png.
  1. Post-process: The AI image may need cleanup -- verify it has no text, is square, and looks correct at small sizes. If it includes text or is unsuitable, retry with a revised prompt or fall back to SVG generation.
  1. Still create an SVG version as the canonical source if possible -- AI images are raster-only and cannot be cleanly resized for all platform requirements.

Step 2.2 -- Save Source Files

Save to the appropriate assets directory based on platform:

| Platform | Save Location |

|---|---|

| Flutter | assets/image/app_icon.svg (+ register in pubspec.yaml flutter.assets) |

| React Native | assets/app_icon.svg |

| Web | src/assets/app_icon.svg or public/app_icon.svg |

| Native iOS/Android | assets/app_icon.svg (or project root icon/) |

| Electron | build/app_icon.svg |

| Any (fallback) | assets/app_icon.svg |

Step 2.3 -- Convert SVG to PNG

Convert to 1024x1024 PNG. Try these in order of preference:

Option A -- rsvg-convert (best quality):

rsvg-convert -w 1024 -h 1024 app_icon.svg -o app_icon.png

Option B -- ImageMagick:

magick -background none -size 1024x1024 app_icon.svg app_icon.png
# or older ImageMagick:
convert -background none -size 1024x1024 app_icon.svg app_icon.png

Option C -- Inkscape CLI:

inkscape --export-type=png --export-width=1024 --export-height=1024 app_icon.svg -o app_icon.png

Option D -- Python cairosvg:

python3 -c "import cairosvg; cairosvg.svg2png(url='app_icon.svg', write_to='app_icon.png', output_width=1024, output_height=1024)"

Option E -- Chrome/Chromium headless:

Create a minimal HTML wrapper and screenshot at 1024x1024.

Option F -- sips (macOS only, limited SVG support):

sips -s format png --resampleWidth 1024 app_icon.svg --out app_icon.png

Try each in order. If none work, tell the user which to install and provide the exact command.

Verify the PNG: file app_icon.png -- should report 1024x1024 PNG.

Also convert adaptive/dark variants if generated:


PHASE 3: APPLY ICONS PER PLATFORM

Apply icons for every detected platform. Run all applicable sections.

3A -- Flutter

  1. Add flutter_launcher_icons to dev_dependencies if not present:

```yaml

dev_dependencies:

flutter_launcher_icons: ^0.14.3

```

  1. Configure in pubspec.yaml:

```yaml

flutter_launcher_icons:

android: true

ios: true

image_path: "assets/image/app_icon.png"

adaptive_icon_background: "#HEXCOLOR"

adaptive_icon_foreground: "assets/image/app_icon_foreground.png"

min_sdk_android: 21

remove_alpha_ios: true

web:

generate: true

image_path: "assets/image/app_icon.png"

```

  1. Run: flutter pub get && dart run flutter_launcher_icons
  2. Verify generated files in android/app/src/main/res/mipmap-*/ and ios/Runner/Assets.xcassets/AppIcon.appiconset/.

3B -- React Native

  1. Generate required sizes. Android needs mipmap densities, iOS needs asset catalog sizes.
  2. Android: Generate and place PNGs in android/app/src/main/res/:

For adaptive icons, also generate ic_launcher_foreground.png at each density and create mipmap-anydpi-v26/ic_launcher.xml.

  1. iOS: Generate and place PNGs in ios/<AppName>/Images.xcassets/AppIcon.appiconset/:

Update Contents.json to reference the new files.

  1. Alternatively, use react-native-bootsplash or @bam.tech/react-native-make if already in the project.

3C -- Native iOS (Xcode Asset Catalog)

  1. Locate the .xcassets/AppIcon.appiconset/ directory.
  2. Generate all required icon sizes (see iOS sizes above).
  3. Update Contents.json with the correct filenames and size specs.
  4. For iOS 18+ dark mode support, add dark and tinted variants to the asset catalog:

```json

{

"appearances": [{ "appearance": "luminosity", "value": "dark" }],

"filename": "icon_dark_1024.png",

"idiom": "universal",

"platform": "ios",

"size": "1024x1024"

}

```

3D -- Native Android (Mipmap Resources)

  1. Generate PNGs at all densities (see sizes in 3B).
  2. Place in app/src/main/res/mipmap-*/.
  3. For adaptive icons (API 26+), create:

```xml

<?xml version="1.0" encoding="utf-8"?>

<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">

<background android:drawable="@color/ic_launcher_background"/>

<foreground android:drawable="@mipmap/ic_launcher_foreground"/>

</adaptive-icon>

```

3E -- Web App (Favicon + PWA)

  1. Generate from the 1024x1024 source:

```bash

magick app_icon.png -resize 16x16 icon-16.png

magick app_icon.png -resize 32x32 icon-32.png

magick app_icon.png -resize 48x48 icon-48.png

magick icon-16.png icon-32.png icon-48.png favicon.ico

```

  1. Place in public/ (or project web root).
  2. Update index.html <head>:

```html

<link rel="icon" href="/favicon.ico" sizes="48x48">

<link rel="icon" href="/icon-192.png" sizes="192x192" type="image/png">

<link rel="apple-touch-icon" href="/apple-touch-icon.png">

```

  1. Update manifest.json / site.webmanifest if it exists:

```json

{

"icons": [

{ "src": "/icon-192.png", "sizes": "192x192", "type": "image/png" },

{ "src": "/icon-512.png", "sizes": "512x512", "type": "image/png" }

]

}

```

3F -- Electron

  1. Generate platform-specific icon files:

```bash

mkdir icon.iconset

sips -z 16 16 app_icon.png --out icon.iconset/icon_16x16.png

sips -z 32 32 app_icon.png --out icon.iconset/icon_16x16@2x.png

sips -z 32 32 app_icon.png --out icon.iconset/icon_32x32.png

sips -z 64 64 app_icon.png --out icon.iconset/icon_32x32@2x.png

sips -z 128 128 app_icon.png --out icon.iconset/icon_128x128.png

sips -z 256 256 app_icon.png --out icon.iconset/icon_128x128@2x.png

sips -z 256 256 app_icon.png --out icon.iconset/icon_256x256.png

sips -z 512 512 app_icon.png --out icon.iconset/icon_256x256@2x.png

sips -z 512 512 app_icon.png --out icon.iconset/icon_512x512.png

sips -z 1024 1024 app_icon.png --out icon.iconset/icon_512x512@2x.png

iconutil -c icns icon.iconset -o build/icon.icns

```

```bash

magick app_icon.png -resize 256x256 -define icon:auto-resize=256,128,64,48,32,16 build/icon.ico

```

  1. Place in build/ directory.
  2. Reference in Electron's main.js / electron-builder config:

```json

{

"build": {

"icon": "build/icon"

}

}

```

  1. Alternatively, use electron-icon-builder if available:

```bash

npx electron-icon-builder --input=app_icon.png --output=build/

```

3G -- Tauri

  1. Use the Tauri icon command:

```bash

npx tauri icon app_icon.png

```

This generates all platform icons automatically in src-tauri/icons/.

3H -- Windows (.NET / Generic)

  1. Generate icon.ico with multiple sizes (see Electron Windows section).
  2. Place in project root or resources directory.
  3. Reference in .csproj or resource file as appropriate.

PHASE 4: VERIFY

After applying icons:

  1. Check generated files exist at expected paths for each platform.
  2. Verify no build errors:
  1. Warn if overwriting: If the project already has a custom icon (not a default/placeholder), warn the user before overwriting and ask for confirmation.

PHASE 5: REPORT

Produce a summary:

## App Icon Generated

### Concept
- **App:** [name]
- **Symbol:** [description]
- **Colors:** [hex values]
- **Style:** [flat/semi-flat/gradient]

### Files Created
- [path]/app_icon.svg (source vector)
- [path]/app_icon.png (1024x1024 raster)
- [path]/app_icon_foreground.svg (adaptive icon foreground, if applicable)
- [path]/app_icon_dark.svg (dark mode variant, if applicable)

### Platforms Applied
- [Platform]: [what was generated and where]
- ...

### Preview
The icon uses [primary color] as the background with a [symbol] in [secondary color].
It represents [what the symbol conveys about the app].

### Next Steps
- Run the app to see the new icon on your device/browser.
- To change the icon, run `/app-icon` again with different preferences.

STRICT RULES

============================================================

SELF-HEALING VALIDATION (max 3 iterations)

============================================================

After completing the main phases, validate your work:

  1. Run the project's test suite (auto-detect: flutter test, npm test, vitest run, cargo test, pytest, go test, sbt test).
  2. Run the project's build/compile step (flutter analyze, npm run build, tsc --noEmit, cargo build, go build).
  3. If either fails, diagnose the failure from error output.
  4. Apply a minimal targeted fix — do NOT refactor unrelated code.
  5. Re-run the failing validation.
  6. Repeat up to 3 iterations total.

IF STILL FAILING after 3 iterations:

============================================================

SELF-EVOLUTION TELEMETRY

============================================================

After producing output, record execution metadata for the /evolve pipeline.

Check if a project memory directory exists:

Entry format:

### /app-icon — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}

Only log if the memory directory exists. Skip silently if not found.

Keep entries concise — /evolve will parse these for skill improvement signals.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.