swiftship/internal/skills/data/always-visionos/visionos-patterns/SKILL.md
visionOS platform patterns: scene types, RealityKit, spatial gestures, hand tracking, entity interaction. Use when building visionOS-specific features, handling spatial input, or implementing Vision Pro app patterns. Triggers: visionOS, Vision Pro, RealityKit, spatial, immersive, hand tracking, eye tracking.
npx skillsauth add abdullah4ai/apple-dev-docs visionos-patternsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
import RealityKit
// In a RealityView
RealityView { content in
if let entity = try? await Entity(named: "Scene", in: realityKitContentBundle) {
// Add collision and input for interaction
entity.components.set(CollisionComponent(shapes: [.generateBox(size: [0.1, 0.1, 0.1])]))
entity.components.set(InputTargetComponent())
content.add(entity)
}
}
Entities need CollisionComponent + InputTargetComponent for user interaction:
RealityView { content in
let sphere = ModelEntity(mesh: .generateSphere(radius: 0.1))
sphere.components.set(CollisionComponent(shapes: [.generateSphere(radius: 0.1)]))
sphere.components.set(InputTargetComponent())
content.add(sphere)
} update: { content in
// Update entities
}
.gesture(
TapGesture()
.targetedToAnyEntity()
.onEnded { value in
// Handle tap on entity
}
)
// Tap gesture on entities
.gesture(
TapGesture()
.targetedToAnyEntity()
.onEnded { value in
handleTap(on: value.entity)
}
)
// Drag gesture on entities
.gesture(
DragGesture()
.targetedToAnyEntity()
.onChanged { value in
value.entity.position = value.convert(value.location3D, from: .local, to: .scene)
}
)
ARKit is only available in Full Space (not Shared Space):
ImmersiveSpace(id: "full-immersive") {
RealityView { content in
// ARKit features available here
}
}
.immersionStyle(selection: .constant(.full), in: .full)
Use @Observable over ObservableObject:
@Observable
class AppModel {
var items: [Item] = []
var selectedItem: Item?
var isImmersive = false
}
// In App
@State private var model = AppModel()
WindowGroup {
ContentView()
.environment(model)
}
MainActor by default in Swift 6.2. Use detached Tasks for background work:
// Already on MainActor by default
func loadData() {
Task.detached {
let data = await fetchData()
await MainActor.run {
self.items = data
}
}
}
Eye tracking drives hover states automatically:
Button("Action") { }
.hoverEffect() // Required for all interactive elements
.hoverEffect(.highlight) // Highlight variant
.hoverEffect(.lift) // Lift variant
visionOS 26 widgets are spatial — they snap to walls and tables:
// Standard WidgetKit implementation works
// visionOS renders them as spatial glass panels
.foregroundStyle() not .foregroundColor().clipShape(.rect(cornerRadius:)) not .cornerRadius()@Observable not ObservableObjectUIScreen.mainCollisionComponent + InputTargetComponent for interaction@Observable over ObservableObject.hoverEffect().targetedToAnyEntity()) for 3D interactionTask.detached for background work.foregroundStyle() not .foregroundColor().clipShape(.rect(cornerRadius:)) not .cornerRadius()tools
Apple platform skill for docs, WWDC lookup, App Store Connect work, and SwiftUI app generation. Use repo-local `node cli.js` for Apple docs and WWDC search, `appledev store` for App Store Connect workflows, and `appledev build` for app scaffolding or fix loops on macOS. USE WHEN: Apple APIs, WWDC sessions, TestFlight/App Store tasks, or building/fixing Apple-platform apps. DON'T USE WHEN: non-Apple platforms, generic backend work, or general web research. EDGE CASES: docs-only queries use `node cli.js` in this repo, not `appledev`; release workflows use `appledev store`; app scaffolding uses `appledev build`; rules-only requests can read `references/ios-rules/` or `references/swiftui-guides/` progressively without invoking binaries.
tools
All-in-one Apple developer skill with three integrated tools shipped as a single unified binary. (1) Documentation search across Apple frameworks, symbols, and 1,267 WWDC sessions from 2014-2025. No credentials needed. (2) App Store Connect CLI with 120+ commands covering builds (find/wait/upload), TestFlight, pre-submission validate, submissions, signing, subscriptions (family-sharable), IAP, analytics, Xcode Cloud, metadata workflows, release pipeline dashboard, insights, win-back offers, promoted purchases, product pages, nominations, accessibility declarations, pre-orders, pricing filters, localizations update, diff, webhooks with local receiver, workflow automation, and more. Requires App Store Connect API key. (3) Multi-platform app builder (iOS/watchOS/tvOS/iPad/macOS/visionOS) that generates complete Swift/SwiftUI apps from natural language with auto-fix, simulator launch, interactive chat mode, and open-in-Xcode. Requires an LLM API key and Xcode. Includes 38 iOS development rules and 12 SwiftUI best practice guides for Liquid Glass, navigation, state management, and modern APIs. All three tools ship as one binary (appledev). USE WHEN: Apple API docs, App Store Connect management, WWDC lookup, or building iOS/watchOS/tvOS/macOS/visionOS apps from scratch. DON'T USE WHEN: non-Apple platforms or general coding.
testing
watchOS complications: WidgetKit complication families, accessory sizes, timeline providers for watch face. Use when implementing watchOS-specific patterns related to widgets.
development
watchOS haptic feedback: WKInterfaceDevice preset haptic types for wrist-based feedback. Use when implementing watchOS-specific patterns related to haptics.