⏳ This skill is pending AI review.
Scores will appear once the review pipeline completes.
swiftui-macos
Expert SwiftUI guidance for macOS apps — covers writing and reviewing code with runtime-level understanding of observation, concurrency, performance, and platform integration. Use when user asks to "build a SwiftUI view", "review my SwiftUI code", "fix observation issues", "bridge AppKit", "architect state management", "debug view updates", or works on any macOS SwiftUI project — building features, reviewing existing code, debugging view updates or performance, fixing concurrency issues, architecting state management, bridging AppKit, or making design decisions. Do NOT use for iOS/iPadOS-only SwiftUI, UIKit bridging, or basic Swift language questions. Focuses on non-obvious traps and deep patterns, not basics.
Choose how to use this skill
You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.
1. Native installer
This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.
Do not guess an installer command or replace an existing version without reviewing the diff.
2. Complete package recommended
Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.
No complete ProSkills package is published for this listing yet.3. Prompt-only
Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.
Need only the instruction file?
Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.
No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.
// RATINGS
// README
SwiftUI macOS Skill
An agent skill for writing and reviewing SwiftUI code on macOS — with runtime-level understanding of observation, concurrency, view identity, and platform integration.
Built from building a production macOS browser with SwiftUI and from reading the Swift runtime source. Every pattern here was validated against actual framework behavior, not inferred from documentation. Designed for frontier models: skips basics, focuses on the non-obvious traps and deep mechanisms that even experienced developers get wrong.
What makes this different
Most SwiftUI guidance rewrites Apple's documentation or targets iOS beginners. This skill targets macOS, assumes the model already knows Swift and SwiftUI, and explains why things work the way they do — the kind of understanding you'd get from a Swift language contributor, not a tutorial author.
Runtime-level depth:
- Observation internals — how
shouldNotifyObserversoverloads resolve via the type system (Equatable vs non-Equatable vs AnyObject), why_modifyalways notifies butsetchecks equality,Observations {}for reactive async streams - Scheduling cost hierarchy — actual allocation costs from reading the Swift runtime:
assumeIsolated(~0B) vsMainActor.run(~0B) vsDispatchQueue.main.async(~64B) vsTask(~300-500B), and when each is correct - View identity graph — how structural identity creates
_ConditionalContent, why.id()with unstable values destroys state, howEquatableconformance short-circuits body evaluation
Patterns from production:
- Version counters to decouple observation from collection mutations
@ObservationIgnoreddiscipline for internal caches and callbacksObservations {}streams for reactive AppKit ↔ SwiftUI bridging- Custom
Layoutprotocol overGeometryReaderfor arrangement logic NSHostingViewsubclassing for embedding SwiftUI in AppKit hierarchies- Debounced SwiftData persistence and background
@ModelActoroperations
macOS-specific:
- Multi-window state architecture with per-window vs global state separation
NSViewRepresentable+Equatableto prevent unnecessaryupdateNSViewcalls- AppKit bridging patterns: window chrome, drag and drop, system blur, menu bar extras
NSBackgroundActivitySchedulerover polling Task loops for periodic work
Installing
Claude Code (plugin)
Add the repo as a plugin marketplace, then install:
/plugin marketplace add kageroumado/swiftui-macos-skill
/plugin install swiftui-macos
Claude Code (manual)
Clone the repo, then copy the skill folder to the appropriate scope:
User-wide (recommended — available across all projects):
git clone https://github.com/kageroumado/swiftui-macos-skill.git
mkdir -p ~/.claude/skills
cp -r swiftui-macos-skill/skills/swiftui-macos ~/.claude/skills/
Per-project (shared with collaborators via version control):
git clone https://github.com/kageroumado/swiftui-macos-skill.git
mkdir -p your-project/.claude/skills
cp -r swiftui-macos-skill/skills/swiftui-macos your-project/.claude/skills/
Claude.ai
- Download or clone this repo
- Zip the
skills/swiftui-macosfolder - Upload via Settings > Capabilities > Skills
Usage
In Claude Code:
/swiftui-macos
In Codex:
$swiftui-macos
The skill works for both writing and reviewing. Examples:
/swiftui-macos Review observation discipline in the sidebar views
/swiftui-macos I'm building a multi-window document editor — help me architect the state
/swiftui-macos Focus on concurrency patterns in the networking layer
/swiftui-macos Help me bridge this NSCollectionView into SwiftUI
References
| File | Coverage |
|---|---|
references/observation.md | Observation tracking: state capture, _modify vs set, version counters, scope narrowing, Observations {} streams, computed property propagation |
references/concurrency.md | Scheduling cost hierarchy, actor isolation, SE-0461/0469/0420/0471/0472, AsyncStream bridging, @concurrent, sending |
references/views.md | View decomposition, .task(id:), preference keys, custom Layout, animation, navigation |
references/data.md | Manager pattern, @Bindable, SwiftData, debounced saving, @ModelActor, environment injection |
references/platform.md | NSViewRepresentable, NSHostingView, multi-window state, openWindow, AppKit bridging, macOS scenes |
references/performance.md | View identity graph, .id() dangers, Equatable views, @State for gestures, Canvas, TimelineView, drawingGroup() |
references/api.md | Deprecated API replacements, Swift modernisms, @Previewable, @Entry, Apple open-source Swift packages |
references/accessibility.md | VoiceOver, Dynamic Type, keyboard navigation, accessibility rotors, @AccessibilityFocusState, drag-and-drop a11y, testing |
Contributing
Contributions welcome. Every rule should earn its token cost — if a capable model already knows it, it doesn't belong here. Focus on things that are non-obvious, frequently wrong, or require runtime-level understanding to get right.
License
MIT License. See LICENSE.
// HOW IT'S BUILT
KEY FILES