/observability:observabilityfrom observability
Writes and reviews Swift observability code on Apple platforms: unified logging (Logger, OSLog), signposts, MetricKit, crash reporting, symbolication, and telemetry pipelines.
Ships in observability. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Write and review Swift code that makes an app observable: emit the right signal (log, signpost, metric, diagnostic) at the right level, keep user data out of the logs, and get the data back from production in a form you can actually read - symbolicated, aggregated, and attributed to the right release.
Review process:
references/fundamentals.md.Logger usage (subsystem/category structure, level choice, privacy annotations, interpolation performance, wrapper design) using references/logger-api.md.log CLI predicates, logging profiles, sysdiagnose) using references/log-cli-and-console.md.references/oslogstore.md.OSSignposter, IDs, intervals, points of interest, Instruments wiring) using references/signposts.md.references/activity-tracing.md.MetricManager API) using references/metrickit.md.references/crash-reporting.md.references/symbolication.md.references/production-monitoring.md.URLSessionTaskMetrics, aggregate monitoring) using references/network-telemetry.md.references/third-party-sdks.md.references/anti-patterns.md.If doing partial work, load only the relevant reference files.
Match the user's goal to the read order. Load only what you need.
references/logger-api.md - Logger setup, categories, levels, privacyreferences/fundamentals.md - which levels persist, who can see whatreferences/logger-api.md - privacy annotations, .private(mask: .hash), equality trackingreferences/log-cli-and-console.md - Console.app workflow, log stream/show/collect, predicates, scripted simulator/device capture tiersreferences/oslogstore.md - OSLogStore, scope limits, export designreferences/logger-api.md - persistence rules decide what is even retrievablereferences/signposts.md - OSSignposter intervals, Instruments os_signpostreferences/production-monitoring.md - if the measurement must come from the fieldreferences/activity-tracing.md - activities, correlation IDs, when signposts fit betterreferences/metrickit.md - MXMetricManager, payloads, histograms, custom mxSignpost metricsreferences/production-monitoring.md - exporting, aggregating, alertingreferences/crash-reporting.md - crash pipeline, exit reasons, OOM, watchdog, hangsreferences/metrickit.md - diagnostic payloads carry the stacksreferences/symbolication.md - make the stacks readablereferences/symbolication.md - dSYMs, UUID matching, atos recipesreferences/third-party-sdks.md - what they add over MetricKit, integration rulesreferences/crash-reporting.md - the native baseline they compete withreferences/production-monitoring.md - the ASC Power and Performance API, pipeline design, units, buckets, index metricsreferences/metrickit.md - the payload shapes you are exportingreferences/network-telemetry.md - error taxonomy, non-fatal report design, URLSessionTaskMetrics, aggregate monitoringreferences/third-party-sdks.md - if an off-the-shelf RUM/performance SDK is in playreferences/anti-patterns.md - the usual causesreferences/fundamentals.md - persistence and delivery rulesRecording a discrete event to reconstruct behavior later?
-> Logger (unified logging), with the level matching persistence needs
Measuring the duration of an operation for local profiling?
-> OSSignposter interval + Instruments os_signpost / Points of Interest
Measuring durations or counts across the production fleet?
-> mxSignpost (MetricKit histograms) or your own telemetry event
Daily launch / hang / battery / disk / memory numbers from production?
-> MetricKit metric payloads (MXMetricPayload)
Crash, hang, CPU-spin, disk-write, or OOM call stacks from production?
-> MetricKit diagnostic payloads + Xcode Organizer (+ third-party if you
need real-time alerting and grouping)
Correlating logs that belong to one user flow across subsystems?
-> os_activity scopes or an explicit correlation ID in the message
Users need to send you what happened on their device?
-> OSLogStore export in-app, or a sysdiagnose for deep system issues
Real-time dashboards, alerting, release health, session context?
-> third-party SDK (Sentry/Crashlytics/Datadog) or your own pipeline
(OpenTelemetry + OTLP backend is the vendor-neutral build-it route)
Only useful while actively developing, high volume? -> debug / trace
Helpful context, fine if it evaporates after the fact? -> info
Essential for troubleshooting, must survive on device? -> notice (default)
Something failed but the app copes? -> error
A bug: broken invariant, data loss risk, must stand out? -> fault / critical
Persistence follows the level: debug is never written to disk, info only
during a log collect, notice/error/fault persist to the store (until
rotation). If support needs to see it from a user's device, it must be
notice or above.
print or NSLog as the app's logging mechanism. print is invisible outside a debugger and never persisted; NSLog is synchronous and slow. Use Logger (iOS 14+) or os_log (iOS 10+).Logger per subsystem/category pair as a static let; use the bundle identifier as the subsystem and a functional area per category (networking, persistence, ui). Do not funnel the whole app through one category.Logger behind a function that takes a plain String. Interpolation in an OSLogMessage is evaluated lazily only if the message is actually emitted; a String parameter forces evaluation on every call. If you must abstract, take @autoclosure () -> String or expose per-category Loggers directly.<private> on a device without a debugger). Mark values privacy: .public only after confirming they contain no user data; use privacy: .private(mask: .hash) when you need to correlate identical values without revealing them..public, and never write it into files or third-party SDKs where the OS redaction cannot protect it. Anyone with the device can read your app's persisted log messages in Console.debug (memory only, near-zero cost when not captured), info (memory, persisted only inside a log collect), notice (persisted default), error (persisted, for failures the app handles), fault/critical (persisted, captures extra state, for actual bugs). Reserve fault for programmer errors, not expected failures.OSSignposter intervals, not log lines with timestamps. Generate an OSSignpostID per operation instance (makeSignpostID()), store the returned OSSignpostIntervalState, and end with the same name. Use .pointsOfInterest category for events you want in the dedicated Instruments track.OSSignposter.disabled or an environment check if needed.MXMetricManager.shared.add(_:)) once, early, on a launch path that always runs (App init / didFinishLaunching). pastPayloads only returns data if the app was subscribed; a late or conditional subscription silently loses history.dictionaryRepresentation()/jsonRepresentation() for export.Measurement values, buckets in the payload's own unit) and convert exactly once at the edge. Verify the unit of every metric before writing transforms - a silent seconds-vs-milliseconds mismatch corrupts a week of dashboards before anyone notices.ActivePrewarm in the environment): since iOS 15 the system may start the process long before the user taps, producing minutes-long fake launches. Prefer MetricKit's histogrammedTimeToFirstDraw.MXAppExitMetric memory-related exit reasons (and the memory-exception diagnostic in the new API), and reduce them by lowering background footprint - do not wait for a crash reporter to show them.NSCache which evicts automatically) rather than eagerly walking and freeing compressed collections - touching compressed pages forces decompression and spikes footprint exactly when you can least afford it.dwarfdump --uuid) before symbolicating. MetricKit call stacks arrive unsymbolicated as binaryUUID + offsets - symbolicate off-device with atos -i (the -i recovers inlined frames; load address = frame address minus offsetIntoBinaryTextSegment). Submit builds to the App Store with symbols so Organizer reports arrive named with jump-to-source.OSLogStore off the main thread; on iOS it is scoped to your own process (.currentProcessIdentifier) and only returns what persistence rules kept - debug/info messages will not be there in production.os_activity) or an explicit correlation ID to relate logs across a flow; use signposts to measure it. Activities correlate, signposts time - do not bend one into the other.URLError, whose shared domain collapses distinct problems into one dashboard row); offline/connection-lost/timeout noise is counted in aggregate, and cancellations you issued are dropped. Diagnose slow requests with URLSessionTaskMetrics phases (DNS, connect, TLS, time-to-first-byte, isReusedConnection) - see references/network-telemetry.md.If the user asks for a review, organize findings by file. For each issue:
Skip files with no issues. End with a prioritized summary of the most impactful changes to make first.
If the user asks you to write or fix observability code, make the changes directly instead of returning a findings report.
Example output:
Line 31: print for a production failure path - invisible and unpersisted.
// Before
print("Payment failed for \(user.email): \(error)")
// After - persisted, categorized, PII kept private
private static let logger = Logger(
subsystem: Bundle.main.bundleIdentifier!, category: "checkout")
Self.logger.error("Payment failed for \(user.email, privacy: .private(mask: .hash)): \(error.localizedDescription, privacy: .public)")
Line 58: hand-rolled timing log - use a signpost interval.
// Before
let start = Date()
let receipt = try await submit(order)
logger.info("submit took \(Date().timeIntervalSince(start))s")
// After
private static let signposter = OSSignposter(
subsystem: Bundle.main.bundleIdentifier!, category: "checkout")
let id = Self.signposter.makeSignpostID()
let state = Self.signposter.beginInterval("SubmitOrder", id: id)
let receipt = try await submit(order)
Self.signposter.endInterval("SubmitOrder", state)
End of example.
references/fundamentals.md - the observability model: three pillars on Apple platforms, unified logging architecture (binary store, memory vs disk), levels and persistence, who can see what in dev vs production, the signal map.references/logger-api.md - Logger and legacy os_log: setup patterns, levels, privacy annotations and masking, formatting/alignment, lazy interpolation, wrapper and multi-destination facade design.references/log-cli-and-console.md - Console.app workflow, log stream/show/collect/config, predicate syntax, logging configuration profiles, sysdiagnose, scripted capture workflows for agent-assisted debugging (simulator stream-to-file, devicectl console launch with an env-gated print mirror, timestamped sudo log collect device archives).references/oslogstore.md - reading your own logs at runtime, scope and persistence limits, building a support-log export.references/signposts.md - OSSignposter intervals/events/animation intervals, signpost IDs, legacy os_signpost, Instruments os_signpost and Points of Interest, xctrace, XCTest metrics, DTrace probes for un-instrumentable processes.references/activity-tracing.md - os_activity in Swift, scopes, labelUserAction, correlation IDs, activities vs signposts.references/metrickit.md - MXMetricManager/MXMetricPayload/MXDiagnosticPayload (iOS 13-25), the iOS 27 MetricManager async API, payload cadence, histograms, custom mxSignpost metrics, extended launch tracking, testing.references/crash-reporting.md - what leaves a report and what does not: crash pipeline, exception types, watchdog codes, exit reasons, OOM, the hang tooling matrix (Thread Performance Checker, on-device detection, Organizer hang reports), Xcode Organizer panes and regressions.references/symbolication.md - dSYMs, UUID matching, atos, debug-info tiers and stripped-symbol behavior, Swift demangling, the dyld shared cache, symbolicating .ips files and MetricKit call stack trees, SDK symbol upload.references/production-monitoring.md - shipping telemetry: the App Store Connect Power and Performance API (metrics, smart insights, diagnostic signatures/logs), OpenTelemetry on iOS (opentelemetry-swift, OTLP exporters, gauge/counter/histogram semantics, TaskLocal span propagation, withSpan facade design, verbosity gating), export pipeline design, units and buckets, lab vs field, launch-metric skew (prewarming), score indexes, percentiles vs means, alerting.references/network-telemetry.md - request-level network observability: why lab conditions undersell the field, the report/count/drop error taxonomy, non-fatal report design (readable custom errors, userInfo context, embedded breadcrumbs), URLSessionTaskMetrics phases and diagnostics (keep-alive, server processing time, latency physics), aggregate monitoring (Firebase Performance / OTel), targeted full-dump collection.references/third-party-sdks.md - Sentry/Crashlytics/Datadog/Firebase vs the native stack, crash-handler exclusivity, bridging unified logging, dSYM upload automation, privacy manifests and cost.references/anti-patterns.md - common mistakes LLMs make when generating logging and telemetry code.agents/openai.yaml (opens in a new tab)references/activity-tracing.md (opens in a new tab)references/anti-patterns.md (opens in a new tab)references/crash-reporting.md (opens in a new tab)references/fundamentals.md (opens in a new tab)references/log-cli-and-console.md (opens in a new tab)references/logger-api.md (opens in a new tab)references/metrickit.md (opens in a new tab)references/network-telemetry.md (opens in a new tab)references/oslogstore.md (opens in a new tab)references/production-monitoring.md (opens in a new tab)references/signposts.md (opens in a new tab)references/symbolication.md (opens in a new tab)references/third-party-sdks.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
Generated from the plugin's indexed repository (n0an/observability-agent-skill) — no native marketplace selected
npx claudepluginhub p/n0an-observability