Skip to content

Add AGENTS.md - #261

Open
huntie wants to merge 1 commit into
react-native-community:mainfrom
huntie:add-agents-md
Open

huntie wants to merge 1 commit into
react-native-community:mainfrom
huntie:add-agents-md

Conversation

@huntie

@huntie huntie commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add an AGENTS.md to new apps, so coding agents get the project commands and avoid the mistakes they commonly make in a Community CLI app. It stays tool-agnostic, per the discussion in #175.

  • Commands to run, test, lint, typecheck and clean the build, and which changes need a native rebuild.
  • Guardrails against reaching for Expo, deprecated APIs and the legacy native module APIs.
  • Built-in Turbo Native Modules and Fabric Native Components as the default for native code.
  • Library guidance: find libraries on React Native Directory, and never downgrade React Native or force past peer dependency conflicts to fit one.

Resolves #175

Changelog:
[General][Added] - Template: AGENTS.md with guidance for coding agents

Test Plan

  • prettier --check template/AGENTS.md passes.
  • Every link in the file resolves.
  • npm run ios installing CocoaPods itself, and start --reset-cache, checked against the Community CLI source and docs.

@huntie huntie changed the title Add AGENTS.md to template Add AGENTS.md Nov 3, 2026
@huntie

huntie commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator Author

@cortinico @cipolleschi Trying my best here to be both minimal + ecosystem agnostic with this first draft. This guidance becomes the default for everyone, so let's review thoroughly!

Comment thread template/AGENTS.md Resolved
@Shreyas-Kumar-S

Copy link
Copy Markdown

The updated commit aligns to what I was trying to convey. Thanks @huntie for this!

Comment thread template/AGENTS.md

It does not include Expo: `npx expo` commands and `expo-*` packages need `npx install-expo-modules` first, so don't use them unless asked.

## Commands

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say this is too trivial to be added to AGENTS.md.

Making sure we have a clear package.json list of commands should make it redundant, for this end let's consider adding npm run clear that does whatever is mentioned below.

Comment thread template/AGENTS.md

- `ios/` and `android/` are source code, edited directly and committed, not generated.
- JavaScript and TypeScript changes reach a running app through Fast Refresh. Native changes, and adding or removing packages with native code, need a rebuild.
- Check APIs against the docs for the React Native version in `package.json` ([reactnative.dev](https://reactnative.dev/docs/getting-started)). Many examples online use deprecated APIs, such as `SafeAreaView` from `react-native`; use `react-native-safe-area-context` instead.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow up to consider: Would be better if all APIs are documented inside the repo instead like what we did with Metro.

Comment thread template/AGENTS.md

## Rules

- `ios/` and `android/` are source code, edited directly and committed, not generated.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the first two lines are needed. This is known by LLMS for sure by now.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a copilot-instructions.md in the template

3 participants