---
name: "sentry-fullstack-error-telemetry"
description: "Capture uncaught exceptions, distributed trace spans, and performance anomalies with Sentry."
metadata:
  author: "Sentry"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "setup sentry nextjs"
  - "capture exception sentry"
  - "upload sourcemaps sentry"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Sentry Fullstack Error Monitoring & Performance Tracing

Configures Sentry across Next.js/Node: sentry.client.config.ts, sentry.server.config.ts, sentry.edge.config.ts, source map uploads in CI, capturing handled exceptions with captureException, and setting user context.

## When to Invoke
Invoke this skill whenever you need to:
- setup sentry nextjs
- capture exception sentry
- upload sourcemaps sentry

## Execution SOP & Rules
1. Run setup: npx @sentry/wizard@latest -i nextjs to scaffold configuration files.
2. Set user context: Sentry.setUser({ id: user.id, email: user.email }).
3. Capture handled errors: Sentry.captureException(error, { tags: { section: 'billing' } }).
4. Tune trace sample rates: tracesSampleRate: 0.1 to avoid overwhelming Sentry quotas in high-traffic apps.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
