Skip to content
Skill

Canvas gestures and hit testing

Turns canvas taps, swipes and drags into typed intents hit-tested on the drawn layout

Canvas gestures and hit testing is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
JavaScript, TypeScript
Platforms
Claude Code, Codex, Cursor
GitHub stars
16
Last commit
License
MIT
Listing updated

Similar skills

About Canvas gestures and hit testing

This skill sets up a single gesture module for hand-drawn React Native canvases built on Skia. Every tap, swipe, drag, long press and aim is hit-tested against the same layout the renderer draws with, and each gesture produces at most one typed intent. A surface's own pure intent function then decides whether that intent becomes a domain action, so the rules of legality stay in one place that tests, undo and bots can all share.

The skill ships an input kit with the gesture builders, swipe and pan classification, stick commands for real-time games, and touch-target helpers, along with a checker script that reports missing pieces and failing rules. It also covers tap-then-tap selection kept in screen state, a drag lift applied in the gesture layer, quantised aim values, and pan settings that keep the system back gestures from competing with the canvas.

It expects a project with Gesture Handler and Skia available and a canvas kit already in place, or the skia-canvas-rendering skill to create one. Code is TypeScript and the checks run with Node and Jest.

When your agent uses it

Turns canvas taps, swipes, drags and aim into typed intents: one gesture module, hit-testing on the drawn layout. Use when a Skia canvas takes touch or a tap hits the wrong cell. Not for drawing (skia-canvas-rendering).

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 63 files (422 KB) on GitHub on 5 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the react-native plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add zakariaf/ReactNative-Skills
/plugin install react-native@react-native-skills

Or copy only this skill to ~/.claude/skills/canvas-gestures-and-hit-testing:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/canvas-gestures-and-hit-testing &&
cp -R "$tmp/skills/canvas-gestures-and-hit-testing" ~/.claude/skills/canvas-gestures-and-hit-testing &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/canvas-gestures-and-hit-testing inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/canvas-gestures-and-hit-testing to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/canvas-gestures-and-hit-testing &&
cp -R "$tmp/skills/canvas-gestures-and-hit-testing" ~/.agents/skills/canvas-gestures-and-hit-testing &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/canvas-gestures-and-hit-testing inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/canvas-gestures-and-hit-testing to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/canvas-gestures-and-hit-testing &&
cp -R "$tmp/skills/canvas-gestures-and-hit-testing" ~/.cursor/skills/canvas-gestures-and-hit-testing &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/canvas-gestures-and-hit-testing inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/zakariaf/ReactNative-Skills.git --path skills/canvas-gestures-and-hit-testing

Or copy the folder to ~/.gemini/skills/canvas-gestures-and-hit-testing yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/canvas-gestures-and-hit-testing:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/canvas-gestures-and-hit-testing &&
cp -R "$tmp/skills/canvas-gestures-and-hit-testing" ~/.copilot/skills/canvas-gestures-and-hit-testing &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/canvas-gestures-and-hit-testing inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git

Then copy ReactNative-Skills/skills/canvas-gestures-and-hit-testing into your agent's skills folder as canvas-gestures-and-hit-testing. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Single gesture module
All canvas gestures are built in one file so a library upgrade touches only one place.
Typed intent output
Each gesture emits at most one tap, long-press, swipe, drag-end or aim intent.
Layout-based hit testing
Touches are tested against the same layout the canvas draws, with a fixed slop margin.
Pure intent functions
Each surface decides legality in a pure function that tests and bots can reuse.
Touch target proofs
Tests confirm every tappable region meets the minimum touch size on the smallest canvas.
Compliance checker
A script reports each failing rule with its file and suggested fix until the setup passes.

Good for

  • Make taps on a progress grid toggle the right day cell
  • Let users drag a task from an inbox list onto a calendar day
  • Add swipe-to-slide controls to a sliding puzzle game
  • Wire aim-and-release input for a simple arena game
  • Check that every tappable cell on a board meets the minimum touch size

Canvas gestures and hit testing FAQ

What does the skill need before Canvas gestures and hit testing can be used?

It needs the canvas kit files at src/canvas/canvas-layout.ts and canvas-types.ts. If they are missing, the skill says to set them up with skia-canvas-rendering first.

Does Canvas gestures and hit testing change how drawing works?

No. Drawing belongs to skia-canvas-rendering; this skill only handles input and hit-testing on the layout that drawing uses.

Does Canvas gestures and hit testing handle right-to-left layouts?

Yes. Touch coordinates stay physical and only the layout mirrors for right-to-left surfaces, so touches land on the correct cell.

Which Gesture Handler versions are covered?

The builder API is used on 2.x and the hook API on 3.x, with the version pinned by the Expo SDK and a migration reference included.

How do I install Canvas gestures and hit testing in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/canvas-gestures-and-hit-testing to use it in all your projects, or to .claude/skills/canvas-gestures-and-hit-testing in one project. Or install the react-native plugin, which includes it: /plugin marketplace add zakariaf/ReactNative-Skills, then /plugin install react-native@react-native-skills.

Does Canvas gestures and hit testing run scripts?

Yes. It runs JavaScript and TypeScript scripts. No network calls were found in its scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Canvas gestures and hit testing?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Canvas gestures and hit testing?

The closest alternatives to Canvas gestures and hit testing are Accessibility as code, Expo animation, Game session host, Android gesture and Expo animation.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from zakariaf/ReactNative-Skills

  1. Adds a gated debug menu, debug deep link and simulated clock and offline mode to React

    • Open source
    • 16 GitHub stars
    • Developer tools
  2. Checks React Native code for accessibility labels, touch targets, text scaling

    • Open source
    • 16 GitHub stars
    • Developer tools
  3. Sells a one-time Premium unlock through the App Store and Google Play

    • Open source
    • 16 GitHub stars
    • Finance and payments
  4. Walks an Expo app through an SDK, Xcode or Android toolchain upgrade in one commit

    • Open source
    • 16 GitHub stars
    • Developer tools
  5. Builds React Native forms with one valibot schema, catalog-key errors and keyboard-aware

    • Open source
    • 16 GitHub stars
    • Developer tools
  6. Headless seeded bot sims that measure and tune difficulty in React Native games

    • Open source
    • 16 GitHub stars
    • Developer tools