Back to Skills

sentry-sdk-upgrade

Upgrade the Sentry JavaScript SDK across major versions. Use when asked to upgrade Sentry, migrate to a newer version, fix deprecated Sentry APIs, or resolve breaking changes after a Sentry version bump.

225stars28forksUpdated 6/24/2026

Security Assessment

Low Risk(70/100)

Detected risks:

Destructive Operations([references/upgrade-patterns.md] rm -rf)
Security Score70/100

About sentry-sdk-upgrade

An AI-guided migration workflow for upgrading the Sentry JavaScript SDK across major versions. It is meant for moving from v7 to v8, v8 to v9, or any major jump, fixing deprecated Sentry APIs, and resolving breaking changes or errors that appear after a version bump. The workflow proceeds through four phases: Detect, Recommend, Guide, and Cross-Link.

Detection reads package.json to find all @sentry/* packages and the current major version, then identifies the framework from dependency indicators, mapping signals such as next, nuxt, @sveltejs/kit, @remix-run/node, react, @angular/core, vue, express, @nestjs/core, and others to their Sentry packages (for example @sentry/nextjs, @sentry/node, @sentry/react). It locates Sentry config and instrumentation files and scans for deprecated patterns that signal which migration steps are needed, including v7 markers like @sentry/hub, @sentry/tracing, BrowserTracing, startTransaction, and configureScope, and v8 markers like @sentry/utils, getCurrentHub, enableTracing, and autoSessionTracking. The Recommend phase computes the migration path, handling single hops and multi-hop upgrades (applying v7-to-v8 changes first, then v8-to-v9, while updating package versions once to the final target), and presents a breaking-changes summary categorized as auto-fixable (import and method renames, config option swaps), AI-assisted (hub removal, transactions-to-spans migration, complex config restructuring), and manual review (removed APIs, behavioral changes).

The Guide phase steps through each file with Sentry imports, applying auto-fixable changes directly, proposing AI-assisted edits with explanation, and flagging uncertain changes for confirmation, working in order through package imports, API renames, config changes, complex pattern migration, and finally updating package.json with all packages on the same major version using the detected package manager (npm, yarn, or pnpm). It then verifies the build with tsc --noEmit and the project build, applies framework-specific steps, and in Cross-Link confirms all packages match, imports resolve, types compile, the build succeeds, and tests pass, optionally adding a temporary thrown error to confirm Sentry works and mentioning new features in the target version.

FAQ

Which version upgrades does this skill handle?

Major-version upgrades of the Sentry JavaScript SDK, such as v7 to v8, v8 to v9, or any major jump, including multi-hop paths like v7 to v9 where v7-to-v8 changes are applied first, then v8-to-v9.

How does it detect which framework is in use?

It checks package.json dependencies against a table of indicators, mapping packages like next, nuxt, @sveltejs/kit, react, express, and @nestjs/core to their corresponding Sentry packages such as @sentry/nextjs, @sentry/node, and @sentry/nestjs.

Does it apply changes automatically or ask first?

It categorizes changes: auto-fixable ones like import and method renames are applied directly, AI-assisted ones like hub removal and transactions-to-spans are explained and proposed, and removed APIs or behavioral changes are flagged for manual review.

How are package versions handled in a multi-hop upgrade?

Code changes are applied incrementally hop by hop, but package versions are updated once to the final target, with all @sentry/* packages required to be on the same major version.

How does it verify the upgrade worked?

It runs tsc --noEmit for type errors and the project build, confirms all packages are on the same version with no import errors and passing tests, and can add a temporary thrown error to verify Sentry is reporting after the upgrade.

All Files

5 files
references/upgrade-patterns.md5.2 KB
View
references/v9-to-v10.md1.1 KB
View
references/v7-to-v8.md8.9 KB
View
SKILL.md8.4 KB
View
references/v8-to-v9.md10.4 KB
View

Install sentry-sdk-upgrade

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill