Skip to content

docs: Revamp root and nested AGENTS.md - #6666

Open
antonis wants to merge 4 commits into
mainfrom
docs/revamp-agents-md
Open

docs: Revamp root and nested AGENTS.md#6666
antonis wants to merge 4 commits into
mainfrom
docs/revamp-agents-md

Conversation

@antonis

@antonis antonis commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Revamps the agent operating manual (AGENTS.md, symlinked as CLAUDE.md) and all nested AGENTS.md files against the "how to write a great AGENTS.md" checklist.

Root AGENTS.md:

  • ## Boundaries — a three-tier ✅ Always / ⚠️ Ask first / 🚫 Never section encoding the decisions an agent can't derive from the code (arch + platform parity, PII gating, bridge/ABI deprecation path, generated-file edits, CHANGELOG placement).
  • ## Skills — load on demand — an index mapping each local skill (spec, design-first, code-guidelines, test-guidelines, review, diagnosing-bugs) to when to reach for it, plus a note on the remote specialists pulled via agents.toml.
  • ## Stack — reframes the intro as a hybrid SDK (TS/JS wrapping sentry-cocoa + sentry-android/java via the bridge) and, rather than copying rot-prone version strings, points at the live sources: packages/core/package.json for JS/peer versions and the release-generated SDK-VERSIONS.md for bundled native versions.
  • Corrected the generated-files boundary (dropped a stale .yalc reference) and refined the CHANGELOG rule so notable internal changes land under ### Internal rather than being excluded outright.

packages/core/AGENTS.md:

  • Added a skill-precedence pointer ("depth lives in the skills; where a convention here overlaps a skill, the skill wins").
  • Fixed drifted diagnostics examples that used logger (the Logs API — recurses in the bridge hot path) to debug, matching the SDK's own source (52 files import { debug } from @sentry/core) and the file's own TurboModule warning.

