mcpbeat

Xb Head Gestures

google/xb-head-gestures

>- Detect completed head nod and shake gestures in XR Blocks from headset or simulator camera motion. Use when triggering actions from head movement without hands/controllers. Covers enableHeadGestures(), options.headGestures, xb.input.headGestures, completed gesture events, heuristic tuning, and custom HeadGestureRecognizer implementations.

563 tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
455
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/google/xrblocks --skill xb-head-gestures

The instruction itself

5 sections, as written by the author

xb-head-gestures: completed head motion

Head gestures are optional children of xb.input and use the same camera pose

in WebXR and the desktop simulator.

Setup

const options = new xb.Options();
options.enableHeadGestures();
await xb.init(options);

The built-in nod, shake, nod-up, nod-down, shake-left, and

shake-right gestures are enabled by default. A completed motion emits its

generic and directional names, such as nod and nod-down. They emit once

after a complete motion, unlike held hand-pose gestures.

Subscribe

class HeadGestureListener extends xb.Script {
  init() {
    this.onGesture = (event) => {
      const {name, confidence, data} = event.detail;
      console.log(name, confidence, data);
    };
    xb.input.headGestures?.addEventListener('gesture', this.onGesture);
  }

  dispose() {
    if (this.onGesture) {
      xb.input.headGestures?.removeEventListener('gesture', this.onGesture);
    }
  }
}

Tune

options.headGestures.minimumConfidence = 0.65;
options.headGestures.releaseConfidence = 0.4;
options.headGestures.setGestureEnabled('shake', false);
options.headGestures.setGestureConfig('nod', {
  enabled: true,
  threshold: THREE.MathUtils.degToRad(10),
});

For built-ins, threshold is angular amplitude in radians. Event data may

include amplitudeRadians, durationMs, peakAngularSpeed, and

initialDirection.

Custom recognition

Use HeuristicHeadGestureRecognizer.registerGesture() for custom temporal

heuristics. For other backends, implement HeadGestureRecognizer; its

recognize(context) method may return a score map synchronously or as a

promise. HeadGestureContext.samples contains the recent full 6DoF head pose

window.

Do not invent xb.core.headGestureRecognition; the runtime API is the optional

xb.input.headGestures child.

How to use it

Copy the folder

Take google/xb-head-gestures from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.