with one click
react-native-best-practices
// React Native development. Cross-platform code, native modules, performance. Use when building mobile apps.
// React Native development. Cross-platform code, native modules, performance. Use when building mobile apps.
C++ development best practices. Modern C++20/23, RAII, zero-overhead abstractions, safety. Use when writing C++ code.
Docker and container best practices. Multi-stage builds, security, optimization. Use when creating Dockerfiles.
Go development best practices. Idiomatic Go, error handling, concurrency patterns, testing. Use when writing Go code.
Observability best practices. Logging, metrics, tracing, alerting. Essential for production services. Use for any backend service.
Test-Driven Development workflow. Write failing test first, implement code to pass, then refactor. Essential for all languages: Go, TypeScript, C++, Python. Use before any implementation task.
Use when the user wants to commit, push, and open a pull request for the current changes. Stages relevant files, writes a descriptive commit message, pushes the branch, opens a PR against main, and posts an /oc review comment so opencode automatically reviews and approves if ready.
| name | react-native-best-practices |
| description | React Native development. Cross-platform code, native modules, performance. Use when building mobile apps. |
| compatibility | opencode |
Cross-platform mobile development with React Native.
// Platform.select for different implementations
import { Platform } from 'react-native';
const styles = Platform.select({
ios: { paddingTop: 48 },
android: { paddingTop: 24 },
});
// React Navigation
import { NavigationContainer } from '@react-navigation/native';
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Home" component={HomeScreen} />
</Stack.Navigator>
</NavigationContainer>
// Zustand for simple state
import { create } from 'zustand';
const useStore = create((set) => ({
count: 0,
increment: () => set((s) => ({ count: s.count + 1 })),
}));
// WatermelonDB for offline-first
import { Database } from '@nozbe/watermelondb';
const database = new Database({
schema: appSchema,
modelClasses: [User, Post],
});
// TurboModule for New Architecture
import type { TurboModule } from 'react-native';
import { TurboModuleRegistry } from 'react-native';
export interface Spec extends TurboModule {
startActivity(options: string): Promise<void>;
}
export default TurboModuleRegistry.getEnforcing<Spec>('CameraModule');
// @notifee/react-native
import messaging from '@react-native-firebase/messaging';
await messaging().requestPermission();
const token = await messaging().getToken();
# iOS
cd ios && pod install && cd ..
npm run build:ios
# Android
cd android && ./gradlew assembleRelease