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.
Works with
--- name: swiftui-code-review description: 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. license: Apache-2.0 --- # SwiftUI Code Review ## Quick Reference | Issue Type | Reference | |------------|-----------| | View extraction, modifiers, body complexity | [references/view-composition.md](references/view-composition.md) | | @State, @Binding, @Observable, @Bindable | [references/state-management.md](references/state-management.md) | | LazyStacks, AnyView, ForEach, identity | [references/performance.md](references/performance.md) | | VoiceOver, Dynamic Type, labels, traits | [references/accessibility.md](references/accessibility.md) | ## Gates (review workflow) Complete in order; do not skip ahead. 1. **Anchor scope** — Pass when: every reviewed file is listed as a repo-relative `.swift` path (or the review explicitly states “none opened / N/A” with reason). 2. **Reference before critique** — Pass when: for any non-trivial body, modifier chain, or wrapper-ownership question, you have opened the matching `references/*.md` row from the table above *or* you state “not needed” with one line why. 3. **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 1. Could this large view body be split into smaller, reusable Views? 2. Is modifier order intentional? (padding -> background -> frame) 3. Is @StateObject/@ObservedObject usage correct for ownership? 4. Could LazyVStack improve this ScrollView's performance? 5. Would VoiceOver users understand this interface?
More Accessibility skills
skill-creator
anthropics/skills
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
ui-ux-pro-max
nextlevelbuilder/ui-ux-pro-max-skill
UI/UX design intelligence for web, mobile, and desktop. This skill should be used when designing, building, reviewing, or fixing interfaces, including pages, components, design systems, accessibility, interaction, responsive layout, typography, color, charts, and stack-specific UI implementation. Searchable local data: 79 searchable styles (50 active), 192 product palettes and reasoning profiles, 74 font pairings, 119 UX guidelines, 105 icons, 17 GSAP presets, 25 chart types, and 22 stacks.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the `data-*` timing attributes, `class="clip"`, tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Also covers Tailwind projects and the STORYBOARD.md / SCRIPT.md plan formats. Read before writing composition HTML.

