BACK TO TEMPLATES
rulesany

React Native and Expo Rules

Guidelines for React Native and Expo mobile app development covering navigation, state management, and native modules.

When to use this

Place this file at the root of a React Native or Expo mobile project to guide AI coding assistants on mobile UI performance, platform checks, and navigation conventions.

The template

# AGENTS.md

## Project Context

Cross-platform mobile application built with Expo, React Native, TypeScript, and React Navigation.

## Commands

- `npx expo start` launch Expo development server
- `npm run test` run Jest test suite
- `npm run typecheck` run TypeScript compiler check

Run `npm run typecheck` and `npm run test` before completing tasks.

## Conventions

- Use platform-specific file extensions (`.ios.tsx`, `.android.tsx`) when platform behavior differs.
- Style UI using `StyleSheet.create` or Tailwind NativeWind utilities. Avoid inline objects.
- Ensure all scroll views handle safe area insets via `useSafeAreaInsets`.
- Optimize list rendering using `FlashList` or `FlatList` with `keyExtractor`.

## Restrictions

- Do not import `window` or Web DOM APIs. Use React Native Native Modules.
- Do not perform synchronous disk/storage access on the main UI thread.

## Approval Required

- Adding new native dependency plugins requiring Expo prebuild changes.
- Modifying authentication or push notification handlers.

Customization Guide

Customize for your specific navigation setup (e.g. Expo Router vs React Navigation).

Last verified 2026-07-26