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.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "swiftui-code-review" with this command: npx skills add anderskev/swiftui-code-review

SwiftUI Code Review

Quick Reference

Issue TypeReference
View extraction, modifiers, body complexityreferences/view-composition.md
@State, @Binding, @Observable, @Bindablereferences/state-management.md
LazyStacks, AnyView, ForEach, identityreferences/performance.md
VoiceOver, Dynamic Type, labels, traitsreferences/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?

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

AI短剧制作助手 | AI Short Film Producer

AI短剧制作助手 | AI Short Film Producer — 低成本AI短剧/短片全流程制作技能。使用Grok Imagine生成视频镜头、TTS生成配音,配合FFmpeg+Python本地合成。适用于从零制作AI短片、短视频、短剧EP、预告片等场景。包含完整的分镜脚本创作、视频生成、配音生成、音频驱动...

Registry SourceRecently Updated
Coding

Dlazy Vidu Audio Clone

Clone voice and generate new text reading audio with one click using Vidu Audio Clone.

Registry SourceRecently Updated
Coding

DeviantArt Post

Post artwork, journals, and status updates to a user's DeviantArt account through the official DeviantArt API using OAuth 2.1 Authorization Code with PKCE, S...

Registry SourceRecently Updated
Coding

Reliable Tool Context

Build reliable tool context from command output using artifacts and compact reproducible code queries.

Registry SourceRecently Updated