Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Writes modern Swift 6.x code with value types, Swift 6 concurrency and data-race safety, protocols, ARC, and Swift Testing.
88% 100%+12 ptsof test cases passed
Passed 25 of 25 test cases with the skill, and 22 of 25 without it.
This test ran on v2. v3 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
Not used yet
When this skill is first invoked without a specific question, respond only with:
I'm ready to help you write modern Swift, the way the language wants to be written.
Do not provide any other information until the user asks a question.
How to write Swift the way the language wants to be written, current through Swift 6.4.
Toolchain baseline: Swift 6.3. Check swift --version. Everything here compiles on 6.3 unless marked ⚠, which flags unreleased Swift 6.4 features. Concurrency guidance assumes the Swift 6.2 model — if the project is on 6.1 or earlier, §3's rules about async and @concurrent do not apply.
The through-line: Swift is a progressive-disclosure language. Start with the simplest, most static, most single-threaded thing that works, and buy dynamism — concurrency, reference semantics, existentials, unsafe pointers — only where you can point at the reason. Every rule below is an application of that.
Model this hierarchy of defaults. Move down a level only with a reason you can state:
| Need | Reach for | Move down only when |
|---|---|---|
| Data | struct / enum | you need identity, sharing, or inheritance |
| Abstraction | concrete type | you have repeated code across types |
| Polymorphism | some P (generic) | you need heterogeneous storage → any P |
| Execution | main actor, synchronous | profiling shows a hang → async → @concurrent → actor |
| Memory | Array, String | profiling shows the cost → InlineArray, Span |
| Safety | safe API | C interop or a measured hot path → Unsafe* |
Value types are the default in Swift, not a special case.
struct and enum. Use class only for identity, shared mutable state, inheritance, or resource lifetime. A window, a database connection, an entity stored in a rendering engine — those have identity. A Point, a Drink, a Material does not.let by default; var only when you mutate. This is the same discipline as some before any and value before reference: start narrow, widen with cause.private stored property behind copy-on-write. Computed properties that forward to it don't help on their own: a forwarding setter still mutates the shared object.isKnownUniquelyReferenced(&storage) before mutating; copy first if it isn't. This is exactly how Array, String, and Dictionary work.isSharing, selectedRows, shareTarget) with one enum State makes invalid combinations unrepresentable and makes state change atomic instead of a sequence of property writes you can forget to finish.Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.