Simulator Audio E2E
hyochan/react-native-nitro-sound
Build and run repeatable react-native-nitro-sound recorder/player regression tests on an iOS Simulator or Android emulator, with explicit virtual-device selection, microphone permission, Maestro…
Builds and designs React Native Nitro Modules with Nitrogen, HybridObject TypeScript specs, Nitro View components, generated native implementations, zero-copy and native-state APIs, Swift/Kotlin/C++…
$ npx skills add margelo/react-native-skills --skill build-nitro-modules -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install margelo/react-native-skills build-nitro-modules --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/margelo/react-native-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/build-nitro-modules .claude/skills/build-nitro-modules && rm -rf skills-srcUse ~/.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/
Install the "build-nitro-modules" agent skill from https://github.com/margelo/react-native-skills/tree/main/skills/build-nitro-modules into .claude/skills/build-nitro-modules/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "build-nitro-modules", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/margelo/react-native-skills/tree/main/skills/build-nitro-modulesType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add margelo/react-native-skills --skill build-nitro-modules -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install margelo/react-native-skills build-nitro-modules --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/margelo/react-native-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/build-nitro-modules .agents/skills/build-nitro-modules && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "build-nitro-modules" agent skill from https://github.com/margelo/react-native-skills/tree/main/skills/build-nitro-modules into .agents/skills/build-nitro-modules/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "build-nitro-modules", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add margelo/react-native-skills --skill build-nitro-modules -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install margelo/react-native-skills build-nitro-modules --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/margelo/react-native-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/build-nitro-modules .cursor/skills/build-nitro-modules && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "build-nitro-modules" agent skill from https://github.com/margelo/react-native-skills/tree/main/skills/build-nitro-modules into .cursor/skills/build-nitro-modules/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "build-nitro-modules", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/margelo/react-native-skills.git --path skills/build-nitro-modules--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add margelo/react-native-skills --skill build-nitro-modules -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install margelo/react-native-skills build-nitro-modules --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/margelo/react-native-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/build-nitro-modules .gemini/skills/build-nitro-modules && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "build-nitro-modules" agent skill from https://github.com/margelo/react-native-skills/tree/main/skills/build-nitro-modules into .gemini/skills/build-nitro-modules/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "build-nitro-modules", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install margelo/react-native-skills build-nitro-modulesInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add margelo/react-native-skills --skill build-nitro-modules -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/margelo/react-native-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/build-nitro-modules .github/skills/build-nitro-modules && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "build-nitro-modules" agent skill from https://github.com/margelo/react-native-skills/tree/main/skills/build-nitro-modules into .github/skills/build-nitro-modules/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "build-nitro-modules", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add margelo/react-native-skills --skill build-nitro-modules -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install margelo/react-native-skills build-nitro-modules --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/margelo/react-native-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/build-nitro-modules .opencode/skills/build-nitro-modules && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "build-nitro-modules" agent skill from https://github.com/margelo/react-native-skills/tree/main/skills/build-nitro-modules into .opencode/skills/build-nitro-modules/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "build-nitro-modules", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
build-nitro-modulesBuilds and designs React Native Nitro Modules with Nitrogen, HybridObject TypeScript specs, Nitro View components, generated native implementations, zero-copy and native-state APIs, Swift/Kotlin/C++…
Build Nitro Modules is an agent skill from margelo/react-native-skills. Builds and designs React Native Nitro Modules with Nitrogen, HybridObject TypeScript specs, Nitro View components, generated native implementations, zero-copy and native-state APIs, Swift/Kotlin/C++ bindings, example apps, and testing. Use when creating a Nitro Module, adding or reviewing HybridObjects, building a Nitro View (HybridView) component, designing Nitro-specific public APIs, implementing native functionality, or setting up the nitrogen codegen pipeline. Pair with api-design for general library API shape.
Its SKILL.md is about 9.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 16 other files, including reference files (for example `references/example-android-config.md`, `references/example-app-setup.md` and `references/example-metro-install.md`).
It sits in Mobile, covering Cross-platform mobile apps, API design and Project scaffolding. It works with React Native, Kotlin, C++ and TypeScript. The repository describes itself as: The best react-native Agent Skills. Forget 10x, this is 100x. The licence is MIT.
5 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 1e9e17b. It shows what the files ask for, not the result of running them.
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.
Shell commands in SKILL.md call:
bunbunxFrom the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
nitro.margelo.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Build Nitro Modules loads about 9.9k tokens when it runs, and up to ~51k if it reads all its reference files. Until then it costs about 135 tokens; SKILL.md has 4,503 words of instructions outside code blocks.
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.
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.
The full file from margelo/react-native-skills at commit 1e9e17b, republished under its MIT licence (© margelo). 4,503 words, ~9,888 tokens.
.claude/skills/build-nitro-modules/SKILL.md (or your agent's skills folder). This skill also uses 15 other files; get the full folder from GitHub.End-to-end skill for building a React Native Nitro Module: monorepo scaffolding via Nitrogen, TypeScript HybridObject spec authoring, native code generation, platform implementation (C++/Swift/Kotlin), example app wiring, and publish preparation.
Nitro Modules use a codegen pipeline (nitrogen) that reads .nitro.ts spec files and generates native C++/Swift/Kotlin boilerplate. You then fill in the implementation. This is fundamentally different from old-style turbo modules.
Generated files under nitrogen/generated/ are outputs. Change the .nitro.ts spec or native implementation source, then re-run nitrogen instead of manually editing generated files. These files can be committed to git, and many Nitro libraries do commit them, but the repo policy can choose otherwise. They must be included in the npm package so consumers can build the native library.
Use api-design first when shaping the public TypeScript, JavaScript, React, or React Native API. This skill adds the Nitro-specific constraints: HybridObject state, generated specs, native resource ownership, zero-copy data, threading, platform implementation, codegen, and real-device validation.
Let api-design own general public API rules and API freshness checks. In this skill, only add Nitro-specific freshness checks for mobile toolchain and generated-template decisions: verify current Nitro, React Native, Gradle, Xcode, Swift, Kotlin, NDK, and package-tooling docs/source before choosing versions, config fields, or native implementation details.
If the user is building a JS-only React or React Native library, do not apply this skill unless Nitro, HybridObjects, native modules, codegen, C++/Swift/Kotlin bindings, or react-native-nitro-modules are part of the task.
Pair with swift when implementing or reviewing Swift-backed HybridObjects, AVFoundation/session code, DispatchQueue usage, Swift concurrency, or thread-affine Swift state. Pair with kotlin when implementing or reviewing Kotlin-backed HybridObjects, Android threading, coroutines, Kotlin nullability, sealed result models, or Android service access. Pair with cpp when implementing or reviewing C++-backed HybridObjects, shared native engines, CMake, RAII ownership, or generated C++ spec bindings.
Load repo-structure-and-workflow.md only when creating a repo, reorganizing layout, adding examples/docs/CI, or changing workflow policy.
Load release-it-publishing.md only when setting up or reviewing bun release / release-it.
createCameraSession(...): Promise<CameraSession>.CameraVideoOutput backed by either a movie-file output or a video-data-output plus asset writer. Factories choose the native implementation and return the shared spec type.VisionCamera = createHybridObject<CameraFactory>('CameraFactory') or Images = createHybridObject<ImageFactory>('ImageFactory'). This avoids collisions with CameraFactory/ImageFactory types without mechanically lowercasing them or adding Hybrid prefixes.DataScannerFactory can expose createBarcodeScanner() and createTextScanner() instead of one broad scanner whose text fields are nullable because Android currently supports only barcodes.isTextScannerAvailable: false or reject createTextScanner() on platforms that do not support that capability today. Future platform support should fill in the existing capability and flip availability to true, not require redesigning a fat HybridObject.CameraObjectOutput can extend a shared CameraOutput, be marked @platform iOS, and reject at createObjectOutput(...) on Android instead of adding object-scanning nullable fields to every output.createLiveScanner() returns a live scanner session, baseline session operations that the implementation controls should be guaranteed by that type. Backends that cannot provide the live workflow should fail creation or return a narrower object, not force the live object to expose dead methods, nullable baseline properties, or repeated can* checks.configure(...) binds a device, output, stream, or native graph, return a new HybridObject handle for commands that only make sense for that configured resource. For example, a CameraSession.configure(...) method should return CameraController handles for setZoom(...) and focusTo(...) instead of putting those methods on CameraSession with implicit "current device" state..nitro.ts file..nitro.ts file only when the file is named after the base HybridObject and child HybridObjects add few or no members, such as ScannedCode, ScannedBarcode, and ScannedQRCode in ScannedCode.nitro.ts..ts files: string-literal unions/enums, structs/interfaces, option objects, event objects, callback option structs, and helper types. Nitro needs names for generated native structs and enum-like values. Import them into .nitro.ts specs and re-export public types from src/index.ts.addErrorListener(listener: (error: Error) => void): ListenerSubscription. Do not create one-off aliases such as ScannerErrorListener unless the function type is reused as a public concept across multiple APIs.DynamicRange plus the exact literal unions that define it.ScannedItem owns common state and methods, while ScannedBarcode, ScannedQRCode, and ScannedFace extend it with specialized properties. APIs can return ScannedItem[]; JS narrows by a discriminator property, and native code can accept the generated base spec when it only needs common behavior.barcode plus barcodeType are compile-time safe..nitro.ts spec exposes.nitro.json autolinking entries. Do not autolink every concrete native implementation of the same JS-facing spec.T? / std::optional<T>) in generated Swift, Kotlin, and C++. Use optional Nitro fields only when absence is part of the intended public/native contract, not because a JS wrapper will translate them away.ArrayBuffer for small or truly zero-copy native data access. For large media, photos, scans, model outputs, or byte payloads, return a HybridObject and expose lazy methods such as toArrayBuffer(), toBase64(), or saveToTemporaryFile() instead of eagerly converting bytes into JS.ArrayBuffer only because it is zero-copy. Use string for decoded text payloads and ArrayBuffer for raw bytes, binary payloads, media, or opaque data where byte-level access is the API contract.rawValue, bounds, format, or byte data lazily instead of converting every field for every detection.addOn...Listener(callback): ListenerSubscription and let each subscription own its cleanup. This avoids one caller replacing another caller's callback through shared object state.remove: () => void function field, not HybridObjects, unless they expose native state beyond cleanup. Call sites still use subscription.remove().setOn...(callback | undefined)-style API only for single hot-path callbacks owned by an object, where replacing or removing the callback is the natural operation. The set verb and docs must make the replacement semantics clear.Sync<(...) => ...> callbacks only for rare thread-bound hot paths that must synchronously execute on a specific JS runtime or worklet thread.getHostComponent wrapper. Add React components or hooks only when they remove repeated setup code while staying layered over the same native objects and refs. Load spec-hybrid-view.md when creating or reviewing a Nitro View component.api-design for naming, platform abstraction, sync/async boundaries, listener cleanup, errors, variants, TypeScript facades, and JSDoc contracts.compileSdkVersion 34+, and NDK 27+; Nitro Views currently require React Native 0.78+ and the New Architecture.Hybrid*Spec for that platform. Never implement a standalone native class and expect Nitro to discover it.final by default unless inheritance is genuinely required. This is especially true for Swift and Kotlin HybridObjects.Hybrid*Factory.swift/.kt file contains the Hybrid*Factory type and no other structs/classes/enums/interfaces/protocols. Helper sessions, coordinators, delegates, option adapters, and platform wrappers go in their own files.Int or Swift Int. Use the domain type's companion, static factory, or initializer direction instead, such as BarcodeFormat.Companion.fromFormat(format: Int) or BarcodeFormat.from(format:).fun/val/var and Swift extension method/property in a separate named extension/converter file with internal/package visibility where possible. Use Type+operation.kt names such as BarcodeFormat+fromMLKitBarcodeFormat.kt for Kotlin converters. There is no private/tiny/same-file exception for Hybrid* files or other implementation files; this keeps code splitting, maintainability, and future review diffs clean.Hybrid*Factory.kt or Hybrid*.swift file must not contain barcode-format mappings, companion extensions, platform conversion utilities, or other extensions below the implementation.Hybrid*Factory files as orchestration only: resolve generated options, call validation/preflight helpers, create/start the native session or platform API, and return/reject the Promise. Do not define session/coordinator/delegate classes, native option adapter structs/classes, presenter lookup helpers, builder/config adapters, barcode mappings, permission switches, Info.plist/manifest checks, or capability checks in factory files.Barcode+toScannedCode.kt, TargetBarcodeFormat+toMLKitFormat.kt, and BarcodeFormat+fromMLKitBarcodeFormat.kt. Do not hide a trivial map { it.toX() } behind a concrete collection extension like Array<TargetBarcodeFormat>.toMLKitFormats().Hybrid* factories and implementation methods. Authorization-status switches, Info.plist/manifest key validation, permission checks, hardware capability checks, and service availability checks belong in focused helper/extension files; the HybridObject call site should read as a short guard or one-line try/check call.Utils file. Use small named files such as Bundle+CameraUsageDescription.swift, AVCaptureDevice+CameraAuthorization.swift, or a focused Android permission/capability helper.Int constants when the platform exposes a matching annotation or @IntDef, such as CameraX flash/capture/mirror mode annotations. Place the annotation according to its target on the function, return value, or parameter; verify whether it is a Java or Kotlin annotation before choosing the syntax.Int, annotate the format: Int parameter on the domain factory/companion function when supported; this gives better IDE and lint feedback than a bare Int.NSError public paths unless the generated API specifically requires it.Bridge.h to Nitro Modules. Nitro generates the Swift/C++ bridge it needs. Add Objective-C/Objective-C++ headers only when real handwritten Objective-C code requires them, and include only necessary files in the podspec.NitroModules.applicationContext lazily and throw a clear error if it is unavailable.Promise<T>.Promise.parallel(queue) for DispatchQueue-owned work such as AVFoundation/session queues, and use Promise.async only when wrapping Swift async/await or Task-based APIs end to end. For UIKit/VisionKit main-thread callback APIs, prefer a manual Promise with direct DispatchQueue.main.async at the Nitro entry/callback boundary; do not use Task { @MainActor in ... } as a generic main-thread hop.Promise<T> instances. Prefer Promise.async, Promise.parallel, Promise.resolved, and Promise.rejected because they complete exactly once through structured control flow. A manual Promise is only justified when bridging a native completion/delegate/callback API that cannot use the helpers; keep it in the smallest scope, do not pass it through arbitrary helpers, and guarantee every path resolves or rejects exactly once.Task<T> once as Task+await.kt with suspendCancellableCoroutine, then use return Promise.async(scope) { task.await() } in the HybridObject method.addOnSuccessListener/addOnFailureListener/addOnCanceledListener inside Hybrid* methods when a reusable callback-to-suspend adapter can express the API once.Task, DispatchQueue, coroutine dispatcher, executor, and JS/Nitro runtime hops inside one operation. Pick a native owner queue/thread/dispatcher for each HybridObject or session and cross into it once at the Promise, lifecycle, or callback boundary. Repeated hops are a sign the HybridObject boundaries or lifecycle handles are wrong.setTimeout, sleeps, artificial delays, extra thread hops, or calling native methods twice. Model readiness with a Promise, listener/event, returned configured HybridObject, explicit state transition, or native completion callback. Use retries only for external hardware, OS service, remote service, or network uncertainty, with bounded/cancellable/idempotent behavior.memorySize for HybridObjects that own native resources or large allocations so the JS VM can collect them under memory pressure.prepareForRecycle when the view owns state that should be reset before reuse. See spec-hybrid-view.md for the full view spec, implementation, registration, and recycling workflow.StorageFactory can accept a Swift/Kotlin PlatformContext and call getTemporaryDirectory() or writeFile(...) through the generated C++ interface. C++ can access only the public spec API, not private Swift/Kotlin fields.react-native-harness when available for end-to-end testing in a real React Native environment. For native-heavy libraries, prefer real-device or CI device-farm coverage for the API surface that depends on hardware or OS behavior.First, determine what the user wants to do:
"Are you creating a new Nitro Module library from scratch, or adding a new HybridObject to an existing library?"
react-native-math)packages/ folder — Should the library live in packages/<name> inside a monorepo? (Strongly recommended — default: yes)apps/example when multiple examples are needed or likely, example only for a small single-example repo that should stay close to generated RN config)swift (default) or cppkotlin (default) or cppcppDo not proceed past Step 1 of the build sequence until all five questions are answered.
Camera, Crypto)swift or cpp? Android: kotlin or cpp?Then skip directly to spec-hybrid-object.md (write the spec), spec-nitro-json.md (add autolinking entry), native-nitrogen-codegen.md (re-run nitrogen), and the relevant native implementation file. Skip all setup, monorepo, and example app steps.
If the new HybridObject is a renderable view component, use spec-hybrid-view.md instead of the plain HybridObject spec reference — it covers the HybridView spec, native view implementation, Android view manager registration, and the getHostComponent JS wiring.
# 0. Work on a separate branch; open a draft PR after the first useful commit
# 1. Scaffold
bunx nitrogen@latest init react-native-math
# 2. Run codegen (from package folder after writing spec + nitro.json)
cd packages/react-native-math && bunx nitrogen
# 3. Create example app
bunx @react-native-community/cli@latest init --skip-install MathExample
mkdir -p apps && mv MathExample apps/example
# Alternative: mv MathExample example
# 4. Install and test
cd apps/example && bun add ../../packages/react-native-math
bun add react-native-nitro-modules@<same-version-as-package>
bun example android
bun example iosFull step-by-step references below.
Reference these guidelines when:
*.nitro.ts files)release-it and bun release| Priority | Category | Impact | Reference |
|---|---|---|---|
| 0 | General public API shape | CRITICAL | api-design |
| 0 | Nitro API constraints | CRITICAL | This SKILL.md |
| 1 | Repo structure and workflow | HIGH | repo-structure-and-workflow.md |
| 2 | Nitrogen scaffold | CRITICAL | setup-monorepo-init.md |
| 3 | HybridObject spec | CRITICAL | spec-hybrid-object.md |
| 3 | Hybrid View components (if building a view) | HIGH | spec-hybrid-view.md |
| 4 | nitro.json autolinking | CRITICAL | spec-nitro-json.md |
| 5 | Nitrogen codegen | HIGH | native-nitrogen-codegen.md |
| 6 | C++ implementation | HIGH | native-implement-cpp.md |
| 7 | Kotlin implementation | HIGH | native-implement-kotlin.md |
| 8 | Swift implementation | HIGH | native-implement-swift.md |
| 9 | Example app setup (if requested) | HIGH | example-app-setup.md |
| 10 | Android Gradle paths (if example app) | HIGH | example-android-config.md |
| 11 | Metro + install + test (if example app) | HIGH | example-metro-install.md |
| 12 | npm publish readiness | MEDIUM | spec-package-publish.md |
| 13 | release-it publishing | MEDIUM | release-it-publishing.md |
| 14 | VisionCamera-style full library patterns | MEDIUM | vision-camera-golden-standard.md |
src/specs/Math.nitro.ts)import type { HybridObject } from 'react-native-nitro-modules'
export interface Math extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> {
add(a: number, b: number): number
}src/index.ts)import { NitroModules } from 'react-native-nitro-modules'
import type { Math } from './specs/Math.nitro'
export const math = NitroModules.createHybridObject<Math>('Math')
export type { Math } from './specs/Math.nitro'Package entry points such as src/index.ts, index.ts, index.js, and index.tsx must stay barrels. They may contain direct re-exports and a one-line Nitro root export such as export const camera = NitroModules.createHybridObject<Camera>('Camera'), but no actual implementation logic, functions, classes, hooks, components, branching, side effects, or helper definitions. Move real definitions to focused files and re-export them.
For JS/TS source in Nitro packages, keep absence and mutation explicit: never use void 0 instead of undefined, and never use logical assignment operators such as ??=, ||=, or &&=. Prefer an explicit if block or direct assignment that makes fallback behavior visible.
nitro.json{
"$schema": "https://nitro.margelo.com/nitro.schema.json",
"cxxNamespace": ["math"],
"ios": { "iosModuleName": "NitroMath" },
"android": {
"androidNamespace": ["math"],
"androidCxxLibName": "NitroMath"
},
"autolinking": {
"Math": {
"ios": {
"language": "swift",
"implementationClassName": "HybridMath"
},
"android": {
"language": "kotlin",
"implementationClassName": "HybridMath"
}
}
}
}package.json Scripts{
"scripts": {
"specs": "bun --cwd packages/react-native-math run specs",
"example": "bun --cwd apps/example"
}
}Run: bun example android, bun example ios, bun specs
| File | Description |
|---|---|
| repo-structure-and-workflow.md | Root layout, README/docs, packages/apps/config/scripts, CI, branch, draft PR, and squash-merge workflow |
| setup-monorepo-init.md | Collecting scaffold inputs and running nitrogen init |
| spec-hybrid-object.md | Writing *.nitro.ts specs and exporting HybridObjects |
| spec-hybrid-view.md | Building Nitro View components: HybridView specs, native views, getHostComponent, hybridRef, callbacks, recycling |
| spec-nitro-json.md | nitro.json all fields, autolinking, namespace configuration |
| native-nitrogen-codegen.md | Running Nitrogen and verifying generated files |
| native-implement-cpp.md | Implementing HybridObjects in C++ |
| native-implement-kotlin.md | Implementing HybridObjects in Kotlin (Android) |
| native-implement-swift.md | Implementing HybridObjects in Swift (iOS) |
| example-app-setup.md | RN CLI example app init, workspace wiring, version alignment |
| example-android-config.md | settings.gradle and build.gradle monorepo path fixes |
| example-metro-install.md | Metro watchFolders, library install, App.tsx usage, test runs |
| spec-package-publish.md | package.json author, files field, and npm publish readiness |
| release-it-publishing.md | One-command releases with release-it and bun release |
| vision-camera-golden-standard.md | Package layout, API layering, Nitro object modeling, and publishing patterns inspired by VisionCamera |
| Problem | Reference | Action |
|---|---|---|
| Need to design the public API first | api-design + this SKILL.md | Shape the TS/React API, then apply Nitro constraints |
| Need latest general APIs | api-design | Check official docs, release notes, source repos, package metadata, or llms-full.txt before deciding |
| Need a recommended repo structure | repo-structure-and-workflow.md | Use main, a strong README, packages/, apps/ or example/, optional Fumadocs, scripts/, config/, and .github/workflows/ |
| Unsure static module vs instance API | This SKILL.md | Prefer HybridObjects for native state, resources, prewarming, and zero-copy data |
| Don't know where to start | setup-monorepo-init.md | Scaffold with nitrogen init |
| Spec file syntax error | spec-hybrid-object.md | Fix *.nitro.ts interface |
| Need a native view component | spec-hybrid-view.md | Write a HybridView spec, implement view, register the Android manager, wire getHostComponent |
View callback prop arrives as true / never fires | spec-hybrid-view.md | Wrap every function prop (including hybridRef) with callback(...) |
| Android "view manager not found" for a Nitro View | spec-hybrid-view.md | Add the generated Hybrid*ViewManager in createViewManagers |
| Autolinking not working | spec-nitro-json.md | Check nitro.json autolinking block |
| Nitrogen generates no files | native-nitrogen-codegen.md | Verify spec file extension and run command from right dir |
| C++ types unclear | native-implement-cpp.md | Follow type reference links to canonical examples |
| Kotlin compilation error | native-implement-kotlin.md | Check annotations and override modifiers |
| Swift compilation error | native-implement-swift.md | Check class inheritance and property signatures |
| Example app won't build (Android) | example-android-config.md | Fix Gradle monorepo path configuration |
| Metro can't resolve library | example-metro-install.md | Add watchFolders to metro.config.js |
| Version mismatch between example and package | example-app-setup.md | Align react-native versions across workspaces |
| Package missing files on npm | spec-package-publish.md | Fix files field in package.json |
| Need one-command releases | release-it-publishing.md | Configure release-it behind bun release |
| Need a full-featured library structure | vision-camera-golden-standard.md | Use the VisionCamera-inspired package, API, hooks, views, and Nitro object model |
© margelo, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 15 other files (references) in skills/build-nitro-modules of margelo/react-native-skills.
Open the folder on GitHubat commit 1e9e17b
Build Nitro Modules 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Build Nitro Modules this skillmargelo/react-native-skills | 175 | — | ~9.9k | Automated safety check: Pass | MIT | |
| Simulator Audio E2Ehyochan/react-native-nitro-sound | 961 | — | ~1.1k | Automated safety check: Pass | MIT | |
| Expo Brownfield Integrationmweinbach/agent-coworker | 156 | 2 repos | ~900 | Automated safety check: Notes | Custom licence | |
| Moq Kitsoftware-mansion-labs/skills | 291 | — | ~5k | Automated safety check: Pass | Apache-2.0 | |
| Upgrade React NativeShopify/flash-list | 7.2k | — | ~1.9k | Automated safety check: Pass | MIT | |
| Expo Brownfieldexpo/skills | 2.7k | — | ~1.4k | Automated safety check: Pass | MIT |
hyochan/react-native-nitro-sound
Build and run repeatable react-native-nitro-sound recorder/player regression tests on an iOS Simulator or Android emulator, with explicit virtual-device selection, microphone permission, Maestro…
mweinbach/agent-coworker
Helps add Expo and React Native to an existing native iOS or Android app, and choose between a prebuilt AAR or XCFramework and a fully integrated build.
software-mansion-labs/skills
Software Mansion's moq-kit — native Swift (iOS) and Kotlin (Android) SDKs for Media over QUIC (moq-lite) live streaming: sub-second-latency playback, camera/microphone/screen publishing, and…
Shopify/flash-list
Upgrade the React Native fixture app to a new version. An agent skill from Shopify/flash-list.
expo/skills
Integrate Expo and React Native into an existing native iOS or Android app.
expo/skills
Migrate an existing Apple/Swift Expo native module from the Expo Modules API 1.0 definition DSL to the 2.0 macro API (sometimes called v2) while preserving its JavaScript and TypeScript contract.
margelo/react-native-skills
Design, implement, and review Kotlin and Android APIs. An agent skill from margelo/react-native-skills.
margelo/react-native-skills
Design, implement, and review Swift APIs and Apple-platform code.
margelo/react-native-skills
Fast native networking primitives for React Native built on Nitro Modules — react-native-nitro-fetch, react-native-nitro-websockets, and react-native-nitro-text-decoder.
margelo/react-native-skills
Fast synchronous key-value storage for React Native via react-native-mmkv (Nitro-backed).
margelo/react-native-skills
Design and review production-grade low-latency VisionCamera v5 pipelines.
margelo/react-native-skills
Design and review predictable public APIs for TypeScript, JavaScript, React, and React Native libraries.
Works with
Categories
Builds and designs React Native Nitro Modules with Nitrogen, HybridObject TypeScript specs, Nitro View components, generated native implementations, zero-copy and native-state APIs, Swift/Kotlin/C++…. Build Nitro Modules is an agent skill from margelo/react-native-skills. Builds and designs React Native Nitro Modules with Nitrogen, HybridObject TypeScript specs, Nitro View components, generated native implementations, zero-copy and native-state APIs, Swift/Kotlin/C++ bindings, example apps, and testing.
Build Nitro Modules fits situations like: creating a Nitro Module; reviewing HybridObjects; building a Nitro View (HybridView) component; designing Nitro-specific public APIs.
Run `npx skills add margelo/react-native-skills --skill build-nitro-modules -a claude-code`. Or copy the skill folder (skills/build-nitro-modules in margelo/react-native-skills) into .claude/skills/build-nitro-modules in your project. Claude Code loads it when a task matches its description.
Run `npx skills add margelo/react-native-skills --skill build-nitro-modules -a codex`. Or copy the skill folder (skills/build-nitro-modules in margelo/react-native-skills) into .agents/skills/build-nitro-modules in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add margelo/react-native-skills --skill build-nitro-modules -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/build-nitro-modules, .gemini/skills/build-nitro-modules, .github/skills/build-nitro-modules and .opencode/skills/build-nitro-modules in your project.
Going by SKILL.md and its folder, Build Nitro Modules needs the command-line tools its instructions call (bun and bunx).
SKILL.md names 1 domain. In commands or code: nitro.margelo.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.
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.
Build Nitro Modules is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 9.9k tokens (SKILL.md is roughly 40k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 41k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Build Nitro Modules: Simulator Audio E2E (hyochan/react-native-nitro-sound, 961 stars), Expo Brownfield Integration (mweinbach/agent-coworker, 156 stars), Moq Kit (software-mansion-labs/skills, 291 stars) and Upgrade React Native (Shopify/flash-list, 7.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
margelo (a GitHub organization) maintains it in margelo/react-native-skills, which has 175 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on August 21, 2026.
Source: margelo/react-native-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.