agentleFS
GoogleKnown publishergoogle/xrblocks/skills/xb-add-ai/SKILL.md

xb-add-ai

Skill481 starsChanged 2 months agoApache-2.0View on GitHub

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.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

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

    line 30
  2. Very specific:

    Use xb.ai.query({prompt}) for a bounded provider-neutral text request.

    line 40
  3. Distinctive:

    Use Gemini multipart input when a bounded request needs an image or typed parts.

    line 41
  4. Distinctive:

    Use Gemini Live for an ongoing audio or video conversation.

    line 43
  5. Very specific:

    Use xb.ai.generate() when the image result becomes an actual app asset.

    line 44
  6. Very specific:

    Use a narrow xb.Tool when the model requests a validated application action.

    line 45

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.