skills/swift-expert/SKILL.md
Expert in the Swift ecosystem, specializing in iOS/macOS/visionOS development, Swift 6 concurrency, and deep system integration.
npx skillsauth add szoloth/skills swift-expertInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Provides Apple ecosystem development expertise specializing in native iOS/macOS/visionOS applications using Swift 6, SwiftUI, and modern concurrency patterns. Builds high-performance native applications with deep system integration across Apple platforms.
Scenario: Rewriting a legacy UIKit app in modern SwiftUI.
Implementation:
Results:
Scenario: Converting callback-based code to async/await.
Implementation:
Results:
Scenario: Optimizing a slow startup time and janky scrolling.
Implementation:
Results:
Do NOT invoke when:
mobile-app-developerbash or python-progame-developer (though Metal/SceneKit is in scope)Goal: Manage a thread-safe cache without locks.
Steps:
Define Actor
actor ImageCache {
private var cache: [URL: UIImage] = [:]
func image(for url: URL) -> UIImage? {
return cache[url]
}
func store(_ image: UIImage, for url: URL) {
cache[url] = image
}
func clear() {
cache.removeAll()
}
}
Usage (Async context)
class ImageLoader {
private let cache = ImageCache()
func load(url: URL) async throws -> UIImage {
if let cached = await cache.image(for: url) {
return cached
}
let (data, _) = try await URLSession.shared.data(from: url)
guard let image = UIImage(data: data) else {
throw URLError(.badServerResponse)
}
await cache.store(image, for: url)
return image
}
}
Use case: Injecting services into the SwiftUI hierarchy.
// 1. Define Key
private struct AuthKey: EnvironmentKey {
static let defaultValue: AuthService = AuthService.mock
}
// 2. Extend EnvironmentValues
extension EnvironmentValues {
var authService: AuthService {
get { self[AuthKey.self] }
set { self[AuthKey.self] = newValue }
}
}
// 3. Use
struct LoginView: View {
@Environment(\.authService) var auth
func login() {
Task { await auth.login() }
}
}
Use case: Decoupling navigation logic from Views.
@Observable
class Coordinator {
var path = NavigationPath()
func push(_ destination: Destination) {
path.append(destination)
}
func pop() {
path.removeLast()
}
func popToRoot() {
path.removeLast(path.count)
}
}
enum Destination: Hashable {
case detail(Int)
case settings
}
Use case: Creating a custom DSL for configuring API requests.
@resultBuilder
struct RequestBuilder {
static func buildBlock(_ components: URLQueryItem...) -> [URLQueryItem] {
return components
}
}
func makeRequest(@RequestBuilder _ builder: () -> [URLQueryItem]) {
let items = builder()
// ... construct URL
}
// Usage
makeRequest {
URLQueryItem(name: "limit", value: "10")
URLQueryItem(name: "sort", value: "desc")
}
swift-openapi-generator.HStack/VStack to replicate.content-media
Fetch transcripts from YouTube videos for summarization and analysis.
documentation
This skill should be used when reviewing or editing written drafts to ensure they match Sam's personal style guide. It prioritizes voice preservation and anti-beige detection while catching structural gaps. Triggers on requests to review, edit, or improve written content.
tools
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
development
Web search and content extraction using Brave Search. Use when researching topics, finding documentation, extracting article content, or gathering information from the web. No browser required - works headlessly.