Official agent skill

Code Guidelines

by getsentry in getsentry/sentry-react-native

Enforce Sentry React Native SDK code guidelines for implementation, refactoring, and review.

OfficialMITAuto-check passedDevelopment

Install Code Guidelines

skills CLI
$ npx skills add getsentry/sentry-react-native --skill code-guidelines -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install getsentry/sentry-react-native code-guidelines --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/getsentry/sentry-react-native.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/code-guidelines .claude/skills/code-guidelines && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
code-guidelines
GitHub stars
1.8k
Token cost
~3.2k tokens
SKILL.md length
1,558 words
Files
3 (incl. references)
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

Enforce Sentry React Native SDK code guidelines for implementation, refactoring, and review.

  • Implementing features
  • SKILL.md covers SDK Development Rules, File Organization, TypeScript & API style and Documentation comments
  • Calls yarn
  • Adding functionality

What it does

Code Guidelines is an agent skill from getsentry/sentry-react-native, published by the product's own GitHub organization. Enforce Sentry React Native SDK code guidelines for implementation, refactoring, and review. Use when implementing features, adding functionality, refactoring, reviewing code, designing APIs, changing the public API surface (the packages/core/src/js/index.ts barrel), handling breaking changes, deprecating options, writing integrations, touching the JS↔native bridge, or making architecture decisions in this yarn-workspaces monorepo.

Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/native-bridge.md` and `references/supply-chain.md`).

It sits in Development, covering Cross-platform mobile apps, Monorepo tooling and Refactoring. It works with Sentry, React Native, Android and iOS. The repository describes itself as: Official Sentry SDK for React Native. The licence is MIT.

When your agent uses it

  • Implementing features
  • Adding functionality
  • Changing the public API surface (the packages/core/src/js/index.ts barrel)
  • Handling breaking changes

Example prompts

  • “/code-guidelines”

What it can do on your machine

Read from SKILL.md and the folder at commit 6ce1083. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • yarn

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • develop.sentry.dev

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Code Guidelines loads about 3.2k tokens when it runs, and up to ~5.8k if it reads all its reference files. Until then it costs about 113 tokens; SKILL.md has 1,558 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~113
When it runs · the whole SKILL.md, loaded when a task matches
~3.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from getsentry/sentry-react-native at commit 6ce1083, republished under its MIT licence (© getsentry). 1,558 words, ~3,234 tokens.

Download SKILL.mdSave it as .claude/skills/code-guidelines/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
code-guidelines
description
Enforce Sentry React Native SDK code guidelines for implementation, refactoring, and review. Use when implementing features, adding functionality, refactoring, reviewing code, designing APIs, changing the public API surface (the `packages/core/src/js/index.ts` barrel), handling breaking changes, deprecating options, writing integrations, touching the JS↔native bridge, or making architecture decisions in this yarn-workspaces monorepo.

Apply these guidelines to all new and modified code in packages/core. Existing code may not follow these conventions — do not refactor it unless asked.

This SDK spans four surfaces: TypeScript/JS (packages/core/src/js/), Android (Java/Kotlin, packages/core/android/), iOS (ObjC/Swift, packages/core/ios/), and the JS↔native bridge (RNSentry TurboModule / legacy NativeModule) that connects them. Read the AGENTS.md for the surface you're touching — root, packages/core/, packages/core/android/, packages/core/ios/ — before writing. The bridge is where most SDK-specific bugs live; the deep guidance for it is in packages/core/AGENTS.md.

For non-trivial work — a new feature or integration, a public barrel-file change, or a change that crosses the native bridge — load the design-first skill to shape the modules and seams before writing code. When writing or modifying tests, also load the test-guidelines skill.

SDK Development Rules

Integrations

SDK features are packaged as integration factory functions that return an Integration (from @sentry/core). See src/js/integrations/ for the canonical shape (e.g. nativelinkederrors.ts):

typescript
const INTEGRATION_NAME = 'MyFeature';

export const myFeatureIntegration = (options: Partial<MyOptions> = {}): Integration => {
  return {
    name: INTEGRATION_NAME,
    setupOnce: () => { /* one-time global side effects, if any */ },
    setup: (client: Client) => { /* per-client wiring */ },
    processEvent: (event, hint, client) => { /* enrich/drop */ return event; },
  };
};
  • Check prerequisites and feature flags early — if the feature is disabled or the native module is missing, log via debug and return without wiring anything up.
  • Name the integration with a module-level INTEGRATION_NAME constant; don't inline the string.
  • Integrations should be order-independent. If yours must run before/after another, reconsider the design.
  • Register default integrations in src/js/integrations/default.ts; keep an integration's options and defaults with the integration, not scattered across options.ts.
  • Clean up anything global (listeners, timers) — an integration that arms a timer or subscribes to an emitter must have a path that tears it down.
Native Bridge (JS side)

Every call into native goes through the NATIVE wrapper (src/js/wrapper.ts) / RNSentry TurboModule. Rules:

  • Guard on availability. If enableNative is false or the module isn't linked, degrade gracefully — return a safe fallback, never throw into user code.
  • Never let a native rejection escape. Wrap bridge calls; log via debug and return a fallback. A thrown promise rejection from the bridge becomes an unhandled rejection in the host app.
  • Everything crossing the bridge must be serializable — plain JSON (no functions, class instances, undefined holes, circular refs, or BigInt). Both the New Architecture (JSI/TurboModule codegen) and the legacy bridge serialize payloads; a non-serializable value is silently dropped or throws on the native side. Verify toJSON/normalization round-trips.
  • Do not wrap RNSentry's own scope-sync methods (setTag, setContext, addBreadcrumb, setUser, captureEnvelope, …). Wrapping them recurses — see the RNSENTRY_SKIP / ignoreTurboModules notes in packages/core/AGENTS.md.
  • In this hot path, logger from @sentry/core is the Logs API (emits log events), not the debug logger. Use debug for diagnostics — see the TurboModule section of packages/core/AGENTS.md.
Native Bridge (native side)
  • Android (packages/core/android/): resolve/reject the Promise on every path; never leak it. Release JNI local refs; don't let a native exception cross back into the bridge uncaught. Old vs new arch code lives in src/oldarch/ and src/newarch/; shared code in src/main/.
  • iOS (packages/core/ios/): prefix classes RNSentry; use nullability annotations; watch for retain cycles in blocks (capture weakSelf). Route hybrid-SDK access through RNSentryInternal (see packages/core/ios/AGENTS.md), not deprecated PrivateSentrySDKOnly.
  • A native exception must never crash the host app — catch at the bridge boundary and reject/log instead.
Codegen (New Architecture)

The bridge spec is codegen'd. src/js/NativeRNSentry.ts is the TurboModule spec; RNSentryReplayMask*NativeComponent.ts are Fabric component specs.

  • Codegen only supports a restricted type vocabulary — primitives, Object (untyped map), arrays, and nullable via ?. No unions of literals, no generics, no Record<K,V> with non-string keys. If a method's shape can't be expressed, pass an Object and validate/parse on the native side.
  • Any change to a Native*.ts spec is a bridge ABI change: it must land in lockstep across the JS spec, ios/RNSentry.mm, and the Android RNSentryModuleImpl, and stay backward-compatible with older native binaries a user may have cached. Treat it like a public API change.
Usage tracking & SDK metadata

The event's SDK interface carries sdk.integrations, sdk.packages, and an optional sdk.features list; the spec says a feature should be reported through either an integration or the features list, not both. RN takes the integrations route: unlike sentry-dart (which populates sdk.features via an explicit addFeature / SentryFeatures API), RN's @sentry/core reports usage only through event.sdk.integrations and does not populate sdk.features. So usage is reported implicitly:

  • An installed integration is auto-reported by its name — @sentry/core collects the names of installed integrations into event.sdk.integrations. So the practical rule is: give the integration a stable, correct INTEGRATION_NAME, and register it (a default in integrations/default.ts, or client.addIntegration(...)) — that registration is the usage signal. A feature that runs without a registered, named integration is invisible to usage tracking.
  • SDK identity/packages come from src/js/version.ts (SDK_NAME, SDK_PACKAGE_NAME, SDK_VERSION) surfaced by integrations/sdkinfo.ts, which also appends the native SDK package — not the place to register feature usage.
  • Do not confuse this with addFeatureFlag on the native module (wrapper.ts / NativeRNSentry.ts) — that is the user-facing feature-flags product, unrelated to SDK usage tracking.

When adding something you want measured, make sure it lands as a named, registered integration rather than a bare side effect.

Logging
  • debug (from @sentry/core) is the internal diagnostic logger — use it for all SDK diagnostics. It is tree-shaken / gated so it stays quiet in production.
  • logger (from @sentry/core) is the Logs API — it emits user-visible log events. Never use it for internal diagnostics, and never in a hot path (see bridge rules above).
  • Log at the right level: debug for lifecycle/config, warn for recoverable/degraded paths (native module missing, option ignored), error for failures that affect SDK behavior.
Privacy (PII)
  • Never collect PII without gating on options.sendDefaultPii. This covers IP inference, device identifiers, deep-link URLs, navigation params, request/response bodies, and user-supplied context.
  • Flag any change that could place user data into breadcrumbs, event payloads, span attributes, or logs for review.
  • Deliberate exceptions exist and must be documented where they live (e.g. TurboModule module/method names are app-defined identifiers sent regardless of sendDefaultPii — see packages/core/AGENTS.md "Privacy"). Don't add new always-on data collection without that justification.
Show full SKILL.md (613 more words)Show less
Breaking changes
  • The public API is the src/js/index.ts barrel plus every exported option in options.ts. Its shape is captured in the API report (packages/core/etc/sentry-react-native.api.md); regenerate with yarn api-report and check with yarn api-report:check.
  • Removing or changing the signature/behavior of an exported symbol or option is a semver-major breaking change. Prefer deprecation with a migration path (@deprecated JSDoc + a working shim) over immediate removal.
  • Bridge/ABI changes (see Codegen) are breaking even when the JS surface looks unchanged — an app can ship new JS against an older cached native binary.
Adding dependencies

When adding or changing any third-party reference — an npm dependency, a .vscode/extensions.json recommendation, a GitHub Action (uses:), or a native dependency (Podfile / Gemfile / Gradle) — verify it is published by its legitimate owner before referencing it. The tool being real is not enough: the namespace must be one the project trusts. Prefer Sentry's own scope/org (@sentry/*, getsentry/*), then the artifact's documented official publisher, and pin to an exact version / full commit SHA rather than a floating tag. Treat an unscoped or unfamiliar-publisher name as a supply-chain risk until proven otherwise — a claimable namespace lets an attacker ship code to every contributor. Provenance is necessary but not sufficient: a legitimate owner's account or CI can be compromised and ship a malicious version, so pin to an immutable ref (lockfile integrity hash / full SHA) and check advisories for that specific version, not just the publisher. See references/supply-chain.md for the surface-by-surface checklist and verification commands.

File Organization

Group by feature, not by type. A processor or helper a feature owns lives with that feature (the TurboModule files sit together as turbomodule/ + integrations/turboModuleContext*.ts). The integrations/ directory is a type-bucket — it collects things that share the Integration type. Don't treat "it's an integration" as the whole home for a cohesive subsystem; keep the subsystem's own logic together and let the integration file be thin wiring.

Native code lives under packages/core/android/ and packages/core/ios/ and is reached only through the NATIVE wrapper seam — features call the bridge, they don't embed native code.

Where a given piece goes is a locality judgment — see design-first.

TypeScript & API style

Shape the public surface deliberately (see design-first for module shape). In an SDK these matter more than in app code:

  • Private by default. Don't export a symbol from the barrel unless it's genuinely part of the SDK's API — every export is a breaking-change liability and shows up in the API report.
  • Explicit types on public functions — annotate parameters and return types; don't rely on inference across the API boundary.
  • unknown over any. Narrow with type guards; any disables the checker exactly where SDK robustness matters.
  • Prefer interface for object shapes; use type for unions/mapped types.
  • Optional chaining / nullish coalescing (?., ??) over hand-rolled truthiness — but remember ?? and ?. treat 0/''/false correctly where || doesn't.
  • Re-throw, don't wrap-and-rethrow. Preserve the original error and its stack; when adding context, attach a cause rather than replacing the error — stack-trace fidelity is the product.
  • No cross-boundary deep imports. Import from @sentry/core / @sentry/browser public entry points, not their internal paths; keep RN-internal imports within src/js.

Style enforced by ESLint/oxlint/Prettier (single quotes, trailing commas, 120 cols, arrow-paren avoidance, import ordering) is not restated here — don't flag what yarn lint / yarn fix already handles. See packages/core/AGENTS.md for the list.

Documentation comments

Prefer self-documenting code; comment for the two cases that earn it:

  • Public APIs — JSDoc for every exported symbol and option, written for users who can't see the implementation.
  • Non-obvious why — workarounds, ordering constraints, native-bridge quirks, RN-version differences. The reasoning, not the play-by-play.

Don't narrate obvious behavior or restate the code. Use @deprecated, @internal, and @hidden deliberately — @internal/@hidden keep a symbol out of the generated API surface even when it must be exported for cross-file use.

© getsentry, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in .agents/skills/code-guidelines of getsentry/sentry-react-native.

  • SKILL.md
  • references/native-bridge.md
  • references/supply-chain.md

Open the folder on GitHubat commit 6ce1083

Compare with similar skills

Code Guidelines next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Code Guidelines compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code Guidelines this skillgetsentry/sentry-react-native1.8k—~3.2kAutomated safety check: PassMIT
Community Migrationjingjing2222/react-native-nitro-geolocation116—~3.5kAutomated safety check: PassMIT
Diagnosing Stacktrace SymbolicationPostHog/posthog-foss721—~2.2kAutomated safety check: PassMIT
Simulator Audio E2Ehyochan/react-native-nitro-sound961—~1.1kAutomated safety check: PassMIT
Code Review React Nativetalsec/Free-RASP-ReactNative175—~3.7kAutomated safety check: PassMIT
Upgrade Rn Versionbrandingbrand/flagship165—~3.7kAutomated safety check: PassMIT

Similar skills

  • Community Migration

    jingjing2222/react-native-nitro-geolocation

    Migrate React Native apps from @react-native-community/geolocation to react-native-nitro-geolocation.

    116 GitHub stars~3.5k tokensUpdated 24 days ago
    MobileAuto-check passed
  • Official

    Help users debug PostHog Error Tracking stack-trace symbolication for any supported platform — JavaScript/TypeScript web, React Native (Hermes), Android (Proguard / R8), or iOS / macOS (dSYM).

    721 GitHub stars~2.2k tokensUpdated today
    MobileAuto-check passed
  • Simulator Audio E2E

    hyochan/react-native-nitro-sound

    Build and run repeatable react-native-nitro-sound recorder/player regression tests on an iOS Simulator or Android emulator, with explicit virtual-device selection, microphone permission, Maestro…

    961 GitHub stars~1.1k tokensUpdated 7 days ago
    MobileAuto-check passed
  • Code Review React Native

    talsec/Free-RASP-ReactNative

    Performs strict code reviews on React Native plugin projects covering TypeScript, the Kotlin (Android) and Swift (iOS) native bridges, and the Expo config plugin.

    175 GitHub stars~3.7k tokensUpdated 2 days ago
    MobileAuto-check passed
  • Upgrade Rn Version

    brandingbrand/flagship

    Adopt a new stable React Native minor into Flagship Code. An agent skill from brandingbrand/flagship.

    165 GitHub stars~3.7k tokensUpdated 5 days ago
    MobileAuto-check passed
  • Analyticscli TS SDK

    LeoYeAI/openclaw-master-skills

    A skill your agent uses when integrating or upgrading the AnalyticsCLI TypeScript SDK in web, TypeScript, React Native, or Expo apps.

    2.2k GitHub stars~5.3k tokensUpdated 2 mo ago
    MobileAuto-check passed

More from getsentry/sentry-react-native

  • Test Guidelines

    getsentry/sentry-react-native

    Official

    Enforce Sentry React Native SDK test conventions for naming, structure, mocking, and fixtures with Jest.

    1.8k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Review

    getsentry/sentry-react-native

    Official

    Three-axis review of the branch diff — Standards (this repo's documented standards + public API/bridge surface), Spec (the originating Linear/GitHub issue or PR), and Correctness (runtime bugs + the…

    1.8k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Design First

    getsentry/sentry-react-native

    Official

    Shape non-trivial work before writing it — decide the modules, the seams, and the public API surface up front.

    1.8k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Diagnosing Bugs

    getsentry/sentry-react-native

    Official

    A discipline for hard bugs, flaky tests, CI hangs, native crashes, and performance regressions in this SDK.

    1.8k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Spec

    getsentry/sentry-react-native

    Official

    Produce a verified spec — problem, desired outcome, and acceptance criteria — before building.

    1.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed

Questions about Code Guidelines

What does Code Guidelines do?

Enforce Sentry React Native SDK code guidelines for implementation, refactoring, and review. Code Guidelines is an agent skill from getsentry/sentry-react-native, published by the product's own GitHub organization. Enforce Sentry React Native SDK code guidelines for implementation, refactoring, and review.

When should I use Code Guidelines?

Code Guidelines fits situations like: implementing features; adding functionality; changing the public API surface (the packages/core/src/js/index.ts barrel); handling breaking changes.

How do I install Code Guidelines in Claude Code?

Run `npx skills add getsentry/sentry-react-native --skill code-guidelines -a claude-code`. Or copy the skill folder (.agents/skills/code-guidelines in getsentry/sentry-react-native) into .claude/skills/code-guidelines in your project. Claude Code loads it when a task matches its description.

How do I install Code Guidelines in Codex?

Run `npx skills add getsentry/sentry-react-native --skill code-guidelines -a codex`. Or copy the skill folder (.agents/skills/code-guidelines in getsentry/sentry-react-native) into .agents/skills/code-guidelines in your project. Codex loads it when a task matches its description.

Can I use Code Guidelines in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add getsentry/sentry-react-native --skill code-guidelines -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-guidelines, .gemini/skills/code-guidelines, .github/skills/code-guidelines and .opencode/skills/code-guidelines in your project.

What does Code Guidelines need to run?

Going by SKILL.md and its folder, Code Guidelines needs the command-line tools its instructions call (yarn).

Does Code Guidelines access the network?

SKILL.md names 1 domain. As links in the text: develop.sentry.dev. This is read from the text; nothing was executed.

Is Code Guidelines safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Code Guidelines use?

Code Guidelines is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Code Guidelines use?

About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.6k tokens, read only when the agent opens those files.

What are the alternatives to Code Guidelines?

Skills that share tags, products or a category with Code Guidelines: Community Migration (jingjing2222/react-native-nitro-geolocation, 116 stars), Diagnosing Stacktrace Symbolication (PostHog/posthog-foss, 721 stars), Simulator Audio E2E (hyochan/react-native-nitro-sound, 961 stars) and Code Review React Native (talsec/Free-RASP-ReactNative, 175 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code Guidelines?

getsentry (a GitHub organization, an official publisher) maintains it in getsentry/sentry-react-native, which has 1,824 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 7, 2026.

Source: getsentry/sentry-react-native on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.