[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72ZECH9Y1VAX8VMMF75W6YF":3,"skill-same:01M72ZECH9Y1VAX8VMMF75W6YF":74},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":31,"commitSha":32,"skillDirectory":33,"forksCount":34,"repositoryHtmlUrl":35,"repositoryHomepageUrl":6,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":37,"install":38,"resources":51},"01M72ZECH9Y1VAX8VMMF75W6YF","swift-expert",null,"Builds iOS\u002FmacOS\u002FwatchOS\u002FtvOS applications, implements SwiftUI views and state management, designs protocol-oriented architectures, handles async\u002Fawait concurrency, implements actors for thread safety, and debugs Swift-specific issues. Use when building iOS\u002FmacOS applications with Swift 5.9+, SwiftUI, or async\u002Fawait concurrency. Invoke for protocol-oriented programming, SwiftUI state management, actors, server-side Swift, UIKit integration, Combine, or Vapor.","enigmaicon-eng\u002FAI-Enterprise-OS","enigmaicon-eng","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F269773191?v=4","01M72YXXYN7Q7BYRHV8RAVYNWD","01M72YXXZPW35H56D6F1XSK84D",2,"MIT","https:\u002F\u002Fgithub.com\u002Fenigmaicon-eng\u002FAI-Enterprise-OS\u002Fblob\u002Fmain\u002Fexamples\u002Fclaude-skills\u002Fskills\u002Fswift-expert\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: swift-expert\ndescription: Builds iOS\u002FmacOS\u002FwatchOS\u002FtvOS applications, implements SwiftUI views and state management, designs protocol-oriented architectures, handles async\u002Fawait concurrency, implements actors for thread safety, and debugs Swift-specific issues. Use when building iOS\u002FmacOS applications with Swift 5.9+, SwiftUI, or async\u002Fawait concurrency. Invoke for protocol-oriented programming, SwiftUI state management, actors, server-side Swift, UIKit integration, Combine, or Vapor.\nlicense: MIT\nmetadata:\n  author: https:\u002F\u002Fgithub.com\u002FJeffallan\n  version: \"1.1.0\"\n  domain: language\n  triggers: Swift, SwiftUI, iOS development, macOS development, async\u002Fawait Swift, Combine, UIKit, Vapor\n  role: specialist\n  scope: implementation\n  output-format: code\n  related-skills: \n---\n\n# Swift Expert\n\n## Core Workflow\n\n1. **Architecture Analysis** - Identify platform targets, dependencies, design patterns\n2. **Design Protocols** - Create protocol-first APIs with associated types\n3. **Implement** - Write type-safe code with async\u002Fawait and value semantics\n4. **Optimize** - Profile with Instruments, ensure thread safety\n5. **Test** - Write comprehensive tests with XCTest and async patterns\n\n> **Validation checkpoints:** After step 3, run `swift build` to verify compilation. After step 4, run `swift build -warnings-as-errors` to surface actor isolation and Sendable warnings. After step 5, run `swift test` and confirm all async tests pass.\n\n## Reference Guide\n\nLoad detailed guidance based on context:\n\n| Topic | Reference | Load When |\n|-------|-----------|-----------|\n| SwiftUI | `references\u002Fswiftui-patterns.md` | Building views, state management, modifiers |\n| Concurrency | `references\u002Fasync-concurrency.md` | async\u002Fawait, actors, structured concurrency |\n| Protocols | `references\u002Fprotocol-oriented.md` | Protocol design, generics, type erasure |\n| Memory | `references\u002Fmemory-performance.md` | ARC, weak\u002Funowned, performance optimization |\n| Testing | `references\u002Ftesting-patterns.md` | XCTest, async tests, mocking strategies |\n\n## Code Patterns\n\n### async\u002Fawait — Correct vs. Incorrect\n\n```swift\n\u002F\u002F ✅ DO: async\u002Fawait with structured error handling\nfunc fetchUser(id: String) async throws -> User {\n    let url = URL(string: \"https:\u002F\u002Fapi.example.com\u002Fusers\u002F\\(id)\")!\n    let (data, _) = try await URLSession.shared.data(from: url)\n    return try JSONDecoder().decode(User.self, from: data)\n}\n\n\u002F\u002F ❌ DON'T: mixing completion handlers with async context\nfunc fetchUser(id: String) async throws -> User {\n    return try await withCheckedThrowingContinuation { continuation in\n        \u002F\u002F Avoid wrapping existing async APIs this way when a native async version exists\n        legacyFetch(id: id) { result in\n            continuation.resume(with: result)\n        }\n    }\n}\n```\n\n### SwiftUI State Management\n\n```swift\n\u002F\u002F ✅ DO: use @Observable (Swift 5.9+) for view models\n@Observable\nfinal class CounterViewModel {\n    var count = 0\n    func increment() { count += 1 }\n}\n\nstruct CounterView: View {\n    @State private var vm = CounterViewModel()\n\n    var body: some View {\n        VStack {\n            Text(\"\\(vm.count)\")\n            Button(\"Increment\", action: vm.increment)\n        }\n    }\n}\n\n\u002F\u002F ❌ DON'T: reach for ObservableObject\u002FPublished when @Observable suffices\nclass LegacyViewModel: ObservableObject {\n    @Published var count = 0  \u002F\u002F Unnecessary boilerplate in Swift 5.9+\n}\n```\n\n### Protocol-Oriented Architecture\n\n```swift\n\u002F\u002F ✅ DO: define capability protocols with associated types\nprotocol Repository\u003CEntity> {\n    associatedtype Entity: Identifiable\n    func fetch(id: Entity.ID) async throws -> Entity\n    func save(_ entity: Entity) async throws\n}\n\nstruct UserRepository: Repository {\n    typealias Entity = User\n    func fetch(id: UUID) async throws -> User { \u002F* … *\u002F }\n    func save(_ user: User) async throws { \u002F* … *\u002F }\n}\n\n\u002F\u002F ❌ DON'T: use classes as base types when a protocol fits\nclass BaseRepository {  \u002F\u002F Avoid class inheritance for shared behavior\n    func fetch(id: UUID) async throws -> Any { fatalError(\"Override required\") }\n}\n```\n\n### Actor for Thread Safety\n\n```swift\n\u002F\u002F ✅ DO: isolate mutable shared state in an actor\nactor ImageCache {\n    private var cache: [URL: UIImage] = [:]\n\n    func image(for url: URL) -> UIImage? { cache[url] }\n    func store(_ image: UIImage, for url: URL) { cache[url] = image }\n}\n\n\u002F\u002F ❌ DON'T: use a class with manual locking\nclass UnsafeImageCache {\n    private var cache: [URL: UIImage] = [:]\n    private let lock = NSLock()  \u002F\u002F Error-prone; prefer actor isolation\n    func image(for url: URL) -> UIImage? {\n        lock.lock(); defer { lock.unlock() }\n        return cache[url]\n    }\n}\n```\n\n## Constraints\n\n### MUST DO\n- Use type hints and inference appropriately\n- Follow Swift API Design Guidelines\n- Use `async\u002Fawait` for asynchronous operations (see pattern above)\n- Ensure `Sendable` compliance for concurrency\n- Use value types (`struct`\u002F`enum`) by default\n- Document APIs with markup comments (`\u002F\u002F\u002F …`)\n- Use property wrappers for cross-cutting concerns\n- Profile with Instruments before optimizing\n\n### MUST NOT DO\n- Use force unwrapping (`!`) without justification\n- Create retain cycles in closures\n- Mix synchronous and asynchronous code improperly\n- Ignore actor isolation warnings\n- Use implicitly unwrapped optionals unnecessarily\n- Skip error handling\n- Use Objective-C patterns when Swift alternatives exist\n- Hardcode platform-specific values\n\n## Output Templates\n\nWhen implementing Swift features, provide:\n1. Protocol definitions and type aliases\n2. Model types (structs\u002Fclasses with value semantics)\n3. View implementations (SwiftUI) or view controllers\n4. Tests demonstrating usage\n5. Brief explanation of architectural decisions\n\n[Documentation](https:\u002F\u002Fjeffallan.github.io\u002Fclaude-skills\u002Fskills\u002Flanguage\u002Fswift-expert\u002F)\n","# Swift Expert\n\n## Core Workflow\n\n1. **Architecture Analysis** - Identify platform targets, dependencies, design patterns\n2. **Design Protocols** - Create protocol-first APIs with associated types\n3. **Implement** - Write type-safe code with async\u002Fawait and value semantics\n4. **Optimize** - Profile with Instruments, ensure thread safety\n5. **Test** - Write comprehensive tests with XCTest and async patterns\n\n> **Validation checkpoints:** After step 3, run `swift build` to verify compilation. After step 4, run `swift build -warnings-as-errors` to surface actor isolation and Sendable warnings. After step 5, run `swift test` and confirm all async tests pass.\n\n## Reference Guide\n\nLoad detailed guidance based on context:\n\n| Topic | Reference | Load When |\n|-------|-----------|-----------|\n| SwiftUI | `references\u002Fswiftui-patterns.md` | Building views, state management, modifiers |\n| Concurrency | `references\u002Fasync-concurrency.md` | async\u002Fawait, actors, structured concurrency |\n| Protocols | `references\u002Fprotocol-oriented.md` | Protocol design, generics, type erasure |\n| Memory | `references\u002Fmemory-performance.md` | ARC, weak\u002Funowned, performance optimization |\n| Testing | `references\u002Ftesting-patterns.md` | XCTest, async tests, mocking strategies |\n\n## Code Patterns\n\n### async\u002Fawait — Correct vs. Incorrect\n\n```swift\n\u002F\u002F ✅ DO: async\u002Fawait with structured error handling\nfunc fetchUser(id: String) async throws -> User {\n    let url = URL(string: \"https:\u002F\u002Fapi.example.com\u002Fusers\u002F\\(id)\")!\n    let (data, _) = try await URLSession.shared.data(from: url)\n    return try JSONDecoder().decode(User.self, from: data)\n}\n\n\u002F\u002F ❌ DON'T: mixing completion handlers with async context\nfunc fetchUser(id: String) async throws -> User {\n    return try await withCheckedThrowingContinuation { continuation in\n        \u002F\u002F Avoid wrapping existing async APIs this way when a native async version exists\n        legacyFetch(id: id) { result in\n            continuation.resume(with: result)\n        }\n    }\n}\n```\n\n### SwiftUI State Management\n\n```swift\n\u002F\u002F ✅ DO: use @Observable (Swift 5.9+) for view models\n@Observable\nfinal class CounterViewModel {\n    var count = 0\n    func increment() { count += 1 }\n}\n\nstruct CounterView: View {\n    @State private var vm = CounterViewModel()\n\n    var body: some View {\n        VStack {\n            Text(\"\\(vm.count)\")\n            Button(\"Increment\", action: vm.increment)\n        }\n    }\n}\n\n\u002F\u002F ❌ DON'T: reach for ObservableObject\u002FPublished when @Observable suffices\nclass LegacyViewModel: ObservableObject {\n    @Published var count = 0  \u002F\u002F Unnecessary boilerplate in Swift 5.9+\n}\n```\n\n### Protocol-Oriented Architecture\n\n```swift\n\u002F\u002F ✅ DO: define capability protocols with associated types\nprotocol Repository\u003CEntity> {\n    associatedtype Entity: Identifiable\n    func fetch(id: Entity.ID) async throws -> Entity\n    func save(_ entity: Entity) async throws\n}\n\nstruct UserRepository: Repository {\n    typealias Entity = User\n    func fetch(id: UUID) async throws -> User { \u002F* … *\u002F }\n    func save(_ user: User) async throws { \u002F* … *\u002F }\n}\n\n\u002F\u002F ❌ DON'T: use classes as base types when a protocol fits\nclass BaseRepository {  \u002F\u002F Avoid class inheritance for shared behavior\n    func fetch(id: UUID) async throws -> Any { fatalError(\"Override required\") }\n}\n```\n\n### Actor for Thread Safety\n\n```swift\n\u002F\u002F ✅ DO: isolate mutable shared state in an actor\nactor ImageCache {\n    private var cache: [URL: UIImage] = [:]\n\n    func image(for url: URL) -> UIImage? { cache[url] }\n    func store(_ image: UIImage, for url: URL) { cache[url] = image }\n}\n\n\u002F\u002F ❌ DON'T: use a class with manual locking\nclass UnsafeImageCache {\n    private var cache: [URL: UIImage] = [:]\n    private let lock = NSLock()  \u002F\u002F Error-prone; prefer actor isolation\n    func image(for url: URL) -> UIImage? {\n        lock.lock(); defer { lock.unlock() }\n        return cache[url]\n    }\n}\n```\n\n## Constraints\n\n### MUST DO\n- Use type hints and inference appropriately\n- Follow Swift API Design Guidelines\n- Use `async\u002Fawait` for asynchronous operations (see pattern above)\n- Ensure `Sendable` compliance for concurrency\n- Use value types (`struct`\u002F`enum`) by default\n- Document APIs with markup comments (`\u002F\u002F\u002F …`)\n- Use property wrappers for cross-cutting concerns\n- Profile with Instruments before optimizing\n\n### MUST NOT DO\n- Use force unwrapping (`!`) without justification\n- Create retain cycles in closures\n- Mix synchronous and asynchronous code improperly\n- Ignore actor isolation warnings\n- Use implicitly unwrapped optionals unnecessarily\n- Skip error handling\n- Use Objective-C patterns when Swift alternatives exist\n- Hardcode platform-specific values\n\n## Output Templates\n\nWhen implementing Swift features, provide:\n1. Protocol definitions and type aliases\n2. Model types (structs\u002Fclasses with value semantics)\n3. View implementations (SwiftUI) or view controllers\n4. Tests demonstrating usage\n5. Brief explanation of architectural decisions\n\n[Documentation](https:\u002F\u002Fjeffallan.github.io\u002Fclaude-skills\u002Fskills\u002Flanguage\u002Fswift-expert\u002F)\n",{"name":5,"license":14,"metadata":23,"description":7},{"role":24,"scope":25,"author":26,"domain":27,"version":28,"triggers":29,"output-format":30,"related-skills":6},"specialist","implementation","https:\u002F\u002Fgithub.com\u002FJeffallan","language","1.1.0","Swift, SwiftUI, iOS development, macOS development, async\u002Fawait Swift, Combine, UIKit, Vapor","code","main","a4b48842f3e48549adf3dc335a8837c66da99497","examples\u002Fclaude-skills\u002Fskills\u002Fswift-expert",0,"https:\u002F\u002Fgithub.com\u002Fenigmaicon-eng\u002FAI-Enterprise-OS","https:\u002F\u002Fgithub.com\u002Fenigmaicon-eng","2026-05-17 16:00:01",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add enigmaicon-eng\u002FAI-Enterprise-OS --skill swift-expert",{"tool":44,"command":45},"bunx","bunx skills add enigmaicon-eng\u002FAI-Enterprise-OS --skill swift-expert",{"tool":47,"command":48},"pnpm","pnpm dlx skills add enigmaicon-eng\u002FAI-Enterprise-OS --skill swift-expert","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fenigmaicon-eng\u002FAI-Enterprise-OS\u002Fblob\u002Fmain\u002Fexamples\u002Fclaude-skills\u002Fskills\u002Fswift-expert\u002FSKILL.md",true,[52,58,62,66,70],{"path":53,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Fasync-concurrency.md","REFERENCE","参考文档",8467,"https:\u002F\u002Fgithub.com\u002Fenigmaicon-eng\u002FAI-Enterprise-OS\u002Fblob\u002Fmain\u002Fexamples\u002Fclaude-skills\u002Fskills\u002Fswift-expert\u002Freferences\u002Fasync-concurrency.md",{"path":59,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":60,"sourceHtmlUrl":61},"references\u002Fmemory-performance.md",8256,"https:\u002F\u002Fgithub.com\u002Fenigmaicon-eng\u002FAI-Enterprise-OS\u002Fblob\u002Fmain\u002Fexamples\u002Fclaude-skills\u002Fskills\u002Fswift-expert\u002Freferences\u002Fmemory-performance.md",{"path":63,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002Fprotocol-oriented.md",7360,"https:\u002F\u002Fgithub.com\u002Fenigmaicon-eng\u002FAI-Enterprise-OS\u002Fblob\u002Fmain\u002Fexamples\u002Fclaude-skills\u002Fskills\u002Fswift-expert\u002Freferences\u002Fprotocol-oriented.md",{"path":67,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Fswiftui-patterns.md",6806,"https:\u002F\u002Fgithub.com\u002Fenigmaicon-eng\u002FAI-Enterprise-OS\u002Fblob\u002Fmain\u002Fexamples\u002Fclaude-skills\u002Fskills\u002Fswift-expert\u002Freferences\u002Fswiftui-patterns.md",{"path":71,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Ftesting-patterns.md",9056,"https:\u002F\u002Fgithub.com\u002Fenigmaicon-eng\u002FAI-Enterprise-OS\u002Fblob\u002Fmain\u002Fexamples\u002Fclaude-skills\u002Fskills\u002Fswift-expert\u002Freferences\u002Ftesting-patterns.md",[75,82,89,96,103,110],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":18},"01M72ZGWW03JSE1T3TKK5NZ11Y","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment","https:\u002F\u002Fgithub.com\u002Fenigmaicon-eng\u002FAI-Enterprise-OS\u002Fblob\u002Fmain\u002Fexamples\u002Fsuperpowers\u002Fskills\u002Fwriting-skills\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":18},"01M72ZGT3FJT7QRM1VNQRKR0XD","writing-plans","Use when you have a spec or requirements for a multi-step task, before touching code","https:\u002F\u002Fgithub.com\u002Fenigmaicon-eng\u002FAI-Enterprise-OS\u002Fblob\u002Fmain\u002Fexamples\u002Fsuperpowers\u002Fskills\u002Fwriting-plans\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":18},"01M72ZGQ69DCF0SBP9JXFPWKJS","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002Fenigmaicon-eng\u002FAI-Enterprise-OS\u002Fblob\u002Fmain\u002Fexamples\u002Fsuperpowers\u002Fskills\u002Fverification-before-completion\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":18},"01M72ZGNF126QT0MQ2D3DNGZRN","using-superpowers","Use when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions","https:\u002F\u002Fgithub.com\u002Fenigmaicon-eng\u002FAI-Enterprise-OS\u002Fblob\u002Fmain\u002Fexamples\u002Fsuperpowers\u002Fskills\u002Fusing-superpowers\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":18},"01M72ZGHVJ9S0YXMNBHQGQ95BY","using-git-worktrees","Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback","https:\u002F\u002Fgithub.com\u002Fenigmaicon-eng\u002FAI-Enterprise-OS\u002Fblob\u002Fmain\u002Fexamples\u002Fsuperpowers\u002Fskills\u002Fusing-git-worktrees\u002FSKILL.md",[],[],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":18},"01M72ZGFNZCHFY2FS3ZD9MCYV9","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002Fenigmaicon-eng\u002FAI-Enterprise-OS\u002Fblob\u002Fmain\u002Fexamples\u002Fsuperpowers\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[]]