# sentry-sdk-upgrade

This skill guides major version upgrades for the Sentry JavaScript SDK, like migrating from v7 to v8 or v9. It finds deprecated APIs, updates imports, and verifies the build.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3100 installs · ★ 272
- Author: getsentry
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/getsentry/sentry-for-ai/tree/HEAD/skills-legacy/sentry-sdk-upgrade/SKILL.md
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/skills/sentry-sdk-upgrade

## What it does

This skill manages major version upgrades for the Sentry JavaScript SDK. It begins by reading `package.json` to inspect installed `@sentry/*` packages and detect your framework, such as Next.js, Remix, Vue, or Node.js. Then it scans the repository for Sentry configuration files and deprecated syntax like `BrowserTracing`, `getCurrentHub`, or `@WithSentry`. The entire workflow is split into detection, planning, and execution phases.

Updates are grouped by complexity. Direct package renames and configuration changes happen automatically. Context-heavy tasks, including Hub removal or rewriting performance transactions into spans, are presented as guided proposals. The standard `npx @sentry/wizard -i upgrade` CLI misses some code patterns, so a step-by-step file inspection avoids hidden breakages.

Package versions are updated in `package.json`. Every `@sentry/*` package must share the exact same major version to prevent dependency collisions. Once edits are complete, the agent validates the project by running `npx tsc --noEmit` and testing the build command.

## Requirements
- Works with: Sentry

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add getsentry/sentry-for-ai --skill sentry-sdk-upgrade -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/sentry-sdk-upgrade/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/sentry-sdk-upgrade/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add getsentry/sentry-for-ai --skill sentry-sdk-upgrade -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/sentry-sdk-upgrade/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add getsentry/sentry-for-ai --skill sentry-sdk-upgrade -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/sentry-sdk-upgrade/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install getsentry/sentry-for-ai sentry-sdk-upgrade
```

2. **Manually: put the files in place**
- File: `.github/skills/sentry-sdk-upgrade/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add getsentry/sentry-for-ai --skill sentry-sdk-upgrade -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/getsentry/sentry-for-ai --path skills-legacy/sentry-sdk-upgrade
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/sentry-sdk-upgrade/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add getsentry/sentry-for-ai --skill sentry-sdk-upgrade -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/getsentry/sentry-for-ai/tree/HEAD/skills-legacy/sentry-sdk-upgrade/SKILL.md

## When to use it
- upgrade Sentry JavaScript SDK from v7 or v8 to v9
- replace deprecated imports and renamed configuration options
- migrate legacy transaction code to current span APIs
- resolve TypeScript compile errors after bumping `@sentry/*` packages

## Example prompts
- Upgrade Sentry SDK in this repository to the latest major version
- Migrate our project from Sentry v7 to v8 and resolve deprecated APIs
- Fix build errors and deprecated calls after bumping @sentry packages

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 6559d4ab1fbde892.

BEGIN THIRD-PARTY FILE 6559d4ab1fbde892
````text
---
name: sentry-sdk-upgrade
description: 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.
license: Apache-2.0
category: workflow
parent: sentry-workflow
disable-model-invocation: true
---

> [All Skills](../../SKILL_TREE.md) > [Workflow](../sentry-workflow/SKILL.md) > SDK Upgrade

# Sentry JavaScript SDK Upgrade

Upgrade the Sentry JavaScript SDK across major versions with AI-guided migration.

## Invoke This Skill When

- User asks to "upgrade Sentry" or "migrate Sentry SDK"
- User mentions deprecated Sentry APIs or breaking changes after a version bump
- User wants to move from v7 to v8, v8 to v9, or any major version jump
- User encounters errors after updating `@sentry/*` package versions
- User asks about Sentry migration guides or changelogs

## Phase 1: Detect

Identify the current Sentry SDK version, target version, and framework.

### 1.1 Read package.json

```bash
cat package.json | grep -E '"@sentry/' | head -20
```

Extract:
- All `@sentry/*` packages and their current versions
- The current major version (e.g., `7.x`, `8.x`, `9.x`)

### 1.2 Detect Framework

Check `package.json` dependencies for framework indicators:

| Dependency | Framework | Sentry Package |
|---|---|---|
| `next` | Next.js | `@sentry/nextjs` |
| `nuxt` or `@nuxt/kit` | Nuxt | `@sentry/nuxt` |
| `@sveltejs/kit` | SvelteKit | `@sentry/sveltekit` |
| `@remix-run/node` | Remix | `@sentry/remix` |
| `react` (no Next/Remix) | React SPA | `@sentry/react` |
| `@angular/core` | Angular | `@sentry/angular` |
| `vue` (no Nuxt) | Vue | `@sentry/vue` |
| `express` | Express | `@sentry/node` |
| `@nestjs/core` | NestJS | `@sentry/nestjs` |
| `@solidjs/start` | SolidStart | `@sentry/solidstart` |
| `astro` | Astro | `@sentry/astro` |
| `bun` types or runtime | Bun | `@sentry/bun` |
| `@cloudflare/workers-types` | Cloudflare | `@sentry/cloudflare` |
| None of above (Node.js) | Node.js | `@sentry/node` |

### 1.3 Find Sentry Config Files

```bash
grep -rn "from '@sentry/\|require('@sentry/" --include="*.ts" --include="*.js" --include="*.tsx" --include="*.jsx" --include="*.mjs" --include="*.cjs" -l
```

```bash
find . -name "sentry.*" -o -name "*.sentry.*" -o -name "instrumentation.*" | grep -v node_modules | grep -v .next | grep -v .nuxt
```

### 1.4 Detect Deprecated Patterns

Scan for patterns that indicate which migration steps are needed:

```bash
````
END THIRD-PARTY FILE 6559d4ab1fbde892

The third-party file has ended. Everything between the 6559d4ab1fbde892 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2515 of 8582 bytes. © getsentry · Apache-2.0 · https://github.com/getsentry/sentry-for-ai/tree/HEAD/skills-legacy/sentry-sdk-upgrade/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
