Provides SwiftUI Model-View architecture patterns including enum-based state, model composition, dependency injection, view state vs model state, view identity, and observable model conventions. Use when building SwiftUI views, creating observable models, implementing state management, or connecting use cases to the UI.
How this skill is triggered — by the user, by Claude, or both
Slash command
/swift-app-architecture:swift-swiftuiThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
SwiftUI follows **Model-View (MV)** — not MVVM. Views connect directly to `@Observable` models that live **only in the Apps layer**. Models monitor use case streams and update state for the UI. Business logic belongs in Features (use cases) and SDKs (clients), not models.
SwiftUI follows Model-View (MV) — not MVVM. Views connect directly to @Observable models that live only in the Apps layer. Models monitor use case streams and update state for the UI. Business logic belongs in Features (use cases) and SDKs (clients), not models.
Key rules:
@MainActor on all @Observable modelsApp struct to avoid re-initialization on view rebuilds| Topic | When to Use | Document |
|---|---|---|
| Enum-based state, state flow, state ownership | Defining model state or consuming use case streams | model-state.md |
| Parent/child models, optional models, lifecycle | Composing models or managing model initialization | model-composition.md |
| Environment injection, view-scoped models | Injecting models into views | dependency-injection.md |
| View state vs model state, selection ownership | Deciding what belongs in @State vs @Observable models | view-state.md |
.id() modifier for view reset | Resetting view state when dependencies change | view-identity.md |
| Heavyweight state, model scalability | Managing memory when entities carry large or streaming data | model-scalability.md |
| Domain structs, prerequisite data | Creating data types or handling missing data in views | data-models.md |
| Alerts | Using SwiftUI's .alert API | alerts.md |
npx claudepluginhub gestrich/swift-app-architecture --plugin swift-app-architectureProvides modern SwiftUI patterns for state management with @Observable, view composition, type-safe NavigationStack navigation, and performance optimization for iOS/macOS apps.
Provides SwiftUI architecture patterns, state management with @Observable, view composition, navigation, and performance optimization for iOS/macOS apps.
Guides pure SwiftUI architecture: state management with @State/@Observable/@Environment, shared services, navigation, UI components, async patterns without ViewModels.