mcpbeat

Xb Gestures

google/xb-gestures

>- Detect named hand gestures in an XR Blocks app — pinch, open-palm, fist, thumbs-up, point, and spread — and subscribe to gesturestart / gestureupdate / gestureend events with per-hand name and confidence. Use when triggering actions from poses rather than raw pinch/touch (e.g. point-to-aim, open-palm menu, thumbs-up confirm). Covers `enableGestures()`, `options.gestures.setGestureEnabled`, and the `xb.core.gestureRecognition` event API. For raw hand joints/touch/grab, use xb-hands; for stroke/shape recognition use the strokes API.

682 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-gestures

The instruction itself

4 sections, as written by the author

xb-gestures: gesture recognition

Builds on hand tracking (xb-hands) to recognize discrete poses and

emit DOM-style events.

Setup

const options = new xb.Options();
options.enableReticles();
options.enableGestures();

// Opt specific gestures in (names: pinch, open-palm, fist, thumbs-up, point, spread).
options.gestures.setGestureEnabled('point', true);
options.gestures.setGestureEnabled('spread', true);

options.hands.enabled = true; // gestures need hands
options.simulator.defaultMode = xb.SimulatorMode.POSE; // pose hands on desktop
xb.init(options);

Subscribe to events

xb.core.gestureRecognition is an EventTarget. Subscribe in your Script's init() and

unsubscribe in dispose():

class GestureLogger extends xb.Script {
  init() {
    const gestures = xb.core.gestureRecognition;
    if (!gestures) {
      console.warn('Call options.enableGestures() before xb.init().');
      return;
    }
    this._onStart = (event) => {
      const {hand, name, confidence = 0} = event.detail; // hand: 'left'|'right'
      console.log(`${hand} started ${name} (${confidence.toFixed(2)})`);
    };
    this._onEnd = (event) => {
      const {hand, name} = event.detail;
      console.log(`${hand} ended ${name}`);
    };
    gestures.addEventListener('gesturestart', this._onStart);
    gestures.addEventListener('gestureend', this._onEnd);
    // 'gestureupdate' fires continuously while a gesture is held.
  }
  dispose() {
    const g = xb.core.gestureRecognition;
    if (!g) return;
    g.removeEventListener('gesturestart', this._onStart);
    g.removeEventListener('gestureend', this._onEnd);
  }
}

Notes

  • Events: gesturestart, gestureupdate, gestureend; event.detail = {hand, name, confidence}.
  • Tune providers/thresholds via options.gestures (see

src/input/gestures/GestureRecognitionOptions.ts).

  • Heuristic detectors ship by default; custom TF-Lite / PyTorch gesture models can be wired in.
  • See templates/heuristic_hand_gestures and demos/sim_hand_poses for full examples.

How to use it

Copy the folder

Take google/xb-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.