Help us improve
Share bugs, ideas, or general feedback.
From Build Swift Apps
Refactors SwiftUI view files toward small subviews, MV-first data flow, stable view trees, explicit dependencies, extracted actions, and correct Observable usage.
npx claudepluginhub xopoko/build-swift-apps --plugin build-swift-appsHow this skill is triggered — by the user, by Claude, or both
Slash command
/build-swift-apps:swiftui-view-architectThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Default to vanilla SwiftUI: local state in views, shared dependencies in environment/services, business logic outside view bodies, and view models only when requested or already present.
Refactors SwiftUI views toward small dedicated subviews, MV over MVVM data flow, stable view trees, explicit dependency injection, and correct Observation usage. Use for cleaning up views, splitting long bodies, removing side effects, or standardizing @Observable patterns.
Refactors SwiftUI views into smaller subcomponents with stable, explicit data flow. Use for cleaning up large views, splitting long bodies, or improving Observation usage.
Builds or refactors iOS SwiftUI views with guidance on navigation, state ownership, environment injection, async loading, and performance-aware patterns.
Share bugs, ideas, or general feedback.
Default to vanilla SwiftUI: local state in views, shared dependencies in environment/services, business logic outside view bodies, and view models only when requested or already present.
Preserve stronger local conventions; otherwise order stored members top-to-bottom:
let inputs@State/other stored propertiesinitbodyView types with explicit inputs/bindings/callbacks. Keep computed some View helpers small and rare.body; call private methods, and move real domain logic into services/models.if/else swapping entire root branches; localize conditions in sections/modifiers/overlays/toolbars.init:
@State private var viewModel: SomeViewModel
init(dependency: Dependency) {
_viewModel = State(initialValue: SomeViewModel(dependency: dependency))
}
@Observable owners on iOS 17+, store as @State and pass explicitly. For iOS 16 or earlier, use @StateObject owner and @ObservedObject injection.body.For ~300+ line files, split aggressively into section views and small private helpers. // MARK: extensions can organize actions/helpers but are not a substitute for extracting real subviews.
Reference: references/mv-patterns.md. Use current Apple docs when SwiftUI/Observation behavior may have changed.