swift-language-expert-skill
SwiftyJourney/swift-language-expert-skill
Non-obvious Swift language & standard-library techniques: value semantics, generics, collections, strings, concurrency - Agent Skill
Instalação
npx convez-ai SwiftyJourney/swift-language-expert-skill1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
README
A tradução para o português deste README ainda está na fila.
Swift Language Expert Agent Skill
A Claude Code skill for non-obvious Swift language and standard-library techniques — the features that make code clearer, safer, or faster but that developers routinely miss. This skill is about the language itself, not SwiftUI, app architecture, or a test framework.
Who is this for?
Swift developers who want idiomatic, modern answers to "how do I do X in Swift":
- Pattern matching and control flow (
if/guard case,switchover tuples and ranges, optional patterns) - Functions, closures, and key paths (variadics, autoclosures,
rethrows, key-path expressions) - Value semantics and custom types (copy-on-write,
~Copyable,callAsFunction,Comparable, recursive enums, property wrappers) - Protocols and generics (associated types,
Self, opaquesomevs existentialany, phantom types) - Collection algorithms (lazy sequences,
RangeSet,ContiguousArray/InlineArray, sorting) - Strings and Unicode (grapheme-correct iteration,
String.Index, raw strings, custom interpolation) - Language-level concurrency and error handling (async/await, task groups,
AsyncSequence/AsyncStream, typedthrows) - Debugging and code organization (assertions,
dump, enum namespaces, compiler directives)
Installation
Install via skills.sh:
npx skills add SwiftyJourney/swift-language-expert-skill
Compatible Agents
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Any agent supporting the
skills/convention
What the Skill Covers
| Area | Topics |
|---|---|
| Control flow & functions | Pattern matching (if/guard case, tuple switch); variadics, autoclosures, rethrows; key paths as values and functions |
| Types | Value semantics, copy-on-write, ~Copyable, callAsFunction, Comparable/literal conformances, recursive enums, property strategies |
| Generics | Associated and primary associated types, some vs any, phantom types, constraints, the default-implementation dispatch trap |
| Data | Lazy sequences, RangeSet/DiscontiguousSlice, ContiguousArray/InlineArray, sorting; strings, String.Index, and Unicode |
| Concurrency & errors | async let, task groups, AsyncSequence/AsyncStream, continuations, typed throws, cooperative cancellation |
| Tooling | Assertions vs preconditions, dump, os.Logger, type subscripts, enum namespaces, compiler directives |
Skill File Structure
SKILL.md # Hub: behavior contract, diagnostic table, reference router
references/
├── pattern-matching-and-control-flow.md # if/guard case, switch over tuples/ranges, optional patterns
├── functions-closures-keypaths.md # variadics, autoclosures, rethrows, overloading, key paths
├── custom-types.md # value semantics, copy-on-write, ~Copyable, callAsFunction, conformances
├── protocols-and-generics.md # associated types, Self, some vs any, phantom types, constraints
├── collections.md # lazy, RangeSet/DiscontiguousSlice, ContiguousArray/InlineArray, sorting
├── strings.md # String.Index, Unicode/graphemes, raw strings, custom interpolation
├── concurrency-and-errors.md # async/await, task groups, AsyncSequence/AsyncStream, typed throws
└── debugging-and-organization.md # assertions, dump, type subscripts, enum namespaces, directives
Related Skills
- SwiftUI Expert — SwiftUI view code: state, composition, performance, animations, accessibility
- iOS Architecture Expert — Clean modular architecture: composition root, protocol boundaries, generic presenters, Swift 6 concurrency
- Requirements Engineering — Turn vague requirements into testable specs: BDD, use cases, contracts, diagrams
- SwiftUI ⇄ UIKit Interop — Bridge SwiftUI and UIKit: hosting controllers, representables, data across the boundary
Credits
- Natalia Panferova (Nil Coalescing) — "Swift Gems", which informed the language and standard-library techniques distilled here
- Apple — The Swift Programming Language, Swift Evolution, and standard-library documentation
License
MIT — see LICENSE.