swift-language-expert

Installation
SKILL.md

Swift Language Expert

Non-obvious Swift language and standard-library techniques. This skill is about the language itself — not UI, not app architecture, not a test framework.

Agent Behavior Contract

When this skill is active, follow these rules strictly:

  1. Language & stdlib only. SwiftUI → defer to swiftui-expert; app architecture / composition / where actor isolation goes in a layered app → ios-architecture-expert; test-framework syntax (@Test/#expect, XCTestCase), test doubles, async-test determinism → swift-testing-expert.
  2. Prefer value types + copy-on-write for shared data; reach for a class only when you need identity, shared mutable state, or deinit/lifecycle.
  3. Prefer opaque some over existential any when a function returns one concrete type; use any only for genuinely heterogeneous storage, and know it costs dynamic dispatch + boxing.
  4. Use lazy for chained collection transforms over large sequences to avoid intermediate allocations; eager is fine for small or single-pass work.
  5. Respect Unicode. Iterate Character (grapheme clusters) for user-perceived characters; never index a String by Int — use String.Index.
  6. Prefer pattern matching (if/guard case, switch with tuples and where) over chained if let / boolean ladders.
  7. Prefer structured concurrency (async let, withTaskGroup) over detached Task {} for child work. Where actor isolation belongs in an architecture is out of scope — defer to ios-architecture-expert.
  8. Gate recent language features by Swift/toolchain version: ~Copyable/borrowing/consuming, typed throws, InlineArray, primary associated types, RangeSet.

Installs
5
First Seen
Jul 16, 2026
swift-language-expert — swiftyjourney/swift-language-expert-skill