
Brownie
- 5 installs
- 541 repo stars
- Updated August 1, 2026
- callstack/react-native-brownfield
brownie is a Claude skill for cross-platform shared state in React Native brownfield apps using @callstack/brownie, from *.brownie.ts store definitions through generated JS and native APIs.
About
This skill provides guidance for shared state across React Native brownfield apps using @callstack/brownie. A developer defines stores in *.brownie.ts, runs brownfield codegen, then uses the generated typed APIs on the TypeScript, Android, and iOS sides. It is used when setting up brownie in an existing brownfield app, changing store schemas, or consuming stores in native hosts. It matters because it keeps state synchronized across the JS and native boundaries with generated types.
- Cross-platform shared state for React Native brownfield apps with @callstack/brownie
- Define stores in *.brownie.ts, run brownfield codegen, use typed APIs on JS, Android, and iOS
- Covers useStore, subscribe, getSnapshot, setState and native framework packaging
Brownie by the numbers
- 5 all-time installs (skills.sh)
- Ranked #828 of 1,039 Mobile Development skills by installs in the Skillselion catalog
- Data as of Aug 2, 2026 (Skillselion catalog sync)
brownie capabilities & compatibility
- Capabilities
- state management · codegen · brownfield integration · cross platform state
- Use cases
- api development
What brownie says it does
Brownie provides cross-platform shared state for React Native brownfield apps.
The workflow starts from `*.brownie.ts` store definitions, runs `brownfield codegen` (or packaging commands that include codegen), then uses typed APIs on TypeScript, Android, and iOS sides.
npx skills add https://github.com/callstack/react-native-brownfield --skill brownieAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 5 |
|---|---|
| repo stars | ★ 541 |
| Last updated | August 1, 2026 |
| Repository | callstack/react-native-brownfield ↗ |
What it does
Share typed state across the JS, Android, and iOS sides of a React Native brownfield app with @callstack/brownie.
Who is it for?
React Native brownfield apps that need state shared between the JS side and native Android/iOS hosts
Skip if: Standalone React Native apps with no native host to share state with
When should I use this skill?
setting up @callstack/brownie, changing *.brownie.ts store schemas, using useStore/subscribe/getSnapshot/setState, or packaging native artifacts
What you get
Typed shared stores consumed on the TypeScript, Android, and iOS sides of a brownfield app
- *.brownie.ts store schemas
- generated native types
- packaged iOS XCFramework or Android module
By the numbers
- 5-reference routing table
- 3 platform targets (JS, Android, iOS)
Files
Overview
Brownie provides cross-platform shared state for React Native brownfield apps. The workflow starts from *.brownie.ts store definitions, runs brownfield codegen (or packaging commands that include codegen), then uses typed APIs on TypeScript, Android, and iOS sides.
When to Apply
Reference this skill when:
- Setting up
@callstack/browniein an existing brownfield app - Defining or changing store schemas in
*.brownie.ts - Using
useStore,subscribe,getSnapshot, orsetStateon the JS side - Registering and consuming stores in Android or iOS hosts
- Packaging and embedding iOS frameworks that include Brownie
Quick Reference
- Install Brownie:
npm install @callstack/brownie- Generate native types:
npx brownfield codegen- Packaging commands also include Brownie codegen:
# iOS
npx brownfield package:ios --scheme YourScheme --configuration Release
# Android
npx brownfield package:android --module-name :YourModuleName --variant release
npx brownfield publish:android --module-name :YourModuleNameRouting (concern -> file)
| Concern | Read |
|---|---|
| Initial install, prerequisites, setup sequence, first integration pass | `getting-started.md` |
*.brownie.ts schema rules, BrownieStores augmentation, type mapping, when to rerun codegen | `store-definition-and-codegen.md` |
useStore selectors, update patterns, low-level APIs (subscribe, getSnapshot, setState) | `typescript-usage.md` |
| Android registration lifecycle, serializer options, package settings, build and publish flow | `android-usage.md` |
| Swift store registration and UI usage, plus XCFramework packaging and embedding | `swift-and-xcframework.md` |
Retrieval and Response Rules
- Single-reference-first: choose exactly one primary reference from the table above that best matches the request before opening any other file.
- Stop-after-sufficiency: once the required command/API is found for the request, stop reading additional references.
- Cross-reference only when blocked: open a second reference only if the first one does not contain the needed command/API.
- Testing-context response budget:
- Return compact actionable steps only.
- Use at most one code snippet.
- Do not restate overview/scope/background sections.
Brownie Android Usage
Minimum prerequisites
package.jsonhasbrownie.kotlinandbrownie.kotlinPackageName.- Gson is available in native dependencies:
com.google.code.gson:gson. - Generated Kotlin store types already exist.
Exact steps
1. Register the store once at startup with registerStoreIfNeeded. 2. Read/update the typed store using StoreManager.shared.store<T>(STORE_NAME). 3. Build/publish artifacts when needed:
npx brownfield package:android --module-name :YourModuleName --variant releasenpx brownfield publish:android --module-name :YourModuleName
Verification command/API
- Required API:
registerStoreIfNeeded(storeName) { initialState } - Success signal:
StoreManager.shared.store<T>(STORE_NAME)returns a non-null store and updates propagate.
One short example
import com.callstack.brownie.StoreManager
import com.callstack.brownie.registerStoreIfNeeded
import com.callstack.brownie.store
import com.rnapp.brownfieldlib.AppStore
registerStoreIfNeeded(storeName = AppStore.STORE_NAME) {
AppStore(counter = 0.0)
}
val store = StoreManager.shared.store<AppStore>(AppStore.STORE_NAME)
store?.set { state -> state.copy(counter = state.counter + 1) }Brownie Getting Started
Minimum prerequisites
- Brownfield setup already works in the project.
@callstack/react-native-brownfieldis installed.- Native host app exists (iOS and/or Android).
Exact steps
1. Install Brownie:
npm install @callstack/brownie
2. Define a store in a *.brownie.ts file:
- create a store interface extending
BrownieStore - augment
declare module '@callstack/brownie' { interface BrownieStores { ... } }
3. Import that *.brownie.ts file from app entry (App.tsx or index.js). 4. Generate native types:
npx brownfield codegen
5. Use the store on JS side (useStore) and register the generated store in native startup.
Verification command/API
- Required command:
npx brownfield codegen - Success signal: generated native files are present and app builds with typed store usage.
One short example
import type { BrownieStore } from '@callstack/brownie';
interface UserStore extends BrownieStore {
name: string;
}
declare module '@callstack/brownie' {
interface BrownieStores {
user: UserStore;
}
}Brownie Store Definition and Codegen
Use this for store schema authoring and regeneration issues.
Store contract
- File ends with
.brownie.ts - Store interface extends
BrownieStore - Module augmentation adds the store to
BrownieStores - Store key matches intended public name
Example
import type {BrownieStore} from '@callstack/brownie';
interface AppStore extends BrownieStore {
counter: number;
user: {name: string};
}
declare module '@callstack/brownie' {
interface BrownieStores {
AppStore: AppStore;
}
}Codegen workflow
1. Import each store file from app entry. 2. Run npx brownfield codegen. 3. Rebuild native artifacts after schema changes.
Common fixes
- Missing generated files: verify
.brownie.tssuffix and augmentation. - Stale native/JS types: rerun codegen and rebuild.
Brownie Swift Usage and XCFramework Packaging
Use this for iOS registration, Swift usage, and packaging.
Package and embed
1. Run npx brownfield package:ios --scheme YourScheme --configuration Release 2. Add generated frameworks to Xcode and set Embed & Sign 3. Ensure Brownie.xcframework, ReactBrownfield.xcframework, and Hermes framework are included
Startup registration
Call YourStore.register(initialState) before first read/subscription.
SwiftUI / UIKit usage
import Brownie
import SwiftUI
struct CounterView: View {
@UseStore(\AppStore.counter) var counter
var body: some View {
Button("Increment") { $counter.set { $0 + 1 } }
}
}UIKit: resolve via StoreManager.get(key:as:), subscribe, and cancel on teardown.
Common fixes
No such module 'Brownie': verify framework embed/sign.- No UI updates: ensure store registered before use.
Brownie TypeScript Usage
Use this for React Native store reads/updates.
Hook pattern
Use useStore(storeKey, selector) and keep selectors narrow to reduce rerenders.
import {useStore} from '@callstack/brownie';
const [counter, setState] = useStore('AppStore', (s) => s.counter);
setState((prev) => ({counter: prev.counter + 1}));Low-level APIs
subscribe(storeKey, onChange)getSnapshot(storeKey)setState(storeKey, patchOrUpdater)
Common fixes
- TS key/type mismatch: ensure store definition file is imported in app entry.
- Drift after schema edits: rerun codegen/package and rebuild host apps.
Related skills
FAQ
What is the brownie workflow?
Define *.brownie.ts stores, run brownfield codegen, then use the generated typed APIs on TypeScript, Android, and iOS.
Which JS APIs does brownie expose?
useStore selectors plus low-level subscribe, getSnapshot, and setState.