/configure:sentry
Check and configure Sentry error tracking integration against project standards.
When to Use This Skill
| Use this skill when... |
Use another approach when... |
| Setting up Sentry error tracking for a new project |
Debugging a specific Sentry issue or alert (use Sentry MCP server) |
| Sentry-specific setup and compliance in depth |
Wiring up the whole observability stack — OTel traces/metrics + logging (use /configure:instrumentation, which delegates Sentry gaps back here) |
| Checking Sentry SDK installation and configuration compliance |
Querying Sentry events or performance data (use Sentry API/MCP) |
| Fixing hardcoded DSNs or missing environment variable references |
Managing Sentry project settings in the Sentry dashboard |
| Adding source map upload and release tracking to CI/CD |
Configuring Sentry alerting rules or notification channels |
| Verifying Sentry configuration across frontend, Next.js, Node.js, or Python projects |
Installing a different error tracking tool (e.g., Bugsnag, Rollbar) |
| Adding profiling, structured logging, or enrichment helpers |
Configuring Sentry alerting rules or notification channels |
| Project-level setup and compliance auditing |
Day-to-day SDK usage patterns — spans, breadcrumbs, cron monitoring, replay (use typescript-plugin:typescript-sentry) |
Context
- Package.json: !
find . -maxdepth 1 -name 'package.json'
- Pyproject.toml: !
find . -maxdepth 1 -name 'pyproject.toml'
- Requirements.txt: !
find . -maxdepth 1 -name 'requirements.txt'
- Project standards: !
find . -maxdepth 1 -name '.project-standards.yaml' -type f
- Sentry in package.json: !
find . -maxdepth 1 -name 'package.json' -exec grep -o '"@sentry/[^"]*"' {} +
- Sentry in pyproject.toml: !
find . -maxdepth 1 -name 'pyproject.toml' -exec grep 'sentry' {} +
- Sentry init files: !
find . -maxdepth 3 -name "*sentry*" -type f
- Next.js config: !
find . -maxdepth 1 -name 'next.config.*'
- Instrumentation files: !
find . -path '*/src/*' -maxdepth 2 -name 'instrumentation*' -type f
- Env files referencing DSN: !
find . \( -name '.env*' -o -path '*/.github/workflows/*' \) -type f -exec grep -l 'SENTRY_DSN' {} +
- CI workflows: !
find . -path '*/.github/workflows/*' -maxdepth 3 -name '*.yml'
Skills referenced: sentry (MCP server for Sentry API)
Parameters
Parse these from $ARGUMENTS:
| Flag |
Description |
--check-only |
Report status without offering fixes |
--fix |
Apply all fixes automatically without prompting |
--type <type> |
Override project type detection (frontend, nextjs, python, node) |
Version Checking
CRITICAL: Before configuring Sentry SDKs, verify latest versions:
- @sentry/vue / @sentry/react: Check npm
- @sentry/nextjs: Check npm
- @sentry/node: Check npm
- sentry-sdk (Python): Check PyPI
- @sentry/vite-plugin: Check npm
Use WebSearch or WebFetch to verify current SDK versions before configuring Sentry.
Execution
Execute this Sentry compliance check:
Step 1: Detect project type
Determine the project type to select the appropriate SDK and configuration:
- Read
.project-standards.yaml for project_type field
- If not found, auto-detect:
- nextjs: Has
package.json with next dependency (check for @sentry/nextjs)
- frontend: Has
package.json with vue/react dependencies (without Next.js)
- node: Has
package.json with Node.js backend (express, fastify, etc.)
- python: Has
pyproject.toml or requirements.txt
- If
--type flag is provided, use that value instead
Step 2: Check SDK installation
Check for Sentry SDK based on detected project type:
Next.js:
@sentry/nextjs in package.json dependencies
@sentry/profiling-node (recommended for server profiling)
Frontend (Vue/React):
@sentry/vue or @sentry/react in package.json dependencies
@sentry/vite-plugin for source maps
Node.js Backend:
@sentry/node in package.json dependencies
@sentry/profiling-node (recommended)
Python:
sentry-sdk in pyproject.toml or requirements.txt
- Framework integrations (django, flask, fastapi)
Step 3: Analyze configuration
Read the Sentry initialization files and check against the compliance tables in REFERENCE.md. Validate:
- DSN comes from environment variables (not hardcoded)
- Tracing sample rate is configured (different for prod vs dev)
- Source maps are enabled (frontend/Next.js)
- Init location is correct (Node.js: before other imports)
- Framework integration is enabled (Python)
Additional checks for Next.js projects:
src/instrumentation.ts exists with register() and onRequestError exports
src/instrumentation-client.ts exists with client-side Sentry init
sentry.server.config.ts and sentry.edge.config.ts exist at project root
next.config.mjs wraps config with withSentryConfig()
- Tunnel route configured (
tunnelRoute: "/monitoring")
- Source maps hidden and deleted after upload (
hideSourceMaps, deleteSourcemapsAfterUpload)
@sentry/profiling-node listed in serverExternalPackages
- Error boundaries exist (
src/app/error.tsx, src/app/global-error.tsx)
- Structured logging enabled (
enableLogs: true)
- Sensitive header stripping in
beforeSend
- Transaction filtering in
beforeSendTransaction (drop health checks, static assets)
Step 4: Run security checks
- Verify no hardcoded DSN in any source files
- Check that DSN is not committed in git-tracked files
- Verify no auth tokens in frontend code
- Check production sample rates are reasonable (not 1.0)
Step 5: Report results
Print a compliance report with:
- Project type (detected or overridden)
- SDK version and installation status
- Configuration check results (PASS/WARN/FAIL)
- Security check results
- Missing configuration items
- Recommendations
If --check-only, stop here.
Step 6: Apply fixes (if --fix or user confirms)
- Missing SDK: Add appropriate Sentry SDK to dependencies
- Missing Vite plugin: Add
@sentry/vite-plugin for source maps
- Missing config file: Create Sentry initialization file using templates from REFERENCE.md
- Hardcoded DSN: Replace with environment variable reference
- Missing sample rates: Add recommended sample rates
Step 7: Check CI/CD integration
Verify Sentry integration in CI/CD:
SENTRY_AUTH_TOKEN secret configured
- Source map upload step in build workflow
- Release creation on deploy
If missing, offer to add the recommended workflow steps from REFERENCE.md.
Step 8: Update standards tracking
Update or create .project-standards.yaml:
standards_version: "2025.1"
project_type: "<detected>"
last_configured: "<timestamp>"
components:
sentry: "2025.1"
Environment Variables
| Variable |
Description |
Required |
SENTRY_DSN |
Sentry Data Source Name (server-side) |
Yes |
NEXT_PUBLIC_SENTRY_DSN |
Sentry DSN for client-side (Next.js) |
Next.js only |
SENTRY_ENVIRONMENT |
Environment name (server-side) |
Recommended |
NEXT_PUBLIC_SENTRY_ENVIRONMENT |
Environment name (client-side, Next.js) |
Next.js only |
SENTRY_ORG |
Sentry organization slug |
For source maps |
SENTRY_PROJECT |
Sentry project slug |
For source maps |
SENTRY_AUTH_TOKEN |
Auth token for CI/CD |
For source maps |
NEXT_PUBLIC_SENTRY_SKIP_BUILD |
Skip Sentry webpack plugin in builds |
Container builds |
Never commit DSN or auth tokens. Use environment variables or secrets management.
For detailed configuration check tables, initialization templates, and CI/CD workflow examples, see REFERENCE.md.
Agentic Optimizations
| Context |
Command |
| Quick compliance check |
/configure:sentry --check-only |
| Auto-fix all issues |
/configure:sentry --fix |
| Frontend project only |
/configure:sentry --type frontend |
| Next.js project |
/configure:sentry --type nextjs |
| Python project only |
/configure:sentry --type python |
| Node.js project only |
/configure:sentry --type node |
| Check for hardcoded DSNs |
rg -l 'https://[a-f0-9]*@.*sentry\.io' --type-not env |
Error Handling
- No Sentry SDK: Offer to install appropriate SDK for project type
- Hardcoded DSN: Report as FAIL, offer to fix with env var reference
- Invalid DSN format: Report error, provide DSN format guidance
- Missing Sentry project: Report warning, provide setup instructions
See Also
/configure:instrumentation - Whole observability stack (OTel traces/metrics, structured logging); delegates Sentry gaps to this skill
/configure:all - Run all compliance checks
/configure:status - Quick compliance overview
/configure:workflows - GitHub Actions integration
typescript-plugin:typescript-sentry - Day-to-day Sentry SDK usage for Bun/Node.js/Next.js (spans, breadcrumbs, cron monitoring, replay)
sentry MCP server - Sentry API access for project verification
1---
2created: 2025-12-16
3modified: 2026-07-05
4reviewed: 2026-07-05
5description: "Sentry error tracking setup. Use when installing the Sentry SDK, fixing hardcoded DSNs, or adding source map upload for frontend, Next.js, Node, or Python."
6allowed-tools: Glob, Grep, Read, Write, Edit, Bash, AskUserQuestion, TodoWrite, WebSearch, WebFetch
7args: "[--check-only] [--fix] [--type <frontend|nextjs|python|node>]"
8argument-hint: "[--check-only] [--fix] [--type <frontend|nextjs|python|node>]"
9name: configure-sentry
10---
11
12# /configure:sentry
13
14Check and configure Sentry error tracking integration against project standards.
15
16## When to Use This Skill
17
18| Use this skill when... | Use another approach when... |
19|------------------------|------------------------------|
20| Setting up Sentry error tracking for a new project | Debugging a specific Sentry issue or alert (use Sentry MCP server) |
21| Sentry-specific setup and compliance in depth | Wiring up the whole observability stack — OTel traces/metrics + logging (use `/configure:instrumentation`, which delegates Sentry gaps back here) |
22| Checking Sentry SDK installation and configuration compliance | Querying Sentry events or performance data (use Sentry API/MCP) |
23| Fixing hardcoded DSNs or missing environment variable references | Managing Sentry project settings in the Sentry dashboard |
24| Adding source map upload and release tracking to CI/CD | Configuring Sentry alerting rules or notification channels |
25| Verifying Sentry configuration across frontend, Next.js, Node.js, or Python projects | Installing a different error tracking tool (e.g., Bugsnag, Rollbar) |
26| Adding profiling, structured logging, or enrichment helpers | Configuring Sentry alerting rules or notification channels |
27| Project-level setup and compliance auditing | Day-to-day SDK usage patterns — spans, breadcrumbs, cron monitoring, replay (use `typescript-plugin:typescript-sentry`) |
28
29## Context
30
31- Package.json: !`find . -maxdepth 1 -name 'package.json'`
32- Pyproject.toml: !`find . -maxdepth 1 -name 'pyproject.toml'`
33- Requirements.txt: !`find . -maxdepth 1 -name 'requirements.txt'`
34- Project standards: !`find . -maxdepth 1 -name '.project-standards.yaml' -type f`
35- Sentry in package.json: !`find . -maxdepth 1 -name 'package.json' -exec grep -o '"@sentry/[^"]*"' {} +`
36- Sentry in pyproject.toml: !`find . -maxdepth 1 -name 'pyproject.toml' -exec grep 'sentry' {} +`
37- Sentry init files: !`find . -maxdepth 3 -name "*sentry*" -type f`
38- Next.js config: !`find . -maxdepth 1 -name 'next.config.*'`
39- Instrumentation files: !`find . -path '*/src/*' -maxdepth 2 -name 'instrumentation*' -type f`
40- Env files referencing DSN: !`find . \( -name '.env*' -o -path '*/.github/workflows/*' \) -type f -exec grep -l 'SENTRY_DSN' {} +`
41- CI workflows: !`find . -path '*/.github/workflows/*' -maxdepth 3 -name '*.yml'`
42
43**Skills referenced**: `sentry` (MCP server for Sentry API)
44
45## Parameters
46
47Parse these from `$ARGUMENTS`:
48
49| Flag | Description |
50|------|-------------|
51| `--check-only` | Report status without offering fixes |
52| `--fix` | Apply all fixes automatically without prompting |
53| `--type <type>` | Override project type detection (`frontend`, `nextjs`, `python`, `node`) |
54
55## Version Checking
56
57**CRITICAL**: Before configuring Sentry SDKs, verify latest versions:
58
591. **@sentry/vue** / **@sentry/react**: Check [npm](https://www.npmjs.com/package/@sentry/vue)
602. **@sentry/nextjs**: Check [npm](https://www.npmjs.com/package/@sentry/nextjs)
613. **@sentry/node**: Check [npm](https://www.npmjs.com/package/@sentry/node)
624. **sentry-sdk** (Python): Check [PyPI](https://pypi.org/project/sentry-sdk/)
635. **@sentry/vite-plugin**: Check [npm](https://www.npmjs.com/package/@sentry/vite-plugin)
64
65Use WebSearch or WebFetch to verify current SDK versions before configuring Sentry.
66
67## Execution
68
69Execute this Sentry compliance check:
70
71### Step 1: Detect project type
72
73Determine the project type to select the appropriate SDK and configuration:
74
751. Read `.project-standards.yaml` for `project_type` field
762. If not found, auto-detect:
77 - **nextjs**: Has `package.json` with `next` dependency (check for `@sentry/nextjs`)
78 - **frontend**: Has `package.json` with vue/react dependencies (without Next.js)
79 - **node**: Has `package.json` with Node.js backend (express, fastify, etc.)
80 - **python**: Has `pyproject.toml` or `requirements.txt`
813. If `--type` flag is provided, use that value instead
82
83### Step 2: Check SDK installation
84
85Check for Sentry SDK based on detected project type:
86
87**Next.js:**
88- `@sentry/nextjs` in package.json dependencies
89- `@sentry/profiling-node` (recommended for server profiling)
90
91**Frontend (Vue/React):**
92- `@sentry/vue` or `@sentry/react` in package.json dependencies
93- `@sentry/vite-plugin` for source maps
94
95**Node.js Backend:**
96- `@sentry/node` in package.json dependencies
97- `@sentry/profiling-node` (recommended)
98
99**Python:**
100- `sentry-sdk` in pyproject.toml or requirements.txt
101- Framework integrations (django, flask, fastapi)
102
103### Step 3: Analyze configuration
104
105Read the Sentry initialization files and check against the compliance tables in [REFERENCE.md](REFERENCE.md). Validate:
106
1071. DSN comes from environment variables (not hardcoded)
1082. Tracing sample rate is configured (different for prod vs dev)
1093. Source maps are enabled (frontend/Next.js)
1104. Init location is correct (Node.js: before other imports)
1115. Framework integration is enabled (Python)
112
113**Additional checks for Next.js projects:**
114
1156. `src/instrumentation.ts` exists with `register()` and `onRequestError` exports
1167. `src/instrumentation-client.ts` exists with client-side Sentry init
1178. `sentry.server.config.ts` and `sentry.edge.config.ts` exist at project root
1189. `next.config.mjs` wraps config with `withSentryConfig()`
11910. Tunnel route configured (`tunnelRoute: "/monitoring"`)
12011. Source maps hidden and deleted after upload (`hideSourceMaps`, `deleteSourcemapsAfterUpload`)
12112. `@sentry/profiling-node` listed in `serverExternalPackages`
12213. Error boundaries exist (`src/app/error.tsx`, `src/app/global-error.tsx`)
12314. Structured logging enabled (`enableLogs: true`)
12415. Sensitive header stripping in `beforeSend`
12516. Transaction filtering in `beforeSendTransaction` (drop health checks, static assets)
126
127### Step 4: Run security checks
128
1291. Verify no hardcoded DSN in any source files
1302. Check that DSN is not committed in git-tracked files
1313. Verify no auth tokens in frontend code
1324. Check production sample rates are reasonable (not 1.0)
133
134### Step 5: Report results
135
136Print a compliance report with:
137- Project type (detected or overridden)
138- SDK version and installation status
139- Configuration check results (PASS/WARN/FAIL)
140- Security check results
141- Missing configuration items
142- Recommendations
143
144If `--check-only`, stop here.
145
146### Step 6: Apply fixes (if --fix or user confirms)
147
1481. **Missing SDK**: Add appropriate Sentry SDK to dependencies
1492. **Missing Vite plugin**: Add `@sentry/vite-plugin` for source maps
1503. **Missing config file**: Create Sentry initialization file using templates from [REFERENCE.md](REFERENCE.md)
1514. **Hardcoded DSN**: Replace with environment variable reference
1525. **Missing sample rates**: Add recommended sample rates
153
154### Step 7: Check CI/CD integration
155
156Verify Sentry integration in CI/CD:
157- `SENTRY_AUTH_TOKEN` secret configured
158- Source map upload step in build workflow
159- Release creation on deploy
160
161If missing, offer to add the recommended workflow steps from [REFERENCE.md](REFERENCE.md).
162
163### Step 8: Update standards tracking
164
165Update or create `.project-standards.yaml`:
166
167```yaml
168standards_version: "2025.1"
169project_type: "<detected>"
170last_configured: "<timestamp>"
171components:
172 sentry: "2025.1"
173```
174
175## Environment Variables
176
177| Variable | Description | Required |
178|----------|-------------|----------|
179| `SENTRY_DSN` | Sentry Data Source Name (server-side) | Yes |
180| `NEXT_PUBLIC_SENTRY_DSN` | Sentry DSN for client-side (Next.js) | Next.js only |
181| `SENTRY_ENVIRONMENT` | Environment name (server-side) | Recommended |
182| `NEXT_PUBLIC_SENTRY_ENVIRONMENT` | Environment name (client-side, Next.js) | Next.js only |
183| `SENTRY_ORG` | Sentry organization slug | For source maps |
184| `SENTRY_PROJECT` | Sentry project slug | For source maps |
185| `SENTRY_AUTH_TOKEN` | Auth token for CI/CD | For source maps |
186| `NEXT_PUBLIC_SENTRY_SKIP_BUILD` | Skip Sentry webpack plugin in builds | Container builds |
187
188Never commit DSN or auth tokens. Use environment variables or secrets management.
189
190For detailed configuration check tables, initialization templates, and CI/CD workflow examples, see [REFERENCE.md](REFERENCE.md).
191
192## Agentic Optimizations
193
194| Context | Command |
195|---------|---------|
196| Quick compliance check | `/configure:sentry --check-only` |
197| Auto-fix all issues | `/configure:sentry --fix` |
198| Frontend project only | `/configure:sentry --type frontend` |
199| Next.js project | `/configure:sentry --type nextjs` |
200| Python project only | `/configure:sentry --type python` |
201| Node.js project only | `/configure:sentry --type node` |
202| Check for hardcoded DSNs | `rg -l 'https://[a-f0-9]*@.*sentry\.io' --type-not env` |
203
204## Error Handling
205
206- **No Sentry SDK**: Offer to install appropriate SDK for project type
207- **Hardcoded DSN**: Report as FAIL, offer to fix with env var reference
208- **Invalid DSN format**: Report error, provide DSN format guidance
209- **Missing Sentry project**: Report warning, provide setup instructions
210
211## See Also
212
213- `/configure:instrumentation` - Whole observability stack (OTel traces/metrics, structured logging); delegates Sentry gaps to this skill
214- `/configure:all` - Run all compliance checks
215- `/configure:status` - Quick compliance overview
216- `/configure:workflows` - GitHub Actions integration
217- `typescript-plugin:typescript-sentry` - Day-to-day Sentry SDK usage for Bun/Node.js/Next.js (spans, breadcrumbs, cron monitoring, replay)
218- `sentry` MCP server - Sentry API access for project verification