/tap-web-sdk:tap-build-an-appfrom tap-web-sdk
Build a complete browser app or interactive experience controlled by a Tap - games, pages, presentations, or creative tools. Use when the user asks to build, make, or create something with their Tap, especially if they are not a developer.
Ships in tap-web-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 you build anything else.tap-tappingtap-vision-modelstap-imu-motiontap-knob (TapSDKWeb2 app recipe)tap-dpad (TapSDKWeb2 app recipe)tap-raw-sensorssendVibrationSequence) and on-screen state, so the user knows the gesture was seen.package.json that depends on @tapwithus/tapsdk, one HTML page, and one run command (npx serve or npx vite, on localhost).Call connect() from a button click. It starts notifications. There is no start(). Register callbacks next, then enable input. Keep callback work short. Update state, then draw.
import {
connect,
isTapSDKWeb2,
DeviceFeatures,
InputModeController,
ModelTypes,
VisionSensorOpModes,
} from '@tapwithus/tapsdk';
document.querySelector('#connect')!.addEventListener('click', async () => {
const sdk = await connect();
if (isTapSDKWeb2(sdk)) {
sdk.registerTapEvents((_id, tapcode) => handle('tap', tapcode[0]));
sdk.registerAirGestureEvents((_id, gesture) => handle('air', gesture[0]));
await sdk.setFeature(DeviceFeatures.MODEL_DETECTION, true);
await sdk.setVisionSensorModel(ModelTypes.TAPPING);
await sdk.setVisionSensorOpMode(VisionSensorOpModes.TRIGGER);
} else {
sdk.registerTapEvents((_id, tapcode) => handle('tap', tapcode));
sdk.registerAirGestureEvents((_id, gesture) => handle('air', gesture));
await sdk.setInputMode(new InputModeController());
}
});
If a callback must not draw, push the event onto an array and read that array from requestAnimationFrame.
| Output | How |
|---|---|
| Status and text | Update the DOM. Show "Click Connect", "Connected", or "Disconnected". |
| Game or visual | Canvas or HTML elements in this page. |
| Sound | Web Audio in this page. |
| Keyboard fallback | keydown on this page (arrow keys, space) calls the same functions as taps. |
The browser cannot press keys in other applications and cannot change the OS volume. Keep the interaction inside the page.
Use this pattern when the app has its own buttons. It is the reconnect flow the SDK expects: the same page reuses the last Tap without the picker, and "Choose device" always shows the picker.
import { connect, getPermittedDevices, isTapSDKWeb2, type ConnectedTapSDK } from '@tapwithus/tapsdk';
const connectBtn = document.querySelector<HTMLButtonElement>('#connect')!;
const chooseBtn = document.querySelector<HTMLButtonElement>('#choose')!;
const statusEl = document.querySelector<HTMLElement>('#status')!;
let sdk: ConnectedTapSDK | null = null;
function setBusy(busy: boolean): void {
connectBtn.disabled = busy;
chooseBtn.disabled = busy;
}
async function attach(pending: Promise<ConnectedTapSDK>): Promise<void> {
setBusy(true); // one connection at a time; a second click would start a second connect()
try {
sdk = await pending;
// Register callbacks, then enable input (see the required order above).
statusEl.textContent = isTapSDKWeb2(sdk) ? 'Connected (framed firmware)' : 'Connected (classic firmware)';
} catch (err) {
statusEl.textContent = `Connection failed: ${(err as Error).message}`;
setBusy(false);
}
}
// Connect: reuses the Tap connected earlier in this page (about 3 s), else opens the picker.
connectBtn.addEventListener('click', () => void attach(connect()));
// Choose device: always opens the picker, for adding or switching Taps.
chooseBtn.addEventListener('click', () => void attach(connect({ reuseKnownDevice: false })));
// Optional: list devices the page was granted. Empty unless getDevices() is enabled (see flags).
const granted = await getPermittedDevices();
Notes:
connect() does not tell you whether it reused the Tap or opened the picker. If the picker opens after Connect, that is expected: the last Tap did not answer.setBusy(false) again on disconnect, as well as on error.package.json.@tapwithus/tapsdk. Do not copy SDK source into the app.connect() from a button click.connect(), which reuses the last Tap of the session) and Choose device… (connect({ reuseKnownDevice: false }), always the picker). After a page reload a Tap still held by the OS cannot be reconnected from the page, so do not build a reload-time Reconnect button. Tell the user to disconnect the Tap in system Bluetooth settings, then use the picker.getPermittedDevices(), feature-detect it. getDevices() needs a flag: Chrome chrome://flags/#enable-experimental-web-platform-features, Edge edge://flags/#enable-experimental-web-platform-features. Without it only this session's Taps are listed.tap-getting-started.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub tapwithus/tap-web-sdk --plugin tap-web-sdk8 skills in this plugin
/tap-dpadBuild a D-Pad style controller with TapSDKWeb2 - 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 web app. Call connect() from a button click, then register callbacks, then enable input. connect() starts notifications. There is no start(). Use for install, connect to my Tap, setup, or no tap events./tap-imu-motionUse Tap hand motion - TapSDKWeb2 IMU motion data (dx, dy, roll, pitch, yaw) and TapSDKWeb 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./tap-knobBuild a virtual knob with TapSDKWeb2 - hold a pinch and twist the wrist to turn a value up or down (volume, brightness, zoom, scroll, color). Use for knob, dial, twist, rotate-to-adjust, slider, volume control, or continuous value control./tap-raw-sensorsStream raw accelerometer and gyroscope samples from a Tap (TapSDKWeb raw mode or TapSDKWeb2 RAW_IMU_DATA), set sensitivity and scaling, log to CSV, and plot. Use for raw sensors, raw IMU, accelerometer, gyro, data logging, datasets, custom gesture recognition, or research./tap-tappingDecode Tap tapcodes (which fingers tapped), map finger combinations to in-page actions, and give haptic feedback. Use for tapping, finger combos, chords, tap-to-action, shortcuts, InputModeController, or the TAPPING vision model.