一键导入
swiftui-developer
Develop SwiftUI applications for iOS/macOS. Use when writing SwiftUI views, managing state, or building Apple platform UIs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Develop SwiftUI applications for iOS/macOS. Use when writing SwiftUI views, managing state, or building Apple platform UIs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run a model through the omni-bench benchmark to MEASURE it — produce a run-artifact and score it, then read the numbers. Use when asked to run, benchmark, measure, evaluate, or "test the results of" a model with omni-bench — ASR (WER/CER, RTFx) or text generation (tok/s, TTFT, prefill tok/s, prompt-cache speedup). Covers the adapter seam (Transcriber/Generator), the prepare→run→score→diff CLI flow, the offline no-download smoke task, and how to interpret each metric. NOT for publishing to a leaderboard (use omni-bench-publish) or changing the framework itself (use omni-bench).
Publish a scored omni-bench result (ASR or text-generation) to a leaderboard platform (e.g. bench.bshk.app) via its write API. Use when asked to publish, upload, submit, or "send a report" for an omni-bench result.json or parity-report.json — sharing ASR WER/RTFx numbers or text-generation TTFT/tok-per-s/prompt-cache numbers. Covers the one modality-agnostic `omni-bench publish` command and the MANDATORY secret handling: the api-key is injected from a secrets manager (1Password `op run` / AgentVault `av run`) at runtime, never read into context, never hardcoded.
Develop the omni-bench benchmark framework (ASR/STT + text generation) built on a producer/scorer split with an open JSON spec as SSOT. Use when working in an omni-bench checkout — changing the JSON schemas, the prepare/producer/scorer/diff pipeline, the adapter seams (Transcriber / Generator), datasets, fixtures, or the Swift producer SDK; or when running and validating benchmark artifacts. Encodes the schema-evolution rules, determinism invariants, commands, and repo gotchas that are easy to get wrong.
Use when generating/managing the offline root signing key or signing & publishing Zamok product keysets from the terminal (the Swift CLI; the ZamokApp GUI is the co-equal interface). Triggers — "generate root key", "rotate root", "publish keyset", "sign keyset", "escrow root key", "zamokctl", "trusted-roots.json", Tish/Zamok license signature setup.
Use when auditing websites or apps for Canadian accessibility law compliance, checking AODA (Ontario) or Accessible Canada Act (federal) requirements, or advising on CAN/ASC-EN 301 549 obligations.
Use when auditing digital products or services for European Accessibility Act (EAA) compliance, checking EN 301 549 conformance, or advising on EU Web Accessibility Directive obligations.
| name | swiftui-developer |
| description | Develop SwiftUI applications for iOS/macOS. Use when writing SwiftUI views, managing state, or building Apple platform UIs. |
| version | 1.0.0 |
Expert guidance for building professional SwiftUI applications targeting iOS 17+/macOS 14+ with modern patterns, accessibility compliance, and optimal performance.
When writing SwiftUI code, follow this workflow:
For simple views:
@State for local stateFor complex features:
@Observable macro (iOS 17+)@Environment for shared data// iOS 17+ Modern Pattern
@Observable
class FeatureViewModel {
var items: [Item] = []
@ObservationIgnored var cache: Cache? // Non-observed
}
struct FeatureView: View {
@State private var viewModel = FeatureViewModel()
var body: some View { ... }
}
Property Wrapper Selection:
| Wrapper | Use Case |
|---|---|
@State | Local value types, simple state, @Observable objects |
@Binding | Two-way connection to parent state |
@Environment | Shared app-wide data, system values |
@Observable | Modern observable objects (iOS 17+) |
.primary, .secondary).accessibilityLabel, .accessibilityHintLazyVStack/LazyHStack for listsbodyInput: "Create a settings view with dark mode toggle and notification preferences"
Output:
import SwiftUI
@Observable
class SettingsViewModel {
var isDarkMode: Bool {
didSet { UserDefaults.standard.set(isDarkMode, forKey: "darkMode") }
}
var notificationsEnabled: Bool {
didSet { UserDefaults.standard.set(notificationsEnabled, forKey: "notifications") }
}
init() {
isDarkMode = UserDefaults.standard.bool(forKey: "darkMode")
notificationsEnabled = UserDefaults.standard.bool(forKey: "notifications")
}
}
struct SettingsView: View {
@State private var viewModel = SettingsViewModel()
var body: some View {
Form {
Section("Appearance") {
Toggle("Dark Mode", isOn: $viewModel.isDarkMode)
.accessibilityHint("Switches between light and dark appearance")
}
Section("Notifications") {
Toggle("Enable Notifications", isOn: $viewModel.notificationsEnabled)
.accessibilityHint("Allows the app to send you notifications")
}
}
.navigationTitle("Settings")
}
}
Input: "Create a list of items with detail navigation"
Output:
import SwiftUI
struct Item: Identifiable {
let id = UUID()
let title: String
let subtitle: String
}
struct ItemListView: View {
let items: [Item]
var body: some View {
List(items) { item in
NavigationLink(value: item) {
VStack(alignment: .leading, spacing: 4) {
Text(item.title)
.font(.headline)
Text(item.subtitle)
.font(.subheadline)
.foregroundStyle(.secondary)
}
.padding(.vertical, 4)
}
.accessibilityLabel("\(item.title), \(item.subtitle)")
}
.navigationTitle("Items")
.navigationDestination(for: Item.self) { item in
ItemDetailView(item: item)
}
}
}
Input: "Create a view that loads data from an API"
Output:
import SwiftUI
@Observable
class DataViewModel {
var items: [Item] = []
var isLoading = false
var errorMessage: String?
func loadData() async {
isLoading = true
errorMessage = nil
do {
items = try await APIService.shared.fetchItems()
} catch {
errorMessage = error.localizedDescription
}
isLoading = false
}
}
struct DataView: View {
@State private var viewModel = DataViewModel()
var body: some View {
Group {
if viewModel.isLoading {
ProgressView("Loading...")
} else if let error = viewModel.errorMessage {
ContentUnavailableView(
"Error",
systemImage: "exclamationmark.triangle",
description: Text(error)
)
} else {
List(viewModel.items) { item in
Text(item.title)
}
}
}
.task {
await viewModel.loadData()
}
.refreshable {
await viewModel.loadData()
}
}
}
@Observable for iOS 17+ projects (better performance).font(.body) etc.LazyVStack/LazyHStack for large collections@State with reference types (causes memory leaks)@ObservedObject to create objects in view (use @StateObject or @State)body property.presentationSizing(.form) for sheets@Entry macro for environment keysSee reference/ directory for:
state-management.md - Property wrapper decision guidehig-checklist.md - HIG compliance checklist