swiftui-code-review
Reviews SwiftUI code for view composition, state management, performance, and accessibility. Use when reviewing .swift files containing SwiftUI views, property wrappers (@State, @Binding, @Observable), or UI code.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/anderskev/swiftui-code-reviewSwiftUI Code Review
Quick Reference
| Issue Type | Reference |
|---|---|
| View extraction, modifiers, body complexity | references/view-composition.md |
| @State, @Binding, @Observable, @Bindable | references/state-management.md |
| LazyStacks, AnyView, ForEach, identity | references/performance.md |
| VoiceOver, Dynamic Type, labels, traits | references/accessibility.md |
Gates (review workflow)
Complete in order; do not skip ahead.
- Anchor scope — Pass when: every reviewed file is listed as a repo-relative
.swiftpath (or the review explicitly states “none opened / N/A” with reason). - Reference before critique — Pass when: for any non-trivial body, modifier chain, or wrapper-ownership question, you have opened the matching
references/*.mdrow from the table above or you state “not needed” with one line why. - Evidence-bound findings — Pass when: each substantive issue includes
[FILE:LINE](or a bounded line range) before recommendations; symbols/snippets may supplement but not replace the location anchor; no finding that rests only on “typical SwiftUI” without pointing at this code.
Review Checklist
- View body under 10 composed elements (extract subviews)
- Modifiers in correct order (padding before background)
- @StateObject for view-owned objects, @ObservedObject for passed objects
- @Bindable used for two-way bindings to @Observable (iOS 17+)
- LazyVStack/LazyHStack for scrolling lists with 50+ items
- No AnyView (use @ViewBuilder or generics instead)
- ForEach uses stable Identifiable IDs (not array indices)
- All images/icons have accessibilityLabel
- Custom controls have accessibilityAddTraits(.isButton)
- Dynamic Type supported (no fixed font sizes)
- .task modifier for async work (not onAppear + Task)
When to Load References
- Complex view bodies or modifier chains -> view-composition.md
- Property wrapper usage (@State, @Observable) -> state-management.md
- List performance or view identity issues -> performance.md
- VoiceOver or accessibility implementation -> accessibility.md
Review Questions
- Could this large view body be split into smaller, reusable Views?
- Is modifier order intentional? (padding -> background -> frame)
- Is @StateObject/@ObservedObject usage correct for ownership?
- Could LazyVStack improve this ScrollView's performance?
- Would VoiceOver users understand this interface?
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-anderskev-swiftui-code-review": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
tutorial-docs
Tutorial patterns for documentation - learning-oriented guides that teach through guided doing
fetch-pr-feedback
Fetch review comments from a PR and evaluate with receive-feedback skill
swift-testing-code-review
Reviews Swift Testing code for proper use of
rust-testing-code-review
Reviews Rust test code for unit test patterns, integration test structure, async testing, mocking approaches, and property-based testing. Covers Rust 2024 edition changes including async fn in traits for mocks,
explanation-docs
Explanation documentation patterns for understanding-oriented content - conceptual guides that explain why things work the way they do