swift-swiftui
Installation
SKILL.md
Swift and SwiftUI
The code is right when it compiles with zero warnings in Swift 6 language
mode and the app does what the story says. For how it should look, call the
Skill tool with mac-design. For copyable view code, read
../../design/mac-design/patterns.md.
Concurrency
The template sets main-actor default isolation: every type and function runs on the main actor unless you say otherwise. UI code needs no annotations.
| Work | Put it in |
|---|---|
| UI state, views, view models | Default (main actor) |
| CPU-heavy pure work (parsing, image work, diffing) | A nonisolated function marked @concurrent |
| Shared mutable state used off the main thread | An actor |
| A C callback (event tap, Carbon hotkey, CoreAudio listener) | A nonisolated static func that hops back with Task { @MainActor in ... } |