[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EBWAY0QNN10HEHY9S885RP":3,"skill-same:01M6EBWAY0QNN10HEHY9S885RP":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":28,"linkOnly":29,"markdownContent":30,"markdownBody":31,"frontMatter":32,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":36,"repositoryHtmlUrl":37,"repositoryHomepageUrl":38,"ownerHtmlUrl":39,"ownerBlogUrl":6,"ownerDescription":40,"updatedAt":41,"install":42,"resources":55},"01M6EBWAY0QNN10HEHY9S885RP","swift-best-practices",null,"Standards for Guard, Value Types, Immutability, and Naming. Use when writing idiomatic Swift using guard, value types, immutability, or naming conventions. (triggers: **\u002F*.swift, guard, let, struct, final)","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",66,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Fswift-best-practices\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27],"swift","best practices","swift best practices","writing","guard","use","standards","conventions","triggers","2026-11-10 10:12:30",false,"---\nname: swift-best-practices\ndescription: 'Standards for Guard, Value Types, Immutability, and Naming. Use when writing idiomatic Swift using guard, value types, immutability, or naming conventions. (triggers: **\u002F*.swift, guard, let, struct, final)'\n---\n\n# Swift Best Practices\n\n## **Priority: P0**\n\n## Implementation Guidelines\n\n### Control Flow (Guard over If)\n\n- **Guard for Early Exit**: Use **`guard let`** over **nested if** statements for better readability and to unwrap optionals early.\n- **Nested Checks**: Use **`guard`** for **precondition** checks at the top of a function to reduce nested depth.\n- **Switch Exhaustiveness**: Always handle all cases; use **`@unknown default`** for freezing enums (enums from frameworks).\n- **if-case**: Use **`if case .success(let value) = result`** for simple enum pattern matching.\n\n### Value Types & Immutability\n\n- **Prefer Structs**: **Default to struct** for **value semantics** and thread safety. Use `class` only when reference identity or **inheritance** is required.\n- **Immutability**: Always **default to let** for all properties and constants. Use `var` only when change is required.\n- **Modifiers**: Use **`final`** for all classes that are not intended to be subclassed to improve performance (static dispatch).\n- **Static Dispatch**: Favor methods in structs and `final` classes.\n\n### Naming & Style\n\n- **Clear Intent**: Prefix booleans with **`is, has, or can`**. Example: **`isValid`**, `hasErrors`, **`canEdit`**. Makes boolean state clear.\n- **API Guidelines**: Follow the official **Swift API Design Guidelines**. Use **`camelCase`** for **clear names** and `PascalCase` for types.\n- **Protocols**: Name protocols with **`-able`**, `-ible`, or `-ing` suffixes (e.g., `Codable`, `Identifiable`).\n- **Opaque Types**: Use **`some View`** or `some Collection` for return types where the underlying type is internal.\n\n### Collection Performance\n\n- **Sequence API**: Use **`compactMap`**, **`filter`**, and **`reduce`** instead of explicit **for-where** loops for data transformations.\n- **Lazy Collections**: Use **`.lazy`** for large sequences when the result is consumed partially.\n- **Dictionaries**: Use **`default`** values in dictionary access to avoid double optional unwrapping.\n\n## Anti-Patterns\n\n- **No Pyramid of Doom**: Use **`guard`** for early exits.\n- **No force unwrap**: Never use **`!`** on optionals. Use **`??`** (nil-coalescing) or **`if let`**.\n- **No global var**: Avoid mutable global state. Use **Singletons** (accessed via `static let shared`) or DI.\n\n## References\n\n- [Guard Patterns & Immutability](references\u002Fimplementation.md)\n\n","# Swift Best Practices\n\n## **Priority: P0**\n\n## Implementation Guidelines\n\n### Control Flow (Guard over If)\n\n- **Guard for Early Exit**: Use **`guard let`** over **nested if** statements for better readability and to unwrap optionals early.\n- **Nested Checks**: Use **`guard`** for **precondition** checks at the top of a function to reduce nested depth.\n- **Switch Exhaustiveness**: Always handle all cases; use **`@unknown default`** for freezing enums (enums from frameworks).\n- **if-case**: Use **`if case .success(let value) = result`** for simple enum pattern matching.\n\n### Value Types & Immutability\n\n- **Prefer Structs**: **Default to struct** for **value semantics** and thread safety. Use `class` only when reference identity or **inheritance** is required.\n- **Immutability**: Always **default to let** for all properties and constants. Use `var` only when change is required.\n- **Modifiers**: Use **`final`** for all classes that are not intended to be subclassed to improve performance (static dispatch).\n- **Static Dispatch**: Favor methods in structs and `final` classes.\n\n### Naming & Style\n\n- **Clear Intent**: Prefix booleans with **`is, has, or can`**. Example: **`isValid`**, `hasErrors`, **`canEdit`**. Makes boolean state clear.\n- **API Guidelines**: Follow the official **Swift API Design Guidelines**. Use **`camelCase`** for **clear names** and `PascalCase` for types.\n- **Protocols**: Name protocols with **`-able`**, `-ible`, or `-ing` suffixes (e.g., `Codable`, `Identifiable`).\n- **Opaque Types**: Use **`some View`** or `some Collection` for return types where the underlying type is internal.\n\n### Collection Performance\n\n- **Sequence API**: Use **`compactMap`**, **`filter`**, and **`reduce`** instead of explicit **for-where** loops for data transformations.\n- **Lazy Collections**: Use **`.lazy`** for large sequences when the result is consumed partially.\n- **Dictionaries**: Use **`default`** values in dictionary access to avoid double optional unwrapping.\n\n## Anti-Patterns\n\n- **No Pyramid of Doom**: Use **`guard`** for early exits.\n- **No force unwrap**: Never use **`!`** on optionals. Use **`??`** (nil-coalescing) or **`if let`**.\n- **No global var**: Avoid mutable global state. Use **Singletons** (accessed via `static let shared`) or DI.\n\n## References\n\n- [Guard Patterns & Immutability](references\u002Fimplementation.md)\n\n",{"name":5,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Fswift-best-practices",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":43,"prompt":53,"zipAvailable":54},[44,47,50],{"tool":45,"command":46},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill swift-best-practices",{"tool":48,"command":49},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill swift-best-practices",{"tool":51,"command":52},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill swift-best-practices","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Fswift-best-practices\u002FSKILL.md",true,[56],{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"customize.toml","OTHER","其他",2696,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.kilocode\u002Fskills\u002Fbmad-cis-agent-storyteller\u002Fcustomize.toml",[63,77,87,96,102,109],{"skillNo":64,"name":65,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":73,"publishedAt":28},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[68],{"categoryNo":69,"categoryName":70,"taxonomyType":71,"taxonomyTypeDesc":72},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[74,75,76],"model","model hierarchy","model hierarchy skill",{"skillNo":78,"name":79,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":83,"publishedAt":28},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[82],{"categoryNo":69,"categoryName":70,"taxonomyType":71,"taxonomyTypeDesc":72},[84,85,86],"MCP","zoom","zoom mcp",{"skillNo":88,"name":89,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":28},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[93,94,95,85],"sdk","zoom apps sdk","apps",{"skillNo":97,"name":98,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":28},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[98],{"skillNo":103,"name":104,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":108,"publishedAt":28},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[107],{"categoryNo":69,"categoryName":70,"taxonomyType":71,"taxonomyTypeDesc":72},[104],{"skillNo":110,"name":111,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":28},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[111]]