plugins/src/base/skills/parity-sentry-sdk-setup/SKILL.md
Install and configure the Sentry SDK for a project — detect the framework/runtime, add the correct @sentry/<framework> package, initialize the client, wire the DSN through env, enable error + performance monitoring, and set up source map upload for readable stack traces. One consolidated skill covering react, nextjs, node, nestjs, express, python, django, react-native, and more. Lisa-native reimplementation of Sentry's SDK-setup suite. Use when adding Sentry to a project or fixing an existing Sentry install.
npx skillsauth add codyswanngt/lisa parity-sentry-sdk-setupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Detect a project's framework and runtime, then install and configure the correct Sentry SDK with sensible, production-ready defaults: client initialization, DSN via environment variable, error capture, performance/tracing, and source map upload so stack traces are readable.
The upstream sentry@claude-plugins-official plugin ships ~30 separate
per-SDK setup skills (one per framework/runtime). This single Lisa-native
skill consolidates all of them: instead of one thin skill per SDK, it detects the
framework and applies the matching case below. The behavior is reimplemented from
scratch against Lisa conventions — it is not a translation of the upstream
skills. Pinned to sentry@[email protected] via synced-from so the
parity drift detector tracks it as one unit.
Inspect the project before choosing an SDK. Read package.json
(dependencies/scripts), config files, and lockfiles:
next dependency or next.config.* → Next.js@nestjs/core → NestJSreact-native / expo → React Native / Exporeact + a bundler (vite/webpack) without Next → React (browser)express / fastify / koa and a Node entrypoint → Node servervue / @angular/core / svelte → that browser frameworkpyproject.toml / requirements.txt; django/flask/fastapi →
Python (and which web framework)If the runtime is genuinely ambiguous, ask which app to instrument rather than guessing. Respect the project's package manager (bun/npm/pnpm/yarn — match the lockfile) and module system (ESM vs CJS).
Use the project's package manager. Examples (swap bun add for your manager):
| Framework | Package |
| --- | --- |
| React (browser) | @sentry/react |
| Next.js | @sentry/nextjs |
| Node / Express / Fastify | @sentry/node (+ @sentry/profiling-node for profiling) |
| NestJS | @sentry/nestjs (+ @sentry/node) |
| React Native / Expo | @sentry/react-native |
| Vue | @sentry/vue |
| Angular | @sentry/angular |
| Svelte / SvelteKit | @sentry/svelte / @sentry/sveltekit |
| Python (generic) | sentry-sdk |
| Django | sentry-sdk[django] |
| Flask | sentry-sdk[flask] |
| FastAPI | sentry-sdk[fastapi] |
For Next.js, prefer the official wizard when available — it scaffolds the config files and source-map upload for you:
npx @sentry/wizard@latest -i nextjs
Initialize as early as possible in the app's lifecycle, before other code runs. Always read the DSN from the environment (see Step 4) — never hard-code it.
React (browser) — src/instrument.ts, imported first in the entrypoint:
import * as Sentry from "@sentry/react";
Sentry.init({
dsn: import.meta.env.VITE_SENTRY_DSN,
environment: import.meta.env.MODE,
integrations: [Sentry.browserTracingIntegration()],
tracesSampleRate: 0.1, // tune per traffic; 1.0 in dev
});
Node / Express — instrument.ts, required at the very top of the entrypoint
(import "./instrument"; must be the first import):
import * as Sentry from "@sentry/node";
Sentry.init({
dsn: process.env.SENTRY_DSN,
environment: process.env.NODE_ENV,
tracesSampleRate: 0.1,
});
Then, after routes are defined: Sentry.setupExpressErrorHandler(app);
NestJS — import ./instrument first in main.ts, then add Sentry's module:
// main.ts — FIRST line
import "./instrument";
// ...
// app.module.ts
import { SentryModule } from "@sentry/nestjs/setup";
@Module({ imports: [SentryModule.forRoot()] })
export class AppModule {}
Next.js — config lives in sentry.client.config.ts,
sentry.server.config.ts, sentry.edge.config.ts, and next.config.js is
wrapped with withSentryConfig. The wizard (Step 2) writes these; verify the DSN
is read from process.env.NEXT_PUBLIC_SENTRY_DSN / process.env.SENTRY_DSN.
React Native / Expo — wrap the root component:
import * as Sentry from "@sentry/react-native";
Sentry.init({
dsn: process.env.EXPO_PUBLIC_SENTRY_DSN,
tracesSampleRate: 0.2,
});
export default Sentry.wrap(App);
Python (Django/Flask/FastAPI/generic) — initialize at startup
(settings.py, app factory, or main module):
import os
import sentry_sdk
sentry_sdk.init(
dsn=os.environ["SENTRY_DSN"],
environment=os.environ.get("ENVIRONMENT", "production"),
traces_sample_rate=0.1,
send_default_pii=False,
)
Framework-specific integrations (e.g. DjangoIntegration, FastApiIntegration)
are auto-enabled by the matching extra installed in Step 2.
.env.example (with a placeholder) so the requirement is documented,
but keep the real value in .env/secrets and confirm .env is gitignored.NEXT_PUBLIC_SENTRY_DSN (Next.js), VITE_SENTRY_DSN (Vite),
EXPO_PUBLIC_SENTRY_DSN (Expo). Server-only code uses SENTRY_DSN.SENTRY_AUTH_TOKEN,
SENTRY_ORG, and SENTRY_PROJECT — these are build/CI secrets, not
shipped to the client.init runs; add the framework error handler where required (Express:
setupExpressErrorHandler; React: an error boundary via
Sentry.ErrorBoundary; NestJS: SentryModule). Use
Sentry.captureException(err) for caught-but-notable errors.tracesSampleRate (start ~0.1 in production,
1.0 in dev) and enable the framework tracing integration (browser tracing,
HTTP/DB auto-instrumentation on the server). Optionally add profiling on Node
via @sentry/profiling-node and profilesSampleRate.environment and (ideally) release so issues are grouped per deploy.Minified/transpiled traces are useless without source maps. Configure upload at build time:
withSentryConfig in next.config.js (the wizard sets
it up); ensure SENTRY_AUTH_TOKEN/SENTRY_ORG/SENTRY_PROJECT exist in CI.@sentry/vite-plugin, @sentry/webpack-plugin, etc.) with sourcemaps
upload enabled and the same auth env vars.sentry-cli sourcemaps upload (or the bundler plugin) in the release step.Sentry.init({ release }) so traces map to the right build.bun run build / bun run typecheck (or the project's equivalents).SENTRY_AUTH_TOKEN; route everything
through env/secrets and update .env.example.tracesSampleRate: 1.0 to
high-traffic production by default.development
Prepare a machine — a fresh laptop or a throwaway container — to run coding agents, before any repository exists. Detects which of Lisa's supported agents (Claude Code, Codex, Cursor, OpenCode, Antigravity, Copilot) are already installed, asks which credential manager the machine uses (Bitwarden, 1Password, Doppler, Vault, AWS, or none), and installs only what is missing, each by its vendor's own preferred method. Idempotent, headless by default, and emits a Dockerfile for a spin-up/spin-down environment. Run it on a new machine, in a container, or before cloning anything.
tools
Provision and verify a remote execution environment for a host project — Codex Cloud today, other remote surfaces as they are added. Generates a repository-owned setup script that installs the declared toolchain, materializes secrets through lisa-secrets-access, and runs the project's own hook. Provisions by API where one exists, by driving the vendor console where one does not, and by emitting exact config otherwise — then proves the result with the same read-back regardless of which tier did the work. Use before dispatching any work with executionEnv.
tools
Bring a developer's machine in line with the toolchain the project declares. Reports every tool in remoteEnv.tools that is missing, outdated, or unpinned for this platform, and installs the missing ones into ~/.local/bin from the same pinned, checksummed entries the remote surfaces use — but only when asked. Same manifest, same pins, same installers as lisa-setup-remote-env; what differs is consent and that the pin is a floor rather than an equality. Run it on a fresh checkout, after a manifest change, or when a tool fails at the moment of use.
tools
Route one unit of work to a remote execution surface. Reads the executionEnv parameter (local by default, codex-cloud or claude-web today), verifies the environment is provisioned and bound to this repository, submits a thin skill invocation, records the task identifier to .lisa/remote-dispatch.json, and exits without polling. Routing only — the remote runs the identical skill from the identical repository. Composable and inline: other skills invoke it via the Skill tool rather than users calling it directly.