$npx -y skills add callstackincubator/agent-skills --skill create-react-native-libraryScaffolds React Native libraries with create-react-native-library for standalone libraries or local native modules and views. Use when creating or working on React Native libraries or adding native functionality in an existing app.
| 1 | # Create React Native Library |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | 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. |
| 6 | |
| 7 | Examples: |
| 8 | |
| 9 | - JS-only library that may use other React Native libraries |
| 10 | - Native modules that expose native functionality to JavaScript |
| 11 | - Native UI components that render native views in React Native |
| 12 | |
| 13 | Choose one flow first: |
| 14 | |
| 15 | - Use [scaffold-library.md][scaffold-library] when creating a new library that may be published to npm |
| 16 | - Use [local-library.md][local-library] when exposing native functionality in a React Native app |
| 17 | |
| 18 | ## When to Apply |
| 19 | |
| 20 | Use this skill when: |
| 21 | |
| 22 | - Creating or working on a React Native library with `create-react-native-library` |
| 23 | - Creating a native module or view in an existing app |
| 24 | - Wrapping native SDKs and exposing them to React Native |
| 25 | |
| 26 | ## Quick Reference |
| 27 | |
| 28 | ```bash |
| 29 | # Inspect current options before scaffolding |
| 30 | npx create-react-native-library@latest --help |
| 31 | |
| 32 | # Scaffold a library with turbo modules and the Expo example app |
| 33 | npx create-react-native-library@latest awesome-library \ |
| 34 | --no-interactive \ |
| 35 | --yes \ |
| 36 | --description "A brief description of the library" \ |
| 37 | --type turbo-module \ |
| 38 | --languages kotlin-objc \ |
| 39 | --example expo |
| 40 | |
| 41 | # Scaffold a local Turbo Module inside an existing app |
| 42 | cd MyApp |
| 43 | npx create-react-native-library@latest awesome-library \ |
| 44 | --local \ |
| 45 | --no-interactive \ |
| 46 | --yes \ |
| 47 | --description "A brief description of the library" \ |
| 48 | --type turbo-module \ |
| 49 | --languages kotlin-objc |
| 50 | ``` |
| 51 | |
| 52 | ## References |
| 53 | |
| 54 | | File | Description | |
| 55 | | --------------------------------------- | ------------------------------------------------------- | |
| 56 | | [scaffold-library.md][scaffold-library] | Scaffold a new library and default to the Expo example | |
| 57 | | [local-library.md][local-library] | Add a local library to an existing app with autolinking | |
| 58 | |
| 59 | ## Problem -> Skill Mapping |
| 60 | |
| 61 | | Problem | Start With | |
| 62 | | -------------------------------------------- | ------------------------------------ | |
| 63 | | Need a new library scaffold | [scaffold-library][scaffold-library] | |
| 64 | | Need to add a local native library to an app | [local-library][local-library] | |
| 65 | |
| 66 | [scaffold-library]: references/scaffold-library.md |
| 67 | [local-library]: references/local-library.md |