Agent skill

Multithreading

by kingstinct in kingstinct/react-native-healthkit

Software Mansion's best practices for multithreading in React Native apps using react-native-worklets.

MITAuto-check passedMobile

Install Multithreading

skills CLI
$ npx skills add kingstinct/react-native-healthkit --skill multithreading -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install kingstinct/react-native-healthkit multithreading --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/kingstinct/react-native-healthkit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/react-native-best-practices/references/multithreading .claude/skills/multithreading && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
multithreading
GitHub stars
716
Used in
1 other repo
Token cost
~1.1k tokens
SKILL.md length
332 words
Files
4
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Software Mansion's best practices for multithreading in React Native apps using react-native-worklets.

  • Works in 3 steps: Read the user's package.json to find the… → Run npm view react-native-worklets… → If the installed version is older than…
  • Running JavaScript on multiple threads
  • SKILL.md covers Version Check, Runtime Model, API Decision Tree and Critical Rules, plus 1 more section
  • Calls npm

What it does

Multithreading is an agent skill from kingstinct/react-native-healthkit. Software Mansion's best practices for multithreading in React Native apps using react-native-worklets. Use when running JavaScript on multiple threads, offloading heavy computation from the JS thread, communicating between runtimes, or sharing data across threads. Trigger on: 'worklet', 'worklets', 'react-native-worklets', 'runOnUI', 'runOnJS', 'scheduleOnUI', 'scheduleOnRN', 'scheduleOnRuntime', 'createWorkletRuntime', 'background thread', 'UI thread', 'worker runtime', 'Serializable', 'Synchronizable'…

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files (for example `setup-and-advanced.md`, `shared-memory.md` and `threading-api.md`).

It sits in Mobile, covering Async programming and Cross-platform mobile apps. It works with React Native and JavaScript. The repository describes itself as: HealthKit bindings for React Native with TypeScript. The licence is MIT.

When your agent uses it

  • Running JavaScript on multiple threads
  • Offloading heavy computation from the JS thread
  • Communicating between runtimes
  • Sharing data across threads

Example prompts

  • “worklet”
  • “worklets”
  • “react-native-worklets”
  • “/multithreading”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Read the user's package.json to find the installed react-native-worklets version.
  2. Run npm view react-native-worklets version to get the latest published version.
  3. If the installed version is older than the latest, inform the user and recommend upgrading before proceeding with implementation advice.

What it can do on your machine

Read from SKILL.md and the folder at commit 9e4e186. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Multithreading loads about 1.1k tokens when it runs. Until then it costs about 174 tokens; SKILL.md has 332 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~174
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from kingstinct/react-native-healthkit at commit 9e4e186, republished under its MIT licence (© kingstinct). 332 words, ~1,105 tokens.

Download SKILL.mdSave it as .claude/skills/multithreading/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
multithreading
description
Software Mansion's best practices for multithreading in React Native apps using react-native-worklets. Use when running JavaScript on multiple threads, offloading heavy computation from the JS thread, communicating between runtimes, or sharing data across threads. Trigger on: 'worklet', 'worklets', 'react-native-worklets', 'runOnUI', 'runOnJS', 'scheduleOnUI', 'scheduleOnRN', 'scheduleOnRuntime', 'createWorkletRuntime', 'background thread', 'UI thread', 'worker runtime', 'Serializable', 'Synchronizable', 'multithreading', 'parallel execution', 'offload computation', 'background processing', 'Bundle Mode', or any request to move work off the JS thread in a React Native app.

React Native Multithreading with Worklets

Software Mansion's production multithreading patterns for React Native using react-native-worklets.

React Native Worklets lets you run JavaScript code in parallel across multiple threads and runtimes. It powers Reanimated, Gesture Handler, and Skia under the hood.

Version Check

Before answering any multithreading question, check that react-native-worklets is up to date:

  1. Read the user's package.json to find the installed react-native-worklets version.
  2. Run npm view react-native-worklets version to get the latest published version.
  3. If the installed version is older than the latest, inform the user and recommend upgrading before proceeding with implementation advice.

Runtime Model

React Native apps have three kinds of runtimes. Picking the right target is the first decision:

What does the work need?
├── Respond to native events or drive animations on the same frame?
│   └── UI Runtime (main thread, one per app)
├── Heavy computation, data processing, or background tasks?
│   └── Worker Runtime (custom thread, many per app)
└── Access React state, navigation, or RN APIs?
    └── RN Runtime (JS thread, one per app)

Runtimes do not share memory. Data crosses runtime boundaries through serialization (immutable copies) or Synchronizable (shared mutable state).

API Decision Tree

Need to run code on a different runtime?
├── Fire-and-forget (no return value needed)?
│   ├── Target is UI Runtime  → scheduleOnUI(fn, ...args)
│   ├── Target is RN Runtime  → scheduleOnRN(fn, ...args)
│   └── Target is Worker      → scheduleOnRuntime(runtime, fn, ...args)
├── Need the return value asynchronously (Promise)?
│   ├── Target is UI Runtime  → await runOnUIAsync(fn, ...args)
│   └── Target is Worker      → await runOnRuntimeAsync(runtime, fn, ...args)
└── Need the return value synchronously (blocks caller)?
    ├── Target is UI Runtime  → runOnUISync(fn, ...args)
    └── Target is Worker      → runOnRuntimeSync(runtime, fn, ...args)

Critical Rules

The 'worklet' directive: functions that run on Worklet Runtimes must be workletized. Add 'worklet'; as the first statement in the function body. Callbacks passed to scheduleOnUI, scheduleOnRuntime, and similar APIs are autoworkletized by the Babel plugin.

tsx
function computeOnUI() {
  'worklet';
  return 2 + 2;
}

Don't call scheduling APIs from the wrong runtime: scheduleOnUI, runOnUISync, runOnUIAsync, runOnRuntimeSync, runOnRuntimeAsync, scheduleOnRuntime can only be called from the RN Runtime (unless Bundle Mode is enabled). Calling them from a Worklet Runtime throws an error.

Closures are copied, not shared: when a worklet runs on a different runtime, its closure variables are serialized at invocation time. Mutating the original variable after scheduling has no effect on the worklet's copy.

Deprecated APIs: runOnUI is replaced by scheduleOnUI. runOnJS is replaced by scheduleOnRN. runOnRuntime is replaced by scheduleOnRuntime. The new APIs pass arguments directly instead of returning a curried function.

References

Load at most one reference file per question.

FileLoad when question is about
threading-api.mdScheduling work across runtimes, creating Worker Runtimes, sync vs async execution, migrating from deprecated APIs
shared-memory.mdPassing data between runtimes, closures in worklets, Serializable, Synchronizable, shared mutable state
setup-and-advanced.mdInstalling worklets, Babel plugin config, Bundle Mode, testing with Jest, feature flags, troubleshooting

© kingstinct, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files in .agents/skills/react-native-best-practices/references/multithreading of kingstinct/react-native-healthkit.

  • SKILL.md
  • setup-and-advanced.md
  • shared-memory.md
  • threading-api.md

Open the folder on GitHubat commit 9e4e186

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in kingstinct/react-native-healthkit, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Multithreading next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Multithreading compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Multithreading this skillkingstinct/react-native-healthkit7161 repos~1.1kAutomated safety check: PassMIT
Agent Cdpgronxb/codex-relay679—~956Automated safety check: PassApache-2.0
Crossbindcrossbind/crossbind148—~1.1kAutomated safety check: PassMIT
Argent Metro Debuggerbbplayer-app/BBPlayer1.1k—~3.4kAutomated safety check: PassMIT
Diagnosing Stacktrace SymbolicationPostHog/posthog40k—~2.2kAutomated safety check: PassCustom licence
API Designmargelo/react-native-skills175—~7.2kAutomated safety check: PassNone

