[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EW4344YE29RCVKHWDFDPC5":3,"skill-same:01M7EW4344YE29RCVKHWDFDPC5":45},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"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":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7EW4344YE29RCVKHWDFDPC5","ams-swift-pro",null,"TanNhatCMS\u002Fjarvis","TanNhatCMS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F113796420?v=4","01M753MV17KG5CD3152G3WQEQY","KietNT","01M7EKEDYVYQ6PWVJJMZ911VMX",0,"MIT","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-swift-pro\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: swift-pro\ndescription: Idiomatic Swift: value types, optionals, protocols, structured concurrency, and SwiftUI\u002FUIKit patterns. Use when writing, reviewing, or structuring Swift apps.\ncategory: development\n---\n\n# Swift Pro\n\n## Overview\n\nSwift rewards **safety by construction**: optionals instead of nulls, value types by default,\nprotocols over inheritance, and a compiler that catches entire bug families. Professional Swift\nmeans leaning into these — modeling with structs and enums, handling optionals explicitly, using\nstructured concurrency instead of callback pyramids, and writing code the compiler can verify.\n\nThe through-line: make invalid states unrepresentable, handle the absent case explicitly, and let\nthe type system do the worrying.\n\n## When to use\n\n- Writing or reviewing Swift code for idiom and safety.\n- Structuring iOS\u002FmacOS apps (SwiftUI or UIKit).\n- Choosing value vs reference types, or designing protocol abstractions.\n- Using async\u002Fawait, actors, and structured concurrency.\n- Debugging optionals, retain cycles, or concurrency issues.\n\n## Core concepts\n\n- **Value types by default.** `struct` for data and domain models — copied on assignment, no\n  shared-mutable-state surprises, thread-safe by construction. `class` only when you need identity,\n  shared mutable state, or inheritance (rare). Enums with associated values model states beautifully.\n- **Optionals are explicit.** `if let`\u002F`guard let` for unwrapping, `map`\u002F`flatMap` for transforms,\n  nil-coalescing for defaults. Force-unwrap (`!`) only for true invariants (IBOutlets after load)\n  — never on network data or user input. Implicitly-unwrapped optionals are a code smell outside\n  narrow cases.\n- **Protocols + extensions.** Protocol-oriented design: small protocols, default implementations\n  via extensions, composition over inheritance. But don't protocol-everything preemptively —\n  concrete types first, protocols when you have two conformers or a testing seam.\n- **Structured concurrency.** `async`\u002F`await` for asynchronous work, `Task` groups for fan-out,\n  `actor` for isolated mutable state. Say goodbye to callback pyramids and manual GCD queue\n  hopping. Respect `@MainActor` for UI updates; don't block the main actor.\n- **Error handling with `throws`.** Typed throws (Swift 6) for precise error modeling; `do\u002Fcatch`\n  at boundaries, `try?`\u002F`try!` only where failure is truly uninteresting\u002Fimpossible. `Result`\n  type when errors are values to pass around rather than control flow.\n- **Memory: ARC + weak\u002Fstrong discipline.** Retain cycles via closures capturing `self` strongly —\n  `[weak self]` in escaping closures that outlive their context. Value types sidestep most of this;\n  reference cycles are a class-design problem.\n\n## Practical workflow\n\n1. **Model first.** Structs for data, enums with associated values for states\u002Fresults, protocols\n   for the seams you'll actually test or vary.\n2. **Handle absence explicitly.** No force-unwraps on external data; `guard let` early for\n   preconditions; meaningful defaults via `??`.\n3. **Write async code structurally.** `async` functions, `TaskGroup` for parallel work, actors for\n   shared mutable state. Migrate legacy completion handlers with `withCheckedContinuation` at the\n   boundary.\n4. **Organize by feature.** Group related models, views, and logic (`Features\u002FCheckout\u002F`) rather\n   than by type (`Models\u002F`, `Views\u002F`). Keep views dumb; move logic to view models or domain types.\n5. **Test the logic, not the framework.** Unit-test domain types, view models, and parsers with\n   XCTest\u002FSwift Testing; UI tests only for critical journeys. Inject dependencies via protocols\n   for testability.\n6. **Mind the platform.** Respect main-actor isolation, handle background\u002Fforeground transitions,\n   test on device for performance and memory, and profile with Instruments before optimizing.\n\nIdiomatic snippets:\n\n```swift\n\u002F\u002F Enum states + async\u002Fawait + guard\nenum LoadState\u003CT> {\n    case idle, loading, loaded(T), failed(Error)\n}\n\nfunc refresh() async {\n    state = .loading\n    do {\n        let items = try await store.fetchItems()\n        state = .loaded(items)\n    } catch {\n        state = .failed(error)\n    }\n}\n\n\u002F\u002F Weak capture in escaping closures\nservice.onUpdate = { [weak self] items in\n    guard let self else { return }\n    self.items = items\n}\n```\n\n## Common pitfalls\n\n- **Force-unwrap roulette.** `!` on optionals from JSON, user input, or casts — crashes in\n  production. Every `!` should have a justification a reviewer can verify.\n- **Massive view controllers \u002F views.** 1,000-line view files doing networking, parsing, and\n  layout. Extract: view models for state, services for I\u002FO, small composable views.\n- **Retain cycles.** Closures capturing `self` strongly in long-lived objects (timers, network\n  callbacks, notification observers). `[weak self]` + `guard let self` is the reflex.\n- **Blocking the main thread.** Synchronous networking, JSON parsing of large payloads, or image\n  processing on main — jank and watchdog kills. Move to background, update UI on main actor.\n- **Over-protocoling.** A protocol for every struct \"for testability\" before there's a second\n  implementation. Concrete types are simpler; add protocols at real seams.\n- **Ignoring Swift 6 concurrency checking.** Data races flagged by the compiler are real bugs.\n  Adopt `Sendable`, respect actor isolation — don't silence with `@unchecked Sendable` without\n  understanding why.\n- **Stringly-typed APIs.** String constants for states, notification names as raw strings.\n  Enums, typed notification wrappers, and `#function`-based identifiers prevent typo-bugs.\n","# Swift Pro\n\n## Overview\n\nSwift rewards **safety by construction**: optionals instead of nulls, value types by default,\nprotocols over inheritance, and a compiler that catches entire bug families. Professional Swift\nmeans leaning into these — modeling with structs and enums, handling optionals explicitly, using\nstructured concurrency instead of callback pyramids, and writing code the compiler can verify.\n\nThe through-line: make invalid states unrepresentable, handle the absent case explicitly, and let\nthe type system do the worrying.\n\n## When to use\n\n- Writing or reviewing Swift code for idiom and safety.\n- Structuring iOS\u002FmacOS apps (SwiftUI or UIKit).\n- Choosing value vs reference types, or designing protocol abstractions.\n- Using async\u002Fawait, actors, and structured concurrency.\n- Debugging optionals, retain cycles, or concurrency issues.\n\n## Core concepts\n\n- **Value types by default.** `struct` for data and domain models — copied on assignment, no\n  shared-mutable-state surprises, thread-safe by construction. `class` only when you need identity,\n  shared mutable state, or inheritance (rare). Enums with associated values model states beautifully.\n- **Optionals are explicit.** `if let`\u002F`guard let` for unwrapping, `map`\u002F`flatMap` for transforms,\n  nil-coalescing for defaults. Force-unwrap (`!`) only for true invariants (IBOutlets after load)\n  — never on network data or user input. Implicitly-unwrapped optionals are a code smell outside\n  narrow cases.\n- **Protocols + extensions.** Protocol-oriented design: small protocols, default implementations\n  via extensions, composition over inheritance. But don't protocol-everything preemptively —\n  concrete types first, protocols when you have two conformers or a testing seam.\n- **Structured concurrency.** `async`\u002F`await` for asynchronous work, `Task` groups for fan-out,\n  `actor` for isolated mutable state. Say goodbye to callback pyramids and manual GCD queue\n  hopping. Respect `@MainActor` for UI updates; don't block the main actor.\n- **Error handling with `throws`.** Typed throws (Swift 6) for precise error modeling; `do\u002Fcatch`\n  at boundaries, `try?`\u002F`try!` only where failure is truly uninteresting\u002Fimpossible. `Result`\n  type when errors are values to pass around rather than control flow.\n- **Memory: ARC + weak\u002Fstrong discipline.** Retain cycles via closures capturing `self` strongly —\n  `[weak self]` in escaping closures that outlive their context. Value types sidestep most of this;\n  reference cycles are a class-design problem.\n\n## Practical workflow\n\n1. **Model first.** Structs for data, enums with associated values for states\u002Fresults, protocols\n   for the seams you'll actually test or vary.\n2. **Handle absence explicitly.** No force-unwraps on external data; `guard let` early for\n   preconditions; meaningful defaults via `??`.\n3. **Write async code structurally.** `async` functions, `TaskGroup` for parallel work, actors for\n   shared mutable state. Migrate legacy completion handlers with `withCheckedContinuation` at the\n   boundary.\n4. **Organize by feature.** Group related models, views, and logic (`Features\u002FCheckout\u002F`) rather\n   than by type (`Models\u002F`, `Views\u002F`). Keep views dumb; move logic to view models or domain types.\n5. **Test the logic, not the framework.** Unit-test domain types, view models, and parsers with\n   XCTest\u002FSwift Testing; UI tests only for critical journeys. Inject dependencies via protocols\n   for testability.\n6. **Mind the platform.** Respect main-actor isolation, handle background\u002Fforeground transitions,\n   test on device for performance and memory, and profile with Instruments before optimizing.\n\nIdiomatic snippets:\n\n```swift\n\u002F\u002F Enum states + async\u002Fawait + guard\nenum LoadState\u003CT> {\n    case idle, loading, loaded(T), failed(Error)\n}\n\nfunc refresh() async {\n    state = .loading\n    do {\n        let items = try await store.fetchItems()\n        state = .loaded(items)\n    } catch {\n        state = .failed(error)\n    }\n}\n\n\u002F\u002F Weak capture in escaping closures\nservice.onUpdate = { [weak self] items in\n    guard let self else { return }\n    self.items = items\n}\n```\n\n## Common pitfalls\n\n- **Force-unwrap roulette.** `!` on optionals from JSON, user input, or casts — crashes in\n  production. Every `!` should have a justification a reviewer can verify.\n- **Massive view controllers \u002F views.** 1,000-line view files doing networking, parsing, and\n  layout. Extract: view models for state, services for I\u002FO, small composable views.\n- **Retain cycles.** Closures capturing `self` strongly in long-lived objects (timers, network\n  callbacks, notification observers). `[weak self]` + `guard let self` is the reflex.\n- **Blocking the main thread.** Synchronous networking, JSON parsing of large payloads, or image\n  processing on main — jank and watchdog kills. Move to background, update UI on main actor.\n- **Over-protocoling.** A protocol for every struct \"for testability\" before there's a second\n  implementation. Concrete types are simpler; add protocols at real seams.\n- **Ignoring Swift 6 concurrency checking.** Data races flagged by the compiler are real bugs.\n  Adopt `Sendable`, respect actor isolation — don't silence with `@unchecked Sendable` without\n  understanding why.\n- **Stringly-typed APIs.** String constants for states, notification names as raw strings.\n  Enums, typed notification wrappers, and `#function`-based identifiers prevent typo-bugs.\n",{},"main","af388a77c2fe5e0b4fd879cca4300a0ffa9a6579","skills\u002Fams-swift-pro",1,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis","https:\u002F\u002Fgithub.com\u002FTanNhatCMS","https:\u002F\u002Fmrkiet.name.vn","2026-11-07 14:23:08",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add TanNhatCMS\u002Fjarvis --skill ams-swift-pro",{"tool":37,"command":38},"bunx","bunx skills add TanNhatCMS\u002Fjarvis --skill ams-swift-pro",{"tool":40,"command":41},"pnpm","pnpm dlx skills add TanNhatCMS\u002Fjarvis --skill ams-swift-pro","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-swift-pro\u002FSKILL.md",true,[],[46,53,61,68,75,82],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":18},"01M7EWYJR0J8DARY7E59Z6Y9MV","web-scrape","Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open\u002Ffetch fails on JS-heavy pages, or when you need clean markdown\u002Fstructured extraction from a site. Requires FIRECRAWL_API_KEY.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fweb-scrape\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":57,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":18},"01M7EWYBN5P6F2AJG3FR24T9BP","design-taste-frontend","tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML\u002FCSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, \"AI-made\", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":18},"01M7EWY8FQFNQ2GB7NZZWGSSDX","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-tdd\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":18},"01M7EWY5SHBFRH1HDHVWM9K7TV","systematic-debugging","Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-debugging\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":18},"01M7EWY3NM0Z0JAKS7HDZ24K66","requesting-code-review","Use when completing tasks, implementing major features, or before merging to verify work meets requirements","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-code-review\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":18},"01M7EWY0WRMWX4M9ZFY0WKC593","brainstorming","You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-brainstorming\u002FSKILL.md",[],[]]