Nested surface + sample files:

  • packages/core/android/AGENTS.md & packages/core/ios/AGENTS.md — added the skill-precedence pointer and a scoped Boundaries block (each tailored to its surface), and fixed drifted bridge examples: the real reject error code is the shared SentryReactNative, not a per-method OPERATION_FAILED; dropped the iOS [SentryLog logWithMessage:] snippet that appears nowhere in the ObjC layer.
    • Android boundaries: land a bridge change in both src/oldarch/ + src/newarch/, catch-and-reject at every @ReactMethod, gate PII, keep the codegen ABI mirrored/backward-compatible, and don’t hand-bump io.sentry:sentry-android (use scripts/update-android.sh).
    • iOS boundaries: always resolve-or-reject (an unfinished Promise hangs the JS caller), catch native exceptions, gate PII, route hybrid-SDK access through RNSentryInternal instead of PrivateSentrySDKOnly, and don’t hand-bump sentry-cocoa (use scripts/update-cocoa.sh).
  • samples/react-native/AGENTS.md — documented the iOS yarn pod-install-<debug|release>-<static|dynamic>[-legacy] build matrix (each script sets ENABLE_PROD / USE_FRAMEWORKS / ENABLE_NEW_ARCH) and the Android newArchEnabled toggle, so a native change gets verified across the combinations it affects.
  • samples/expo/AGENTS.md — added the real run:ios / run:android scripts and the dev-client caveat (native code means plain Expo Go isn't enough).

💡 Motivation and Context

Closes #6638. The always-loaded manual was missing the highest-value guidance (boundaries, when to load which skill) and had drifted from the code in places. Version numbers are deliberately not copied into prose — they point at existing sources so they can't rot into confident falsehoods in a file agents treat as ground truth.

💚 How did you test it?

Docs-only change. Every factual claim was verified against the codebase: package/peer/native versions against package.json/RNSentry.podspec/build.gradle; all referenced skills against agents.toml; every command against package.json scripts; the SentryReactNative reject code and NSLog/logger.log idioms against the actual ObjC/Java source; the android arch dirs, RNSentryInternal.swift, scripts/update-{cocoa,android}.sh, and the sample arch toggles against the tree.

📝 Checklist

  • I added tests to verify changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • No breaking changes.

🔮 Next steps

None — the revamp now covers the root manual plus every nested AGENTS.md (packages/core, android, ios, samples/react-native, samples/expo).

🤖 Generated with Claude Code

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>
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • docs: Revamp root and nested AGENTS.md by antonis in #6666
  • chore(deps): update Android SDK to v8.55.0 by github-actions in #6658
  • fix: Prevent Metro serializer crash on non-standard serializer output by antonis in #6652
  • chore(deps): Bump browserslist to ^4.28.7 to resolve security alerts by antonis in #6653
  • fix: Avoid NSNull RCTConvert warning when clearing scope context by antonis in #6651
  • chore(deps): update React Native to v0.87.1 by github-actions in #6607
  • chore: Add supply-chain provenance guidance to agent skills by antonis in #6644
  • fix(tracing): Keep launch-screen TTID/TTFD anchored to navigation on delayed first navigation by antonis in #6626
  • chore: Extend agents.toml and .agents/skills (Extend Warden setup #6637) by antonis in #6643
  • chore(sample): Bump React Native sample to 0.87.0 by antonis in #6617
  • fix(core): Resolve Metro from project root for source map generation by antonis in #6625
  • docs(sdk-versions): Add 8.14.3 row to SDK-VERSIONS.md by antonis in #6649
  • chore(deps): update Maestro to v2.10.0 by github-actions in #6641
  • chore(deps): update JavaScript SDK to v10.73.0 by github-actions in #6642
  • test(ios): Speed up sentry-xcode-scripts tests by antonis in #6633
  • fix: Update recommended vscode extensions by antonis in #6640
  • chore(deps): bump actions/setup-java from 5.7.0 to 6.0.0 by dependabot in #6636
  • chore(deps): bump the codeql-action group with 3 updates by dependabot in #6635
  • chore(deps): update JavaScript SDK to v10.72.0 by github-actions in #6634
  • chore(e2e): Bump E2E tests to React Native 0.87.0 by antonis in #6616
  • chore(deps): update CLI to v3.7.0 by github-actions in #6632
  • feat(tracing): Copy app start vitals onto standalone children by buenaflor in #6631
  • chore(deps): update Cocoa SDK to v9.26.1 by github-actions in #6623
  • fix(ios): Force-load the Sentry static archive to keep ObjC category methods by antonis in #6615

Plus 3 more


🤖 This preview updates automatically when you update the PR.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor
Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request

Generated by 🚫 dangerJS against 57f8da2

antonis and others added 2 commits September 3, 2026 11:58
Extend the AGENTS.md revamp to the nested surface files: add a
skill-precedence pointer and scoped Boundaries to android/ and ios/,
fix drifted bridge examples to the real `SentryReactNative` reject
code, and correct/expand the sample run commands (New/Old Arch toggle
for RN, real run:ios/run:android scripts for Expo).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the bare pod-install note with the sample's actual
`yarn pod-install-<debug|release>-<static|dynamic>[-legacy]` script
matrix, mapping each axis to the env it sets (ENABLE_PROD,
USE_FRAMEWORKS, ENABLE_NEW_ARCH).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@antonis
antonis requested a lite review from Copilot September 3, 2026 10:02
@antonis

antonis commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

@sentry review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The Android bridge example says to “catch everything” but only catches Exception, which is inconsistent with the stated boundary guidance and the repo’s own catch (Throwable ...) practice.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Docs-only refresh of the repository’s agent operating manuals (AGENTS.md + nested surface-specific AGENTS.md files) to better capture non-derivable boundaries, stack framing, and when to load each specialist skill, with updated examples aligned to current code.

Changes:

  • Added explicit repo-wide and surface-specific “Boundaries” (Always / Ask first / Never) and a “Skills — load on demand” index to guide agent decision-making.
  • Updated native-bridge examples (Android/iOS) to use the shared reject error code (SentryReactNative) and refreshed sample-app run guidance (RN + Expo).
  • Refined core-package diagnostics guidance to prefer debug (vs logger) in the TurboModule/bridge hot path.
File summaries
File Description
AGENTS.md Reframed as a hybrid SDK, added stack framing, boundaries, and a skills index.
packages/core/AGENTS.md Added skill precedence note and updated diagnostics examples to use debug.
packages/core/android/AGENTS.md Added skill precedence + boundaries; refreshed bridge reject-code example.
packages/core/ios/AGENTS.md Added skill precedence + boundaries; refreshed bridge reject-code example.
samples/react-native/AGENTS.md Documented iOS pod-install build matrix scripts and Android new-arch toggle for verification coverage.
samples/expo/AGENTS.md Clarified dev-client run commands and why Expo Go alone isn’t sufficient for native SDK changes.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/core/android/AGENTS.md

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit a6148f7. Configure here.

@antonis antonis changed the title docs: Revamp AGENTS.md with boundaries, skills index, and stack framing docs: Revamp root and nested AGENTS.md — boundaries, skills index, stack framing Sep 3, 2026
The example caught Exception while the boundary rule says to catch
everything and the module code (RNSentryModuleImpl) catches Throwable
throughout — an Error would otherwise crash the app. Flagged by Copilot.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@antonis
antonis marked this pull request as ready for review September 3, 2026 10:14
@antonis antonis changed the title docs: Revamp root and nested AGENTS.md — boundaries, skills index, stack framing docs: Revamp root and nested AGENTS.md Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Revamp AGENTS.md

2 participants