Communitygithub.com

iOS图标生成器

从SF Symbols(5000+个Apple原生图标)或Iconify API(来自200+图标集的27.5万+个开源图标)生成用于Xcode资源目录的iOS应用图标PNG。适用于生成图标、创建图标资源、向资源目录添加图标或搜索iOS项目图标时使用。

iOS图标生成器 是什么?

iOS图标生成器是一个AI助手技能,专为需要在Xcode项目中生成和管理图标资源的开发者设计。它支持两种图标来源:苹果官方的SF Symbols(5000+个原生图标,离线可用,仅限macOS)和Iconify API(27.5万+个来自200多个开源图标集的图标,需联网)。该技能能够根据用户需求搜索图标,并生成包含1x、2x、3x三套分辨率的PNG图片集,直接输出符合Xcode资源目录格式的.imageset文件夹。它还能根据项目现有图标风格(尺寸、颜色、线宽等)自动匹配,避免样式不统一。支持在Cursor、Claude Code等AI编码工具中使用,通过命令行脚本快速完成图标搜索、预览、生成和集成全流程,极大提升iOS开发中图标处理的效率。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/ios-icon-gen

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

iOS图标生成器 是做什么的?

从两个来源为Xcode资源目录生成PNG图标集。

何时启用

  • 为iOS/macOS Xcode项目生成图标资源
  • 在开源图标集中搜索图标
  • 为资源目录创建PNG图标集(1x、2x、3x)
  • 将占位符图标替换为生产级资源
  • 匹配Xcode项目中已有的图标样式

核心原则

1. 两个来源,统一输出格式

两个来源都生成完全兼容Xcode的图标集。根据需求选择:

来源图标数量依赖最佳用途
Iconify API来自200+图标集的27.5万+个图标联网广泛的选择、特定风格、开源图标
SF Symbols5000+个Apple符号仅macOSApple原生风格、离线使用

2. 始终匹配现有样式

在生成前,检查项目现有图标的尺寸、颜色和粗细,保持一致性。

3. 输出结构

两种方法都生成完整的Xcode图标集:

<输出目录>/<资源名称>.imageset/
  Contents.json
  <资源名称>.png        # 1x(默认68px)
  <资源名称>@2x.png     # 2x(默认136px)
  <资源名称>@3x.png     # 3x(默认204px)

示例

第一步:评估需求

确定图标需求:图标表示什么、首选风格、目标颜色和尺寸。

如果项目已有图标,检查现有样式:

# 检查现有图标的尺寸
sips -g pixelWidth -g pixelHeight 路径/到/已有@2x.png

第二步:搜索图标

Iconify API(推荐用于广泛选择):

# 搜索所有图标集
$SKILL_DIR/scripts/iconify_gen.sh search "receipt"

# 在特定图标集内搜索
$SKILL_DIR/scripts/iconify_gen.sh search "business card" --prefix mdi

# 列出可用的图标集
$SKILL_DIR/scripts/iconify_gen.sh collections

SF Symbols(适用于Apple原生风格): 浏览SF Symbols应用或参考常用名称:

用途符号名称
文档doc.text, doc.fill
收据doc.text.below.ecg, receipt
人物person.crop.rectangle, person.text.rectangle
相机camera, camera.fill
扫描doc.viewfinder, qrcode.viewfinder
设置gearshape, slider.horizontal.3

第三步:预览(可选)

# Iconify预览
$SKILL_DIR/scripts/iconify_gen.sh preview mdi:receipt-text-outline

第四步:生成

Iconify API:

# 基本生成
$SKILL_DIR/scripts/iconify_gen.sh mdi:receipt-text-outline editTool_expenseReport

# 自定义颜色和输出位置
$SKILL_DIR/scripts/iconify_gen.sh mdi:receipt-text-outline myIcon --color 007AFF --output ./Assets.xcassets/icons

选项:--size <pt>(默认:68),--color <hex>(默认:8E8E93),--output <目录>(默认:/tmp/icons)

SF Symbols:

# 基本生成
swift $SKILL_DIR/scripts/generate_icons.swift doc.text.below.ecg editTool_expenseReport

# 自定义颜色、粗细和输出
swift $SKILL_DIR/scripts/generate_icons.swift person.crop.rectangle myIcon --color 007AFF --weight regular --output ./Assets.xcassets/icons

选项:--size <pt>(默认:68),--color <hex>(默认:8E8E93),--weight <名称>(默认:thin),--output <目录>(默认:/tmp/icons)

第五步:验证并集成

  1. 读取生成的@2x PNG进行视觉验证
  2. 如果没有直接输出到资源目录,则复制进去:
    cp -r /tmp/icons/<名称>.imageset 路径/到/Assets.xcassets/<分组>/
    
  3. 构建项目,验证Xcode能识别新资源

流行的Iconify图标集

前缀名称数量风格
mdiMaterial Design Icons7400+填充+轮廓变体
phPhosphor9000+每个图标6种粗细
solarSolar7400+粗体、线性、轮廓
tablerTabler Icons6000+一致的线条宽度
lucideLucide1700+干净、简约
riRemix Icon3100+填充+线条变体
carbonCarbon2400+IBM设计语言
heroiconsHeroIcons1200+Tailwind CSS伴侣

浏览全部:https://icon-sets.iconify.design/

脚本参考

脚本来源路径
iconify_gen.shIconify API(27.5万+个图标)$SKILL_DIR/scripts/iconify_gen.sh
generate_icons.swiftSF Symbols(5000+个图标)$SKILL_DIR/scripts/generate_icons.swift

最佳实践

  • 先生成前搜索 -- 浏览可用图标,找到最佳匹配
  • 匹配项目现有样式 -- 生成前检查现有图标的尺寸、颜色和粗细
  • 使用Iconify获得多样性 -- 200+个图标集意味着你能找到精确需要的风格
  • 使用SF Symbols保持Apple一致性 -- 它们与系统UI完美匹配
  • 直接生成到资源目录 -- 使用--output ./Assets.xcassets/icons跳过手动复制
  • 视觉验证 -- 在提交前始终预览@2x PNG

反模式

  • 在未检查项目现有图标样式的情况下生成图标
  • 当项目有定义好的调色板时仍使用默认颜色
  • 以错误尺寸生成(先检查现有图标)
  • 提交生成的图标前未进行视觉验证

Individual skills in this repo

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

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

相关技能