Agent Skill
2/7/2026

sentry-client

Enforces project client-side Sentry monitoring conventions when implementing error boundaries, route-level error pages, user interaction tracking, and client component error handling. This skill ensures consistent patterns for global error handling, breadcrumbs, and front-end error capture.

J
jasonpaff
2GitHub Stars
2Views
npx skills add JasonPaff/head-shakers

SKILL.md

Namesentry-client
DescriptionEnforces project client-side Sentry monitoring conventions when implementing error boundaries, route-level error pages, user interaction tracking, and client component error handling. This skill ensures consistent patterns for global error handling, breadcrumbs, and front-end error capture.

name: sentry-client description: Enforces project client-side Sentry monitoring conventions when implementing error boundaries, route-level error pages, user interaction tracking, and client component error handling. This skill ensures consistent patterns for global error handling, breadcrumbs, and front-end error capture. user-invocable: false

Sentry Client Monitoring Skill

Purpose

This skill enforces the project client-side/front-end Sentry monitoring conventions automatically during error tracking implementation. It ensures consistent patterns for error boundaries, route-level error pages, user interaction tracking, and client component error handling.

Note: For server-side Sentry patterns (server actions, facades, middleware), use the sentry-server skill instead.

Activation

This skill activates when working on client-side/front-end code:

  • Creating or modifying client components with error handling
  • Implementing error boundaries (src/components/ui/error-boundary/)
  • Creating route-level error pages (error.tsx files)
  • Working on the global error handler (global-error.tsx)
  • Adding user interaction tracking/breadcrumbs in client components
  • Working with client instrumentation (src/instrumentation-client.ts)
  • Components with 'use client' directive that need error tracking

Workflow

  1. Detect client-side Sentry work (imports from @sentry/nextjs in client files)
  2. Load references/Sentry-Client-Conventions.md
  3. Generate/modify code following all conventions
  4. Scan for violations of Sentry patterns
  5. Auto-fix all violations (no permission needed)
  6. Report fixes applied

Key Patterns

Error Boundaries

  • Use class-based ErrorBoundary component for component-level errors
  • Capture exceptions in componentDidCatch with full context
  • Log user actions (retry, continue) with captureMessage

Route-Level Error Pages

  • ALL error.tsx files MUST have Sentry integration
  • Use captureException in useEffect with proper context and tags
  • Include digest, route name, and feature area in context

Global Error Handler

  • global-error.tsx captures fatal errors with level: 'fatal'
  • Include error digest and route context

Client Components

  • Add breadcrumbs before significant user interactions
  • Track form submissions, dialog opens, and key actions
  • Capture exceptions for failed client-side operations

Constants (Always Use)

ConstantImport PathPurpose
SENTRY_CONTEXTS@/lib/constants/sentryContext names for setContext
SENTRY_BREADCRUMB_CATEGORIES@/lib/constants/sentryBreadcrumb category values
SENTRY_LEVELS@/lib/constants/sentryBreadcrumb level values
SENTRY_TAGS@/lib/constants/sentryTag names for tags

Usage Pattern Reference

Use CasePrimary MethodLevel
Route error pageSentry.captureExceptionerror
Global errorSentry.captureExceptionfatal
Error boundary catchSentry.captureExceptionerror
Error boundary resetSentry.captureMessageinfo
User interactionSentry.addBreadcrumbinfo
Form submission startSentry.addBreadcrumbinfo
Client action failureSentry.captureExceptionerror

File Patterns

This skill applies to:

  • src/app/**/error.tsx
  • src/app/global-error.tsx
  • src/components/ui/error-boundary/**/*.tsx
  • src/instrumentation-client.ts
  • Client components ('use client') with Sentry imports
  • src/app/**/components/*-client.tsx
  • src/components/feature/**/*.tsx with error handling

References

  • references/Sentry-Client-Conventions.md - Complete client-side Sentry monitoring conventions
Skills Info
Original Name:sentry-clientAuthor:jasonpaff