agentleFS
SentryKnown publishergetsentry/sentry-react-native/packages/core/android/AGENTS.md

sentry-react-native / android

AGENTS.md1.8k starsChanged 3 months agoMITView on GitHub

Depth lives in the skills. code-guidelines (.agents/skills/, esp. references/native-bridge.md) is authoritative for bridge and native conventions — load it before non-trivial work. This file is the quick reference for the Android surface; where a convention here overlaps a skill, the skill wins. Android native code supports both React Native architectures — a bridge-method change usually has to land in both: Catch Throwable at the boundary — not just Exception, so an Error can't crash the app either (the module code…

Trending

Quiet this year.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the getsentry/sentry-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 getsentry/sentry-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 GitHub (9 times).

On GitHub · 9

4 more on GitHub

The file

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

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use Google Java Format (enforced by CI)

    line 19
  2. Distinctive:

    Use ktlint formatting (enforced by CI)

    line 25
  3. Distinctive:

    Prefer Kotlin idioms (data classes, extension functions, etc.)

    line 26
  4. Very specific:

    Add mavenLocal() to sample's android/build.gradle

    line 66
  5. Distinctive:

    Update version to locally published version

    line 67

≈ “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.

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

packages/core/android — Java & Kotlin

Depth lives in the skills. code-guidelines (.agents/skills/, esp. references/native-bridge.md) is authoritative for bridge and native conventions — load it before non-trivial work. This file is the quick reference for the Android surface; where a convention here overlaps a skill, the skill wins.

Formatting & Linting

TaskCommand
Java format (Google Java Format)yarn fix:android
Kotlin format (ktlint)yarn fix:kotlin
Java lint checkyarn lint:android
Kotlin lint checkyarn lint:kotlin
PMD static analysisyarn java:pmd

Code Conventions

Java

  • Use Google Java Format (enforced by CI)
  • Package structure: io.sentry.react.*
  • Null safety: Use @Nullable and @NonNull annotations

Kotlin

  • Use ktlint formatting (enforced by CI)
  • Prefer Kotlin idioms (data classes, extension functions, etc.)

Architecture Variants

Android native code supports both React Native architectures — a bridge-method change usually has to land in both:

  • src/oldarch/ — Legacy bridge implementation
  • src/newarch/ — TurboModule / Fabric implementation
  • src/main/ — Shared code (io.sentry.react)

Native Bridge Pattern (Java)

Catch Throwable at the boundary — not just Exception, so an Error can't crash the app either (the module code catches Throwable throughout) — and reject with the shared "SentryReactNative" code, not a per-method one:

@ReactMethod
public void nativeOperation(String param, Promise promise) {
  try {
    boolean result = performOperation(param);
    promise.resolve(result);
  } catch (Throwable e) {
    promise.reject("SentryReactNative", e.getMessage(), e);
  }
}

Boundaries

✅ Always

  • Land a bridge-method change in both src/oldarch/ and src/newarch/ — one arch is not done.
  • Catch Throwable at every @ReactMethod and promise.reject(...) — an uncaught throwable crashes the host app.
  • Gate any user data added to events/breadcrumbs/spans on sendDefaultPii.

🚫 Never

  • Change the codegen bridge ABI without mirroring it in JS + iOS and keeping it backward-compatible with an older cached native binary.
  • Bump the bundled io.sentry:sentry-android version by hand — go through scripts/update-android.sh.

Working with Local sentry-java

  1. Build sentry-java: cd sentry-java && make dryRelease
  2. Add mavenLocal() to sample's android/build.gradle
  3. Update version to locally published version

Download now (ZIP)

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.