hz-android-2d-porting
Guides porting existing Android 2D apps to Meta Quest and Horizon OS — input adaptation, panel layout, and design requirements. Use when adapting a mobile…
Builds spatial Android apps for Meta Quest and Horizon OS with Meta Spatial SDK — ECS architecture, 2D panels, 3D objects, hybrid experiences. Use when creating Kotlin-based spatial applications.
$ npx -y skills add meta-quest/agentic-tools --skill hz-spatial-sdk --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/hz-spatial-sdkContext preview
The summary Claude sees to decide when to auto-load this skill.
Builds spatial Android apps for Meta Quest and Horizon OS with Meta Spatial SDK — ECS architecture, 2D panels, 3D objects, hybrid experiences. Use when creating Kotlin-based spatial applications.
name: hz-spatial-sdk license: Apache-2.0 description: Builds spatial Android apps for Meta Quest and Horizon OS with Meta Spatial SDK — ECS architecture, 2D panels, 3D objects, hybrid experiences. Use when creating Kotlin-based spatial applications. allowed-tools: Bash(metavr:*) Bash(hzdb:*)
Build native Android spatial applications for Meta Quest using the Meta Spatial SDK. This skill covers the Entity-Component-System architecture, 2D panel rendering, 3D object placement, hybrid app development, and deployment to Horizon OS devices.
Use this skill when you need to:
This skill applies to all Meta Quest headsets running Horizon OS (Quest 2, Quest 3, Quest 3S, Quest Pro).
Meta Spatial SDK is Meta's native Android framework for building spatial applications on Horizon OS. It extends the standard Android development model with spatial capabilities, allowing developers to write apps in Kotlin that render 2D UI panels in 3D space, display glTF models, handle spatial input, and integrate with Horizon OS features like passthrough, scene understanding, and hand tracking.
Unlike Unity or Unreal Engine, Spatial SDK builds on top of the Android Activity lifecycle. Applications are standard Android APKs that use Spatial SDK libraries to gain spatial rendering and interaction capabilities.
The Spatial SDK uses an ECS architecture to manage the 3D scene graph. This separates data (components) from behavior (systems):
// Example: a simple system that rotates all entities with a Spinner component
class SpinnerSystem : SystemBase() {
override fun execute() {
val query = Query.where { has(Spinner.id, Transform.id) }
for (entity in query.eval()) {
val transform = entity.getComponent<Transform>()
val spinner = entity.getComponent<Spinner>()
transform.rotation *= Quaternion.fromAxisAngle(Vector3.UP, spinner.speed * getDeltaTime())
entity.setComponent(transform)
}
}
}Panels are the primary way to display Android UI in spatial apps. A `PanelRegistration` maps a panel name to a Jetpack Compose composable or an Android View. Panels render as flat rectangles positioned in 3D space.
override fun registerPanels(): List<PanelRegistration> {
return listOf(
PanelRegistration("main_panel") {
layoutParams = LayoutParams(592f, 592f, SpatialPanelLayoutParams.HORIZONTAL)
panel {
MainScreen() // Jetpack Compose composable
}
}
)
}Load glTF models as meshes and place them in the scene using `Transform` and `Mesh` components:
val modelEntity = Entity.create()
modelEntity.setComponent(
Mesh(Uri.parse("apk:///models/robot.glb"))
)
modelEntity.setComponent(
Transform(Pose(Vector3(0f, 1f, -2f)))
)Spatial SDK excels at hybrid applications that combine 2D panels with 3D content. A single activity can display Android UI panels alongside 3D models, allowing users to interact with familiar 2D interfaces while surrounded by spatial content.
For most Spatial SDK apps, keep one `SpatialActivity` subclass as the root shell for the whole experience. Tool-style apps usually work best when that single activity owns the scene, registered panels, and ECS systems while UI states change inside that shell.
Avoid structuring a Quest-native tool app like a standard multi-activity Android app unless you have a specific platform reason. Multiple panels or different UI states are usually better expressed inside the same spatial activity.
The `Scene` class manages the 3D environment, including the skybox, image-based lighting (IBL), viewer position, and the reference space. Each `SpatialActivity` has an associated scene.
The Spatial Editor is a visual tool (integrated into Android Studio via the Meta Horizon plugin) for composing 3D scenes. It produces `.glxf` files that define entity arrangements, panel placements, and 3D object positions. These files are loaded at runtime.
1. **Android Studio** with the Meta Horizon Android Studio Plugin installed 2. **Meta Spatial SDK** dependencies added to your Gradle project 3. **A Meta Quest device** connected via USB with developer mode enabled
1. **Create a new project** from the Spatial SDK template in Android Studio (or add Spatial SDK dependencies to an e
Agentic skills and tools for Meta Quest and Horizon OS development.
Repo: meta-quest/agentic-tools
Guides porting existing Android 2D apps to Meta Quest and Horizon OS — input adaptation, panel layout, and design requirements. Use when adapting a mobile…
Upgrades Meta Quest apps to newer Horizon OS SDK versions — migration guides, deprecated API replacements, changelog. Use when updating SDK versions or fixing…
Guides design of comfortable, intuitive VR/MR experiences for Meta Quest and Horizon OS — comfort guidelines, interaction patterns, spatial layout,…
Builds WebXR experiences for Meta Quest and Horizon OS using the Immersive Web SDK (IWSDK) — ECS architecture, Three.js integration, spatial UI. Use when…
Scaffolds new Meta Quest and Horizon OS projects with recommended settings for Unity, Unreal, Android/Spatial SDK, or WebXR. Use when creating a new Quest app…
Analyzes Meta Quest and Horizon OS VR performance using Perfetto traces — frame timing, CPU/GPU bottlenecks, render pass analysis. Use when profiling frame…