/tap-python-sdk:tap-build-an-appfrom tap-python-sdk
Builds complete apps controlled by a Tap wearable device - games, browser pages, presentations, media control, or creative tools. Uses Python SDK with async event queue pattern and supports multiple output types including terminal, browser via WebSocket, keyboard control, and game windows.
Ships in tap-python-sdk. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The user may not be a developer. Keep the project small, explain how to run it in plain words, and test with the real device.
tap-getting-started quickstart and confirm taps arrive before building anything else.tap-tappingtap-vision-modelstap-imu-motiontap-knob (TapXR developer firmware / TapBand)tap-dpad (TapXR developer firmware / TapBand)tap-raw-sensorssend_vibration_sequence) and on-screen state, so the user knows the gesture was seen.requirements.txt, and one run command (python app.py).SDK callbacks run on the Bluetooth path. Do not draw UI or do slow work in them. Put events on an asyncio.Queue and handle them in your own loop:
import asyncio
from tapsdk import (
DeviceFeatures,
InputModeController,
ModelTypes,
VisionSensorOpModes,
connect,
)
def first(v):
return v[0] if isinstance(v, (list, tuple)) else v
async def main():
events = asyncio.Queue()
sdk = await connect()
sdk.register_tap_events(lambda i, t: events.put_nowait(("tap", first(t))))
sdk.register_air_gesture_events(lambda i, g: events.put_nowait(("air", first(g))))
await sdk.start()
if hasattr(sdk, "set_input_mode"):
await sdk.set_input_mode(InputModeController())
else:
await sdk.set_feature(DeviceFeatures.MODEL_DETECTION, True)
await sdk.set_vision_sensor_model(ModelTypes.TAPPING)
await sdk.set_vision_sensor_op_mode(VisionSensorOpModes.TRIGGER)
while True:
kind, code = await events.get()
handle(kind, code)
asyncio.run(main())
| Output | How | Extra install |
|---|---|---|
| Terminal | print, or rich for a live view | none / rich |
| Browser page (best for visual apps) | Python sends events over a WebSocket; an HTML page reacts | websockets |
| Keyboard / media keys (control other apps) | pynput key presses | pynput |
| Game window | pygame loop reads a thread-safe queue.Queue | pygame |
| Sound / music | simpleaudio, or a browser page with Web Audio | varies |
# pip install websockets
import json, websockets
clients = set()
async def ws_handler(ws):
clients.add(ws)
try:
await ws.wait_closed()
finally:
clients.discard(ws)
async def broadcast(event):
msg = json.dumps(event)
for ws in list(clients):
await ws.send(msg)
# in main(): await websockets.serve(ws_handler, "localhost", 8765)
# in the loop: await broadcast({"kind": kind, "code": code})
<script>
const ws = new WebSocket("ws://localhost:8765");
ws.onmessage = (e) => { const ev = JSON.parse(e.data); /* update the page */ };
</script>
Serve the HTML with python -m http.server or open the file directly.
pygame needs the main thread. Run the Tap SDK in a background thread with its own event loop and pass events through queue.Queue:
import queue, threading
q = queue.Queue()
threading.Thread(target=lambda: asyncio.run(tap_main(q)), daemon=True).start()
# in the pygame loop: while not q.empty(): handle(*q.get_nowait())
requirements.txt.python3 -m venv .venv). Requires Python 3.10 or newer.tap-getting-started.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
tap-wearable, gesture-control, wearable-apps, event-driven, prototyping
8 skills in this plugin
/tap-dpadBuild a D-Pad style controller with a Tap - swipes for directions, short pinches to select, pinch-hold that locks into rotate (twist) or drag (move) mode, fist-hold to hide. Use for D-Pad, menu navigation, select and move, drag and drop, rotate objects, or game controls with gestures./tap-getting-startedFirst skill for any Tap app. The connect order is await connect(), then register_* callbacks, then await sdk.start(), then enable input. connect() alone delivers no taps. Use for install, pairing, "connect to my Tap", setup, or no tap events./tap-imu-motionUse Tap hand motion - IMU motion data (dx, dy, roll, pitch, yaw) and mouse events - to move a cursor, steer, tilt, or rotate things. Use for air mouse, pointer, cursor control, tilt, orientation, euler angles, roll/pitch/yaw, or motion-driven UI.npx claudepluginhub tapwithus/tap-python-sdk --plugin tap-python-sdkOther plugins' skills for the same job