Similar skills

  • Agent Cdp

    gronxb/codex-relay

    Chrome DevTools Protocol CLI workflow for runtime, console, network, trace, memory, and JavaScript CPU profiling analysis.

    679 GitHub stars~956 tokensUpdated yesterday
    MobileAuto-check passed
  • Crossbind

    crossbind/crossbind

    A skill your agent uses when a user wants to call C++ or Rust from JavaScript or TypeScript; add a native library such as GDAL, SQLite, OpenSSL, GEOS or PROJ to a browser, Node.js, Cloudflare Worker…

    148 GitHub stars~1.1k tokensUpdated today
    MobileAuto-check passed
  • Argent Metro Debugger

    bbplayer-app/BBPlayer

    Debug a JS runtime via CDP using argent debugger tools. An agent skill from bbplayer-app/BBPlayer.

    1.1k GitHub stars~3.4k tokensUpdated today
    MobileAuto-check passed
  • Official

    Help users debug PostHog Error Tracking stack-trace symbolication for any supported platform — JavaScript/TypeScript web, React Native (Hermes), Android (Proguard / R8), or iOS / macOS (dSYM).

    40k GitHub stars~2.2k tokensUpdated today
    MobileAuto-check passed
  • API Design

    margelo/react-native-skills

    Design and review predictable public APIs for TypeScript, JavaScript, React, and React Native libraries.

    175 GitHub stars~7.2k tokensUpdated 1 mo ago
    MobileAuto-check passed
  • Jsi

    software-mansion-labs/skills

    React Native JSI (JavaScript Interface) — C++ API for interacting with the JS runtime.

    291 GitHub stars~904 tokensUpdated 10 days ago
    MobileAuto-check passed

More from kingstinct/react-native-healthkit

All 11 skills in this repo
  • React Native Healthkit

    kingstinct/react-native-healthkit

    How to use @kingstinct/react-native-healthkit (and its sibling @react-native-healthkit/health-records) to read, write and subscribe to Apple HealthKit data from React Native / Expo apps.

    716 GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Gestures

    kingstinct/react-native-healthkit

    Software Mansion's best practices for gestures in React Native apps using React Native Gesture Handler.

    716 GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed
  • Expo Deployment

    kingstinct/react-native-healthkit

    Deploying Expo apps to iOS App Store, Android Play Store, web hosting, and API routes

    716 GitHub starsUsed in 4 repos~930 tokens
    Auto-check passed
  • React Native Healthkit Contributing

    kingstinct/react-native-healthkit

    How to change the react-native-healthkit monorepo itself (packages/core, packages/react-native-healthkit, packages/health-records, apps/example).

    716 GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • Expo Dev Client

    kingstinct/react-native-healthkit

    Build and distribute Expo development clients locally or via TestFlight

    716 GitHub starsUsed in 5 repos~879 tokens
    Auto-check passed
  • Rich Text

    kingstinct/react-native-healthkit

    Software Mansion's best practices for rich text in React Native using react-native-enriched and react-native-enriched-markdown.

    716 GitHub stars~3.1k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Multithreading

What does Multithreading do?

Software Mansion's best practices for multithreading in React Native apps using react-native-worklets. Multithreading is an agent skill from kingstinct/react-native-healthkit. Software Mansion's best practices for multithreading in React Native apps using react-native-worklets.

When should I use Multithreading?

Multithreading fits situations like: running JavaScript on multiple threads; offloading heavy computation from the JS thread; communicating between runtimes; sharing data across threads.

How do I install Multithreading in Claude Code?

Run `npx skills add kingstinct/react-native-healthkit --skill multithreading -a claude-code`. Or copy the skill folder (.agents/skills/react-native-best-practices/references/multithreading in kingstinct/react-native-healthkit) into .claude/skills/multithreading in your project. Claude Code loads it when a task matches its description.

How do I install Multithreading in Codex?

Run `npx skills add kingstinct/react-native-healthkit --skill multithreading -a codex`. Or copy the skill folder (.agents/skills/react-native-best-practices/references/multithreading in kingstinct/react-native-healthkit) into .agents/skills/multithreading in your project. Codex loads it when a task matches its description.

Can I use Multithreading in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add kingstinct/react-native-healthkit --skill multithreading -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/multithreading, .gemini/skills/multithreading, .github/skills/multithreading and .opencode/skills/multithreading in your project.

What does Multithreading need to run?

Going by SKILL.md and its folder, Multithreading needs the command-line tools its instructions call (npm).

Does Multithreading access the network?

SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Multithreading safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Multithreading use?

Multithreading is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Multithreading use?

About 1.1k tokens (SKILL.md is roughly 4.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Multithreading?

Skills that share tags, products or a category with Multithreading: Agent Cdp (gronxb/codex-relay, 679 stars), Crossbind (crossbind/crossbind, 148 stars), Argent Metro Debugger (bbplayer-app/BBPlayer, 1.1k stars) and Diagnosing Stacktrace Symbolication (PostHog/posthog, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Multithreading?

kingstinct (a GitHub organization) maintains it in kingstinct/react-native-healthkit, which has 716 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on October 7, 2026.

Source: kingstinct/react-native-healthkit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.