Skip to content

Commit 2e4e830

Browse files
huntiemeta-codesync[bot]
authored andcommitted
Update agent guidance, move to AGENTS.md (#57944)
Summary: Pull Request resolved: #57944 The V1 of our `CLAUDE.md` was mostly contributor boilerplate. Revise this towards a plan overview of the repo — giving the agent immediate context on working in the codebase (and reducing exploratory file reads). Also moves `CLAUDE.md` to `AGENTS.md`, for interop with non-Claude harnesses — `CLAUDE.md` is now a pointer to this source. New contents: - Repo structure - Common commands - Gotchas - Contributing guidelines This remains intentionally high level rather than exhaustive, to keep the context window lean. We can move towards nested `AGENTS.md` files over time. **Notes** - `CONTRIBUTING.md` is unchanged — already a short pointer to reactnative.dev. (Possible candidate for later deletion.) Changelog: [Internal] Reviewed By: Abbondanzo Differential Revision: D115564651 fbshipit-source-id: 8e237cd1ab6189632bf59b2bd865c5f06fef8bcc
1 parent 9c770f5 commit 2e4e830

2 files changed

Lines changed: 54 additions & 24 deletions

File tree

AGENTS.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# React Native
2+
3+
A framework for building native applications using React.
4+
5+
This file provides guidance for coding agents working in this repository.
6+
7+
## Repo structure
8+
9+
React Native is a monorepo: the `react-native` package, the packages published alongside it, and the apps and tooling used to develop them.
10+
11+
| Path | Contents |
12+
| --- | --- |
13+
| `packages/react-native/Libraries` | JavaScript source (Flow) — the legacy location, with code gradually moving to `src/private` |
14+
| `packages/react-native/src/private` | JavaScript source (Flow) |
15+
| `packages/react-native/ReactCommon` | Shared C++ — Fabric renderer, TurboModules, JSI, Yoga, `jsinspector-modern` |
16+
| `packages/react-native/ReactAndroid` | Android runtime (Kotlin, Java, JNI) |
17+
| `packages/react-native/{React,ReactApple}` | Apple runtime (Objective-C++, Swift) |
18+
| `packages/rn-tester` | RNTester — test app showcasing each core component and API, plus a `Playground` scratch surface |
19+
| `packages/*` | Other published packages — Metro config, Codegen, ESLint config, dev-middleware, React Native DevTools frontend |
20+
| `private/*` | Unpublished — the `helloworld` sample app, the `react-native-fantom` test runner |
21+
| `scripts/*` | Repository tooling — build, test, release, and CI scripts |
22+
23+
Architecture notes live in `__docs__` directories beside the code they describe, indexed by [`__docs__/README.md`](__docs__/README.md). Treat them as reference for the subsystem you are working in, not as required reading.
24+
25+
## Common commands
26+
27+
Run these from the repository root:
28+
29+
| Command | Purpose |
30+
| --- | --- |
31+
| `yarn test <path>` | Jest unit tests, found in `__tests__` directories |
32+
| `yarn fantom <path>` | [Fantom](private/react-native-fantom/__docs__/README.md) integration tests, named `*-itest.js` |
33+
| `yarn lint` | ESLint |
34+
| `yarn format` | Prettier and clang-format |
35+
| `yarn flow-check` | Flow |
36+
| `yarn start`, `yarn android` | Metro, and RNTester on Android. See [RNTester](packages/rn-tester/README.md) for iOS |
37+
38+
Native builds use Gradle on Android, and CocoaPods or Swift Package Manager on iOS. See [Building from source](https://reactnative.dev/contributing/how-to-build-from-source).
39+
40+
## Gotchas
41+
42+
- 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.
43+
- 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`. CI validates both.
44+
- Native modules and components are declared by JavaScript specs (`Native*.js`, `*NativeComponent.js`), from which their native counterparts are generated. Do not hand-edit generated code.
45+
- `CHANGELOG.md` is compiled at release time. Changelog entries belong in the pull request description.
46+
47+
## Contributing guidelines
48+
49+
- Keep each change focused — no unrelated refactors, formatting, or dependency updates.
50+
- Complete the pull request template — the motivation and the user-visible effect, and a [changelog entry](https://reactnative.dev/contributing/changelogs-in-pull-requests) with its category and type tags.
51+
- In the test plan, give the exact commands you ran and their results, plus screenshots or a video for user-interface changes.
52+
53+
See [CONTRIBUTING.md](CONTRIBUTING.md) for the full process, including how to report bugs.

CLAUDE.md

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1 @@
1-
# Contributing to React Native
2-
3-
This file provides guidance for coding agents contributing to React Native.
4-
These requirements apply to every contribution, regardless of how it was
5-
created.
6-
7-
## Contributor guidelines
8-
9-
- Read [Contributing to React Native](CONTRIBUTING.md) and the [Code of Conduct](CODE_OF_CONDUCT.md) before making changes.
10-
- Keep changes focused on the requested issue. Do not include unrelated refactors, formatting changes, or dependency updates.
11-
- Explain the motivation and user-visible effect of the change in the pull request summary.
12-
- Add or update tests for every behavior change. For user-facing changes, update an existing RNTester example or add a focused example when applicable.
13-
- Run the most relevant tests and linters. In the test plan, include the exact commands and results, plus screenshots or videos for user-interface changes.
14-
- Add a changelog entry using the format documented in [Changelogs in Pull Requests](https://reactnative.dev/contributing/changelogs-in-pull-requests). Use the pull request template's category and type tags.
15-
- Do not open a pull request or issue on someone's behalf unless they have explicitly asked you to do so.
16-
17-
## Issue guidelines
18-
19-
- Use the [issue chooser](https://github.com/react/react-native/issues/new/choose) and select the template that matches the problem. Blank issues are not accepted.
20-
- Search the [existing issues](https://github.com/react/react-native/issues) before filing a new one.
21-
- Verify bugs against a currently supported React Native release and provide the React Native version, affected platforms, clear reproduction steps, environment information, and relevant logs.
22-
- Every bug report must include a public reproducer. Prefer an `RNTesterPlayground.js` change, an [Expo Snack](https://snack.expo.dev/) for a focused UI problem, or a project created from the [React Native reproducer template](https://github.com/react-native-community/reproducer-react-native). See [How to Report a Bug](https://reactnative.dev/contributing/how-to-report-a-bug) for details.
23-
- Report Expo, Metro, documentation, and third-party library problems to their respective repositories. Use the support resources linked by the issue chooser for questions and help.
24-
- Discuss feature requests and API proposals in [Discussions and Proposals](https://github.com/react-native-community/discussions-and-proposals) instead of filing a bug report.
1+
@AGENTS.md

0 commit comments

Comments
 (0)