Write safe Swift code avoiding memory leaks, optional traps, and concurrency bugs.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install swift或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install swift⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/swift/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: Swift slug: swift version: 1.0.1 description: Write safe Swift code avoiding memory leaks, optional traps, and concurrency bugs. metadata: {"clawdbot":{"emoji":"🦅","requires":{"bins":["swift"]},"os":["darwin","linux"]}} ---
| Topic | File | |-------|------| | Optionals, nil safety, force unwrap | optionals.md | | Retain cycles, weak refs, closures | memory.md | | async/await, actors, Sendable, value types | concurrency.md | | JSON encoding/decoding traps | codable.md | | Protocols, collections, strings, errors, build | types.md | | SwiftUI state (@State, @Binding, Combine) | swiftui.md | | Property wrappers, actors, result builders, macros | advanced.md | | XCTest pitfalls, SPM gotchas | testing.md |
! crashes on nil — use guard let or if let insteadself strongly create retain cycles — use [weak self] in escaping closuresweak — strong delegate = object never deallocatestry! crashes on any error — never use in production pathsremoveFirst() crashes on empty — use popFirst() for safetyasync let starts immediately — not when you awaitawait — state may change between suspension points@MainActor doesn't guarantee immediate main thread — it's queuedSendable conformance violations crash at runtime — compiler warnings are errorsarray[0].mutate() doesn't workString.Index from one string invalid on another — even if contents match@StateObject owns, @ObservedObject borrows — recreating view loses ObservedObject state@EnvironmentObject crashes if not injected — no compile-time check@State — changing ID loses stateprint() builds strings even in release — remove or use os_log安装 Swift 后,可以对 AI 说这些话来触发它
Help me get started with Swift
Explains what Swift does, walks through the setup, and runs a quick demo based on your current project
Use Swift to write safe Swift code avoiding memory leaks, optional traps, and co...
Invokes Swift with the right parameters and returns the result directly in the conversation
What can I do with Swift in my developer & devops workflow?
Lists the top use cases for Swift, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/swift/ 目录(个人级,所有项目可用),或 .claude/skills/swift/(项目级)。重启 AI 客户端后,用 /swift 主动调用,或让 AI 根据上下文自动发现并使用。
Swift 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Swift 可免费安装使用。请查阅仓库了解许可证信息。
Write safe Swift code avoiding memory leaks, optional traps, and concurrency bugs.
Swift 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using Swift
Identifies repetitive steps in your workflow and sets up Swift to handle them automatically