What this thread does
As of November 2026, use stable list identity and NavigationSplitView with selection that survives width changes. Do first: read the skill’s list and navigation references; choose compact or multi-column behavior from the available space.
The problem
SwiftUI list-to-detail screens written by agents go wrong in quiet ways: unstable ForEach identity that crashes on delete, old NavigationLink(destination:) mixed with newer navigation, and phone-only layouts that do not adapt on iPad.
What the source says
AvdLee/SwiftUI-Agent-Skill (MIT) ships swiftui-expert-skill with a topic router. Two references apply:
list-patterns: always giveForEachstable identity (useIdentifiableor a key path); never.indicesfor dynamic content (it can crash on removal); keep a constant number of views per element; plus patterns for pull-to-refresh andContentUnavailableViewempty states (iOS 17+).sheet-navigation-patterns: type-safe navigation withNavigationStackandnavigationDestination(for:), programmatic navigation with a path, item-driven sheets (sheet(item:)), andNavigationSplitViewwith two or three columns usingList(selection:). It is available on iOS 16+. The current navigation reference makes width the boundary: compact contexts collapse, regular contexts can show columns even on an iPhone. Do not select the layout from the device family alone.
How to describe it to the agent
Use the swiftui-expert-skill. Build a Recipes list and detail screen. Model has a stable id and conforms to Identifiable. Use NavigationSplitView with List(selection:) so it shows columns when space permits and collapses at compact width. Keep selection consistent as the available width changes. Use navigationDestination(for:) and no NavigationLink(destination:). Add pull-to-refresh and ContentUnavailableView for empty and no-results. Editing opens through sheet(item:). Gate anything newer than my deployment target with #available.
Mistakes to check
ForEach(items.indices, ...)orid: \.selfon non-stable values.- Old and new navigation APIs mixed.
- An empty list showing a blank screen.
- The skill says to adopt Liquid Glass only when asked; do not let the agent add it unprompted.
Limits
Availability still matters: NavigationSplitView needs iOS 16+, while ContentUnavailableView needs iOS 17+. Use fallbacks for older deployment targets (navigation, lists).
Sources
Started from a post by @Antoine van der Lee, packaged by the editor. Original post