swift-guide

Installation
SKILL.md

Swift Guide

Applies to: Swift 5.9+, iOS/macOS/Server-Side, SPM, Concurrency

Core Principles

  1. Value Semantics First: Prefer structs over classes; use classes only when identity or inheritance is required
  2. Protocol-Oriented Design: Compose behavior through protocols and extensions rather than class hierarchies
  3. Safe Optionals: Unwrap explicitly with guard let or if let; force-unwrap (!) is forbidden outside tests
  4. Structured Concurrency: Use async/await and task groups; avoid raw GCD queues for new code
  5. Compiler as Ally: Enable strict concurrency checking; treat warnings as errors in CI

Guardrails

Version & Dependencies

  • Use Swift 5.9+ with Swift Package Manager (Package.swift)
  • Pin package versions with .upToNextMinor(from:) for libraries
  • Run swift package resolve before committing after dependency changes
Related skills
Installs
8
Repository
ar4mirez/samuel
First Seen
Mar 1, 2026