From modern-swift
Swift language features beyond concurrency: attributes (@available, @discardableResult, @frozen, @inlinable, @usableFromInline, @backDeployed, @resultBuilder, @propertyWrapper) and macro usage (#Preview, custom macros). Use when the user asks about API availability checks, library evolution, deprecating or renaming APIs, back-deploying functions to older OSes, result builders / DSLs, property wrappers, or Swift macros. Do NOT use this skill for concurrency topics (async/await, actors, Sendable, @MainActor, @Observable) - those belong to swift-concurrency.
How this skill is triggered — by the user, by Claude, or both
Slash command
/modern-swift:modern-swiftThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Focused reference for Swift language features that are commonly misused or
Focused reference for Swift language features that are commonly misused or
forgotten but are not concurrency-related. Concurrency lives in the
swift-concurrency skill; this skill deliberately does not duplicate it.
| Topic | File | Load when |
|---|---|---|
@available, #available, deprecation, renames | references/attributes.md#availability | Marking API availability, deprecating, renaming, or gating runtime behavior on OS version |
@discardableResult | references/attributes.md#discardableresult | Function returns a value callers may reasonably ignore |
@frozen | references/attributes.md#frozen | Library author deciding whether an enum/struct layout is stable |
@inlinable, @usableFromInline | references/attributes.md#inlinable | Performance-critical code in a resilient library |
@backDeployed | references/attributes.md#backdeployed | Shipping a new API to clients running older OSes |
@resultBuilder | references/attributes.md#resultbuilder | Building a DSL (SwiftUI-style) |
@propertyWrapper | references/attributes.md#propertywrapper | Encapsulating get/set behavior on stored properties |
#Preview | references/macros.md#preview | Writing SwiftUI previews |
| Custom macros | references/macros.md#custom-macros | Understanding or authoring Swift macros |
async, await, actor, @MainActor, Sendable,
@Observable, @preconcurrency) belong to swift-concurrency. Do not
answer them from this skill - defer.@frozen, @inlinable, @backDeployed are relevant only to
resilient libraries (frameworks distributed as binaries with ABI
stability). App targets rarely need them. If the user is writing an app,
say so and suggest the simpler alternative.@backDeployed has real rules beyond "copy the body": public or
@usableFromInline, body must follow @inlinable restrictions, methods
on classes must be final, stored properties are excluded. See
references/attributes.md#backdeployed.@frozen in an app target. It's a library-evolution feature
and has no effect outside resilient libraries. Remove it.@backDeployed on a stored property. Not supported. Only computed
properties (no storage), functions, final methods, and subscripts.@inlinable body referencing an internal symbol. The body is
emitted into client binaries, so it can only reference public or
@usableFromInline symbols.@discardableResult on a fluent API. Causes "result
unused" warnings for legitimate call sites. Mark the method, don't tell
the caller to add _ =.didSet clamping loop. Swift prevents the
recursion, but it's still clearer to clamp in the setter of a computed
wrappedValue backed by a private stored value. See the canonical
pattern in references/attributes.md#propertywrapper.Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub pszypowicz/claude-skills --plugin modern-swift