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
docs: Revamp AGENTS.md with boundaries, skills index, and stack framing
Address #6638. Add the three high-value
sections the "great AGENTS.md" checklist calls for and that were missing:
a three-tier ✅/⚠️/🚫 Boundaries section, a Skills-load-on-demand index,
and a hybrid-SDK Stack framing that points at live version sources rather
than copying rot-prone version strings. Fix a drifted diagnostics example
(logger -> debug) and add a skill-precedence pointer in packages/core.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: AGENTS.md
+48-3Lines changed: 48 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,21 @@
1
1
# AGENTS.md
2
2
3
-
Sentry React Native SDK — monorepo using yarn workspaces with a single package at `packages/core`.
3
+
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.
-**Wraps native SDKs:** sentry-cocoa (iOS) + sentry-android/java (Android) through the JS↔native bridge.
9
+
-**Hosts:** React Native on **both** the New (TurboModule/Fabric) and Old (bridge) Architecture, plus Expo and React.
10
+
-**Exact versions** (don't copy them here — they rot): JS deps and host peer ranges in [`packages/core/package.json`](packages/core/package.json); the bundled native SDK versions per release in [`SDK-VERSIONS.md`](SDK-VERSIONS.md) (regenerated each release by `craft-pre-release.sh`).
11
+
12
+
Changes to the wrapped native SDKs can ripple to them and to downstream hybrid SDKs (Flutter, .NET/MAUI, Unity) — see *Cross-Platform Dependencies*.
4
13
5
14
## Agent Responsibilities
6
15
7
-
-**Continuous Learning**: Document new patterns in the appropriate nested `AGENTS.md` file.
8
-
-**Context Management**: After compaction, re-read `AGENTS.md` files relevant to your current task.
16
+
-**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.
17
+
-**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.
18
+
-**Context Management:** after compaction, re-read the `AGENTS.md` for the surface you're touching before continuing.
9
19
10
20
## Setup
11
21
@@ -32,6 +42,26 @@ yarn build
32
42
| ObjC/C++ lint |`yarn lint:clang`|
33
43
| Swift lint |`yarn lint:swift`|
34
44
45
+
## Boundaries
46
+
47
+
**✅ Always**
48
+
- Run `yarn lint`, `yarn test`, and `yarn circularDepCheck` before calling a change done; regenerate the API report (`yarn api-report`) when the public surface moved.
49
+
- Make a change work on **both** architectures (New + Old) and **both** platforms (iOS + Android) — a fix that only covers one is not done.
50
+
- Gate any user data placed in events/breadcrumbs/spans/logs on `options.sendDefaultPii`.
51
+
- Catch native errors at the bridge boundary and degrade — reject/log, never let them propagate.
52
+
53
+
**⚠️ Ask first**
54
+
- Adding or changing any dependency, `.vscode` extension, GitHub Action, or native dependency — verify provenance first (load `code-guidelines` → *Adding dependencies*).
55
+
- Changing the public API (`packages/core/src/js/index.ts` barrel, exported options) or a codegen/bridge spec (`NativeRNSentry.ts`, `*NativeComponent.ts`) — these are breaking and need a deprecation path.
56
+
- Changing CI workflows, release config, or anything under `scripts/`.
57
+
58
+
**🚫 Never**
59
+
- Crash the host app — a native exception that reaches the app is the highest-severity failure this SDK can cause.
60
+
- Break the public API or bridge ABI without a `@deprecated` migration path (an app can ship new JS against an older cached native binary).
61
+
- Hand-edit generated files: `packages/core/etc/sentry-react-native.api.md` (regenerate it) or New-Architecture codegen output — regenerate, never edit by hand.
62
+
- Add `CHANGELOG.md` noise 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 `### Internal` section instead, not among the user-facing entries.
@@ -99,6 +129,21 @@ Changes may impact downstream SDKs. Coordinate with other teams when modifying n
99
129
-**Inline comments** for complex logic only
100
130
- Update `CHANGELOG.md` for user-visible changes
101
131
132
+
## Skills — load on demand
133
+
134
+
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:
135
+
136
+
| Skill | Load it when |
137
+
|-------|--------------|
138
+
|`spec`| The *what* isn't pinned down yet — a fuzzy issue or idea to scope into acceptance criteria. Hands off to `design-first`. |
139
+
|`design-first`| Starting a feature/integration, changing the public barrel, crossing the bridge, or changing a codegen spec — shape modules and seams before coding. |
|`test-guidelines`| Writing, modifying, or reviewing Jest tests, fixtures, and mocks. |
142
+
|`review`| A three-axis (Standards / Spec / Correctness) pass on a branch or PR before opening or merging. |
143
+
|`diagnosing-bugs`| A hard bug, flaky test, CI hang, native crash, or perf regression — builds a red-capable loop before hypothesizing. |
144
+
145
+
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.
Copy file name to clipboardExpand all lines: packages/core/AGENTS.md
+9-3Lines changed: 9 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
# packages/core — TypeScript/JavaScript SDK
2
2
3
+
> **Depth lives in the skills.** The `code-guidelines` and `test-guidelines` skills (`.agents/skills/`) hold the authoritative, current guidance on code style, API/integration design, the bridge, and tests — load them before non-trivial work. This file covers the package's build/test commands, quick-reference conventions, and the **TurboModule subsystem**, which is documented nowhere else. Where a convention here overlaps a skill, the skill wins.
> Diagnostics use **`debug`** from `@sentry/core`, not `logger` — `logger` is the Logs API and emits log *events* (and recurses in the bridge hot path). See *TurboModule Instrumentation* below.
0 commit comments