swift
Skill28 starsChanged 5 months agoMITView on GitHub
Use when writing Swift for iOS, macOS, or server-side. Covers value semantics, optionals, protocol-oriented design, structured concurrency with async/await and actors, and SwiftUI state management.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- g-cqd/skillstheir own version, first seen Sep 4, 2026
- swift-institute/Skillstheir own version, first seen Aug 7, 2026
- margelo/react-native-skillstheir own version, first seen Jun 5, 2026
- harshii0509/swift-skill-packtheir own version, first seen Jun 1, 2026
- wendylabsinc/claude-skillstheir own version, first seen Jan 25, 2026
- Mindrally/skillstheir own version, first seen Jan 23, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- Mindrally/skills★ 266same name
- margelo/react-native-skills★ 173same name
- wendylabsinc/claude-skills★ 62same name
- g-cqd/skills★ 2same name
- rogue-dev-studio/ai-agents-rogue★ 2same name
- harshii0509/swift-skill-pack★ 0same name
- swift-institute/Skills★ 0same name
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 repository137 other files it gives its agents.
- agent-instructionsSkill
- agent-memorySkill
- hooksSkill
- plugin-developmentSkill
- skill-authoringSkill
- skill-reviewSkill
- slash-commandsSkill
- subagentsSkill
- agent-designSkill
- context-engineeringSkill
- fine-tuningSkill
- llm-cost-optimizationSkill
- llm-evaluationSkill
- llm-integrationSkill
- mcp-serverSkill
- ml-pipelineSkill
- model-selectionSkill
- prompt-engineeringSkill
- ragSkill
- structured-outputSkill
- api-designSkill
- background-jobsSkill
- cachingSkill
- djangoSkill
- event-driven-architectureSkill
- fastapiSkill
- graphqlSkill
- microservicesSkill
- nestjsSkill
- realtime-websocketsSkill
- spring-bootSkill
- competitive-analysisSkill
- lead-researchSkill
- product-analysisSkill
- resumeSkill
- user-researchSkill
- database-performanceSkill
- data-modelingSkill
- data-qualitySkill
- pandasSkill
- postgresSkill
- sparkSkill
- brand-guidelinesSkill
- generative-artSkill
- themingSkill
- ui-reviewSkill
- visual-designSkill
- architecture-decisionsSkill
- bug-fix-protocolSkill
- cli-developmentSkill
- code-reviewSkill
- debuggingSkill
- design-patternsSkill
- domain-modelingSkill
- git-workflowSkill
- legacy-modernizationSkill
- refactoringSkill
- repository-explorationSkill
- simple-designSkill
- system-designSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Write Swift that leans on value semantics and the concurrency model rather than fighting them: structs by default, actors for shared …
- Very specific: line 57
Prefer async let for a fixed set of concurrent calls.
“Common” is measured: kept by at least 6 in 10 of the 7 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
Purpose
Write Swift that leans on value semantics and the concurrency model rather than fighting them: structs by default, actors for shared mutable state, and no force-unwrapping.
When to Use
- Writing Swift for Apple platforms or server-side Swift.
- Migrating callback or Combine code to async/await.
- Resolving data-race warnings under strict concurrency checking.
- Designing SwiftUI state and view models.
- Diagnosing retain cycles and memory growth.
Capabilities
- Value vs reference semantics and copy-on-write.
- Optional handling:
guard let, optional chaining,Resulttypes. - Protocol-oriented design with associated types and generics.
- Structured concurrency:
async let, task groups, actors,Sendable. - SwiftUI:
@State,@Observable, and unidirectional data flow.
Inputs
- Source target, Swift version, minimum deployment target.
- Concurrency checking level (minimal, targeted, complete).
Outputs
- Code free of force-unwraps and implicit unwrapped optionals.
- Concurrency that compiles cleanly under strict checking.
- View models with a single source of truth.
Workflow
- Prefer structs — Reach for a class only when identity or shared mutation is required.
- Eliminate optionals early — Unwrap once at the boundary with
guard; the rest of the function works with non-optionals. - Isolate mutable state — Any shared mutable state becomes an actor or is confined to the main actor.
- Model async explicitly — Replace completion handlers with
asyncfunctions; use task groups for concurrency. - Gate — Build with strict concurrency checking and treat warnings as errors.
Best Practices
!is a crash waiting for a user to find it. The only acceptable uses are IBOutlets and genuinely proven invariants with a comment.- Capture lists (
[weak self]) on every escaping closure that capturesselfin a class. - Mark types
Sendabledeliberately; suppressing the warning with@unchecked Sendablerequires a documented reason. - SwiftUI views are cheap and disposable — put logic in the model, not the view body.
- Prefer
async letfor a fixed set of concurrent calls; useTaskGroupwhen the count is dynamic. - Long-running work never runs on the main actor.
Examples
Actor-isolated cache with concurrent loading:
actor ImageCache {
private var cache: [URL: UIImage] = [:]
private var inFlight: [URL: Task<UIImage, Error>] = [:]
func image(for url: URL) async throws -> UIImage {
if let cached = cache[url] { return cached }
if let existing = inFlight[url] { return try await existing.value }
let task = Task<UIImage, Error> {
let (data, _) = try await URLSession.shared.data(from: url)
guard let image = UIImage(data: data) else { throw CacheError.decodeFailed(url) }
return image
}
inFlight[url] = task
defer { inFlight[url] = nil }
let image = try await task.value
cache[url] = image
return image
}
}Notes
- The actor above deduplicates concurrent requests for the same URL — a common source of redundant network traffic in image-heavy screens.
- Strict concurrency checking is noisy on legacy code. Enable it target by target rather than repository-wide.
@Observable(iOS 17+) replacesObservableObjectand only invalidates views that actually read the changed property.
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.

