swift
Skill15 starsChanged 42 days agoMITView on GitHub
Expert Swift assistance covering Swift 6 strict concurrency, async/await, actors, protocols, generics, memory management with ARC, and SwiftUI integration. Use when writing iOS/macOS applications, debugging concurrency warnings, or building robust Swift codebases.
13 other projects use a version of this.
Adopted by
Most recently taken up by
- testdino-hq/google-styleguides-skillstheir own version, first seen Nov 8, 2026
- rogue-dev-studio/ai-agents-roguetheir own version, first seen Nov 1, 2026
- hmj1026/dhpktheir own version, first seen Nov 1, 2026
- joshuaramkissoon/claude-skillstheir own version, first seen Oct 25, 2026
- tiago-oliveira-ca/zenodotus-harnesstheir own version, first seen Oct 25, 2026
- g-cqd/skillstheir own version, first seen Oct 23, 2026
Other versions13 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 13
- Mindrally/skills★ 275same name
- margelo/react-native-skills★ 172same name
- wendylabsinc/claude-skills★ 62same name
- nimadorostkar/Claude-Skills-collection★ 33same name
- testdino-hq/google-styleguides-skills★ 15same name
- g-cqd/skills★ 2same name
- hmj1026/dhpk★ 2same name
- kimtth/agent-skill-100-lines-or-less★ 2same name
- rogue-dev-studio/ai-agents-rogue★ 2same name
- cocart-headless/cocart-skills★ 1same name
3 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository350 other files it gives its agents.
- airflowSkill
- catboostSkill
- claudeSkill
- comfyuiSkill
- cursor-aiSkill
- dalleSkill
- daskSkill
- dbtSkill
- deepseekSkill
- fastaiSkill
- geminiSkill
- github-copilotSkill
- huggingfaceSkill
- jaxSkill
- jupyterSkill
- kerasSkill
- langchainSkill
- lightgbmSkill
- llamaindexSkill
- llamaSkill
- matplotlibSkill
- midjourneySkill
- mistralSkill
- mlflowSkill
- nltkSkill
- numpySkill
- ollamaSkill
- openai-gptSkill
- opencvSkill
- pandasSkill
- perplexitySkill
- plotlySkill
- polarsSkill
- pytorchSkill
- raySkill
- scikit-learnSkill
- seabornSkill
- spacySkill
- sparkSkill
- stable-diffusionSkill
- tensorflowSkill
- vaexSkill
- weights-biasesSkill
- whisperSkill
- xgboostSkill
- api-gatewaySkill
- clean-architectureSkill
- cqrsSkill
- domain-driven-designSkill
- event-drivenSkill
- event-sourcingSkill
- graphqlSkill
- grpcSkill
- hexagonalSkill
- microservicesSkill
- modular-monolithSkill
- monolithSkill
- rest-apiSkill
- sagaSkill
- serverlessSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 188
Prefer struct and value types over class unless reference identity or Objective-C runtime bridging is explicitly required.
- Very specific: line 190
Use async/await and structured withTaskGroup rather than legacy completion handlers and Grand Central Dispatch (DispatchQueue).
“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Swift
Modern Swift development with protocol-oriented programming and async/await.
When to Use
- Apple Ecosystem Native Applications: iOS, iPadOS, macOS, watchOS, and visionOS applications using SwiftUI.
- Modern Concurrent Systems: Utilizing Swift 6 complete concurrency checking, actors, and structured
Tasktrees. - Cross-Platform Server-Side Swift: High-performance backends and microservices built with Hummingbird or Vapor.
- Embedded & Real-Time Edge Processing: Utilizing Embedded Swift for microcontrollers and real-time audio engines.
Quick Start
struct User: Identifiable, Codable {
let id: UUID
var name: String
var email: String
var displayName: String {
name.capitalized
}
}Core Concepts
Modern Swift 6 Concurrency: Actors & Structured Tasks
Data-race safety guaranteed at compile time with Sendable enforcement and actors:
import Foundation
// Thread-safe state isolation via actor
actor AccountManager {
private var balances: [UUID: Decimal] = [:]
func deposit(to accountId: UUID, amount: Decimal) {
guard amount > 0 else { return }
balances[accountId, default: 0] += amount
}
func balance(for accountId: UUID) -> Decimal {
balances[accountId, default: 0]
}
}
// Structured concurrency with TaskGroup
func fetchUserMetrics(userIds: [UUID]) async throws -> [UUID: Decimal] {
let manager = AccountManager()
return try await withThrowingTaskGroup(of: (UUID, Decimal).self) { group in
for id in userIds {
group.addTask {
let bal = await manager.balance(for: id)
return (id, bal)
}
}
var results: [UUID: Decimal] = [:]
for try await (id, bal) in group {
results[id] = bal
}
return results
}
}Protocol-Oriented Architecture & Primary Associated Types
Expressive type contracts using Swift 5.7+ some and any semantics:
// Protocol with primary associated type
protocol Repository<Entity>: Sendable {
associatedtype Entity: Identifiable, Sendable
func fetch(by id: Entity.ID) async throws -> Entity?
func save(_ entity: Entity) async throws
}
struct User: Identifiable, Sendable {
let id: UUID
let name: String
}
final class InMemoryUserRepository: Repository {
private var store: [UUID: User] = [:]
func fetch(by id: UUID) async throws -> User? {
store[id]
}
func save(_ entity: User) async throws {
store[entity.id] = entity
}
}
// Opaque return type using 'some' for static dispatch performance
func makeDefaultRepo() -> some Repository<User> {
InMemoryUserRepository()
}Result Builders & Custom DSLs
Constructing declarative hierarchies modeled after SwiftUI:
@resultBuilder
struct HTMLBuilder {
static func buildBlock(_ components: String...) -> String {
components.joined(separator: "
")
}
static func buildOptional(_ component: String?) -> String {
component ?? ""
}
}
func htmlDoc(@HTMLBuilder content: () -> String) -> String {
"<html>
<body>
\(content())
</body>
</html>"
}
let page = htmlDoc {
"<h1>Welcome to Swift 6</h1>"
"<p>Safe, fast, and expressive systems programming.</p>"
}Common Patterns
Modern Async/Await Network Request
Problem: Deeply nested completion handler callbacks and error propagation bugs in asynchronous code.
Solution:
func fetchUser(id: UUID) async throws -> User {
let url = URL(string: "https://api.example.com/users/\(id)")!
let (data, response) = try await URLSession.shared.data(from: url)
guard let httpResponse = response as? HTTPURLResponse,
httpResponse.statusCode == 200 else {
throw NetworkError.invalidResponse
}
return try JSONDecoder().decode(User.self, from: data)
}
// Parallel execution
async let user = fetchUser(id: userId)
async let orders = fetchOrders(userId: userId)
let (userResult, ordersResult) = try await (user, orders)Actors
Problem: Preventing concurrent data race bugs when mutating shared mutable state across asynchronous tasks.
Solution:
actor UserCache {
private var cache: [UUID: User] = [:]
func get(_ id: UUID) -> User? { cache[id] }
func set(_ user: User) { cache[user.id] = user }
}Best Practices
Do:
- Enable Swift 6 complete concurrency checking (
-strict-concurrency=complete) to catch data races at compile time. - Prefer
structand value types overclassunless reference identity or Objective-C runtime bridging is explicitly required. - Favor
some Protocol(opaque types) overany Protocol(existential types) to eliminate dynamic dispatch overhead. - Use
async/awaitand structuredwithTaskGrouprather than legacy completion handlers and Grand Central Dispatch (DispatchQueue).
Don't:
- Force unwrap optionals (
!) in production; useguard let,if let, or default coalescing (??). - Capture strong
selfreferences in escaping closures; use[weak self]to avoid retain cycles. - Bypass actor isolation with
@unchecked Sendablewithout verifying thread-safety invariants.
Troubleshooting
| Error | Cause | Solution |
unexpectedly found nil | Force unwrap of nil | Use optional binding |
Actor-isolated property | Accessing actor from sync context | Use await |
Sendable closure | Non-sendable type across concurrency | Make type Sendable |
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

