agentleFS
reactreact/react-native/AGENTS.md

react-native

AGENTS.md127k starsChanged 5 months agoMITView on GitHub

A framework for building native applications using React. React Native is a monorepo: the react-native package, the packages published alongside it, and the apps and tooling used to develop them. Architecture notes live in docs directories beside the code they describe, indexed by docs/README.md. Treat them as reference for the subsystem you are working in, not as required reading. JavaScript CI is the lint, testjs, and buildjs_types jobs in .github/workflows/test-all.yml; Fantom and the native platforms have their own jobs. The…

We split this AGENTS.md into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Never hand-edit generated output — change the source and regenerate.

    line 59
  2. Distinctive:

    Keep each change focused — no unrelated refactors, formatting, or dependency updates.

    line 69

≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

React Native

A framework for building native applications using React.

Repo structure

React Native is a monorepo: the react-native package, the packages published alongside it, and the apps and tooling used to develop them.

PathContents
packages/react-native/LibrariesJavaScript source (Flow) — the legacy location, with code gradually moving to src/private
packages/react-native/src/privateJavaScript source (Flow)
packages/react-native/ReactCommonShared C++ — Fabric renderer, TurboModules, JSI, Yoga, jsinspector-modern
packages/react-native/ReactAndroidAndroid runtime (Kotlin, Java, JNI)
packages/react-native/{React,ReactApple}Apple runtime (Objective-C++, Swift)
packages/rn-testerRNTester — test app showcasing each core component and API, plus a Playground scratch surface
packages/*Other published packages — Metro config, Codegen, ESLint config, dev-middleware, React Native DevTools frontend
private/*Unpublished — the helloworld sample app, the react-native-fantom test runner
scripts/*Repository tooling — build, test, release, and CI scripts

Architecture notes live in __docs__ directories beside the code they describe, indexed by __docs__/README.md. Treat them as reference for the subsystem you are working in, not as required reading.

Environment

  • Yarn v1, pinned via packageManager. Run commands from the repository root.
  • JavaScript work — lint, type checks, Jest, Metro — needs only Node and Yarn, on any platform.
  • Native builds need a platform toolchain: Xcode with CocoaPods or Swift Package Manager for iOS (macOS only), and the Android SDK and NDK with Gradle for Android. See Building from source.

Common commands

CommandPurpose
yarn test <path>Jest unit tests, found in __tests__ directories
yarn fantom <path>Fantom integration tests, named *-itest.js — builds a native tester on first run
yarn lintESLint (--max-warnings 0)
yarn flow-checkFlow
yarn formatFormat JavaScript/TypeScript, C/C++/Objective-C/protobuf, Kotlin, Java, Python, and Swift sources
yarn format-checkCheck all repository formatting without changing files
yarn format-<language>Format one language: javascript, cpp, kotlin, java, python, or swift
yarn format-check-<language>Check one language without changing files

JavaScript CI is the lint, test_js, and build_js_types jobs in .github/workflows/test-all.yml; Fantom and the native platforms have their own jobs.

The formatting command uses pinned npm packages for Kotlin and Java and installs pinned Ruff through Python. To format every language, install a JDK with Java 17 or newer, Python 3 with pip, and a Swift 6.3 or newer toolchain in addition to Node and Yarn. Each language wrapper checks its own requirements and prints installation guidance when something is missing; yarn format then skips that language and continues formatting the others. Swift formatting accepts either swift-format or swift format from the installed toolchain.

Verification: Running RNTester

Needed only for changes that have to be seen running, such as user interface behavior.

yarn start serves RNTester over Metro at http://localhost:8081; yarn android builds and installs it on Android. Check the bundler with curl "http://localhost:8081/js/RNTesterApp.bundle?platform=ios&dev=true".

Gotchas

  • yarn install dirties the working tree: a preinstall hook (scripts/try-set-hermes-compiler-prebuilt.js) resolves the hermes-compiler placeholder in packages/react-native/package.json (0.0.0 → a real version) and touches yarn.lock. Expected — do not commit it.
  • Metro cannot bundle until codegen is built once — yarn --cwd packages/react-native-codegen build. Without it, bundling fails with Cannot find module '@react-native/codegen/lib/parsers/flow/parser'. Every other package runs from source — yarn build is not needed for development (see scripts/build/README.md).

Generated code

Never hand-edit generated output — change the source and regenerate. CI validates the committed snapshots.

  • Native modules and components are declared by JavaScript specs (Native*.js, *NativeComponent.js); their native counterparts are generated at build time.
  • Feature flags are declared in packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js; yarn featureflags regenerates the JavaScript, Java, and C++ accessors.
  • JavaScript sources are typed with Flow, and the public API is exported from packages/react-native/index.js. TypeScript types are generated from those sources, and packages/react-native/ReactNativeApi.d.ts is a committed snapshot of that API — run yarn build-types to regenerate both whenever the public API changes, then yarn test-generated-typescript to type-check the result.
  • The public native API is snapshotted as well: C++ under scripts/cxx-api (yarn cxx-api-build), and Android in packages/react-native/ReactAndroid/api/ReactAndroid.api.
  • CHANGELOG.md is compiled at release time from pull request descriptions.

Contributing guidelines

  • Keep each change focused — no unrelated refactors, formatting, or dependency updates.
  • Complete the pull request template — the motivation and the user-visible effect, and a changelog entry with its category and type tags.
  • In the test plan, give the exact commands you ran and their results, plus screenshots or a video for user-interface changes. Say which checks you could not run.

The full process is on reactnative.dev.

Download now (ZIP)

Trending

More talk lately.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 1 mentionApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 2 mentionsOct 2026: 2 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the react/react-native repository that our weekly crawl found: only 9 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about react/react-native

The biggest 5 of 9 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 9

Talked about on the web, YouTube and Bluesky (9 times).

On the web · 7

2 more on the web

On YouTube · 1

On Bluesky · 1

  • Other versions1 project uses a version of this.

    Word for word · 1

    1. react-native-tvos/react-native-tvos★ 1.4k100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 28,693 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.