
react-native-vision-camera-realtime
Design and review production-grade low-latency VisionCamera v5 pipelines. Use for real-time GPU, ML, CV, Skia or WebGPU overlays, Nitro frame plugins, zero-copy interop, frame budgets, and latency profiling. Use the general react-native-vision-camera skill for setup, capture, controls, basic frame outputs, or v4 migration.
- Installs
- 111
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/margelo/react-native-skills --skill react-native-vision-camera-realtime- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads react-native-vision-camera-realtime automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Real-time VisionCamera pipelines
This is the specialized companion to react-native-vision-camera. Optimize the complete path from Camera buffer to final result, not an isolated stage. Before relying on exact APIs, check installed versions against current VisionCamera docs and the consumer's official docs or source.
Choose by final consumer
| Final consumer | Preferred path |
|---|---|
| Frame-coupled rendering, effects, or overlays | Keep processing and drawing on one GPU timeline with <SkiaCamera /> or WebGPU |
| WGSL compute or GPU inference | Frame.getNativeBuffer() to a WebGPU video frame to device.importExternalTexture(...) |
| Native plugin that depends on VisionCamera | A long-lived Nitro HybridObject whose hot method accepts a typed Frame |
| Native library without a VisionCamera dependency | The untyped NativeBuffer pointer and explicit release contract |
| State-only ML or scanning | Benchmark the platform runtime across ANE or NPU, GPU, and CPU backends; return compact state |
| CPU-only consumer | Use the smallest useful resolution and format with a bounded, reusable CPU buffer path |
Load references/interop.md only when implementing or reviewing Nitro, NativeBuffer, WebGPU, Skia, Resizer, or ArrayBuffer interop.
Hot-path invariants
- Keep orientation and mirroring as metadata. Set
enablePhysicalBufferRotation: false, then passframe.orientationandframe.isMirroredto the consumer or apply them in the same GPU transform that scales, crops, or renders. Never rotate the Camera buffer physically. - Stay in one execution and memory domain. In a GPU pipeline, import once, keep preprocessing, inference, postprocessing, and rendering on the GPU, and read back only a compact result when required.
- Prefer
pixelFormat: 'native'for a verified GPU-only path. Checkframe.pixelFormatandframe.hasNativeBufferbecause the resolved native format may be YUV, RGB, RAW, or private. - Do not use
getPixelBuffer(),getPlanes(), plane pixel buffers, mapped GPU buffers, or typed pixel views in the normal GPU path. CPU visibility can force synchronization or download. - Create and warm pipelines, shaders, samplers, model sessions, resizers, large buffers, and native processors once. Reuse them for the component or session lifetime; never allocate them per frame.
- Draw frame-coupled overlays from the same
Framewith Skia or WebGPU. Do not route per-frame geometry through React state, ordinary views, or Reanimated shared values. - Release every
Frame,NativeBuffer, wrapper, texture, and pooled slot exactly once on every path. Release wrappers in reverse ownership order and dispose theFramelast.
Prefer same-frame processing
Keep detection, tracking, decisions, and drawing synchronous with the matching frame when they must align visually. At 60 FPS the hard interval is 16.67 ms; at 30 FPS it is 33.33 ms. Target under roughly 16 ms and 33 ms to leave scheduling margin.
"Synchronous" means same-frame dataflow, not blocking the CPU until the GPU finishes. Encode dependent GPU stages in one command graph when possible. Do not add per-frame queue.onSubmittedWorkDone(), buffer mapping, readback, or another CPU or GPU fence.
Before making work asynchronous, remove copies and readbacks, reduce input resolution or FPS, fuse passes, optimize model tensors, and reuse warmed state. Use async only when the optimized work still cannot fit the frame interval, often around 50 ms or more, and the product accepts stale results. For frame-coupled visuals, prefer simplifying the work over visible lag.
The async delivery patterns are peers:
- native Nitro work with a retained completion callback
- native Nitro work that stores completed state behind a synchronous latest-state getter
- a synchronous native method scheduled with VisionCamera's
useAsyncRunner()
Every async design must bound in-flight work. Use one active task or a small fixed pool, reject or replace stale pending input, and never build an unbounded FIFO queue. dropFramesWhileBusy is an overload guard, not the architecture. With useAsyncRunner(), dispose an accepted Frame inside the task and a rejected Frame immediately.
Choose ML compute end to end
If inference feeds a same-frame Skia or WebGPU render, prefer keeping the entire path on the GPU. Crossing to an ANE, NPU, or CPU and returning geometry to the renderer is worthwhile only when end-to-end profiling proves it is faster while preserving the frame budget.
For state-only scanning, benchmark the platform runtime's available compute units. An ANE or NPU can avoid GPU contention and accelerate supported models; a CPU can win for tiny models when accelerator dispatch and transfer cost dominates. Measure input conversion, synchronization, inference, and result delivery, not inference alone. Normal React state or navigation is fine after a scan that has no frame-coupled overlay.
Development and production checks
When all native dependencies support it, use a resizable iPad-shaped Mac Catalyst or iPad-on-Mac build as a rapid iteration harness. A desktop agent can relaunch, resize, and screenshot it while using a built-in Mac camera or external UVC camera via useCameraDevice('external'). Fall back to a phone when the Mac target or required plugin is unavailable.
The Mac loop is for functional iteration, not performance prediction. Validate release builds on every production device class and representative GPUs. Test long enough to expose thermal throttling and pool leaks. Track:
- camera timestamp to matching result or presentation latency at median, p95, and p99
- dropped frames and maximum in-flight frames
- CPU and GPU time, readbacks, maps, and synchronization points
- allocations per frame, steady-state memory, sustained FPS, temperature, and power
Sample GPU timings asynchronously and sparsely enough that instrumentation does not become a synchronization point.
Authoritative references
- VisionCamera: docs index, performance, async processing, external cameras
- Rendering and compute: VisionCamera Skia, React Native WebGPU integration
- ML compute: Apple Core ML compute units, LiteRT NPU delegates
FAQ
What does the react-native-vision-camera-realtime skill do?
Design and review production-grade low-latency VisionCamera v5 pipelines. Use for real-time GPU, ML, CV, Skia or WebGPU overlays, Nitro frame plugins, zero-copy interop, frame budgets, and latency profiling. Use the general react-native-vision-camera skill for setup, capture, controls, basic frame outputs, or v4 migration.
How do I install react-native-vision-camera-realtime?
Run npx skills add https://github.com/margelo/react-native-skills --skill react-native-vision-camera-realtime in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/react-native-vision-camera-realtime/ (personal) or .claude/skills/react-native-vision-camera-realtime/ (project).
Which AI agents can use react-native-vision-camera-realtime?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is react-native-vision-camera-realtime safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains react-native-vision-camera-realtime?
It is published by margelo in margelo/react-native-skills. It has 111 recorded installs.
More from margelo/react-native-skills
react-native-mmkv
margelo/react-native-skills
Fast synchronous key-value storage for React Native via react-native-mmkv (Nitro-backed). Covers creating and configuring MMKV instances, reading/writing all value types (string, number, boolean, buffer), React hooks for reactive UI, value-change listeners, encryption, AsyncStorage migration, and state-management integrations (zustand, redux-persist, jotai, react-query). Also covers storage limits, multi-process mode, and the V4 upgrade from the class-based API.
build-nitro-modules
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.
react-native-vision-camera
margelo/react-native-skills
Best-practices guide for React Native VisionCamera v5 setup, migration, capture, controls, outputs, and basic frame processing. Use the separate react-native-vision-camera-realtime skill for production low-latency GPU, ML, CV, Skia or WebGPU pipelines and frame-coupled overlays.
nitro-fetch
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. Covers the fetch API, global replacement, prefetching and cold-start cache warming, the NitroWebSocket class and pre-warming, migrating from React Native's built-in WebSocket, the in-process NetworkInspector, native Perfetto / Instruments tracing, the native TextDecoder, and plugging nitro-fetch into axios via a custom adapter.
api-design
margelo/react-native-skills
Design and review predictable public APIs for TypeScript, JavaScript, React, and React Native libraries. Use when shaping exported functions, classes, hooks, options objects, event and listener APIs, error behavior, naming, cross-platform abstractions, or JS-only packages. Pair with build-nitro-modules when the library is backed by Nitro.
swift
margelo/react-native-skills
Design, implement, and review Swift APIs and Apple-platform code. Use when working on .swift files, Swift types, Foundation or AVFoundation APIs, DispatchQueue, async/await, Task, actors, MainActor, thread-affine state, or Swift-backed React Native Nitro Module implementations.
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.