swift-lang

Installation
SKILL.md

Swift 6.2 Language Patterns

Corrective guide for Swift code generation. Swift 6.2 fundamentally changed the concurrency model — most LLM training data reflects the old model.

Critical Constraints

  • ❌ DO NOT use ObservableObject + @Published for macOS 14+ / iOS 17+ → ✅ Use @Observable macro (import Observation)
  • ❌ DO NOT use @StateObject → ✅ Use @State with @Observable classes
  • ❌ DO NOT use @ObservedObject → ✅ Use @Bindable for bindings, or just pass the object
  • ❌ DO NOT use @EnvironmentObject → ✅ Use @Environment with custom key
  • ❌ DO NOT assume async functions always hop off the actor → ✅ In Swift 6.2, async functions run on the caller's actor by default
  • ❌ DO NOT use Task.detached to get background execution → ✅ Use @concurrent attribute on the function
  • ❌ DO NOT add @Sendable to everything to silence warnings → ✅ Use default MainActor isolation mode, opt out with nonisolated
  • ❌ DO NOT use DispatchQueue.main.async for main thread work → ✅ Use @MainActor or MainActor.run {}
  • ❌ DO NOT use DispatchQueue.global().async for background work → ✅ Use @concurrent functions with await
  • ❌ DO NOT create NavigationView → ✅ Use NavigationSplitView or NavigationStack

Decision Tree: Concurrency Model

Related skills

More from makgunay/claude-swift-skills

Installs
8
First Seen
Feb 14, 2026