Skip to main content
skill CX Codex

swiftui-code-review — Claude Code skill: SwiftUI code audit

swiftui-code-review audits SwiftUI code for view composition quality, state management patterns, list performance, and accessibility. Use it when reviewing files with @State, @Binding, @Observable, or view layout code.

Apache-2.0 277 installs ★ 89 updated 2026-09-15

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add existential-birds/beagle --skill swiftui-code-review -a claude-code
Open on GitHub

What swiftui-code-review does

The skill examines view body structure, modifier stacking, and property wrapper usage (@State, @Binding, @Observable, @Bindable). It checks whether ownership is clear — @StateObject for objects owned by the view, @ObservedObject for objects passed in. For two-way bindings to @Observable models on iOS 17+, it looks for @Bindable.

On performance, it identifies where LazyVStack or LazyHStack can defer rendering, spots AnyView usage (better replaced with @ViewBuilder or generics), and catches unstable ForEach identifiers. On accessibility, it verifies that images and icons have accessibilityLabel, custom controls get accessibilityAddTraits(.isButton), and layouts adapt to Dynamic Type without hardcoded font sizes.

Each finding includes a file and line reference. The skill reads internal guides on view composition, state patterns, performance tuning, and VoiceOver before making suggestions.

What it helps with

  • Break down large view bodies into smaller, composable subviews
  • Fix modifier order so backgrounds, padding, and frames apply as intended
  • Verify @State, @Binding, @Observable ownership matches the data flow
  • Speed up lists by switching to lazy rendering for large datasets
  • Confirm VoiceOver users can navigate and that text scales with Dynamic Type

Example prompts for the agent

  • Review this view controller for state management and composition patterns
  • Check modifier order and styling in ProfileView.swift
  • Audit accessibility labels and Dynamic Type support in this screen

How to install swiftui-code-review

1Skills CLI (Vercel)

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

2Manually: put the files in place

~/.claude/skills/swiftui-code-review/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/swiftui-code-review/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about swiftui-code-review

How do I install swiftui-code-review in Claude Code?

Run npx skills add existential-birds/beagle --skill swiftui-code-review -a claude-code, then open ~/.claude/skills/swiftui-code-review/SKILL.md.

What does swiftui-code-review check?

View composition and body complexity, property wrapper patterns (@State, @Binding, @Observable), list rendering performance, modifier sequencing, and accessibility via VoiceOver and Dynamic Type support.

Which platforms support this skill?

Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode. Each platform has its own install command.

Source text

SKILL.md · Apache-2.0
---
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.
---

# 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?

© existential-birds · Apache-2.0 · existential-birds/beagle

Similar skills

All skills for Code review and refactoring →

From the same set68

The whole set →
react-flow-implementation react-flow-implementation guides your coding agent in building diagram editors and node interfaces with @xyflow/react. Useful for clean viewport state and node handling. CX Codex +1 382installs shadcn-ui Teaches the agent shadcn/ui component patterns — CVA variants, compound components, data-slot attributes. Fires on Button, Card, Dialog, cn() and Radix primitives. CX Codex +1 358installs react-flow-code-review react-flow-code-review walks @xyflow/react code through a review checklist: anti-patterns, wasted re-renders, typing. Useful when a graph stutters or nodes keep remounting. CX Codex +1 329installs langgraph-architecture langgraph-architecture helps you choose how to structure a LangGraph application, manage state, and handle persistence. Use it when comparing LangGraph with simpler options or planning a multi-agent system. CX Codex +1 283installs tutorial-docs tutorial-docs is a Claude Code skill that structures learning-oriented tutorials using the Diataxis framework. The model applies it when creating getting-started guides and onboarding docs. CX Codex +1 273installs bubbletea-code-review bubbletea-code-review reviews Go terminal UIs for Elm architecture, BubbleTea update flow, and Lipgloss styling. Use it when checking code built with charmbracelet/bubbletea. CX Codex +1 270installs zustand-state zustand-state — a skill for Zustand, a lightweight state-management library for React and vanilla JavaScript. CX Codex +1 261installs dagre-react-flow dagre-react-flow configures automatic directed graph layouts in React Flow using dagre. It helps arrange hierarchical trees, process flows, and nodes across directional axes. CX Codex +1 257installs

Project sponsors

Companies that keep this analytics open