home / skills / jeremylongshore / claude-code-plugins-plus-skills / sentry-local-dev-loop

This skill configures an environment-aware Sentry local dev loop to enable debug mode and separate development projects for testing errors.

npx playbooks add skill jeremylongshore/claude-code-plugins-plus-skills --skill sentry-local-dev-loop

Review the files below or copy the command above to add this skill to your agents.

Files (4)
SKILL.md
1.2 KB
---
name: sentry-local-dev-loop
description: |
  Execute set up local development workflow with Sentry.
  Use when configuring Sentry for development environments,
  setting up debug mode, or testing error capture locally.
  Trigger with phrases like "sentry local dev", "sentry development",
  "debug sentry", "sentry dev environment".
allowed-tools: Read, Write, Edit, Bash(npm:*), Grep
version: 1.0.0
license: MIT
author: Jeremy Longshore <[email protected]>
---

# Sentry Local Dev Loop

## Prerequisites
- Sentry SDK installed
- Development environment set up
- Separate Sentry project for development (recommended)


See `{baseDir}/references/implementation.md` for detailed implementation guide.

## Output
- Environment-aware Sentry configuration
- Debug logging enabled for development
- Separate project/DSN for development events

## Error Handling

See `{baseDir}/references/errors.md` for comprehensive error handling.

## Examples

See `{baseDir}/references/examples.md` for detailed examples.

## Resources
- [Sentry Environment Config](https://docs.sentry.io/platforms/javascript/configuration/environments/)
- [Sentry Debug Mode](https://docs.sentry.io/platforms/javascript/configuration/options/#debug)

Overview

This skill sets up a local development workflow for Sentry so you can safely capture and inspect errors during development. It focuses on environment-aware configuration, enabling debug logging, and routing events to a separate development project or DSN. Use it to avoid polluting production data while iterating on error capture and instrumentation.

How this skill works

The skill configures the Sentry SDK to detect the current environment and apply development-specific settings: debug mode on, verbose logging, and an alternate DSN or sample rate for local events. It can toggle behavior based on environment variables and inject helpers for test error generation and local replay. The setup emphasizes minimal change to production code paths by isolating development configuration behind an env flag.

When to use it

  • When developing locally and you need to validate Sentry event capture without affecting production projects
  • When you want detailed debug logs from the Sentry SDK to troubleshoot integration issues
  • When creating automated or manual tests that should report to a development-only DSN
  • When configuring CI jobs that run in a dev-like environment and require isolated error telemetry
  • When iterating on error fingerprinting, stack trimming, or before promoting configuration to staging/production

Best practices

  • Use a dedicated Sentry project or DSN for development to keep production data clean
  • Control behavior with environment variables (e.g., SENTRY_ENV=development, SENTRY_DSN_DEV) and avoid hardcoding secrets
  • Enable debug and verbose logging locally, but ensure debug is disabled in staging/production
  • Set sample rates or event filters for local runs to prevent noisy or duplicate events
  • Include a lightweight helper to trigger synthetic errors for validating the full pipeline

Example use cases

  • Enable Sentry debug logs locally to diagnose why a source map or frame grouping is incorrect
  • Point local builds at a dev DSN so engineers can reproduce and inspect events without touching prod
  • Run a test that throws a controlled exception and confirms correct tags, user context, and breadcrumbs
  • Switch to a higher local sample rate to capture rare errors while developing a new feature
  • Automate a pre-merge job that validates Sentry instrumentation emits expected events to dev project

FAQ

Can I reuse my production DSN for local testing?

You can, but it is not recommended. Use a separate development DSN or project to avoid mixing telemetry and exposing prod data during local tests.

How do I enable Sentry debug logging only locally?

Control the Sentry SDK option 'debug' via an environment variable and set it true when SENTRY_ENV=development; ensure your deployment configs set it false.