update-swiftui-apis - SKILL
name: update-swiftui-apisdescription: Scan Apple’s SwiftUI documentation for deprecated APIs and update the SwiftUI Expert Skill with modern replacements. Use when asked to “update latest APIs”, “refresh deprecated SwiftUI APIs”, “check for new SwiftUI deprecations”, “scan for API changes”, or after a new iOS/Xcode…risk: criticalsource: https://github.com/AvdLee/SwiftUI-Agent-Skill/tree/main/.agents/skills/update-swiftui-apissource_repo: AvdLee/SwiftUI-Agent-Skillsource_type: communitydate_added: 2026-07-01license: MITlicense_source: https://github.com/AvdLee/SwiftUI-Agent-Skill/blob/main/LICENSE更新 SwiftUI API何时使用当你需要扫描 Apple 的 SwiftUI 文档以查找已弃用的 API并用现代替代品更新 SwiftUI 专家技能时使用此技能。当被要求update latest APIs、“refresh deprecated SwiftUI APIs”、“check for new SwiftUI deprecations”、“scan for API changes”或在新 iOS/Xcode… 之后使用时通过 Sosumi MCP 系统地扫描 Apple 开发者文档识别已弃用的 SwiftUI API 及其现代替代品并更新swiftui-expert-skill/references/latest-apis.md。前置条件Sosumi MCP必须已启用且可用提供searchAppleDocumentation、fetchAppleDocumentation、fetchAppleVideoTranscript、fetchExternalDocumentation对此仓库或 fork具有写入权限工作流1. 了解当前覆盖范围阅读swiftui-expert-skill/references/latest-apis.md以了解哪些弃用到现代的转换已经记录在案正在使用的版本分段iOS 15、16、17、18、26底部的快速查找表2. 加载扫描清单阅读references/scan-manifest.md相对于此技能。其中包含要扫描的 API 领域分类列表、文档路径、搜索查询和 WWDC 视频路径。3. 扫描 Apple 文档对于清单中的每个类别使用列出的查询调用searchAppleDocumentation以发现相关页面。使用特定文档路径调用fetchAppleDocumentation以获取完整的 API 详细信息。查找弃用通知、“Deprecated” 标签和 “Use … instead” 指导。记录现代替代品可用的 iOS 版本。可选对宣布 API 变更的 WWDC 会议调用fetchAppleVideoTranscript。为提高效率批量执行相关搜索。重点查找latest-apis.md中尚未记录的新弃用项。4. 比较并识别变更将发现与现有条目进行比较。对结果分类新弃用项latest-apis.md中尚未记录的 API修正需要更新的现有条目版本错误、有更好的替代品可用新版本分段如果新 iOS 版本引入了弃用项添加新章节5. 更新 latest-apis.md严格遵循既定格式。每个条目必须包含章节位置– 放在正确的版本分段下长期弃用的 API 放在 “Always Use (iOS 15)”版本门控的变更放在 “When Targeting iOS 16” / “17” / “18” / “26”条目格式**Always use modernAPI() instead of deprecatedAPI().** \swift // Modern View() .modernAPI() // Deprecated View() .deprecatedAPI() \快速查找表– 在文件底部添加一行| deprecatedAPI() | modernAPI() | iOS XX |保留文件顶部的署名行Based on a comparison of Apple’s documentation using the Sosumi MCP, we found the latest recommended APIs to use.6. 打开拉取请求从main创建名为update/latest-apis-YYYY-MM的分支使用当前年月。提交对swiftui-expert-skill/references/latest-apis.md的更改。通过gh pr create打开 PR标题“Update latest SwiftUI APIs (Month Year)”正文新增/变更条目的摘要、对 Sosumi MCP 的署名Sosumi MCP 工具参考工具参数返回searchAppleDocumentationquery字符串包含results[]的 JSON其中含title、url、description、breadcrumbs、tags、typefetchAppleDocumentationpath字符串如/documentation/swiftui/view/foregroundstyle(_:)Markdown 文档内容fetchAppleVideoTranscriptpath字符串如/videos/play/wwdc2025/10133Markdown 文字记录fetchExternalDocumentationurl字符串完整的 https URLMarkdown 文档内容提示先从searchAppleDocumentation查询开始广泛搜索然后用fetchAppleDocumentation深入特定路径。Apple 的弃用文档通常在页面中标注 “Deprecated” 并链接到替代品。WWDC 的 “What’s new in SwiftUI” 会议是寻找新引入替代品的最佳来源。当不确定弃用的确切 iOS 版本时通过检查获取文档中的 “Availability” 部分来验证。如果 API 已弃用但没有直接替代品请如实记录而不是建议不正确的替代方案。局限性仅当任务与上游来源和本地项目上下文明确匹配时使用此技能。在应用更改之前验证命令、生成的代码、依赖项、凭据和外部服务行为。不要将示例视为环境特定测试、安全审查或用户对破坏性或高成本操作批准的替代品。