audit-swiftui-layout
Scan SwiftUI layout code for patterns that break across device sizes or cause unexpected re-layouts.
What This Command Does
Launches the swiftui-layout-auditor agent to flag layout patterns that look fine on the developer's simulator but break on iPad, landscape, Dynamic Type at maximum, or split-screen multitasking.
What It Checks
- GeometryReader misuse — using
GeometryReaderwhere a layout container would suffice, or for sizing decisions that should respond to environment - Deprecated screen APIs —
UIScreen.main.boundsand other window-coordinate calls that fail in multi-window contexts - Hardcoded breakpoints — magic-number widths instead of
horizontalSizeClassorViewThatFits - Identity loss — conditional
HStack/VStackswaps that destroy and recreate child views, losing animation continuity - Missing safe-area handling — fixed insets that don't account for keyboard, Dynamic Island, or external displays
Related Agent
- swiftui-layout-auditor — The agent that powers this command
- swiftui-layout-ref — SwiftUI layout reference