Skip to content

CLAUDE.md template for React Native

One codebase for iOS and Android, with release and signing guardrails.

CLAUDE.md

Check this file
# React Native app

A React Native app in TypeScript, built for iOS and Android. Change any command below that differs from your setup (Expo or the bare CLI).

## Commands

```bash
npm install  # install dependencies
npx expo start  # start the dev server (use npx react-native start for the bare CLI)
npm run lint  # lint
npx tsc --noEmit  # type-check
npm test  # run the tests
```

Run the tests and the linter after every code change, and fix failures before saying a task is done.

## Layout

- Screens live in one folder, reusable components in another, and shared hooks and helpers in a third. Follow the folders that already exist.
- Platform-specific code uses the .ios.tsx and .android.tsx file suffixes or Platform checks, kept small and in one place.
- Navigation is defined in one place. Add a screen by registering it there, not by importing screens into each other.

## Conventions

- TypeScript strict mode. Use StyleSheet or the project's styling approach, not inline style objects in hot lists.
- Test on both platforms in mind: no web-only APIs, and check keyboard, safe area and back-button behavior for new screens.
- Store tokens and sensitive values in secure storage, never in AsyncStorage or in source.
- Match the style of the file you are editing. Do not reformat files you did not change.

## Database

- If the app has a local database (SQLite, WatermelonDB, Realm), schema changes need a versioned migration so existing installs upgrade cleanly.
- Never change a shipped migration. Never run destructive commands against a shared or production backend database.

## Secrets

- Never read, print, edit or commit .env files, credentials, API keys or private keys.
- Use placeholder values in examples and tests. If a secret shows up in a file or a log, stop and tell me.

## Deploys

- Never deploy a release: no App Store or Google Play submission and no over-the-air update. I do releases myself.
- Do not change signing, bundle identifiers, version numbers or EAS and Fastlane config without asking.

## Git

- Make small commits on a branch and write messages that say why the change was made.
- Never run git push --force, git reset --hard, git clean, git checkout -- <file>, git stash or git rebase, and never use --no-verify. Ask first.
- Do not push unless I ask.

## Do not touch

- The ios/ and android/ native folders when the project is managed by Expo: do not edit by hand.
- Signing keys, keystores, provisioning profiles and Podfile.lock or lockfiles: never change them without asking.
- Generated folders (node_modules/, Pods/, build/) and anything marked generated or do not edit.

AGENTS.md

Check this file
# AGENTS.md: React Native app

Instructions for any coding agent working in this repository. A React Native app in TypeScript, built for iOS and Android. Change any command below that differs from your setup (Expo or the bare CLI).

## Commands

```bash
npm install  # install dependencies
npx expo start  # start the dev server (use npx react-native start for the bare CLI)
npm run lint  # lint
npx tsc --noEmit  # type-check
npm test  # run the tests
```

Run the tests and the linter after every code change, and fix failures before saying a task is done.

## Layout

- Screens live in one folder, reusable components in another, and shared hooks and helpers in a third. Follow the folders that already exist.
- Platform-specific code uses the .ios.tsx and .android.tsx file suffixes or Platform checks, kept small and in one place.
- Navigation is defined in one place. Add a screen by registering it there, not by importing screens into each other.

## Conventions

- TypeScript strict mode. Use StyleSheet or the project's styling approach, not inline style objects in hot lists.
- Test on both platforms in mind: no web-only APIs, and check keyboard, safe area and back-button behavior for new screens.
- Store tokens and sensitive values in secure storage, never in AsyncStorage or in source.
- Match the style of the file you are editing. Do not reformat files you did not change.

## Database

- If the app has a local database (SQLite, WatermelonDB, Realm), schema changes need a versioned migration so existing installs upgrade cleanly.
- Never change a shipped migration. Never run destructive commands against a shared or production backend database.

## Secrets

- Never read, print, edit or commit .env files, credentials, API keys or private keys.
- Use placeholder values in examples and tests. If a secret shows up in a file or a log, stop and tell me.

## Deploys

- Never deploy a release: no App Store or Google Play submission and no over-the-air update. I do releases myself.
- Do not change signing, bundle identifiers, version numbers or EAS and Fastlane config without asking.

## Git

- Make small commits on a branch and write messages that say why the change was made.
- Never run git push --force, git reset --hard, git clean, git checkout -- <file>, git stash or git rebase, and never use --no-verify. Ask first.
- Do not push unless I ask.

## Do not touch

- The ios/ and android/ native folders when the project is managed by Expo: do not edit by hand.
- Signing keys, keystores, provisioning profiles and Podfile.lock or lockfiles: never change them without asking.
- Generated folders (node_modules/, Pods/, build/) and anything marked generated or do not edit.

Why it says what it says

Two platforms

Agents write code that works on one platform and breaks on the other. Reminding them of both keeps changes portable.

Secure storage

Tokens saved in plain storage are a common mobile mistake. The rule points the agent at the right place.

Local migrations

Installed apps carry old data. Schema changes without a migration crash updates for existing users.

Releases are yours

A store submission or over-the-air update reaches real users immediately. That decision stays with you.

Native folders and signing

Hand edits to native projects and signing files are easy to get wrong and hard to debug.

Other formats