/swiftui-pro:swiftui-profrom swiftui-pro
Writes and reviews SwiftUI code for correctness, modern APIs, and performance. Covers @Observable state management, NavigationStack, layout, and accessibility.
Ships in swiftui-pro. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Write and review SwiftUI for correctness, modern APIs, and performance. Report real problems only — no nitpicking.
Trigger: /swiftui-pro or natural language ("review this SwiftUI view").
Use @Observable (Observation framework), not ObservableObject/@Published.
❌ Legacy
final class CounterModel: ObservableObject {
@Published var count = 0
}
struct CounterView: View {
@StateObject private var model = CounterModel()
var body: some View { Text("\(model.count)") }
}
✅ Modern
@Observable
final class CounterModel {
var count = 0
}
struct CounterView: View {
@State private var model = CounterModel()
var body: some View { Text("\(model.count)") }
}
Rules:
@State. Pass it down plainly; use @Bindable only where you need
two-way bindings to its properties.@Environment for app-wide models, not singletons.foregroundStyle() not foregroundColor()..background { ... } / .overlay { ... } closure form, not deprecated overloads.Grid, ViewThatFits, and layout containers over manual GeometryReader math.❌
Text("Hi").foregroundColor(.red)
✅
Text("Hi").foregroundStyle(.red)
Use NavigationStack with a typed path. NavigationView is deprecated.
❌
NavigationView {
NavigationLink("Detail", destination: DetailView())
}
✅
NavigationStack(path: $path) {
List(items) { item in
NavigationLink(item.name, value: item.id)
}
.navigationDestination(for: Item.ID.self) { id in
DetailView(id: id)
}
}
LazyVStack/LazyHStack inside ScrollView for long content; plain VStack
renders everything eagerly.ForEach stable identity (Identifiable or id:), never array indices for
mutable collections.body cheap. Move expensive work out of body into the model or .task.❌ Index identity on a mutable list
ForEach(0..<items.count, id: \.self) { i in Row(items[i]) }
✅
ForEach(items) { item in Row(item) }
Use .task (auto-cancelled on disappear), not onAppear { Task { } }.
✅
.task { await model.load() }
.font(.body) etc..accessibilityLabel for icon-only controls.ObservableObject/@Published instead of @Observable.foregroundColor / NavigationView / other deprecated APIs.VStack where LazyVStack is needed.ForEach keyed by index on a mutable collection.body.Walk the code top to bottom. For each real problem give: the file:line, a one-line
statement of what's wrong, and a tight before → after snippet. Don't mention files that
are already fine. Close with the two or three fixes that matter most, in priority order.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub laxrajpurohit/swift-skills-pro --plugin swiftui-pro