Communitygithub.com

iOS 圖示產生器

從 SF Symbols(5000+ Apple 原生圖示)或 Iconify API(275k+ 開源圖示,來自 200+ 集合)為 Xcode 資源目錄產生 iOS 應用程式圖示的 PNG imageset。可用於產生圖示、建立圖示資源、新增圖示至資源目錄,或搜尋 iOS 專案適用的圖示。

iOS 圖示產生器 是什麼?

iOS 圖示產生器是一個專為 iOS/macOS Xcode 專案設計的 AI 代理技能,可從兩個主要來源產生 PNG 圖示 imageset:Apple 原生的 SF Symbols(超過 5,000 個圖示,無需網路)與 Iconify API(超過 275,000 個開源圖示,來自 200+ 集合)。它支援 Cursor、Claude Code 和 Codex 等平台,開發者可透過簡單的 CLI 命令搜尋、預覽並產生 Xcode 相容的 imageset(包含 1x、2x、3x 尺寸與 Contents.json)。此技能會自動匹配專案現有圖示的樣式(尺寸、顏色、粗細),並可直接輸出至 Assets.xcassets 目錄,省去手動複製步驟。生成後可透過 sips 或直接預覽 @2x PNG 進行視覺驗證,確保生產級品質。

相容平台~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 圖示 imageset。

何時啟用

  • 為 iOS/macOS Xcode 專案產生圖示資源
  • 在開源圖示集合中搜尋圖示
  • 為資源目錄建立 PNG imageset(1x、2x、3x)
  • 將佔位圖示替換為生產級品質的資源
  • 匹配 Xcode 專案中現有的圖示風格

核心原則

1. 兩個來源,統一輸出格式

兩種來源均產生完全相容於 Xcode 的 imageset。根據需求選擇:

來源圖示數量需求最佳用途
Iconify API275,000+ 個,來自 200+ 集合網路連線廣泛選擇、特定風格、開源圖示
SF Symbols5,000+ 個 Apple 符號僅限 macOSApple 原生風格、離線使用

2. 始終匹配現有風格

在產生之前,檢查專案現有圖示的尺寸、顏色和粗細一致性。

3. 輸出結構

兩種方法都會產生完整的 Xcode imageset:

<輸出目錄>/<資源名稱>.imageset/
  Contents.json
  <資源名稱>.png        # 1x(預設 68px)
  <資源名稱>@2x.png     # 2x(預設 136px)
  <資源名稱>@3x.png     # 3x(預設 204px)

範例

步驟 1:評估需求

確定圖示需求:圖示代表的內容、偏好的風格、目標顏色和尺寸。

如果專案已有圖示,請檢查現有風格:

# 檢查現有圖示的尺寸
sips -g pixelWidth -g pixelHeight path/to/[email protected]

步驟 2:搜尋圖示

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

步驟 3:預覽(可選)

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

步驟 4:產生

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)

步驟 5:驗證並整合

  1. 讀取產生的 @2x PNG 以視覺方式驗證
  2. 如果未直接輸出到資源目錄,請複製過去:
    cp -r /tmp/icons/<名稱>.imageset path/to/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(275k+ 圖示)$SKILL_DIR/scripts/iconify_gen.sh
generate_icons.swiftSF Symbols(5k+ 圖示)$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.

相關技能