src/orchestrator/plugins/sentry/SKILL.md
Sentry error monitoring, SDK initialization, performance tracing, source maps, session replay, and release tracking. Use when adding Sentry to a project, capturing errors with context, setting up distributed tracing, configuring source maps, or debugging production issues.
npx skillsauth add monkilabs/opencastle sentry-monitoringInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Read the matching reference before writing code for any of these topics:
| Topic | Reference |
|-------|-----------|
| SDK setup & initialization | references/sdk-setup.md |
| Error capture & context enrichment | references/error-patterns.md |
| Performance tracing & spans | references/performance.md |
SDK Initialization
instrumentation-client.ts (browser), sentry.server.config.ts (Node), sentry.edge.config.ts (edge runtime)Sentry.init() as early as possible — before any other imports that might throwsendDefaultPii: true to capture authenticated user context automaticallynpx @sentry/wizard@latest -i nextjs for guided setup; it creates all init files and patches next.config.tsError Capture
Sentry.captureException(err) for caught errors; uncaught errors are captured automaticallySentry.setContext(), Sentry.setTag(), Sentry.setUser() before or inside the capture callSentry.addBreadcrumb() to build a debugging trail leading to the errorevent.fingerprint in beforeSend to control issue groupingPerformance
tracesSampleRate: 1.0 in development, 0.1 (or lower) in production to control costsSentry.startSpan() for custom instrumentation around expensive operationsSource Maps
next.config.ts with withSentryConfig() to auto-upload source maps at build timeSENTRY_AUTH_TOKEN in CI environment; generate at Organization Settings → Auth TokenstunnelRoute: '/monitoring' to proxy Sentry requests through your server and avoid ad-blockersReleases & Replay
SENTRY_RELEASE or letting the wizard configure it automaticallyreplaysSessionSampleRate and replaysOnErrorSampleRate for visual debugging// instrumentation-client.ts (browser) — mirrors sentry.server.config.ts / sentry.edge.config.ts
import * as Sentry from '@sentry/nextjs';
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
tracesSampleRate: process.env.NODE_ENV === 'production' ? 0.1 : 1.0,
sendDefaultPii: true,
// Browser-only options:
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
integrations: [Sentry.replayIntegration()],
});
import * as Sentry from '@sentry/nextjs';
try {
await processOrder(orderId);
} catch (err) {
Sentry.withScope((scope) => {
scope.setTag('action', 'process-order');
scope.setContext('order', { orderId, userId });
Sentry.captureException(err);
});
throw err; // re-throw after capturing
}
references/sdk-setup.md — Init patterns for Next.js, React, Node.js; wizard usage; config optionsreferences/error-patterns.md — captureException, context enrichment, breadcrumbs, fingerprinting, error boundariesreferences/performance.md — tracesSampleRate, startSpan, distributed tracing, custom instrumentationnpx @sentry/wizard@latest -i nextjs — select your Sentry org and project when promptedinstrumentation-client.ts, sentry.server.config.ts, sentry.edge.config.ts, and patches next.config.tsNEXT_PUBLIC_SENTRY_DSN in .env.local and SENTRY_AUTH_TOKEN in .env.local (and CI secrets)tracesSampleRate in each init file — verify Sentry receives a test event before mergingglobal-error.tsx and call Sentry.captureException inside it for App Router error boundaries
tunnelRoute is configured → confirm SENTRY_AUTH_TOKEN is set for source map uploadswithSentryConfig wraps the Next.js config → check build logs for upload errorsdevelopment
Defines 10 sequential validation gates: secret scanning, lint/test/build checks, blast radius analysis, dependency auditing, browser testing, cache management, regression checks, smoke tests. Use when running pre-deploy validation or CI checks, CI/CD pipelines, deployment pipeline validation, pre-merge checks, continuous integration, or pull request validation.
development
Generates test plans, writes unit/integration/E2E test files, identifies coverage gaps, flags common testing anti-patterns. Use when writing tests, creating test suites, planning test strategies, mocking dependencies, measuring code coverage, or test planning.
development
Provides model routing rules, validates delegation prerequisites, supplies cost tracking templates, defines dead-letter queue formats for Team Lead orchestration. Load when assigning tasks to agents, choosing model tiers, starting delegation session, running multi-agent workflow, delegating work, choosing which model to use, or assigning tasks.
testing
Saves, restores session state including task progress, file changes, delegation history. Use when saving progress, resuming interrupted work, picking up where you left off, or checkpointing current work.