build-sentry-macos-swift
Use if adding or auditing Sentry crash reporting in a macOS/Swift app — dSYM, breadcrumbs, tracing.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use if adding or auditing Sentry crash reporting in a macOS/Swift app — dSYM, breadcrumbs, tracing.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use if driving agent-browser for webpage interaction, screenshots, @ref snapshots, tabs, UI verification, CDP attach, Steel Browser, or cloud providers (Browser Use, Browserbase, Browserless, Kernel).
Use if verifying claimed-done work or auditing session/plan/branch completion with evidence.
Use if creating, redesigning, or merging a Claude skill, with research before writing SKILL.md.
Use skill if you are running repeatable Codex reviews across lenses or branches, optionally verifying and fixing confirmed findings in isolated worktrees.
Use if running deep multi-file research over 5+ entities or a market — wave-dispatched corpus.
Use if finishing a project — review and merge every branch/worktree into main, retire dead branches.
| name | build-sentry-macos-swift |
| description | Use if adding or auditing Sentry crash reporting in a macOS/Swift app — dSYM, breadcrumbs, tracing. |
Wire Sentry (sentry-cocoa) into a native macOS or Swift app the way a senior engineer
would — explore the repo first, understand what actually works on this platform, then
integrate deeply (crash reporting plus breadcrumbs, tags, scope/context, tracing,
release health, structured logs, and privacy scrubbing). Not a one-line SentrySDK.start
drop-in.
This skill steers the agent through four phases: Explore → Understand & Decide → Integrate → Verify. Do them in order. Each phase routes to a focused reference.
getsentry/sentry-for-ai cocoa guide for a general Apple setup..xcodeproj, SwiftUI vs AppKit, sandboxed?, App Store vs notarized DMG,
CI or none, existing os.Logger) and let it drive every choice. → references/explore-the-repo.mdreferences/macos-support-matrix.mdsendDefaultPii = true, screenshots on). →
references/privacy-and-scrubbing.mdcapture(error:). It is crash + uncaught NSException
references/choosing-what-to-capture.md, references/advanced-instrumentation.mdreferences/verify-and-troubleshoot.mdsentry-cocoa ships ~weekly; option names and defaults drift.
Verify the current version and any option you rely on before writing it. This skill was
authored against 9.21.0 / sentry-cli 3.6.0 — treat that as a floor to re-check, not a
fact to trust blindly.Goal: build a fact sheet of this project before recommending anything. Run the detection
sweep in references/explore-the-repo.md and record each signal:
| Signal | Why it changes the integration |
|---|---|
Dependency manager (SPM-in-.xcodeproj / Package.swift / CocoaPods) | Where and how you add Sentry |
App lifecycle (SwiftUI App / AppKit AppDelegate) | Where SentrySDK.start goes; whether NSException opt-in is needed |
Sandboxed? (com.apple.security.app-sandbox) | Crash-cache path; entitlement reasoning |
| Distribution (App Store / notarized DMG / Sparkle) | dSYM upload flow; release naming |
| CI present? | dSYM upload as a pipeline step vs. a local Makefile/build-phase step |
Existing logging (os.Logger, CocoaLumberjack) | Whether to bridge into breadcrumbs/logs |
| Companion backend | Whether distributed tracing correlation is worth it |
| Data sensitivity (does it handle user text, files, audio, PII?) | How aggressive scrubbing + consent must be |
Output of this phase: a short written summary of the eight signals. Do not skip to install.
references/macos-support-matrix.md. On
native macOS, cross off: watchdog/OOM, Session Replay, screenshots, view hierarchy,
user-interaction breadcrumbs, UIViewController/app-start/TTID-TTFD instrumentation, and
the managed user-feedback widget. Keep: crash, app-hangs (v1), network/file/Core-Data
tracing, profiling, MetricKit, structured logs, release health, feedback API.references/choosing-what-to-capture.md
to choose which of error / span / log / metric / feedback each need maps to. Reject
"just errors" and reject "turn everything on." Default baseline: errors + a modest
tracing rate + releases + dSYM upload, then add logs/breadcrumbs/metrics per real need.references/privacy-and-scrubbing.mdAskUserQuestion for the
few real choices.Work top-down; verify each layer compiles before the next. Route to references for the detail.
| Layer | What to do | Reference |
|---|---|---|
| Install | Add the Sentry SPM product (one product, right place for this repo). | references/install-and-initialize.md |
| Initialize | SentrySDK.start on the main thread, earliest point in the detected lifecycle; options tuned to the platform + privacy posture. | references/install-and-initialize.md |
| Crash + hangs | enableUncaughtNSExceptionReporting = true (macOS must); understand hang false-positives around permission dialogs. | references/crash-and-hangs.md |
| Privacy floor | sendDefaultPii = false; beforeSend/beforeBreadcrumb scrubbers; network breadcrumbs off; IP handled server-side; opt-in gate. | references/privacy-and-scrubbing.md |
| Deep signals | Breadcrumbs, tags, configureScope/withScope context, user, fingerprints, manual capture, structured logs, OSLog bridging reality, attachments discipline. | references/advanced-instrumentation.md |
| Tracing + releases | Manual transactions/spans, network tracking + tracePropagationTargets, release health/environments, local (no-CI) dSYM upload, source context, commit association. | references/tracing-releases-dsym.md |
The advanced-instrumentation and choosing-what-to-capture references are the heart of "deep, not basic" — they turn a crash reporter into real observability tied to app context.
Never declare done off a clean compile. Follow references/verify-and-troubleshoot.md:
SentrySDK.capture(message:)), confirm it lands in the dashboard./Users/<name> paths, no IP.| Works on native macOS | Does NOT (iOS/UIKit/Catalyst only) |
|---|---|
| Crash, uncaught NSException (with opt-in), app-hangs v1, network/file/Core-Data tracing, profiling, MetricKit, structured logs, release health, breadcrumbs/scope/tags, feedback API | Watchdog/OOM, Session Replay, screenshots, view hierarchy, tap breadcrumbs, UIViewController/app-start/TTID-TTFD, feedback widget UI |
| Question | Signal |
|---|---|
| Something broke — what/where/why? | Error (baseline, always) |
| Why slow / what did it call? | Span / trace |
| What happened leading up to it? | Log or breadcrumb |
| How many / what trend? | Metric |
| Which function burns CPU? | Profile (needs tracing on) |
| What does the user think broke? | Feedback API (macOS: no widget) |
Tag every event with the context the app already knows (feature/mode, network endpoint
name, subsystem, retry count) so issues are triageable — but as fixed-vocabulary tags and
numeric measurements, never free-form strings that could carry user content. Details and
the scrub-safe patterns: references/advanced-instrumentation.md.
start, no capture, no logs when off).sessionReplay.*,
attachScreenshot, or enableWatchdogTerminationTracking on native macOS is a no-op —
don't present it as working.SENTRY_AUTH_TOKEN (sntrys_…) uploads debug files — keep it out of git
(gitignored .sentryclirc / env var).profilesSampleRate, integrations, enableTracing — removed in SDK 9.0.0. Use
configureProfiling, the enable* flags, and tracesSampleRate.Finish with: the eight explored signals; the chosen signals + sample rates; the privacy posture (scrub list + opt-in state); files changed; the dSYM upload mechanism; and the verification rung reached (with the event/issue URL if you got one). Name any macOS feature you deliberately skipped and why.
| Read when | Reference | Answers |
|---|---|---|
| Phase 1 — profiling the repo before any change | references/explore-the-repo.md | What to detect and how each signal steers the integration. |
| Phase 2 — deciding what's even possible here | references/macos-support-matrix.md | Which Sentry features work on native macOS vs. iOS-only. |
| Phase 2 — deciding which signals to capture | references/choosing-what-to-capture.md | Error vs. log vs. span vs. metric vs. feedback, and "deep not basic". |
| Phase 3 — adding and starting the SDK | references/install-and-initialize.md | SPM product choice, init placement, SentryOptions reference. |
| Phase 3 — crash capture correctness | references/crash-and-hangs.md | What's captured, the macOS NSException opt-in, the app-hang permission-dialog trap. |
| Phase 3 — the privacy crux | references/privacy-and-scrubbing.md | Threat model, beforeSend/beforeBreadcrumb scrubbers, the IP gotcha, server-side backstop, opt-in consent. |
| Phase 3 — deep observability | references/advanced-instrumentation.md | Breadcrumbs, tags, scope/context, user, fingerprints, manual capture, structured logs, OSLog reality, attachments. |
| Phase 3 — performance, releases, symbolication | references/tracing-releases-dsym.md | Manual tracing, network correlation, release health, and local (no-CI) dSYM upload. |
| Phase 4 — proving it works | references/verify-and-troubleshoot.md | The debugger-off verification workflow and a troubleshooting table. |