Create React Native Library
CallstackOfficialPublished by Callstack
- Skill
- Workflow
- Software development
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides guidance on using the create-react-native-library CLI to scaffold new React Native libraries or integrate local native modules and views into existing applications. It covers the setup process for various library types, including Turbo Modules, Nitro Modules, and Fabric components, ensuring proper configuration for both standalone projects and monorepo-style local development.
What it does
- Scaffolds new standalone React Native libraries for npm distribution
- Integrates local native modules or views directly into existing React Native apps
- Configures project structures for Turbo Modules, Nitro Modules, and Fabric components
- Sets up example applications using Expo or React Native Community CLI
- Provides standardized project layouts with native implementation folders
- Guides users through post-scaffolding dependency installation and build tasks
When to use it
- When starting a new React Native library project
- When adding custom native functionality to an existing React Native application
- When wrapping native SDKs for use within a React Native environment
- When you need to create native UI components or native APIs
Advantages
- Ensures consistent project structure across different library types
- Automates complex setup for native modules and autolinking
- Provides built-in example apps for immediate testing and development
- Supports modern React Native architectures like Turbo Modules and Nitro
Usage examples
- “Scaffold a new React Native library named my-native-lib with Turbo Modules and an Expo example.”
- The agent executes the CLI command with the appropriate flags to generate a library structure with Kotlin/Obj-C support and an Expo example app.
- “How do I add a local native module to my existing React Native project?”
- The agent provides the command to run the CLI with the --local flag from the app root, creating a module under the modules/ directory.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/callstackincubator/create-react-native-library/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip create-react-native-library.zip -d .agents/skills
Documentation by Callstack
Create React Native Library
Overview
Use this skill to scaffold a standalone React Native library or a local library inside an existing app, then continue with the correct implementation docs.
Examples:
JS-only library that may use other React Native libraries
Native modules that expose native functionality to JavaScript
Native UI components that render native views in React Native
Choose one flow first:
Use scaffold-library.md when creating a new library that may be published to npm
Use local-library.md when exposing native functionality in a React Native app
When to Apply
Use this skill when:
Creating or working on a React Native library with
create-react-native-libraryCreating a native module or view in an existing app
Wrapping native SDKs and exposing them to React Native
Quick Reference
# Inspect current options before scaffolding
npx create-react-native-library@latest --help
# Scaffold a library with turbo modules and the Expo example app
npx create-react-native-library@latest awesome-library \
--no-interactive \
--yes \
--description "A brief description of the library" \
--type turbo-module \
--languages kotlin-objc \
--example expo
# Scaffold a local Turbo Module inside an existing app
cd MyApp
npx create-react-native-library@latest awesome-library \
--local \
--no-interactive \
--yes \
--description "A brief description of the library" \
--type turbo-module \
--languages kotlin-objcReferences
| File | Description |
|---|---|
| scaffold-library.md | Scaffold a new library and default to the Expo example |
| local-library.md | Add a local library to an existing app with autolinking |
Problem -> Skill Mapping
| Problem | Start With |
|---|---|
| Need a new library scaffold | scaffold-library |
| Need to add a local native library to an app | local-library |
Files
- ATTRIBUTION.mdAdded by AutoGineer873 B
- LICENSELicence file added by AutoGineer1.1 KiB
- SKILL.md2.7 KiB
- agents/openai.yaml386 B
- references/local-library.md3.7 KiB
- references/scaffold-library.md4.4 KiB
references/local-library.md
title: Add a Local Library to an Existing App impact: HIGH tags: react-native, library, create-react-native-library, local, autolinking, monorepo, expo
Skill: Add a Local Library to an Existing App
Scaffold a local library inside an existing React Native app with create-react-native-library.
When to Use
Adding native functionality or UI components to an existing React Native app
Prerequisites
An existing React Native app with
package.jsonat the root
Step-by-Step Instructions
Progress checklist:
- [ ] Create local library with CLI
- [ ] Verify symlink setup in node_modules
- [ ] Install dependencies to create symlink
- [ ] Import and use the library in the appRun
npx create-react-native-library@latest --helpto check the latest available options.Choose the appropriate
--typebased on user's requirements:Use
turbo-moduleornitro-modulefor exposing native APIs.Use
fabric-viewornitro-viewfor rendering native UI components.
Choose the appropriate
--languagesbased on the--type:Use
kotlin-objcfor Turbo Modules or Fabric Components.Use
kotlin-swiftfor Nitro Modules or Nitro Views.
Run the
npx create-react-native-library@latestcommand with the--localflag from the root of the existing app to scaffold a local library under themodules/folder:cd MyApp # Scaffold a local Turbo Module inside the app repo npx create-react-native-library@latest awesome-library \ --local \ --no-interactive \ --yes \ --description "A brief description of the library" \ --type turbo-module \ --languages kotlin-objcVerify the local library is linked correctly in the app's
dependenciesinpackage.json:If the app uses Yarn, the generated dependency entry in
package.jsonshould uselink:("react-native-awesome-library": "link:./modules/awesome-library")If the app uses npm, the generated dependency entry in
package.jsonshould usefile:("react-native-awesome-library": "file:./modules/awesome-library")For other package manager setups, refer to the package manager documentation on how to create symlink under
node_modulesthat points to the local library.
Run
yarn installornpm installfrom the app root to create the symlink undernode_modulesthat points to the local library.For nitro modules or views, ensure
react-native-nitro-modulesdependency is added to the app'spackage.json.Import the library with its package name (e.g.
import { multiply } from 'react-native-awesome-library') in the app to use it.
Generated Project Structure
Typical generated layout:
MyApp/
package.json
modules/
awesome-library/
src/ TypeScript entry points
android/ Android native implementation
ios/ iOS native implementation
package.json Local package metadataThe local library is self contained under the modules/ folder and is symlinked into the app's node_modules/ for autolinking.
Common Pitfalls
Not running the command from an app directory: Run from a React Native app directory that already contains
package.json.Using incorrect combination of
--typeand--languages: Usekotlin-objcfor turbo modules and fabric views, and usekotlin-swiftfor nitro modules and nitro views.
Canonical Docs
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs Node.js
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Callstack
- Publisher
- Callstack (Official)
- Source
- callstackincubator/agent-skills · skills/create-react-native-library · commit 59e9d17
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Callstack.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download create-react-native-library.zip