Skip to content
Back to skills

Swiftui Code Review

ASecurity

Reviews SwiftUI code for view composition, state management, performance, and accessibility. Use when reviewing .swift files containing SwiftUI views, property wrappers (@State, @Binding, @Observable, @Bindable), or UI code.

  • 92 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added February 8, 2026
developmentswiftcode-reviewperformance

Works with

  • cli

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned November 26, 2026

npx -y skills add existential-birds/beagle --skill swiftui-code-review --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Swiftui Code Review?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Swiftui Code Review
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/existential-birds-swiftui-code-review/badge)](https://www.skillsdirectory.com/skills/existential-birds-swiftui-code-review)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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, @Bindable), or UI code."
---

# 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`, `@Environment` | [references/state-management.md](references/state-management.md) |
| `LazyVStack`, `AnyView`, `ForEach`, view 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 & protocol** — Pass when: every finding satisfies `review-verification-protocol` ([review-verification-protocol](../review-verification-protocol/SKILL.md)) and 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

- [ ] Large view bodies (`> 40` lines or causing measurable layout/type-checker cost) extracted into reusable `View` structs (not trivial 1–3 line leaf views)
- [ ] Modifiers in correct order (`padding` before `background`, `clipShape` before `shadow`)
- [ ] iOS 17+ `@Observable`: `@State` in owning view (with lightweight `init()`), plain property for read-only child access, `@Bindable` for two-way bindings, `@Environment(Type.self)` for environment injection
- [ ] Legacy `ObservableObject` (when supporting `< iOS 17` or Combine): `@StateObject` in owning view, `@ObservedObject` when passed from parent
- [ ] `LazyVStack`/`LazyHStack` for scrolling lists with many items (e.g. 50+)
- [ ] No `AnyView` (use `@ViewBuilder` or generics instead)
- [ ] `ForEach` uses stable `Identifiable` IDs (not array indices)
- [ ] Interactive icon-only controls have `.accessibilityLabel(...)` and decorative SF Symbols use `.accessibilityHidden(true)`
- [ ] Custom controls have `.accessibilityAddTraits(.isButton)` (and value/selection state)
- [ ] Dynamic Type supported (semantic text styles rather than fixed font sizes)
- [ ] `.task` modifier for view-scoped async work (not `onAppear` + unstructured `Task`)

## When to Load References

- Complex view bodies or modifier chains -> [references/view-composition.md](references/view-composition.md)
- Property wrapper usage (`@State`, `@Bindable`, `@Observable`, `@StateObject`) -> [references/state-management.md](references/state-management.md)
- List performance or view identity issues -> [references/performance.md](references/performance.md)
- VoiceOver or accessibility implementation -> [references/accessibility.md](references/accessibility.md)

## Review Questions

1. Should a view body over 40 lines (or causing slow type-checking/re-evaluation) be split into dedicated `View` structs?
2. Is modifier order intentional (`padding` -> `background` -> `frame`, `clipShape` -> `shadow`)?
3. Is ownership clear (`@State` + `@Observable` or legacy `@StateObject` in the creator, plain property/`@Bindable` in children)?
4. Could `LazyVStack`/`LazyHStack` improve this `ScrollView`'s performance?
5. Would VoiceOver users understand interactive icons and decorative symbols?

Files in this skill

  • SKILL.md2.1 KB
  • references/accessibility.md3.3 KB
  • references/performance.md3 KB
  • references/state-management.md2.7 KB
  • references/view-composition.md2.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.