Ios swiftui architect
Build or refactor iOS SwiftUI views/components: navigation, TabView, sheets, async state, responsive stacks/grids, state ownership, environment injection, previews, and performance-aware declarative UI.From its SKILL.md
npx -y skills add Xopoko/build-swift-apps --skill ios-swiftui-architectAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
3.4 KB, 701 tokens by cl100k_base, as published. Nobody here has run it
iOS SwiftUI Architect
Use for iOS SwiftUI UI structure and component choices. Read the nearest local example before introducing a new pattern.
Start
- Existing project: identify screen model (list/detail/editor/settings/tab), search for nearby examples (
rg "TabView\\(", etc.), then readreferences/components-index.md. - New app: start with
references/app-wiring.mdfor TabView + NavigationStack + sheets, then expand route/sheet enums as screens appear. - For scroll-driven reveals, read
references/scroll-reveal.mdbefore hand-rolling gestures.
Rules
- Prefer
@State,@Binding,@Observable, and@Environment; avoid unnecessary view models. - If iOS 16 or earlier is supported, use
ObservableObjectwith@StateObjectat the owner and@ObservedObjectfor injection. - Keep views small, composed, and project-formatted.
- Use
.task/.task(id:)with loading/error states; readreferences/async-state.mdfor cancellation/debouncing. - Put shared app services in
@Environment; keep feature-local dependencies as explicit inputs. - Prefer newest SwiftUI APIs that match deployment target and call out minimum OS.
- Maintain legacy patterns only inside legacy files.
- Sheets: prefer
.sheet(item:), avoidif letinside sheet bodies, let sheets calldismiss()internally. - Scroll reveals: derive one normalized progress value from scroll offset instead of parallel gesture state machines when possible.
State Ownership
| Scenario | Pattern |
|---|---|
| Local UI state | @State |
| Child mutates parent value | @Binding |
| Root-owned iOS 17+ reference model | @State with @Observable |
| Injected iOS 17+ observable | explicit stored property |
| Shared service/config | @Environment(Type.self) |
| iOS 16 legacy model | @StateObject owner, @ObservedObject injected |
Choose ownership first; do not introduce a reference model when value state is enough.
New View Workflow
- Define state ownership, dependencies, and minimum OS.
- Sketch hierarchy, routing, and presentation; read navigation/sheet/deeplink refs when complex.
- Build and verify before widening call-site changes.
- Add async loading and explicit error/loading UI when needed.
- Add previews for primary/secondary states and accessibility IDs/labels for interactive UI.
- Validate build/previews/state propagation/list identity/observation scope. If build fails, fix the exact error before continuing.
Anti-Patterns
- Giant views mixing layout, business logic, networking, routing, and formatting.
- Multiple booleans for exclusive sheets/alerts/destinations.
- Live service calls from
body. AnyViewas a composition escape hatch.- Defaulting every shared dependency to
@EnvironmentObjector a global router.
References
references/components-index.mdreferences/navigationstack.mdreferences/sheets.mdreferences/deeplinks.mdreferences/app-wiring.mdreferences/async-state.mdreferences/previews.mdreferences/performance.md
Use current Apple docs when API availability or platform guidance may have changed. New component refs should be short, actionable, and listed in components-index.md.
What ships with it: 31 files
74.0 KB alongside SKILL.md
agents/
- openai.yaml225 B
references/
- app-wiring.md6.3 KB
- async-state.md2.8 KB
- components-index.md4.2 KB
- controls.md1.6 KB
- deeplinks.md1.7 KB
- focus.md2.3 KB
- form.md3.0 KB
- grids.md1.8 KB
- haptics.md2.0 KB
- input-toolbar.md1.4 KB
- lightweight-clients.md2.5 KB
- list.md2.7 KB
- loading-placeholders.md1.2 KB
- macos-settings.md2.0 KB
- matched-transitions.md1.6 KB
- media.md2.0 KB
- menu-bar.md2.2 KB
- navigationstack.md4.2 KB
- overlay.md1.2 KB
- performance.md1.9 KB
- previews.md1.6 KB
- scroll-reveal.md5.1 KB
- scrollview.md2.3 KB
- searchable.md1.7 KB
- sheets.md4.2 KB
- split-views.md2.0 KB
- tabview.md3.0 KB
- theming.md1.7 KB
- title-menus.md2.1 KB
- top-bar.md1.3 KB