adding-error-tracking — скилл для Claude Code: Sentry в проект
Скилл подключает Sentry к веб-приложению: ловит ошибки, считает трейсы и загружает source maps. Пригодится, когда нужен crash reporting без ручной настройки.
npx skills add spencerpauly/awesome-cursor-skills --skill adding-error-tracking -a claude-codeЧто делает adding-error-tracking
Скилл включается, когда вы просите добавить отслеживание ошибок, отчёты о падениях или трассировку производительности. Сначала он смотрит package.json, конфиги и структуру каталогов, чтобы понять стек: Next.js, React, Node.js, Python. Дальше ставит нужный SDK — для Next.js запускает npx @sentry/wizard@latest -i nextjs, для React на Vite npm install @sentry/react, для Node.js npm install @sentry/node, для Python pip install sentry-sdk.
После установки скилл инициализирует Sentry. В Next.js мастер создаёт sentry.client.config.ts, sentry.server.config.ts и sentry.edge.config.ts — их надо проверить, что DSN на месте. В React инициализация идёт в main.tsx с browserTracingIntegration() и tracesSampleRate, в Node.js — в самом верху входного файла, до остальных импортов. Затем добавляются переменные окружения: NEXT_PUBLIC_SENTRY_DSN, SENTRY_AUTH_TOKEN, SENTRY_ORG, SENTRY_PROJECT.
Для продакшена скилл настраивает загрузку source maps через плагин webpack или vite, а в Next.js это делает withSentryConfig в next.config.js. Заранее нужен DSN и токен SENTRY_AUTH_TOKEN — без них события не уйдут в дашборд. Токен не коммитьте, а sentry.properties и .sentryclirc добавьте в .gitignore. В продакшене скилл советует снизить tracesSampleRate до 0.1, чтобы не раздувать расходы.
Какие задачи решает
- подключить Sentry к Next.js и проверить, что DSN прописан во всех конфигах
- обернуть приложение в
Sentry.ErrorBoundaryс запасным UI - настроить загрузку source maps для продакшен-сборки
- добавить переменные окружения для DSN и токена авторизации
- проверить интеграцию временной кнопкой, которая бросает ошибку
Примеры запросов агенту
- добавь Sentry в этот проект
- настрой error tracking и source maps для продакшена
- подключи crash reporting к React-приложению
Как установить adding-error-tracking
1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill adding-error-tracking -a claude-code2Вручную: положить файлы
~/.claude/skills/adding-error-tracking/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/adding-error-tracking/
1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill adding-error-tracking -a codex2Вручную: положить файлы
.agents/skills/adding-error-tracking/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill adding-error-tracking -a cursor2Вручную: положить файлы
.cursor/skills/adding-error-tracking/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install spencerpauly/awesome-cursor-skills adding-error-tracking2Вручную: положить файлы
.github/skills/adding-error-tracking/SKILL.md1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill adding-error-tracking -a gemini-cli2Командой платформы
gemini skills install https://github.com/spencerpauly/awesome-cursor-skills --path resources/adding-error-trackingВручную: положить файлы
.devin/skills/adding-error-tracking/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill adding-error-tracking -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о adding-error-tracking
Как установить adding-error-tracking в Claude?
Выполните npx skills add spencerpauly/awesome-cursor-skills --skill adding-error-tracking -a claude-code. Скилл окажется в ~/.claude/skills/adding-error-tracking/SKILL.md.
Что делает adding-error-tracking?
Определяет стек проекта, ставит SDK Sentry, инициализирует его, добавляет error boundary и настраивает загрузку source maps. В конце предлагает проверить интеграцию тестовой ошибкой.
Что нужно подготовить до запуска скилла?
DSN проекта и токен SENTRY_AUTH_TOKEN, а также значения SENTRY_ORG и SENTRY_PROJECT. Токен нельзя коммитить в репозиторий.
Исходный текст
SKILL.md · CC0-1.0
---
name: adding-error-tracking
description: Add Sentry error tracking, performance monitoring, and source maps to a web application.
---
# Add Error Tracking (Sentry)
Use this skill when the user asks to add error tracking, crash reporting, exception monitoring, or performance tracing.
## Steps
1. **Detect the framework** — check `package.json`, config files, and directory structure to determine the stack (Next.js, React, Node.js, Python/Django/Flask, etc.).
2. **Install the SDK**
- Next.js: `npx @sentry/wizard@latest -i nextjs`
- React (Vite): `npm install @sentry/react`
- Node.js: `npm install @sentry/node`
- Python: `pip install sentry-sdk`
3. **Initialize Sentry**
- For Next.js, the wizard creates `sentry.client.config.ts`, `sentry.server.config.ts`, and `sentry.edge.config.ts`. Verify they exist and contain the DSN.
- For React (Vite), init in `main.tsx`:
```tsx
import * as Sentry from "@sentry/react";
Sentry.init({
dsn: import.meta.env.VITE_SENTRY_DSN,
integrations: [Sentry.browserTracingIntegration()],
tracesSampleRate: 1.0,
});
```
- For Node.js, init at the very top of the entry file before any other imports.
4. **Add environment variables**
```
NEXT_PUBLIC_SENTRY_DSN=https://[email protected]/...
SENTRY_AUTH_TOKEN=sntrys_...
SENTRY_ORG=your-org
SENTRY_PROJECT=your-project
```
5. **Add error boundary** — wrap the app (or critical subtrees) with `Sentry.ErrorBoundary` and a fallback UI.
6. **Source maps** — for production builds, configure the Sentry webpack/vite plugin to upload source maps. For Next.js, this is handled by `withSentryConfig` in `next.config.js`.
7. **Test the integration** — add a temporary button that throws an error to verify events appear in the Sentry dashboard.
## Notes
- Set `tracesSampleRate` to a lower value (e.g. `0.1`) in production to control costs.
- Add `sentry.properties` and `.sentryclirc` to `.gitignore`.
- Never commit `SENTRY_AUTH_TOKEN`.
© spencerpauly · CC0-1.0 · spencerpauly/awesome-cursor-skills