agentleFS
ariaraminariaramin/flutter-skills/skills/flutter-app-icon-engineering/SKILL.md

flutter-app-icon-engineering

Skill8 starsChanged 48 days agoMITView on GitHub

Use when configuring, generating, replacing, auditing, validating, fixing, or troubleshooting application launcher icons in a Flutter project for any platform — Android (including adaptive, monochrome, themed), iOS, macOS, Web (favicon, PWA manifest), Windows (.ico), or Linux. Also use when integrating flutter_launcher_icons, preparing icon source assets, diagnosing missing or stale icons after builds, or resolving icon-related App Store and Play Store submission failures.

The file

Show its rules and text

We split this skill into the rules it gives an agent

31 rules. About 0 are common, 20 are distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈20

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before changing any icon asset or configuration:

    line 14
  2. Very specific:

    Read pubspec.yaml — SDK constraints, existing flutter_launcher_icons config, and dev_dependencies.

    line 16
  3. Very specific:

    Check AndroidManifest.xml for android:icon and android:roundIcon.

    line 22
  4. Very specific:

    Check web/manifest.json icon entries and web/index.html favicon link.

    line 25
  5. Very specific:

    Check windows/runner/Runner.rc icon reference.

    line 26
  6. Very specific:

    Look for any flutter_launcher_icons.yaml or per-flavor config files.

    line 28
  7. Distinctive:

    Do not modify platforms that are absent from the project or that the user has not asked about.

    line 31
  8. Distinctive:

    Only one platform needs an icon update.

    line 61
  9. Distinctive:

    Start with a 1024×1024 px PNG on a square canvas:

    line 77
  10. Distinctive:

    iOS: No transparency. Opaque fill to the edges.

    line 79
  11. Distinctive:

    When one source image serves all platforms, use an opaque 1024×1024 PNG with the logo centered in the inner 66% (safe zone for adaptive …

    line 89
  12. Distinctive:

    Use sRGB or Display P3 color profiles.

    line 93
  13. Distinctive:

    Keep the source image under version control.

    line 94
  14. Very specific:

    Always dev_dependencies — it is a build-time tool with zero runtime footprint.

    line 105
  15. Very specific:

    Only include platforms that exist in the project.

    line 139
  16. Distinctive:

    After generation, inspect the generated files for each platform.

    line 155
  17. Very specific:

    Does not modify AndroidManifest.xml (assumes @mipmap/ic_launcher is set).

    line 160
  18. Very specific:

    Does not modify the Xcode project file (.pbxproj) or Info.plist.

    line 161
  19. Distinctive:

    Does not add macOS icon shape or shadow to generated PNGs.

    line 162
  20. Distinctive:

    Does not generate iOS 18+ dark/tinted icon variants.

    line 163
  21. Distinctive:

    Does not validate adaptive-icon safe-zone compliance.

    line 164
  22. Very specific:

    Does not set up Linux .desktop files or FreeDesktop icon theme directories.

    line 165
  23. Distinctive:

    Verify generated files exist at the expected paths for each platform.

    line 172
  24. Very specific:

    Check image dimensions match platform requirements (use file or identify / sips commands).

    line 173
  25. Distinctive:

    Do not claim a platform is verified unless its build actually succeeded.

    line 206
  26. Distinctive:

    When the toolchain is unavailable, state which platforms remain unverified.

    line 207
  27. Distinctive:

    When a fix does not resolve the issue, verify the asset pipeline end-to-end: source image → generator output → native project reference → …

    line 225
  28. Distinctive:

    Using a low-resolution source image: Start with 1024×1024 minimum.

    line 242
  29. Distinctive:

    Check dimensions, formats, references, and platform builds.

    line 248
  30. Distinctive:

    flutter_launcher_icons: Verify the current version on pub.dev before relying on specific config keys.

    line 284
  31. Distinctive:

    When a task depends on a recent platform change, verify the relevant official documentation before proceeding.

    line 295

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Flutter App Icon Engineering

Configure application icons correctly across all Flutter deployment targets. Each platform has distinct asset formats, directory structures, and build-system references. Treat them as independent pipelines that share a single source image.

Start with evidence

Before changing any icon asset or configuration:

  1. Read pubspec.yaml — SDK constraints, existing flutter_launcher_icons config, and dev_dependencies.
  2. List which platform directories exist (android/, ios/, web/, windows/, macos/, linux/). Only configure platforms that are present and intended.
  3. Inspect existing icon assets in every present platform directory (paths in the Platform Requirements table below).
  4. Check AndroidManifest.xml for android:icon and android:roundIcon.
  5. Check ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json format — is it modern single-icon or legacy multi-size?
  6. Check web/manifest.json icon entries and web/index.html favicon link.
  7. Check windows/runner/Runner.rc icon reference.
  8. Check macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json.
  9. Look for any flutter_launcher_icons.yaml or per-flavor config files.
  10. Determine the task: new icon, replacement, fix, audit, or automation.

Do not modify platforms that are absent from the project or that the user has not asked about.

Platform requirements

PlatformFormatLocationKey sizesConfig reference
AndroidPNG (mipmap dirs) + XML (adaptive)android/app/src/main/res/mipmap-*/48–192 px legacy; 108–432 px adaptive layersAndroidManifest.xml android:icon
iOSPNG (asset catalog)ios/Runner/Assets.xcassets/AppIcon.appiconset/1024×1024 single (Xcode 15+) or multiple legacy sizesContents.json, Xcode build setting ASSETCATALOG_COMPILER_APPICON_NAME
macOSPNG (asset catalog)macos/Runner/Assets.xcassets/AppIcon.appiconset/16–1024 px (multiple required)Contents.json with idiom: mac
WebPNGweb/favicon.png, web/icons/16 favicon; 192+512 PWA; 192+512 maskableweb/manifest.json, web/index.html
WindowsICOwindows/runner/resources/app_icon.ico16–256 in single .ico containerwindows/runner/Runner.rc
LinuxPNG or SVGProject-specific; no default generated256 or 512 recommended.desktop file Icon field

See references/platform-implementation.md for exact file layouts, Contents.json templates, XML examples, and per-platform step-by-step procedures.

Decision framework

Choose the approach that matches the project's needs:

Use flutter_launcher_icons when

  • Multiple platforms need icons from a single source image.
  • The project does not have heavily customized native icon resources.
  • Adaptive Android icons (foreground + background + monochrome) are needed.
  • The team wants reproducible, config-driven generation.

Use native platform tooling when

  • Only one platform needs an icon update.
  • The project has custom native icon resources the generator would overwrite.
  • iOS 18+ dark/tinted icon variants are required (the generator does not support them as of v0.14.3).
  • macOS icons need the traditional rounded-rectangle shape with drop shadow (the generator does not add shape or shadow).
  • Precise control over every generated asset is required.

Use a custom pipeline when

  • CI/CD must generate icons from SVG or vector sources.
  • The project uses non-standard directory structures or icon names.
  • Multiple brands or white-label builds need different icons.

Source asset preparation

Start with a 1024×1024 px PNG on a square canvas:

  • iOS: No transparency. Opaque fill to the edges. No rounded corners — iOS masks them automatically (~17.5% radius).
  • Android adaptive: Foreground on 108 dp canvas with content inside the 66 dp safe-zone circle. Background can be a color or image. Monochrome variant is single-color (grayscale) on transparent background.
  • macOS: Can have transparency. Should include the rounded-rectangle shape and shadow in the image itself — macOS does not auto-mask.
  • Web: Can have transparency. Maskable variants need extra safe-zone padding.
  • Windows: Can have transparency. The ICO container holds multiple sizes.

When one source image serves all platforms, use an opaque 1024×1024 PNG with the logo centered in the inner 66% (safe zone for adaptive masking). Provide separate platform-specific source images when visual requirements differ.

Use sRGB or Display P3 color profiles. Avoid CMYK. Use lossless PNG — not JPEG. Keep the source image under version control; generated assets are derived output.

flutter_launcher_icons workflow

1. Add the dependency

dev_dependencies:
  flutter_launcher_icons: ^0.14.3

Always dev_dependencies — it is a build-time tool with zero runtime footprint.

2. Configure

In pubspec.yaml or a separate flutter_launcher_icons.yaml:

flutter_launcher_icons:
  image_path: "assets/icon/icon.png"

  android: true
  min_sdk_android: 21
  adaptive_icon_foreground: "assets/icon/foreground.png"
  adaptive_icon_background: "#FFFFFF"
  adaptive_icon_monochrome: "assets/icon/monochrome.png"

  ios: true
  remove_alpha_ios: true

  web:
    generate: true
    image_path: "assets/icon/icon.png"
    background_color: "#FFFFFF"
    theme_color: "#000000"

  windows:
    generate: true
    image_path: "assets/icon/icon.png"

  macos:
    generate: true
    image_path: "assets/icon/icon.png"

Only include platforms that exist in the project. Set remove_alpha_ios: true unless the source image is already opaque.

3. Generate

dart run flutter_launcher_icons

For a specific flavor:

dart run flutter_launcher_icons --flavor dev

4. Verify generated output

After generation, inspect the generated files for each platform. See the Validation section below.

What the generator does NOT do

  • Does not modify AndroidManifest.xml (assumes @mipmap/ic_launcher is set).
  • Does not modify the Xcode project file (.pbxproj) or Info.plist.
  • Does not add macOS icon shape or shadow to generated PNGs.
  • Does not generate iOS 18+ dark/tinted icon variants.
  • Does not validate adaptive-icon safe-zone compliance.
  • Does not set up Linux .desktop files or FreeDesktop icon theme directories.
  • Overwrites existing icon files without backup.

Validation

Static checks (always possible)

  1. Verify generated files exist at the expected paths for each platform.
  2. Check image dimensions match platform requirements (use file or identify / sips commands).
  3. Validate Contents.json is well-formed JSON with correct filename, idiom, size, and scale entries.
  4. Validate ic_launcher.xml references valid drawables.
  5. Confirm AndroidManifest.xml android:icon="@mipmap/ic_launcher".
  6. Confirm web/manifest.json icon entries reference existing files.
  7. Confirm windows/runner/Runner.rc references app_icon.ico.
  8. Confirm iOS icon PNGs have no alpha channel: sips -g hasAlpha ios/Runner/Assets.xcassets/AppIcon.appiconset/*.png

Platform builds (when toolchain is available)

# Android — requires Android SDK
flutter build apk --debug

# iOS — requires macOS + Xcode
flutter build ios --debug --no-codesign

# Web
flutter build web

# Windows — requires Windows + Visual Studio
flutter build windows

# macOS — requires macOS + Xcode
flutter build macos

# Linux — requires Linux + build tools
flutter build linux

Do not claim a platform is verified unless its build actually succeeded. When the toolchain is unavailable, state which platforms remain unverified.

Troubleshooting

SymptomLikely causeFix
Default Flutter icon still showingGenerated assets not in correct mipmap dirs, or build cache staleVerify files exist at correct paths. Run flutter clean && flutter pub get, then rebuild.
Only some platforms show new iconGenerator skipped platforms with generate: false or missing configCheck config — web, windows, macos need explicit generate: true.
Android icon cropped or zoomedForeground content outside 66dp safe zoneRedesign foreground: keep critical content inside inner 61% of canvas.
Android themed icon not workingMissing adaptive_icon_monochrome config, or device < API 33Add monochrome layer. Verify device runs Android 13+.
iOS build fails with alpha errorIcon PNG has transparencySet remove_alpha_ios: true in config, or provide opaque source.
Xcode "unassigned children" errorContents.json references files that don't exist in appiconsetRegenerate icons or fix filenames in Contents.json to match actual files.
Web favicon unchanged in browserBrowser cacheHard refresh (Ctrl+Shift+R). Clear site data. Rename favicon with cache-busting query.
macOS icon has no rounded shapeGenerator outputs raw PNG without macOS shapeProvide a pre-shaped macOS source image with rounded rect + shadow.
Windows icon appears pixelated.ico contains only one sizeEnsure .ico includes 16, 32, 48, 128, 256 px layers.
Generator overwrote custom iconsPackage replaces files without backupBack up custom icons before running. Use native tooling for customized setups.
Icon correct in debug but wrong in releaseSeparate debug/release resource sets in AndroidCheck src/debug/res/ for overrides. Remove or update them.

When a fix does not resolve the issue, verify the asset pipeline end-to-end: source image → generator output → native project reference → build output. Cache clearing is a last resort, not a first step.

Common mistakes

  • Running the generator on every build. Icon generation is a one-time step when the source image changes. Do not add it to build hooks or CI pipelines that run on every commit.
  • Putting flutter_launcher_icons in dependencies. It belongs in dev_dependencies. It adds zero runtime code.
  • Ignoring platform differences. iOS forbids transparency. macOS needs the shape in the image. Android uses layers. Treating all platforms identically produces broken icons.
  • Not inspecting existing icons before replacing. The project may have custom native icons, adaptive XML, or flavor-specific overrides. Overwriting blindly destroys intentional customizations.
  • Using a low-resolution source image. Start with 1024×1024 minimum. Upscaling a 256 px image produces blurry icons across high-density devices.
  • Assuming generation configures everything. The generator creates image files but does not set up AndroidManifest.xml, .desktop files, or Xcode build settings. These must already be correct.
  • Not validating after generation. Files existing is not proof of correctness. Check dimensions, formats, references, and platform builds.

Completion checklist

Before reporting success:

  • Source image is ≥1024×1024, PNG, sRGB or P3, square canvas
  • Only platforms present in the project were configured
  • Existing native customizations were preserved or intentionally replaced
  • flutter_launcher_icons is in dev_dependencies (if used)
  • Generator was run and completed without errors (if used)
  • Android: mipmap directories populated, adaptive XML valid, manifest references correct
  • iOS: AppIcon.appiconset populated, Contents.json valid, no alpha channel
  • macOS: AppIcon.appiconset populated with all sizes, Contents.json valid
  • Web: favicon.png + manifest icons exist, manifest.json references correct
  • Windows: app_icon.ico exists with multiple sizes, Runner.rc references it
  • Linux: icon file exists, .desktop file references it (if packaging configured)
  • Each platform build succeeds (or state which platforms lack toolchain)
  • Git diff reviewed — only expected files changed

Official references

SourceURLCovers
Android adaptive iconshttps://developer.android.com/develop/ui/views/launch/icon_design_adaptiveLayers, safe zone, monochrome, masking
Android create app iconshttps://developer.android.com/studio/write/create-app-iconsImage Asset Studio, density buckets
Apple HIG app iconshttps://developer.apple.com/design/human-interface-guidelines/app-iconsiOS/macOS design, dark/tinted variants
Apple configuring iconshttps://developer.apple.com/documentation/xcode/configuring-your-app-iconAsset catalogs, Xcode 15+ single icon
App Store icon specshttps://developer.apple.com/help/app-store-connect/reference/app-icon-specifications/Submission sizes, format requirements
Flutter web buildinghttps://docs.flutter.dev/platform-integration/web/buildingWeb asset structure
Flutter desktophttps://docs.flutter.dev/platform-integration/desktopWindows, macOS, Linux integration
flutter_launcher_iconshttps://pub.dev/packages/flutter_launcher_iconsGenerator config, platforms, limitations
FreeDesktop icon spechttps://specifications.freedesktop.org/icon-theme-spec/latest/Linux icon themes, naming

Version sensitivity

  • flutter_launcher_icons: Verify the current version on pub.dev before relying on specific config keys. The schema evolves between minor releases.
  • Android adaptive icons: API 26+ (Android 8.0). Monochrome: API 33+ (Android 13).
  • iOS single-icon approach: Xcode 15+ / iOS 17+. Older Xcode versions require legacy multi-size icons.
  • iOS dark/tinted variants: iOS 18+ / Xcode 16+. Not supported by the generator as of v0.14.3.
  • macOS icon requirements: Multiple sizes always required — no single-icon shortcut exists.

When a task depends on a recent platform change, verify the relevant official documentation before proceeding.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.