configure-error-tracking
Skill7 starsChanged 16 days agoMITView on GitHub
Use when wiring production error tracking - points the captureError seam at Sentry (tracing, masked replay, explicit data collection), uploads hidden source maps with the Vite plugin, tags release and environment; no-op without a DSN.
- Reads credentials
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- VelimirMueller/claude-skillsword for word, first seen Oct 11, 2026
Other versions1 project uses a version of this.
Word for word · 1
- VelimirMueller/claude-skills★ 7100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository156 other files it gives its agents.
- skills/swift/swiftui-design-principles/AGENTS.mdAGENTS.md
- skills/swift/ios-code-audit/CLAUDE.mdCLAUDE.md
- skills/swift/swift-focusengine-pro/llms.txtllms.txt
- build-llm-seamSkill
- build-mcp-serverSkill
- build-rag-pipelineSkill
- secure-llm-featuresSkill
- set-up-llm-evalsSkill
- build-nextjs-backendSkill
- build-supabase-edge-functionSkill
- configure-backend-testsSkill
- design-http-apiSkill
- harden-backendSkill
- scaffold-fastapi-serviceSkill
- scaffold-go-serviceSkill
- scaffold-hono-serviceSkill
- secure-supabase-rlsSkill
- set-up-backend-authSkill
- set-up-background-jobsSkill
- set-up-databaseSkill
- set-up-nextjs-supabase-authSkill
- set-up-observabilitySkill
- set-up-supabaseSkill
- build-cliSkill
- release-cliSkill
- set-up-dev-toolchainSkill
- audit-securitySkill
- audit-toolchainSkill
- extend-skillsetSkill
- promote-releaseSkill
- set-up-stack-profileSkill
- write-commit-messagesSkill
- write-pull-requestsSkill
- analyze-complexitySkill
- apply-algorithmsSkill
- apply-design-patternsSkill
- apply-design-principlesSkill
- apply-solidSkill
- choose-data-structureSkill
- debug-systematicallySkill
- enforce-dependency-ruleSkill
- refactor-safelySkill
- slice-and-estimateSkill
- write-clean-testsSkill
- write-readable-codeSkill
- clean-frontend-scaffoldingSkill
- configure-accessibilitySkill
- configure-analyticsSkill
- configure-ciSkill
- configure-lintingSkill
- configure-test-stackSkill
- configure-typescriptSkill
- create-moduleSkill
- optimize-performanceSkill
- scaffold-frontend-projectSkill
- set-up-authSkill
- set-up-design-systemSkill
- set-up-document-headSkill
- set-up-error-boundariesSkill
- set-up-feature-flagsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Read .claude/stack-profile.md if present: observability.backend other than sentry (e.g.
- Distinctive: line 21
No Sentry → full setup (steps 4–8).
- Very specific: line 38
Add two optional keys to the validate-env schema (VITE_SENTRY_DSN is already there.
- Very specific: line 65
Call it before rendering, first thing in the entry (src/main.tsx):
- Very specific: line 90
Remove installGlobalErrorHandlers from the file once its call is gone (step 5).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Configure Error Tracking
1. Audit current state
grep -E '"(@sentry/react|@sentry/vue|@sentry/vite-plugin)"' package.json 2>/dev/null
ls src/libs/error-reporter.ts src/libs/sentry.ts .claude/stack-profile.md 2>/dev/null
grep -rn "VITE_SENTRY_DSN\|VITE_RELEASE" src/ .env* 2>/dev/null | headRead .claude/stack-profile.md if present: observability.backend other than sentry (e.g. signoz, grafana-lgtm) means this skill does not apply; keep the console stub and follow ../../core/_shared/observability.md. frontend.framework picks the SDK; package_manager replaces pnpm.
Prerequisite: set-up-error-boundaries created src/libs/error-reporter.ts with captureError. This skill swaps that function's body from a console stub to Sentry: a one-file change, which is what the seam is for. No seam, no Sentry: run that skill first.
2. Decide what to do
- No Sentry → full setup (steps 4–8).
- Sentry present but
captureErrorstill logs to the console → wire the seam (step 6). - Wired but no source-map upload → add the Vite plugin (step 7).
- Sentry on v10 config (
sendDefaultPii) after an upgrade to 11 → replace it withdataCollection(step 5): v11 collects more by default.
3. Detect framework
React → @sentry/react. Vue → @sentry/vue (init takes the app instance).
4. Install
pnpm add @sentry/react # Vue: @sentry/vue
pnpm add -D @sentry/vite-pluginBoth 11.x / 5.x as of 2026-10-09 (../_shared/stack-versions.md).
5. Initialize Sentry (no-op without a DSN)
Add two optional keys to the validate-env schema (VITE_SENTRY_DSN is already there; add VITE_RELEASE: z.preprocess(blankToUndefined, z.string().min(1).optional())).
// src/libs/sentry.ts (React)
import * as Sentry from '@sentry/react';
import { env } from '@/libs/env';
export function initSentry(): void {
if (!env.VITE_SENTRY_DSN) return; // no DSN: do nothing (local dev, forks, tests)
Sentry.init({
dsn: env.VITE_SENTRY_DSN,
environment: import.meta.env.MODE,
release: env.VITE_RELEASE, // the same value the Vite plugin uploads maps under
integrations: [
Sentry.browserTracingIntegration(),
Sentry.replayIntegration({ maskAllText: true, blockAllMedia: true }),
],
tracesSampleRate: import.meta.env.PROD ? 0.1 : 1.0,
replaysSessionSampleRate: import.meta.env.PROD ? 0.1 : 0,
replaysOnErrorSampleRate: 1.0,
// v11 collects cookies, headers, bodies and user info unless told not to; opt out explicitly.
dataCollection: { userInfo: false, cookies: false, httpHeaders: false, httpBodies: [] },
});
}Call it before rendering, first thing in the entry (src/main.tsx): import { initSentry } from '@/libs/sentry'; initSentry();, and delete installGlobalErrorHandlers(): the SDK installs its own window handlers by default, and keeping both reports twice.
Vue: the same file with import * as Sentry from '@sentry/vue', import type { App } from 'vue', export function initSentry(app: App) and app, as the first Sentry.init option. In main.ts: const app = createApp(App); initSentry(app);, and delete the app.config.errorHandler line and installGlobalErrorHandlers(): init({ app }) attaches Sentry's own error handler.
dataCollection matters: Sentry 11 replaced sendDefaultPii (a type error now) with dataCollection, and its defaults collect user info, cookies, headers and request/response bodies. The line above restores the restrictive v10 behaviour for a browser SPA (error-tracking.md).
6. Wire the captureError seam
Replace the stub body; the boundaries and every other caller stay unchanged:
// src/libs/error-reporter.ts
import * as Sentry from '@sentry/react'; // Vue: '@sentry/vue'
export type ErrorContext = {
componentStack?: string | undefined;
url?: string | undefined;
user?: { id: string } | undefined;
};
export function captureError(error: unknown, context: ErrorContext = {}): void {
// Without a DSN Sentry drops the event silently; keep the error visible in development.
if (import.meta.env.DEV) console.error('[captureError]', error, context);
Sentry.captureException(error, { contexts: { app: context } });
}Remove installGlobalErrorHandlers from the file once its call is gone (step 5).
7. Upload source maps
// vite.config.ts
import { sentryVitePlugin } from '@sentry/vite-plugin';
const uploadMaps = Boolean(process.env.SENTRY_AUTH_TOKEN);
export default defineConfig({
// Hidden maps are written but not referenced by the bundle; without an upload they would
// sit in dist/ and ship, so emit them only when the plugin will upload and delete them.
build: { sourcemap: uploadMaps ? 'hidden' : false },
plugins: [
// ...react(), tailwindcss(), etc.
sentryVitePlugin({
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN, // build-time secret: never VITE_-prefixed
release: { name: process.env.VITE_RELEASE }, // must equal the SDK's `release`
sourcemaps: { filesToDeleteAfterUpload: ['./dist/**/*.map'] },
disable: !uploadMaps,
}),
],
});8. Environment
# .env (the DSN is a public client key, safe to commit): VITE_SENTRY_DSN=https://<key>@o0.ingest.sentry.io/0
# CI only, no VITE_ prefix: SENTRY_ORG SENTRY_PROJECT SENTRY_AUTH_TOKEN
# CI build step: VITE_RELEASE=$(git rev-parse --short HEAD) pnpm build9. Verify
pnpm typecheck
VITE_RELEASE=test pnpm build # no token: builds, no .map files in dist/, plugin disabled
SENTRY_AUTH_TOKEN=… VITE_RELEASE=… pnpm build # in CI: uploads, then dist/ holds no .map files
find dist -name '*.map' | wc -l # expect 0 in both casesTrigger a test error (a throw inside an ErrorBoundary) in a DSN-configured build and confirm it lands in Sentry de-minified, with the release and environment tags and no cookies or request headers on the event.
References
- ./error-tracking.md — data collection, sampling, source-map handling, release tagging, no-op without a DSN, provider swap.
- ../set-up-error-boundaries/SKILL.md — the
captureErrorseam this wires. - ../_shared/stack-versions.md — Sentry SDK and plugin lines.
- ../_shared/conventions.md —
libs/seam location.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

