swift
Installation
SKILL.md
Swift Best Practices
Production guide for modern Swift on iOS and macOS. Rules are prioritized by impact to guide code generation, review, and refactoring. Toolchain baseline: Swift 6.2+ language mode with Approachable Concurrency (current release: Swift 6.4, Xcode 27).
When to Apply
Use these guidelines when:
- Writing new Swift code, SwiftUI views, or Swift packages
- Reviewing or refactoring Swift for correctness, safety, or structure
- Fixing Swift 6 concurrency diagnostics (
Sendable, actor isolation, data races) - Designing app architecture, module boundaries, or repository layout
- Integrating REST/OpenAPI backends, persistence, push notifications, webhooks, or WebSockets
- Explaining Swift to a developer coming from TypeScript, JavaScript, or Python
Core Principle
Swift is a progressive-disclosure language. Start with the simplest, most static, single-threaded thing that works, and add dynamism (concurrency, reference semantics, existentials, unsafe code) only where you can name the reason.