swift-development
Skill3 starsChanged 23 days agoMITView on GitHub
Provides core Swift 6+ language development capabilities, covering concurrency, macros, model design, and business logic. Use this skill when writing ViewModel, Service, or Repository layer code, defining data models, implementing algorithms, writing unit tests, or fixing concurrency warnings and data races.
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 12 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Follow this guide when working on non-UI Swift code, business logic, algorithms, or the data layer.
- Distinctive: line 14
Concurrent Programming: Write safe concurrent code using Actors, async/await, Task, and TaskGroup.
- Distinctive: line 16
Testing: Write modern unit tests using the Swift Testing framework.
- Distinctive: line 17
Data Processing: Write Codable models and encapsulate JSON parsing and network requests.
- Distinctive: line 18
Macros: Use or create macros to reduce boilerplate.
- Distinctive: line 23
When writing ViewModel, Service, or Repository layer code.
- Distinctive: line 24
When defining data models (structs, enums).
- Distinctive: line 25
When implementing algorithms or utility functions.
- Distinctive: line 26
When writing unit tests.
- Distinctive: line 27
When fixing concurrency warnings or data races.
- Distinctive: line 74
Avoid Global Mutable State: Avoid global variables unless protected by an Actor.
- Very specific: line 76
Use
letovervar: Default to constants; use variables only when necessary. - Very specific: line 77
Error Handling: Prefer throws and do-catch over returning Optional or Result types (throws is more natural in async contexts).
- Distinctive: line 81
Always pay attention to "Strict Concurrency Checking" compiler warnings.
- Very specific: line 82
When handling closures across Actor boundaries, be mindful of [weak self] or [unowned self] (though usually not needed in Task unless …
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Swift 6 Development Skill
Instructions
Follow this guide when working on non-UI Swift code, business logic, algorithms, or the data layer. Your goal is to write high-performance, thread-safe, and expressive Swift code.
What This Skill Does
- Concurrent Programming: Write safe concurrent code using Actors, async/await, Task, and TaskGroup.
- Type Safety: Define Sendable types and use Typed Throws for precise error handling.
- Testing: Write modern unit tests using the Swift Testing framework.
- Data Processing: Write Codable models and encapsulate JSON parsing and network requests.
- Macros: Use or create macros to reduce boilerplate.
When to Use This Skill
Trigger scenarios:
- When writing ViewModel, Service, or Repository layer code.
- When defining data models (structs, enums).
- When implementing algorithms or utility functions.
- When writing unit tests.
- When fixing concurrency warnings or data races.
Examples
Example 1: Defining a Safe Actor Service
/// A thread-safe user data service
actor UserService {
private var cache: [String: User] = [:]
// Use typed throws to specify the error type explicitly
func fetchUser(id: String) async throws(NetworkError) -> User {
if let cached = cache[id] {
return cached
}
// Simulate network request
let user = try await NetworkClient.shared.get("/users/\(id)", as: User.self)
cache[id] = user
return user
}
}Example 2: Testing with Swift Testing
import Testing
@testable import MyApp
@Test("User parsing should succeed")
func userParsing() async throws {
let json = """
{ "id": "1", "name": "Alice" }
""".data(using: .utf8)!
let user = try JSONDecoder().decode(User.self, from: json)
#expect(user.name == "Alice")
#expect(user.id == "1")
}Best Practices
- Conform to Sendable: Any type passed between concurrency domains must conform to the
Sendableprotocol. - Avoid Global Mutable State: Avoid global variables unless protected by an Actor.
- Implicitly Unwrapped Optionals: Strictly forbidden (the force unwrap operator), except where unavoidable in initializers (very rare).
- Use
letovervar: Default to constants; use variables only when necessary. - Error Handling: Prefer
throwsanddo-catchover returningOptionalorResulttypes (throws is more natural in async contexts).
Notes
- Always pay attention to "Strict Concurrency Checking" compiler warnings.
- When handling closures across Actor boundaries, be mindful of
[weak self]or[unowned self](though usually not needed inTaskunless breaking a reference cycle).
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- sammcj/agentic-coding★ 164same name
- hmohamed01/swift-development★ 60same 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 repository37 other files it gives its agents.
- api-designSkill
- database-designSkill
- design-patternSkill
- enterprise-javaSkill
- frontend-reactSkill
- frontend-svelteSkill
- frontend-vueSkill
- git-guruSkill
- go-developmentSkill
- javascript-typescriptSkill
- product-managementSkill
- python-developmentSkill
- session-summarySkill
- swiftui-developmentSkill
- system-architectureSkill
- tech-documentationSkill
- testingSkill
- xcode-managementSkill
- api-designSkill
- database-designSkill
- design-patternSkill
- enterprise-javaSkill
- frontend-reactSkill
- frontend-svelteSkill
- frontend-vueSkill
- git-guruSkill
- go-developmentSkill
- javascript-typescriptSkill
- product-managementSkill
- python-developmentSkill
- session-summarySkill
- swift-developmentSkill
- swiftui-developmentSkill
- system-architectureSkill
- tech-documentationSkill
- testingSkill
- xcode-managementSkill
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.

