본문으로 건너뛰기

google/xrblocks

XR Blocks is a lightweight WebXR + AI library for rapidly prototyping advanced AI + XR experiences.

https://skillcdn.ai/gh/google/xrblocks

내 AI에 이 주소를 연결하면 이 스킬을 쓸 수 있어요. 연결 방법 보기

  • 미확인
  • 기본 브랜치main
  • 커밋f2d2cc8
  • 라이선스Apache-2.0
  • 검색단어
GitHub에서 보기

xb-add-ai

Add AI behavior to an XR Blocks application. Use when implementing Gemini or OpenAI queries, Gemini Live voice or vision, generated images, scene-grounded responses, or model-requested tools with an observable XR outcome.

경로
skills/xb-add-ai/SKILL.md
라이선스
Apache-2.0

Add AI behavior

Build complete AI behavior: intentional input, provider, validated response, observable result, and owned cleanup.

1. Write the AI contract

Name the input, provider branch, response modality, application consumer, data sent off-device, user disclosure, concurrency rule, and visible waiting, unavailable, empty, disconnected, and error states. Treat prompts, microphone, camera, screenshots, and scene context as separate disclosures.

Complete this step when success changes scene, UI, speech, or an asset and each disclosed input is necessary for that result.

2. Prove the provider path

Read ../../docs/docs/manual/AI.mdx and references/current-api.md. Verify planned symbols in ../../src/xrblocks.ts, ../../src/ai/AI.ts, and the selected provider. For Live, tools, camera, or context grounding, also read references/live-tools-grounding.md.

Use ../../templates/06_ai_query/ for bounded queries and ../../templates/07_ai_live_assistant/ for the common Live loop.

Complete this step when every symbol is public and the selected provider supports every required operation and modality.

3. Select one primary branch

  • Use xb.ai.query({prompt}) for a bounded provider-neutral text request.
  • Use Gemini multipart input when a bounded request needs an image or typed parts.
  • Use Gemini Live for an ongoing audio or video conversation.
  • Use xb.ai.generate() when the image result becomes an actual app asset.
  • Use a narrow xb.Tool when the model requests a validated application action.

Complete this step when latency, modality, provider support, data disclosure, and resource ownership match the contract.

4. Implement the complete behavior

Configure and enable the selected provider before initialization. Check availability at use time, catch provider failures, and prevent unintended concurrent starts. Accept missing text, null, rejected requests, interruption, and disconnection as normal observable states.

For Live, register callbacks before connecting, make readiness depend on onopen, use provider-typed nested realtime inputs, and route remote close, local stop, error, and disposal through one idempotent cleanup owner. Stop the Live session, microphone, playback, frame timers, and app-owned tracks.

Validate tool arguments again at execution and resolve targets through an allowlist or current scene context. Keep consequential actions behind application authorization or confirmation.

Complete this step when one intentional input reaches its consumer, duplicate starts are controlled, every failure is visible, and every acquired resource has one cleanup owner.

5. Prove and hand off provider behavior

Build or type-check the app and run startup smoke that does not require a long conversation. Check configuration, availability guards, request and response types, visible states, tool validation, disclosures, and cleanup. Use existing safe prototype credentials only for one narrow connectivity check.

Give the user the trigger, required credentials and permissions, data sent off-device, waiting/success/error states, and recovery steps. For Live, include open, interruption, remote close, local stop, and restart. For tools, include valid, invalid, unknown, denied, and failed outcomes.

Finish when the user can evaluate real provider behavior without discovering setup, disclosure, expected states, or cleanup from source.

이 스킬의 파일

지원 파일 전체 둘러보기