Skills swift-code-review
Reviews Swift code for concurrency safety, error handling, memory management, and common mistakes. Use when reviewing .swift files for async/await patterns, actor isolation, Sendable conformance, or general Swift best practices.
install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/anderskev/swift-code-review" ~/.claude/skills/openclaw-skills-swift-code-review && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/anderskev/swift-code-review" ~/.openclaw/skills/openclaw-skills-swift-code-review && rm -rf "$T"
manifest:
skills/anderskev/swift-code-review/SKILL.mdsource content
Swift Code Review
Quick Reference
| Issue Type | Reference |
|---|---|
| async/await, actors, Sendable, Task | references/concurrency.md |
| @Observable, @ObservationIgnored, @Bindable | references/observable.md |
| throws, Result, try?, typed throws | references/error-handling.md |
| Force unwraps, retain cycles, naming | references/common-mistakes.md |
Review Checklist
- No force unwraps (
) on runtime data (network, user input, files)! - Closures stored as properties use
[weak self] - Delegate properties are
weak - Independent async operations use
orasync letTaskGroup - Long-running Tasks check
Task.isCancelled - Actors have mutable state to protect (no stateless actors)
- Sendable types are truly thread-safe (beware
)@unchecked - Errors handled explicitly (no empty catch blocks)
- Custom errors conform to
with descriptive messagesLocalizedError - Nested @Observable objects are also marked @Observable
- @Bindable used for two-way bindings to Observable objects
When to Load References
- Reviewing async/await, actors, or TaskGroups → concurrency.md
- Reviewing @Observable or SwiftUI state → observable.md
- Reviewing error handling or throws → error-handling.md
- General Swift review → common-mistakes.md
Review Questions
- Are async operations that could run concurrently using
?async let - Could actor state change across suspension points (reentrancy bug)?
- Is
backed by actual synchronization?@unchecked Sendable - Are errors logged and presented with helpful context?
- Could any closure or delegate create a retain cycle?