Community-maintained Agent Skills for complete Swift and Apple-platform app delivery.
73
92%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Medium
Suggest reviewing before use
Adapted and rewritten for this collection; see ../NOTICE.md.
Review the dependency graph and lifetime, not just the presence of async.
Swift actors are reentrant at suspension points, and a task's ownership is part
of its correctness.
Use async let only after confirming that operations do not depend on one
another and that partial failure semantics are acceptable:
async let profileTask = fetchProfile()
async let flagsTask = fetchFeatureFlags()
let profile = try await profileTask
let flags = try await flagsTask
let result = ScreenData(profile: profile, flags: flags)Sequential awaits are correct when the second request needs the first result, or when ordering/rate limits are part of the contract. Use a task group when the number of child tasks is dynamic; check whether unbounded fan-out needs a limit.
An unstructured task should have an explicit owner, cancellation path, and error
policy. A stored task commonly gets cancelled before replacement and in
deinit; a SwiftUI view-owned operation usually belongs in .task(id:) so the
framework controls its lifetime. Task {} in onAppear is not automatically
wrong, but it is easy to leak or duplicate without a stored handle.
private var refreshTask: Task<Void, Never>?
func refresh() {
refreshTask?.cancel()
refreshTask = Task { [loader] in
do {
try Task.checkCancellation()
let value = try await loader.load()
try Task.checkCancellation()
await apply(value)
} catch is CancellationError {
// Expected when a newer refresh replaces this one.
} catch {
await record(error)
}
}
}
deinit { refreshTask?.cancel() }Do not require [weak self] by rote. If self owns the task, a strong capture
can keep the owner alive until the task finishes; that may be a leak for an
infinite sequence or the intended lifetime for a finite operation. Verify the
actual cycle and cancellation path. Likewise, a fire-and-forget task may
intentionally collapse errors, but the code should make that policy observable.
Long CPU loops and custom async sequences should check cancellation. An awaited API may already do so; inspect its contract before reporting a missing check.
Every await inside an actor can allow another actor-isolated call to run before
the function resumes. Do not claim that “mutate before await” is always correct:
reserve state before suspension only when the operation has a rollback/failure
policy, or re-check the invariant after the await.
actor Inventory {
private var available = 1
func reserve() async throws {
guard available > 0 else { throw StockError.empty }
available -= 1 // reserve the invariant
do {
try await persistReservation()
} catch {
available += 1 // compensate failed persistence
throw error
}
}
}Inspect all actor state read before an await and used after it, including cache entries, authentication state, counters, and “check then mutate” sequences.
SendableValues crossing actor/task boundaries must be safe to share. Prefer immutable
value types that conform to Sendable, actor isolation, or a reference type with
auditable synchronization. @unchecked Sendable is a promise to the compiler;
flag it when the code does not show a lock, serial executor, immutable storage,
or another complete synchronization argument.
struct Session: Sendable {
let token: String
}A stateless actor is not automatically a bug. It may intentionally provide an isolation boundary, but if it only adds needless actor hops, a value type or free function can be considered as a measured cleanup. Do not report this as a correctness issue without an observable cost or a violated isolation contract.
await?@unchecked Sendable backed by complete synchronization?.tessl-plugin
skills
accessorysetupkit
references
activitykit
adattributionkit
references
alarmkit
references
app-clips
app-intents
app-store-optimization
app-store-review
apple-on-device-ai
appmigrationkit
audioaccessorykit
references
authentication
references
avkit
background-processing
references
browserenginekit
callkit
references
carplay
cloudkit
contacts-framework
references
core-bluetooth
references
core-data
core-motion
references
core-nfc
references
coreml
references
cryptokit
cryptotokenkit
references
debugging-instruments
device-integrity
references
dockkit
energykit
references
eventkit
financekit
references
focus-engine
gamekit
healthkit
references
homekit
references
ios-accessibility
ios-app-workflow
references
ios-ettrace-performance
ios-localization
ios-memgraph-analysis
ios-networking
ios-simulator
references
metrickit
references
musickit
references
natural-language
references
paperkit
references
passkit
references
pdfkit
pencilkit
references
permissionkit
references
photokit
push-notifications
realitykit
references
relevancekit
references
scenekit
sensorkit
speech-recognition
references
spritekit
storekit
swift-api-design-guidelines
swift-architecture
references
swift-charts
swift-codable
references
swift-code-review
swift-concurrency
swift-formatstyle
references
swift-language
swift-security
references
swift-testing
swiftdata
swiftlint
swiftui-animation
swiftui-gestures
references
swiftui-layout-components
swiftui-liquid-glass
references
swiftui-patterns
swiftui-performance
swiftui-responsive-layout
swiftui-uikit-interop
swiftui-webkit
tabletopkit
tipkit
vision-framework
weatherkit
references