You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Create a copilot-instructions.md in the template #175
It would be nice to have a copilot-instructions.md like so?
# Copilot Instructions
This project was generated with [React Native](https://reactnative.dev).
To get the most out of GitHub Copilot (or other AI coding assistants) while working on this codebase:
## General Guidance
- **Keep prompts specific.** Mention whether you’re targeting iOS, Android, or both when asking for help.
- **Reference APIs.** Copilot responds better if you include the React Native API name (e.g. `FlatList`, `useColorScheme`, `StyleSheet`).
- **Ask iteratively.** Start with small, scoped requests (e.g. *“generate a button component with onPress logging”*), then refine.
## Common Use Cases
- **UI Components**
Ask Copilot to scaffold screens, navigation stacks, or UI elements.
Example: *“Generate a login screen using React Navigation with two TextInput fields and a button.”*
- **Platform-Specific Code**
Specify iOS or Android if you need native modules, permissions, or configuration.
Example: *“Show me how to request camera permission on Android using React Native.”*
- **Testing**
Copilot can generate Jest/React Native Testing Library test cases.
Example: *“Write a test for a Button component that ensures onPress is called.”*
## Best Practices
- **Review suggestions carefully.** Copilot may propose outdated APIs—always verify against the [React Native docs](https://reactnative.dev/docs).
- **Keep context short.** Too much boilerplate in your prompt may confuse the assistant.
- **Use version awareness.** If you upgrade React Native, check that Copilot suggestions match the new APIs.
---
Happy coding with React Native 🚀
In general, we're trying to keep the template as agnostic as possible. This change feels like we'll make it 'tool specific' (at least specific to GH Copilot). But at the same time is something we should explore as it will make RN projects easier to be consumed by AI tools.
Let me brainstorm about it with my colleagues and get back to you 👍
The original issue suggested we add a copilot-instructions.md which is not relevant anymore. However we could consider a AGENTS.md file addition to the template
Thanks @huntie for putting the Agents.MD, it covers the main pitfalls well. One question(@cortinico) on the scope : would recovering from build failures after an upgrade or migration be in scope here, or be better as a follow-up?
The idea would be a single bullet point under "Making changes", somthing like:
If the build fails after an upgrade or branch switch, escalate one step at a time: reset the Metro cache, reinstall node_modules, then for iOS rm -rf ios/Pods ios/build && bundle exec pod install, and for Android cd android && ./gradlew clean. Don't delete lockfiles or commit Pods/, build/ or .gradle/.
The idea being agents tend to go down destructive loop or repeated installs when a native build fails after an upgrade or migration, and an ordered cheapest-first list helps avoid that. It also stays tool-agnostic and doesn't duplicate the existing Upgrade Helper / upgrade-react-native pointer, since it only covers recovery, not the upgrade itself.
Happy to contribute towards it if you prefer it as separate pull request, rather than huntie's well put out AGENTS.md.
@Shreyas-Kumar-S It's tough to put much at all in AGENTS.md to be honest, as capable models can basically figure everything they need out. In fact, if I ask Opus 5.5 to delete what it doesn't need to know from the #261 draft, it deletes half of it already.
I think basic instructions on the clean commands can fly.
Instructing how to use them, especially strongly, needs care and should be left up to the agent. Metro's --reset-cache for example should rarely be needed and is a last resort.
@huntie Makes sense that --reset-cache is a last resort and shouldn't be pushed.
For context, I was coming at this from smaller, locally hosted open-weight models. They tend to guess at project-specific commands rather than work them out the way frontier models do, so I was wondering whether the file could cover that gap.
Activity
horner commentedon Sep 6, 2025
Would be happy to propose a PR if the maintainers think its a good idea.
cortinico commentedon Sep 6, 2025
In general, we're trying to keep the template as agnostic as possible. This change feels like we'll make it 'tool specific' (at least specific to GH Copilot). But at the same time is something we should explore as it will make RN projects easier to be consumed by AI tools.
Let me brainstorm about it with my colleagues and get back to you 👍
Shreyas-Kumar-S commentedon Nov 3, 2026
@cortinico any update on this?
cortinico commentedon Nov 3, 2026
The original issue suggested we add a
copilot-instructions.mdwhich is not relevant anymore. However we could consider aAGENTS.mdfile addition to the templateShreyas-Kumar-S commentedon Nov 3, 2026
could I write one and raise a PR?
huntie commentedon Nov 3, 2026
Opened #261
Shreyas-Kumar-S commentedon Nov 4, 2026
Thanks @huntie for putting the Agents.MD, it covers the main pitfalls well. One question(@cortinico) on the scope : would recovering from build failures after an upgrade or migration be in scope here, or be better as a follow-up?
The idea would be a single bullet point under "Making changes", somthing like:
node_modules, then for iOSrm -rf ios/Pods ios/build && bundle exec pod install, and for Androidcd android && ./gradlew clean. Don't delete lockfiles or commitPods/,build/or.gradle/.The idea being agents tend to go down destructive loop or repeated installs when a native build fails after an upgrade or migration, and an ordered cheapest-first list helps avoid that. It also stays tool-agnostic and doesn't duplicate the existing Upgrade Helper /
upgrade-react-nativepointer, since it only covers recovery, not the upgrade itself.Happy to contribute towards it if you prefer it as separate pull request, rather than huntie's well put out AGENTS.md.
huntie commentedon Nov 4, 2026
@Shreyas-Kumar-S It's tough to put much at all in
AGENTS.mdto be honest, as capable models can basically figure everything they need out. In fact, if I ask Opus 5.5 to delete what it doesn't need to know from the #261 draft, it deletes half of it already.--reset-cachefor example should rarely be needed and is a last resort.Shreyas-Kumar-S commentedon Nov 4, 2026
@huntie Makes sense that
--reset-cacheis a last resort and shouldn't be pushed.For context, I was coming at this from smaller, locally hosted open-weight models. They tend to guess at project-specific commands rather than work them out the way frontier models do, so I was wondering whether the file could cover that gap.