スキル一覧に戻る
JasonPaff

sentry-server

by JasonPaff

Website for Bobblehead Collectors

2🍴 0📅 2026年1月19日
GitHubで見るManusで実行

SKILL.md


name: sentry-server description: Enforces project server-side Sentry monitoring conventions when implementing error tracking, performance monitoring, and breadcrumb logging in server actions, facades, middleware, and API routes. This skill ensures consistent patterns for context setting, breadcrumb categories, error capture, and performance spans.

Sentry Server Monitoring Skill

Purpose

This skill enforces the project server-side Sentry monitoring conventions automatically during error tracking implementation. It ensures consistent patterns for context setting, breadcrumb categories, error capture, performance spans, and middleware integration.

Note: For client-side/front-end Sentry patterns, use the sentry-client skill instead.

Activation

This skill activates when working on server-side code:

  • Creating or modifying server actions in src/lib/actions/
  • Implementing error handling in facades (src/lib/facades/)
  • Setting up performance monitoring spans in server code
  • Adding breadcrumbs in server-side operations
  • Working with middleware (src/middleware.ts, src/lib/middleware/)
  • API routes (src/app/api/)
  • Instrumentation files (src/instrumentation.ts)

Workflow

  1. Detect server-side Sentry work (imports from @sentry/nextjs in server files)
  2. Load references/Sentry-Server-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

Server Actions

  • Set context at the start with Sentry.setContext(SENTRY_CONTEXTS.*, {...})
  • Add breadcrumbs for successful operations
  • Log non-critical failures (e.g., cache invalidation) with level: 'warning'

Facades

  • Add breadcrumbs for non-blocking operations (Cloudinary cleanup)
  • Capture non-critical exceptions without failing the operation

Middleware

  • Use Sentry.withScope and Sentry.startSpan for performance tracking
  • Set tags and context within the scope

Instrumentation

  • Export onRequestError = Sentry.captureRequestError for RSC error capture

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 setTag
SENTRY_OPERATIONS@/lib/constants/sentryOperation names for spans

Import from @/lib/utils/sentry-server/breadcrumbs.server:

For Server Actions

FunctionPurpose
withActionErrorHandling()Wrap action with automatic breadcrumbs + error handling
withActionBreadcrumbs()Wrap action with breadcrumbs only (no error handling)
trackActionEntry()Track action operation start
trackActionSuccess()Track action success with optional result data
trackActionWarning()Track action warning for partial failures
trackCacheInvalidation()Track cache invalidation with automatic warning on failure
setActionContext()Set Sentry context with type-safe keys

For Facades

FunctionPurpose
withFacadeBreadcrumbs()Wrap facade method with automatic breadcrumbs
trackFacadeEntry()Track facade operation start
trackFacadeSuccess()Track facade success with optional result data
trackFacadeWarning()Track facade warning for partial failures
trackFacadeError()Track facade error
facadeBreadcrumb()Add a simple breadcrumb for facade operations
captureFacadeWarning()Capture non-critical exception with warning level and tags

See references/Sentry-Server-Conventions.md for complete documentation with examples.

Usage Pattern Reference

Use CasePrimary MethodLevel
Action startSentry.setContextN/A
Successful operationSentry.addBreadcrumbINFO
Non-critical failureSentry.captureExceptionwarning
Critical failureLet error propagateerror
Performance trackingSentry.startSpanN/A

File Patterns

This skill applies to:

  • src/lib/actions/**/*.ts
  • src/lib/facades/**/*.ts
  • src/lib/middleware/**/*.ts
  • src/middleware.ts
  • src/app/api/**/*.ts
  • src/instrumentation.ts
  • sentry.server.config.ts
  • sentry.edge.config.ts

References

  • references/Sentry-Server-Conventions.md - Complete server-side Sentry monitoring conventions

スコア

総合スコア

40/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です