# Sentry Error Tracking

Error tracking discipline for Sentry integration and incident workflow.

## Rules

1. **Initialize Sentry before everything else.** SDK setup runs at application bootstrap so startup failures and middleware errors are captured.

2. **Enrich errors with context.** User ID, request path, release version, breadcrumbs — a stack trace without context is a puzzle with missing pieces.

3. **Don't capture expected errors.** Validation failures and 404s are not exceptions. Filter noise or Sentry becomes a dashboard nobody trusts.

4. **Source maps in production.** Minified stack traces are useless. Upload source maps as part of the build pipeline so production errors point to real lines.

5. **Triage by impact, not count.** One error affecting all users outranks a thousand errors affecting one. Use Sentry's issue grouping and user impact metrics.

6. **Fix in Sentry's workflow.** Stack trace → breadcrumbs → trace → fix → resolve. Mark resolved in Sentry when the fix ships so regressions re-open automatically.

## What This Replaces

Sentry installed but capturing noise, stack traces that point to minified gibberish, and errors triaged by volume instead of user impact.

## Official Source

Distilled from Sentry's official dev team skills.
Full upstream: https://officialskills.sh/getsentry/skills/sentry-workflow
