agentleFS
chsistryingchsistrying/swift-ship-skills/skills/macos-app-icon/SKILL.md

macos-app-icon

Skill0 starsChanged 3 months agoMITView on GitHub

Generates a complete macOS .icns app icon file from a single source image (SVG or PNG at least 1024px). Use when asked to create/build/generate a macOS app icon, .icns file, AppIcon, iconset, or to fix a blurry/missing/wrong-size app icon, or to wire an icon into an Xcode project or app bundle. Also covers menu bar / status bar icon requirements (separate from .icns). Trigger with "/macos-app-icon".

  • Deletes or force-pushes

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. wangyong5609/wangyong-skills★ 8same name
    2. lucasmaher-hash/claude-skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository4 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 2 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If input is .svg, renders it to a 1024px PNG via qlmanage.

    line 36
  2. Very specific:

    If input is .png, uses it directly (warns if smaller than 1024px or non-square).

    line 37
  3. Very specific:

    Run it with no args (or -h) for usage help.

    line 42
  4. Distinctive:

    If you need to do this by hand or the script is unavailable, run the exact commands below.

    line 62
  5. Distinctive:

    Leave roughly a 10% transparent margin around the visual content (i.e.

    line 113
  6. Very specific:

    Prefer a source >= 1024x1024 so the largest size (icon_512x512@2x.png, itself 1024x1024) isn't upscaled.

    line 116
  7. Very specific:

    Ensure the target's Build Settings > "Asset Catalog App Icon Set Name" is set to that asset set's name (default AppIcon).

    line 129
  8. Very specific:

    Prefer an SF Symbol (NSImage(systemSymbolName:accessibilityDescription:)) when a suitable one exists — it inherits correct weight/scale for …

    line 153
  9. Very specific:

    Do not hand it a full-color, multi-size .icns — it will not adapt to dark mode or menu bar height and will look out of place next to system …

    line 155
  10. Very specific:

    file doesn't show "Mac OS X icon.": If file AppIcon.icns doesn't report it as an icon, iconutil silently wrote something else or failed — …

    line 195

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

macOS App Icon Generator

Overview

Build a macOS .icns app icon from one source image (SVG or PNG), and wire it into an app. A .icns file packs all ten required icon sizes (16px through 1024px, @1x and @2x) into the single artifact macOS expects in an app bundle.

Prerequisites

  • macOS with qlmanage, sips, iconutil, and file — all ship with the OS, nothing to install.
  • A square source image: SVG, or PNG at least 1024x1024.

Instructions

Quick start — run the bundled script:

scripts/make_icns.sh <input-image> <output.icns>

The script:

  1. Validates required tools (sips, iconutil, file) and the input file.
  2. If input is .svg, renders it to a 1024px PNG via qlmanage.
  3. If input is .png, uses it directly (warns if smaller than 1024px or non-square).
  4. Generates all required sizes into a temp .iconset folder.
  5. Compiles the .iconset into .icns via iconutil.
  6. Cleans up the temp folder and prints the final file output to confirm validity.

Run it with no args (or -h) for usage help.

Examples

# SVG source, output next to it
scripts/make_icns.sh AppIcon.svg AppIcon.icns

# 1024px PNG source, output into a build directory
scripts/make_icns.sh artwork_1024.png build/AppIcon.icns

Output

A valid .icns file at the path you specified, confirmed by file reporting Mac OS X icon. Intermediate .iconset folders are cleaned up automatically. Wire the result into an app via the sections below.

Manual workflow (no script)

If you need to do this by hand or the script is unavailable, run the exact commands below.

1. Get a 1024x1024 PNG.

From SVG:

qlmanage -t -s 1024 -o /tmp/icon_render AppIcon.svg
# writes /tmp/icon_render/AppIcon.svg.png

From an existing PNG >= 1024px, just use it as-is.

2. Create the iconset folder and generate every required size:

mkdir icon.iconset
SRC=source_1024.png

sips -z 16 16     "$SRC" --out icon.iconset/icon_16x16.png
sips -z 32 32     "$SRC" --out icon.iconset/icon_16x16@2x.png
sips -z 32 32     "$SRC" --out icon.iconset/icon_32x32.png
sips -z 64 64     "$SRC" --out icon.iconset/icon_32x32@2x.png
sips -z 128 128   "$SRC" --out icon.iconset/icon_128x128.png
sips -z 256 256   "$SRC" --out icon.iconset/icon_128x128@2x.png
sips -z 256 256   "$SRC" --out icon.iconset/icon_256x256.png
sips -z 512 512   "$SRC" --out icon.iconset/icon_256x256@2x.png
sips -z 512 512   "$SRC" --out icon.iconset/icon_512x512.png
sips -z 1024 1024 "$SRC" --out icon.iconset/icon_512x512@2x.png

3. Compile to .icns:

iconutil -c icns icon.iconset -o AppIcon.icns
rm -rf icon.iconset

4. Verify:

file AppIcon.icns
# expect: "AppIcon.icns: Mac OS X icon, ..."

Design guidance

  • Source artwork should be square. macOS renders icons inside a rounded-rect "squircle" mask automatically for most contexts — do not pre-mask/round the corners yourself, or you'll get double-masking artifacts.
  • Leave roughly a 10% transparent margin around the visual content (i.e. the drawn artwork occupies about the center 80–90% of the 1024x1024 canvas). Icons that bleed to the edge look oversized next to system icons.
  • Prefer a source >= 1024x1024 so the largest size (icon_512x512@2x.png, itself 1024x1024) isn't upscaled.
  • Flatten the SVG (embed/inline any linked images, fonts, or <use href> external refs) before rendering — see Edge Cases below.

Wiring the icon into an app

Xcode asset catalog (typical app target):

  1. Open Assets.xcassets in Xcode, add an "App Icon" image set (or use the existing AppIcon set already scaffolded by most templates).
  2. Drag AppIcon.icns onto the asset slot — Xcode auto-extracts the sizes it needs (modern Xcode also accepts a single 1024px PNG directly instead of an .icns, via the "single size" App Icon set style).
  3. Ensure the target's Build Settings > "Asset Catalog App Icon Set Name" is set to that asset set's name (default AppIcon).

Raw bundle (no Xcode asset catalog, e.g. a hand-built .app or a CLI-built bundle):

  1. Copy AppIcon.icns into YourApp.app/Contents/Resources/.
  2. In Contents/Info.plist, set:
    <key>CFBundleIconFile</key>
    <string>AppIcon</string>
    (Omit the .icns extension — CFBundleIconFile implies it. Filename must match exactly, case-sensitive.)
  3. Re-sign/re-bundle as needed, then refresh the icon cache (see Edge Cases).

Menu bar / status bar icons are NOT the .icns

Menu bar (NSStatusItem) icons are a completely separate asset from the app icon:

  • They should be small template images (typically 18x18pt @1x/@2x/@3x, or an SF Symbol), rendered in monochrome and automatically tinted/inverted by the system for light/dark mode and selection states.
  • Set image.isTemplate = true on the NSImage (or use an asset catalog image marked "Render As: Template Image").
  • Prefer an SF Symbol (NSImage(systemSymbolName:accessibilityDescription:)) when a suitable one exists — it inherits correct weight/scale for free.
  • Do not hand it a full-color, multi-size .icns — it will not adapt to dark mode or menu bar height and will look out of place next to system icons.

Edge cases

  • Non-square source. sips -z H W scales width/height independently, so a non-square source gets stretched/distorted. Pad to a square canvas first (e.g. in the design tool, or via sips --padToHeightWidth) rather than feeding it directly.
  • Source smaller than 1024px. The largest iconset entries (512, 512@2x = 1024px) will be upscaled and look soft. Get a bigger source, or accept the blur if the icon is only ever shown small.
  • SVG with external references renders blank. qlmanage's QuickLook renderer runs sandboxed and often cannot resolve <image href="...">, external fonts, or <use xlink:href="external.svg#id">. Symptom: the rendered PNG is fully transparent/blank even though the SVG looks correct in a browser. Fix: inline/flatten all external references in the SVG (or export a PNG directly from the design tool — Figma/Illustrator/Sketch "Export as PNG @1024px" — and skip qlmanage entirely).
  • Icon doesn't update after replacing it (Gatekeeper / icon cache). macOS aggressively caches app icons. After swapping AppIcon.icns or rebuilding an unsigned/dev app:
    touch YourApp.app
    killall Finder
    # if still stale:
    qlmanage -r cache
    killall Dock
    For unsigned/ad-hoc-signed builds during development, a full re-copy of the .app to a new path (or mv it) often forces Finder to re-read the icon rather than reuse a cached one keyed by the old inode/path. Do not delete system cache directories under /Library/Caches to force a refresh; the steps above are enough, and a stale icon is cosmetic.
  • iconutil fails with "not a valid iconset." Usually means a required filename is missing or misnamed (must exactly match icon_16x16.png, icon_16x16@2x.png, ... icon_512x512@2x.png) or the folder isn't named *.iconset. Re-check the ls output against the size list above.
  • file doesn't show "Mac OS X icon." If file AppIcon.icns doesn't report it as an icon, iconutil silently wrote something else or failed — re-run with a fresh iconset folder rather than reusing a partially-built one.

Resources

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.