nitro-ui-migrate-react-native
Installation
SKILL.md
Migrate a React Native app to NitroUI
Start with the app's code. Keep the React components, hooks, state, services and native implementations that can run on NitroUI. Change the parts that depend on the React Native host. Use the running original to check what those changes do to the product.
Establish the reference
- Record the source revision, lockfile, target platforms and requested scope. Build or obtain the matching RN app. Start from each mobile entry point and follow its value imports, platform-specific files, route definitions and feature flags. A package manifest alone misses which implementation actually runs.
- Identify how a user reaches each in-scope flow. Include gates that replace the navigator, sheets, deep links and OS entry points. Use existing end-to-end flows and seed data to reach the same states in both apps. For a trial, pick a representative journey with a real read or write and a return path. For a whole app, keep a per-platform list of flows, original source paths, results and open gaps.
- Keep the RN build available for comparison. If a NitroUI target already exists, work there. Otherwise run
bunx create-nitro-ui MyAppfrom the intended parent directory, using an empty destination whose name starts with a letter and contains only letters and numbers. Record the SDK version and run the starter on the requested targets. Finish dependency installs before native compilation starts. A workspace reinstall can move headers under a running build.
Port each flow end to end
If the user wants multiple agents, assign independent flows in parallel. Each agent owns its flow from the original caller through verification against the RN app. Agree on who handles shared changes, such as a navigation primitive or a dependency update, so agents can reuse the same implementation. After integration, exercise the paths that cross between their flows.
- Start at the real caller. Follow the original screen through its queries, actions and native dependencies. Import portable workspace packages directly. When both hosts need a helper buried in an RN component, move that implementation to a shared module and have both call it. Retain the original client, data contracts, state transitions, translations, tokens, fonts and licensed assets wherever possible.
- Find the first host dependency. Inspect transitive imports and public package exports. A design system can expose portable tokens even if its components import RN. For a shared client, check which globals it captures at import time and initialize the NitroUI runtime first. Exercise its actual read, write or stream through the app. If a call fails, compare the request, HTTP status, content type and body with RN before changing the client.
- Translate the host code. Keep the starter's
registerAppentry and wire it to the app's providers and routes. Read the relevant package READMEs and public types for the installed SDK (package-docs.mdbesidenitro-ui-cli/package.jsonindexes them). Work from the original JSX, styles and event handlers. For lists, navigation, input or images, see Porting native UI. - Reuse native implementations. Look beneath Expo modules, Fabric components and RN bridges for existing Swift, Kotlin or C++ code. A custom diff view can keep its drawing code and row builder while a NitroUI native view supplies mounting, props and events. Use a HybridObject for a service such as secure storage. Carry over the native library version, build flags and resources the original wrapper used. Port permissions, entitlements and lifecycle entry points into the app's permanent
ios/andandroid/projects. Follow app-local native code for scaffolding and regeneration. - Resolve SDK gaps at their owner. Check the installed API and newer releases before relying on a trial patch. For a missing renderer, navigation or runtime capability, reduce the failure to its smallest caller and follow missing API guidance. When a package patch is needed, edit the package manager's prepared package and regenerate the patch with its patch command. Verify a clean install and rerun the original product flow.