sentry-react-native
AGENTS.md1.8k starsChanged 3 months agoMITView on GitHub
Sentry React Native SDK — a hybrid SDK: a TypeScript/JS layer on top that wraps the native sentry-cocoa (iOS) and sentry-android/java SDKs through a JS↔native bridge. Monorepo using yarn workspaces; the SDK itself is the packages/core package. Changes to the wrapped native SDKs can ripple to them and to downstream hybrid SDKs (Flutter, .NET/MAUI, Unity) — see Cross-Platform Dependencies. ✅ Always - Run yarn lint, yarn test, and yarn circularDepCheck before calling a change done; regenerate the API report (yarn…
- Deletes or force-pushes
Trending
Quiet this year.thin dataabout the whole repository
Who's talking about getsentry/sentry-react-native
- bluesky-social/social-app“Make Sentry optional”GitHub · Sep 8, 2023 · 21 reactions
- expo/sentry-expo“Critical Security - Upgrade @sentry/react-native to 1.3.9”GitHub · May 21, 2020 · 15 reactions
- expo/expo“[SDK 51] Xcode 16 compilation fails on pegged Sentry version”GitHub · Jul 2, 2024 · 14 reactions
- react/react-native“[0.60.3] --sourcemap-output | enableHermes: false | gradle file | wrong output path”GitHub · Jul 17, 2019 · 10 reactions
- expo/expo“[expo] Bump recommended @sentry/react-native version”GitHub · Sep 25, 2024 · 8 reactions
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 GitHub (9 times).
On GitHub · 9
- Sep 8, 2023Make Sentry optional — bluesky-social/social-app21 reactions
- May 21, 2020Critical Security - Upgrade @sentry/react-native to 1.3.9 — expo/sentry-expo15 reactions · 28 comments
- Jul 2, 2024[SDK 51] Xcode 16 compilation fails on pegged Sentry version — expo/expo14 reactions · 12 comments
- Jul 17, 2019[0.60.3] --sourcemap-output | enableHermes: false | gradle file | wrong output path — react/react-native10 reactions · 8 comments
- Sep 25, 2024[expo] Bump recommended @sentry/react-native version — expo/expo8 reactions · 1 comment
4 more on GitHub
- Jul 19, 2024Update sessions after running beforeSend — getsentry/sentry-cocoa7 reactions · 6 comments
- Jun 22, 2022Bundling React Native with Hermes manually — react/react-native7 reactions · 24 comments
- Nov 6, 2019Implement hermes source maps — getsentry/rust-sourcemap7 reactions · 2 comments
- May 30, 2023Upgrade `@sentry/react-native` to version `5` — expo/sentry-expo6 reactions · 6 comments
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 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.
In this repository12 other files it gives its agents.
- packages/core/AGENTS.mdAGENTS.md
- packages/core/android/AGENTS.mdAGENTS.md
- packages/core/ios/AGENTS.mdAGENTS.md
- samples/expo/AGENTS.mdAGENTS.md
- samples/react-native/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- code-guidelinesSkill
- design-firstSkill
- diagnosing-bugsSkill
- reviewSkill
- specSkill
- test-guidelinesSkill
The file
We split this AGENTS.md into the rules it gives an agent
12 rules. About 1 is common, 5 are distinctive, and 6 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
6
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
- Distinctive: line 17
Continuous Learning: when you discover a durable pattern, record it in the nearest nested AGENTS.md (or the relevant skill), not inline in …
- Distinctive: line 18
Context Management: after compaction, re-read the AGENTS.md for the surface you're touching before continuing.
- Very specific: line 48
Run yarn lint, yarn test, and yarn circularDepCheck before calling a change done.
- Very specific: line 62
Add CHANGELOG.md noise for routine internal/CI/test/chore changes — the user-facing sections (### Features, ### Fixes) are for user-visible …
- Common: line 63
Commit secrets, tokens, or DSNs.
- Very specific: line 67
Follow conventional commit format: <type>(<scope>): <subject>
- Distinctive: line 81
When asked to open a PR:
- Distinctive: line 82
Ask: if it should be a draft PR (default: draft).
- Very specific: line 83
Use the repo's PR template (.github/pull_request_template.md) for the body.
- Very specific: line 130
Update CHANGELOG.md for user-visible changes
- Very specific: line 163
Ensure build is up to date: yarn build
- Distinctive: line 170
When discovering new patterns, add them to the nearest nested AGENTS.md file.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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.
Files
AGENTS.md
Sentry React Native SDK — a hybrid SDK: a TypeScript/JS layer on top that wraps the native sentry-cocoa (iOS) and sentry-android/java SDKs through a JS↔native bridge. Monorepo using yarn workspaces; the SDK itself is the packages/core package.
Stack
- Published packages:
@sentry/react-native(packages/core, the SDK) + companion@sentry/expo-upload-sourcemaps; yarn 4 workspaces. - Wraps native SDKs: sentry-cocoa (iOS) + sentry-android/java (Android) through the JS↔native bridge.
- Hosts: React Native on both the New (TurboModule/Fabric) and Old (bridge) Architecture, plus Expo and React.
- Exact versions (don't copy them here — they rot): JS deps and host peer ranges in
packages/core/package.json; the bundled native SDK versions per release inSDK-VERSIONS.md(regenerated each release bycraft-pre-release.sh).
Changes to the wrapped native SDKs can ripple to them and to downstream hybrid SDKs (Flutter, .NET/MAUI, Unity) — see Cross-Platform Dependencies.
Agent Responsibilities
- Reach for a skill first. For anything beyond a trivial edit, load the matching skill (see Skills) — it carries the deep, current guidance this file only indexes.
- Continuous Learning: when you discover a durable pattern, record it in the nearest nested
AGENTS.md(or the relevant skill), not inline in a PR. - Context Management: after compaction, re-read the
AGENTS.mdfor the surface you're touching before continuing.
Setup
yarn install
yarn buildQuick Reference
| Task | Command |
| Build all packages | yarn build |
| Build SDK (watch) | cd packages/core && yarn build:sdk:watch |
| Run all tests | yarn test |
| Run all linters | yarn lint |
| Auto-fix lint | yarn fix |
| Circular dep check | yarn circularDepCheck |
| API report generate | yarn api-report |
| API report check | cd packages/core && yarn api-report:check |
| TS/JS lint | yarn lint:lerna |
| Android lint | yarn lint:android |
| Kotlin lint | yarn lint:kotlin |
| ObjC/C++ lint | yarn lint:clang |
| Swift lint | yarn lint:swift |
Boundaries
✅ Always
- Run
yarn lint,yarn test, andyarn circularDepCheckbefore calling a change done; regenerate the API report (yarn api-report) when the public surface moved. - Make a change work on both architectures (New + Old) and both platforms (iOS + Android) — a fix that only covers one is not done.
- Gate any user data placed in events/breadcrumbs/spans/logs on
options.sendDefaultPii. - Catch native errors at the bridge boundary and degrade — reject/log, never let them propagate.
⚠️ Ask first
- Adding or changing any dependency,
.vscodeextension, GitHub Action, or native dependency — verify provenance first (loadcode-guidelines→ Adding dependencies). - Changing the public API (
packages/core/src/js/index.tsbarrel, exported options) or a codegen/bridge spec (NativeRNSentry.ts,*NativeComponent.ts) — these are breaking and need a deprecation path. - Changing CI workflows, release config, or anything under
scripts/.
🚫 Never
- Crash the host app — a native exception that reaches the app is the highest-severity failure this SDK can cause.
- Break the public API or bridge ABI without a
@deprecatedmigration path (an app can ship new JS against an older cached native binary). - Hand-edit generated files:
packages/core/etc/sentry-react-native.api.md(regenerate it) or New-Architecture codegen output — regenerate, never edit by hand. - Add
CHANGELOG.mdnoise for routine internal/CI/test/chore changes — the user-facing sections (### Features,### Fixes) are for user-visible changes. A genuinely notable internal change goes under the### Internalsection instead, not among the user-facing entries. - Commit secrets, tokens, or DSNs.
Commit Conventions
Follow conventional commit format: <type>(<scope>): <subject>
Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore
Scopes: android, ios, core, tracing, replay, profiling, e2e
Examples:
feat(replay): Add mobile replay masking support
fix(android): Fix crash on startup with HermesPull Requests
When asked to open a PR:
- Ask if it should be a draft PR (default: draft).
- Use the repo's PR template (
.github/pull_request_template.md) for the body. Fill in the sections:- Type of change — check the applicable boxes (Bugfix, New feature, Enhancement, Refactoring).
- Description — describe the changes in detail.
- Motivation and Context — why the change is needed, link related issues.
- How did you test it? — list tests added/run.
- Checklist — check the applicable boxes.
- Next steps — note any follow-up work, or leave empty.
Pre-Commit Checklist
- Code compiles without errors (
yarn build) - All tests pass (
yarn test) - Linting passes (
yarn lint) - No circular dependencies (
yarn circularDepCheck) - API report up to date (
yarn api-reportafteryarn build:sdk) - Native code formatted correctly
- TypeScript types are correct
- Tests added/updated for changes
CI Overview
Workflows in .github/workflows/:
| Workflow | Purpose |
buildandtest.yml | TS compilation, Jest tests, linting, circular dep check, API report, TS 3.8 compat |
native-tests.yml | iOS/Android native tests across RN versions |
e2e-v2.yml | E2E tests with Maestro on Sauce Labs |
sample-application.yml | Sample RN app builds (iOS, Android, old/new arch) |
sample-application-expo.yml | Sample Expo app builds |
Ready-to-merge gate: Expensive tests (native, E2E, sample builds) only run when the PR has the ready-to-merge label. Basic tests run on every commit.
Concurrency: PR workflows cancel previous runs on new pushes. Main branch workflows never cancel.
Cross-Platform Dependencies
Changes may impact downstream SDKs. Coordinate with other teams when modifying native bridge APIs.
- Sentry Cocoa → iOS native SDK
- Sentry Java/Android → Android native SDK
- Flutter, .NET (MAUI), Unity → depend on native SDKs
Documentation
- JSDoc comments for public APIs
- Inline comments for complex logic only
- Update
CHANGELOG.mdfor user-visible changes
Skills — load on demand
The deep, task-specific guidance lives in .agents/skills/ (registered in agents.toml) and is loaded when you need it — this file is the always-on operating manual, the skills are the specialists. Reach for one before doing the matching work:
| Skill | Load it when |
spec | The what isn't pinned down yet — a fuzzy issue or idea to scope into acceptance criteria. Hands off to design-first. |
design-first | Starting a feature/integration, changing the public barrel, crossing the bridge, or changing a codegen spec — shape modules and seams before coding. |
code-guidelines | Implementing, refactoring, designing APIs, writing integrations, handling breaking changes, or adding dependencies. |
test-guidelines | Writing, modifying, or reviewing Jest tests, fixtures, and mocks. |
review | A three-axis (Standards / Spec / Correctness) pass on a branch or PR before opening or merging. |
diagnosing-bugs | A hard bug, flaky test, CI hang, native crash, or perf regression — builds a red-capable loop before hypothesizing. |
Warden's automated PR review and agents.toml also pull remote specialists (security-review, gha-security-review, span-convention-review, and more) — invoke those for depth beyond the local pass.
Nested AGENTS.md Files
packages/core/AGENTS.md— TypeScript/JavaScript code style, testing, patternspackages/core/android/AGENTS.md— Java/Kotlin conventionspackages/core/ios/AGENTS.md— Objective-C/Swift conventionssamples/react-native/AGENTS.md— Running & troubleshooting the RN samplesamples/expo/AGENTS.md— Running the Expo sample
Troubleshooting
Build Failures:
- Clear and reinstall:
rm -rf node_modules && yarn install - Clean build:
yarn clean && yarn build
Test Failures:
- Clear Jest cache:
jest --clearCache - Ensure build is up to date:
yarn build
Linting Failures:
- Auto-fix:
yarn fix
Maintenance
When discovering new patterns, add them to the nearest nested AGENTS.md file. Keep examples concise but complete. Remove outdated information during reviews.
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
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.

