swift-development
Skill174 starsChanged 28 days agoApache-2.0View on GitHub
You MUST activate this skill when working on Swift projects
3 other projects use a version of this.
Adopted by
Most recently taken up by
- rshankras/claude-code-apple-skillstheir own version, first seen Nov 29, 2026
- ProjAnvil/MindForgetheir own version, first seen Nov 14, 2026
- hmohamed01/swift-developmenttheir own version, first seen Dec 26, 2025
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- rshankras/claude-code-apple-skills★ 915same name
- hmohamed01/swift-development★ 60same name
- ProjAnvil/MindForge★ 3same 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 repository74 other files it gives its agents.
- Rules/CLAUDE.mdCLAUDE.md
- Skills/ambitious-model-use/CLAUDE.mdCLAUDE.md
- Skills/authoring-claude-md/CLAUDE.mdCLAUDE.md
- Skills/bento-slides/CLAUDE.mdCLAUDE.md
- Skills/extract-wisdom/CLAUDE.mdCLAUDE.md
- Skills/ghostty-config/CLAUDE.mdCLAUDE.md
- Skills/llm-wiki/CLAUDE.mdCLAUDE.md
- Skills/llm-wiki/examples/CLAUDE.mdCLAUDE.md
- Skills/openspec-bootstrap/CLAUDE.mdCLAUDE.md
- Skills/openspeccer/CLAUDE.mdCLAUDE.md
- Skills/rewrite-slop/CLAUDE.mdCLAUDE.md
- Skills/skill-creator-primer/CLAUDE.mdCLAUDE.md
- Skills/tla-plus/CLAUDE.mdCLAUDE.md
- Skills/yue2-music/CLAUDE.mdCLAUDE.md
- ai-changelogSkill
- ambitious-model-useSkill
- analyse-designSkill
- apply-mantel-stylesSkill
- authoring-claude-mdSkill
- backlogSkill
- bento-slidesSkill
- code-reviewSkill
- code-simplificationSkill
- creating-development-plansSkill
- critical-thinking-logical-reasoningSkill
- deeperSkill
- deferred-task-executionSkill
- demo-recorderSkill
- excalidraw-diagramsSkill
- explainSkill
- extract-wisdomSkill
- find-docsSkill
- ghostty-configSkill
- githubSkill
- golang-developmentSkill
- graphifySkill
- grill-meSkill
- guided-demoSkill
- handoffSkill
- hardware-designSkill
- herdrSkill
- home-assistantSkill
- html-design-examplesSkill
- improve-codebase-architectureSkill
- json-schema-lookupSkill
- liteparseSkill
- llm-prompting-guideSkill
- ml-llm-wikiSkill
- llm-wikiSkill
- mermaid-diagramsSkill
- openspec-bootstrapSkill
- openspeccerSkill
- pptx-to-mdSkill
- private-software-distributionSkill
- prompt-enhancerSkill
- prototypeSkill
- prototyping-logos-iconsSkill
- python-developmentSkill
- raspberry-pi-pico2Skill
- release-debriefSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. 0 are common, 14 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
14
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use this skill when:
- Distinctive: line 29
Write documentation for every public declaration: - if you can't describe functionality simply, the API may be poorly designed
- Distinctive: line 31
Favour elegance through simplicity: - avoid over-engineering unless complexity genuinely warrants it
- Distinctive: line 101
Don't create stateless actors: - use non-isolated async functions instead
- Distinctive: line 102
Avoid split isolation: - don't mix isolation domains within one type
- Very specific: line 144
No side effects: Noun phrases (x.distance(to: y))
- Distinctive: line 175
Import visibility requires explicit access control
- Very specific: line 213
Use appropriate isolation (@MainActor for UI, actors for mutable state)
- Distinctive: line 215
Follow Swift 6 concurrency model - trust compiler's flow analysis
- Distinctive: line 216
Document public APIs with clear, concise summaries
- Distinctive: line 220
Check for concurrency safety violations
- Distinctive: line 221
Verify proper actor isolation and Sendable conformance
- Distinctive: line 222
Ensure async functions handle cancellation appropriately
- Distinctive: line 229
Avoid over-engineering and unnecessary abstractions
- Distinctive: line 230
Use meaningful variable names based on role, not type
- Distinctive: line 231
Follow established project architecture and patterns
- Very specific: line 232
Prefer count(where:) over filter().count
- Very specific: line 233
Use InlineArray for fixed-size, performance-critical data
- Very specific: line 255
Use #available for runtime platform detection
- Very specific: line 256
Use @available for API availability marking
“Common” is measured: kept by at least 6 in 10 of the 3 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 Best Practices Skill
Overview
Apply modern Swift development best practices focusing on Swift 6+ features, concurrency safety, API design principles, and code quality guidelines for iOS and macOS projects targeting macOS 15.7+.
When to Use This Skill
Use this skill when:
- Writing new Swift code for iOS or macOS applications
- Reviewing Swift code for correctness, safety, and style
- Implementing Swift concurrency features (async/await, actors, MainActor)
- Designing Swift APIs and public interfaces
- Migrating code from Swift 5 to Swift 6
- Addressing concurrency warnings, data race issues, or compiler errors related to Sendable/isolation
- Working with modern Swift language features introduced in Swift 6 and 6.2
Core Guidelines
Fundamental Principles
- Clarity at point of use is paramount - evaluate designs by examining use cases, not just declarations
- Clarity over brevity - compact code comes from the type system, not minimal characters
- Write documentation for every public declaration - if you can't describe functionality simply, the API may be poorly designed
- Name by role, not type -
var greeting = "Hello"notvar string = "Hello" - Favour elegance through simplicity - avoid over-engineering unless complexity genuinely warrants it
Swift 6 Concurrency Model
Swift 6 enables complete concurrency checking by default with region-based isolation (SE-0414). The compiler now proves code safety, eliminating many false positives whilst catching real concurrency issues at compile time.
Critical understanding:
- Async ≠ background - async functions can suspend but don't automatically run on background threads
- Actors protect mutable shared state through automatic synchronisation
@MainActorensures UI-related code executes on the main thread- Global actor-isolated types are automatically
Sendable
Essential Patterns
Async/Await
// Parallel execution with async let
func fetchData() async -> (String, Int) {
async let stringData = fetchString()
async let intData = fetchInt()
return await (stringData, intData)
}
// Always check cancellation in long-running operations
func process(_ items: [Item]) async throws -> [Result] {
var results: [Result] = []
for item in items {
try Task.checkCancellation()
results.append(await process(item))
}
return results
}MainActor for UI Code
// Apply at type level for consistent isolation
@MainActor
class ContentViewModel: ObservableObject {
@Published var images: [UIImage] = []
func fetchData() async throws {
self.images = try await fetchImages()
}
}
// Avoid MainActor.run when direct await works
await doMainActorStuff() // Good
await MainActor.run { doMainActorStuff() } // UnnecessaryActor Isolation
actor DataCache {
private var cache: [String: Data] = [:]
func store(_ data: Data, forKey key: String) {
cache[key] = data // No await needed inside actor
}
nonisolated func cacheType() -> String {
return "DataCache" // No await needed - doesn't access isolated state
}
}Common Pitfalls to Avoid
- Don't mark functions as
asyncunnecessarily - async calling convention has overhead - Never use
DispatchSemaphorewith async/await - risk of deadlock - Don't create stateless actors - use non-isolated async functions instead
- Avoid split isolation - don't mix isolation domains within one type
- Check task cancellation - long operations must check
Task.checkCancellation() - Don't assume async means background - explicitly move work to background if needed
- Avoid excessive context switching - group operations within same isolation domain
AppKit Gotchas
Menu-bar app windows open behind everything / hide on click-away. Two separate causes, usually hit together:
.accessoryactivation policy means the app is never brought forward when a window opens.- SwiftUI's
Settingsscene is anNSPanel, which in an accessory app defaults tohidesOnDeactivate = true.
Fix both: switch to .regular while the window is open, clear hidesOnDeactivate, then revert on NSWindow.willCloseNotification.
NSApp.setActivationPolicy(.regular)
NSApp.activate()
openSettings()
DispatchQueue.main.async { // window does not exist until SwiftUI opens it
guard let w = NSApp.windows.first(where: {
$0.identifier?.rawValue.hasPrefix("com_apple_SwiftUI_Settings") == true }) else { return }
w.hidesOnDeactivate = false
w.makeKeyAndOrderFront(nil)
w.orderFrontRegardless()
}
// On willCloseNotification: NSApp.setActivationPolicy(.accessory)Cost: a Dock icon while the window is open. SettingsLink cannot do this - it has no action hook, so use @Environment(\.openSettings).
JSONEncoder.dateEncodingStrategy = .iso8601 truncates to whole seconds. Silently breaks any sub-second timing logic. Use .custom with ISO8601DateFormatter + .withFractionalSeconds.
API Design Quick Reference
Naming Conventions
- Types/protocols:
UpperCamelCase - Everything else:
lowerCamelCase - Protocols describing capabilities:
-able,-ible,-ingsuffixes (Equatable,ProgressReporting) - Factory methods: Begin with
make(x.makeIterator()) - Mutating pairs: imperative vs past participle (
x.sort()/x.sorted())
Method Naming by Side Effects
- No side effects: Noun phrases (
x.distance(to: y)) - With side effects: Imperative verbs (
x.append(y),x.sort())
Argument Labels
- Omit when arguments can't be distinguished:
min(number1, number2) - Value-preserving conversions omit first label:
Int64(someUInt32) - Prepositional phrases label at preposition:
x.removeBoxes(havingLength: 12) - Label all other arguments
Swift 6 Breaking Changes
Must Explicitly Mark Types with @MainActor (SE-0401)
Property wrappers no longer infer actor isolation automatically.
@MainActor
struct LogInView: View {
@StateObject private var model = ViewModel()
}Global Variables Must Be Concurrency-Safe (SE-0412)
static let config = Config() // Constant - OK
@MainActor static var state = State() // Actor-isolated - OK
nonisolated(unsafe) var cache = [String: Data]() // Unsafe - use with cautionOther Changes
@UIApplicationMain/@NSApplicationMaindeprecated (use@main)anyrequired for existential types- Import visibility requires explicit access control
API Availability Patterns
// Basic availability
@available(macOS 15, iOS 18, *)
func modernAPI() { }
// Deprecation with message
@available(*, deprecated, message: "Use newMethod() instead")
func oldMethod() { }
// Renaming with auto-fix
@available(*, unavailable, renamed: "newMethod")
func oldMethod() { }
// Runtime checking
if #available(iOS 18, *) {
// iOS 18+ code
}
// Inverted checking (Swift 5.6+)
if #unavailable(iOS 18, *) {
// iOS 17 and lower
}Key differences:
deprecated- Warning, allows usageobsoleted- Error from specific versionunavailable- Error, completely prevents usage
How to Use This Skill
When Writing Code
- Apply naming conventions following role-based, clarity-first principles
- Use appropriate isolation (
@MainActorfor UI, actors for mutable state) - Implement async/await patterns correctly with proper cancellation handling
- Follow Swift 6 concurrency model - trust compiler's flow analysis
- Document public APIs with clear, concise summaries
When Reviewing Code
- Check for concurrency safety violations
- Verify proper actor isolation and Sendable conformance
- Ensure async functions handle cancellation appropriately
- Validate API naming follows Swift guidelines
- Confirm availability annotations are correct for target platforms
Code Quality Standards
- Minimise comments - code should be self-documenting where possible
- Avoid over-engineering and unnecessary abstractions
- Use meaningful variable names based on role, not type
- Follow established project architecture and patterns
- Prefer
count(where:)overfilter().count - Use
InlineArrayfor fixed-size, performance-critical data - Trust compiler's concurrency flow analysis - avoid unnecessary
Sendableconformances
Resources
references/
Detailed reference material to load when in-depth information is needed:
- api-design.md - Complete API design conventions, documentation standards, parameter guidelines, and naming patterns
- concurrency.md - Detailed async/await patterns, actor best practices, common pitfalls, performance considerations, and thread safety patterns
- swift6-features.md - New language features in Swift 6/6.2, breaking changes, migration strategies, and modern patterns
- availability-patterns.md - Comprehensive
@availableattribute usage, deprecation strategies, and platform version management
Load these references when detailed information is needed beyond the core guidelines provided above.
Platform Requirements
- Swift 6.0+ compiler for Swift 6 features
- Swift 6.2+ for InlineArray and enhanced concurrency features
- macOS 15.7+ with appropriate SDK
- iOS 18+ for latest platform features
- Use
#availablefor runtime platform detection - Use
@availablefor API availability marking
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.

