MCPInstall

sentry-javascript-bugs

Review Sentry React and TypeScript changes for bug patterns drawn from real production issues. Use when reviewing a frontend diff or PR, checking Warden findings, auditing the current branch, reviewing production-error patterns, or looking for common regressions in static/.

Installs
92
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/getsentry/sentry --skill sentry-javascript-bugs
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads sentry-javascript-bugs automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Sentry JavaScript Frontend Bug Pattern Review

Find bugs in Sentry frontend code by checking for the patterns that cause the most real production errors.

This skill encodes patterns from 428 real production issues (201 resolved, 130 ignored, 97 unresolved) generating over 524,000 error events across 93,000+ affected users. These are not theoretical risks -- they are the actual bugs that ship most often, with known fixes from resolved issues.

Scope

Review the code provided by the user, Warden, or the current branch diff. If the user does not provide a target, review the current branch diff. Start from the changed hunk or file, then read outward only as needed to confirm the behavior.

  1. Analyze the changed code against the pattern checks below.
  2. Use Read and Grep to trace data flow beyond the initial diff when needed. Follow component props, hook return values, API response shapes, and state transitions until the behavior is confirmed.
  3. Report only HIGH and MEDIUM confidence findings.
ConfidenceCriteriaAction
HIGHTraced the code path, confirmed the pattern matches a known bug classReport with fix
MEDIUMPattern is present but context may mitigate itReport as needs verification
LOWTheoretical or mitigated elsewhereDo not report

Step 1: Classify the Code

Determine what you are reviewing and load the relevant reference.

Code TypeLoad Reference
Null/undefined property access, optional chaining, object destructuringreferences/null-reference-errors.md
Dashboard widgets, chart visualization, widget URL generationreferences/dashboard-widget-errors.md
Trace views, span details, trace tree renderingreferences/trace-view-errors.md
API calls, response handling, error states, fetch wrappersreferences/api-response-handling.md
React hooks, context providers, render loops, component lifecyclereferences/react-lifecycle-errors.md
AI Insights, LLM prompt parsing, gen_ai span datareferences/ai-insights-parsing.md
Array operations, date/time values, numeric formattingreferences/range-and-bounds-errors.md

If the code spans multiple categories, load all relevant references.

Step 2: Check for Top Bug Patterns

These are ordered by combined frequency and impact from real production data.

Check 1: Null/Undefined Property Access -- 158 issues, 46,337 events

Code accesses a property on a value that may be null or undefined. This is the single most common bug pattern in the Sentry frontend.

Red flags:

  • Accessing .id, .slug, .name, .type, .match, .length, .charCodeAt without null checks
  • Using object.property instead of object?.property on data from API responses
  • Passing API response data directly to utility functions without null validation
  • Accessing DOM element properties from querySelector or useRef without checking if the element exists
  • Destructuring objects from hooks/stores that may return null during loading states
  • Calling .dispatchEvent() on elements that have been unmounted

Safe patterns:

  • Optional chaining: obj?.property?.nested
  • Default values: const value = obj?.field ?? defaultValue
  • Null guards before function calls: if (data) { parser.parse(data); }
  • Early returns for null/undefined parameters in utility functions

Check 2: Dashboard Widget Input Validation -- 6 issues, 90,482 events

Widget visualization components throw when receiving data in unexpected formats.

Red flags:

  • Rendering chart components without checking if data contains plottable values
  • Calling getWidgetExploreUrl() for widget types that do not support multiple queries
  • Passing undefined field values to parseFunction() or similar field parsers
  • Not handling empty API responses in widget data fetchers

Safe patterns:

  • Validate data shape before rendering: if (!hasPlottableValues(data)) return <EmptyState />
  • Check widget query count before generating explore URLs
  • Guard field parsers: if (!field) return null

Check 3: Trace View Data Integrity -- 12 issues, 328,482 events

The trace tree renderer and trace detail views encounter data that violates structural assumptions.

Red flags:

  • Building trace trees without cycle detection (or detecting cycles but not handling them gracefully)
  • Looking up projects by ID from span data without checking if the project is accessible
  • Generating trace links without validating traceSlug is non-empty
  • Using captureException in render paths without deduplication (fires every render cycle)

Safe patterns:

  • Break cycles by detaching cyclic nodes as orphan roots
  • Validate traceSlug before generating links: if (!traceSlug) return fallbackLink
  • Deduplicate error captures using a ref: if (!capturedRef.current) { captureException(...); capturedRef.current = true; }
  • Check project access before rendering span details

Check 4: API Response Shape Assumptions -- 31 issues, 24,019 events

Frontend code assumes API responses have a specific shape but the response is empty, undefined, or has an unexpected status code.

Red flags:

  • Not handling 200 responses with empty bodies (e.g., GET /customers/{orgSlug}/ returns 200 with no body)
  • Not handling 402 (Payment Required) status codes in subscription flows
  • Not handling 409 (Conflict) status codes in mutation endpoints
  • Treating UndefinedResponseBodyError as unexpected (it indicates the API returned no parseable body)
  • Assuming SelectAsync options will always load successfully

Safe patterns:

  • Check response body before parsing: if (!response.body) return null
  • Handle specific 4xx status codes in catch blocks
  • Provide fallback empty states for failed API fetches instead of throwing

Check 5: React Lifecycle Violations -- 10 issues, 2,595 events

Components violate React rendering rules, causing infinite loops or crashes.

Red flags:

  • Setting state unconditionally in useEffect without proper dependency arrays
  • Calling useOrganization() in components that render before organization context is loaded
  • Using useContext() outside the provider boundary
  • Passing objects as React children instead of strings/elements
  • Components that trigger immediate re-render on mount

Safe patterns:

  • Always provide dependency arrays for useEffect
  • Guard context hooks: const org = useOrganization(); if (!org) return <Loading />
  • Wrap organization-dependent routes in a provider boundary
  • Validate element types before rendering: if (typeof Component !== 'function') return null

Check 6: AI Insights Data Parsing -- 2 issues, 3,005 events

JSON parsing of AI prompt messages and gen_ai span data fails on non-standard formats.

Red flags:

  • Calling JSON.parse() on ai.prompt.messages span attributes without try-catch
  • Assuming all AI model responses produce valid JSON
  • Not handling the "parts" format for multi-modal AI messages

Safe patterns:

  • Wrap all JSON.parse calls on external data in try-catch
  • Check for leading [ or { before parsing
  • Provide raw-text fallback rendering when parsing fails

Check 7: Array and Bounds Validation -- 15 issues, 3,120 events

Array operations and numeric formatting with values that exceed valid ranges.

Red flags:

  • Using result.push(...largeArray) (crashes when array is too large)
  • Passing unclamped values to toLocaleString({maximumFractionDigits: n})
  • Constructing Date objects from unvalidated timestamps
  • Recursive component rendering without depth limits

Safe patterns:

  • Use concat or iterative push for potentially large arrays
  • Clamp numeric format parameters: Math.min(100, Math.max(0, precision))
  • Validate dates before constructing: if (isNaN(new Date(ts).getTime())) return fallback
  • Use iterative rendering with explicit stacks for deeply nested structures

Check 8: Logic Correctness -- not pattern-based

After checking all known patterns above, reason about the changed code itself:

  • Does every code path return the correct type (or JSX)?
  • Are all branches of conditionals handled (especially missing else / default cases in switches)?
  • Can any prop or state value (null, undefined, empty array, empty string) cause unexpected behavior?
  • Are hook dependency arrays correct? Missing deps cause stale closures; extra deps cause infinite loops.
  • If this component unmounts mid-async-operation, is cleanup handled?

Only report if you can trace a specific input that triggers the bug. Do not report theoretical concerns.

If no checks produced a potential finding, stop and report zero findings. Do not invent issues to fill the report. An empty result is the correct output when the code has no bugs matching these patterns.

Each code location should be reported once under the most specific matching pattern. Do not flag the same line under multiple checks.

Step 3: Report Findings

For each finding, provide the evidence the review harness needs:

  • precise location
  • severity and confidence
  • concrete triggering input or state
  • root cause and consequence
  • a matching production precedent when available
  • a concrete code fix, preferably as a unified diff when the harness supports it

Fix suggestions must include actual code. Never suggest a comment or docstring as a fix.

Do not prescribe your own output format — the review harness controls the response structure.

FAQ

What does the sentry-javascript-bugs skill do?

Review Sentry React and TypeScript changes for bug patterns drawn from real production issues. Use when reviewing a frontend diff or PR, checking Warden findings, auditing the current branch, reviewing production-error patterns, or looking for common regressions in static/.

How do I install sentry-javascript-bugs?

Run npx skills add https://github.com/getsentry/sentry --skill sentry-javascript-bugs in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/sentry-javascript-bugs/ (personal) or .claude/skills/sentry-javascript-bugs/ (project).

Which AI agents can use sentry-javascript-bugs?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is sentry-javascript-bugs safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains sentry-javascript-bugs?

It is published by getsentry in getsentry/sentry, and it is an official skill from the maker of the technology it covers. It has 92 recorded installs.

More from getsentry/sentry

View all →

design-system

getsentry/sentry

Open the skill to read its SKILL.md instructions.

OfficialFrontend & Design111 installs

sentry-security

getsentry/sentry

Open the skill to read its SKILL.md instructions.

OfficialDevOps & Cloud100 installs

generate-migration

getsentry/sentry

Open the skill to read its SKILL.md instructions.

OfficialCode Quality & Workflow90 installs

generate-frontend-forms

getsentry/sentry

Open the skill to read its SKILL.md instructions.

OfficialFrontend & Design86 installs

sentry-backend-bugs

getsentry/sentry

Open the skill to read its SKILL.md instructions.

OfficialDevOps & Cloud84 installs

migrate-frontend-forms

getsentry/sentry

Open the skill to read its SKILL.md instructions.

OfficialFrontend & Design82 installs

Popular devops & cloud skills

View category →

microsoft-foundry

microsoft/azure-skills

Build, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end. USE FOR: foundry, azd ai agent, azd provision/deploy, hosted agent scaffold/develop/run/deploy/troubleshoot, prompt agent create, managed harness agent create, GitHub Copilot harness agent, create agent, update agent, add tool to agent, invoke agent, agent insights, evaluate agent, batch eval, continuous eval, continuous monitoring, agent CI/CD, optimize prompt, improve prompt, optimize agent instructions, Agent Optimizer scaffold, dataset curation from traces, deploy model, model fine-tuning (SFT/DPO/RFT), Foundry project, RBAC, role assignment, permissions, quota, capacity, region, deployment failure, AI Services, create Foundry resource, knowledge index, customize deployment, onboard, availability, training-data, grader, distillation, large file upload. DO NOT USE FOR: Azure Functions, App Service, general Azure deploy (use azure-deploy), general Azure prep (use azure

OfficialDevOps & Cloud579.1K installs

azure-diagnostics

microsoft/azure-skills

Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, container app 503 or target port mismatch, troubleshoot functions, function telemetry missing or stopped after a config/connection-string change, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, analyze logs, KQL, insights, image pull failures, cold start issues, health probe failures, resource health, root cause of errors, troubleshoot event hubs, troubleshoot service bus, messaging SDK error, AMQP connection failure, message lock lost, lock renewal during long-running processing, service bus dead letter.

OfficialDevOps & Cloud569.8K installs

azure-prepare

microsoft/azure-skills

Prepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd) workflow. USE ONLY when the user explicitly wants to use azd as the deployment tool, or the project already has an azure.yaml file. DO NOT USE FOR: non-azd deployments, Python App Service code-only deploys (use python-appservice-deploy), or cross-cloud migration (use azure-cloud-migrate). WHEN: prepare app for azd, create azure.yaml, set up azd infrastructure, modernize app for Azure with azd, deploy with azd, function app, timer trigger, service bus trigger, event-driven function, managed identity, generate Bicep, generate Terraform, create and deploy to Azure.

OfficialDevOps & Cloud569K installs

azure-ai

microsoft/azure-skills

Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.

OfficialDevOps & Cloud568.8K installs

azure-deploy

microsoft/azure-skills

Execute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files. DO NOT use this skill when the user asks to CREATE a new application — use azure-prepare instead. This skill runs azd up, azd deploy, terraform apply, and az deployment commands with built-in error recovery. Requires .azure/deployment-plan.md from azure-prepare and validated status from azure-validate. WHEN: "run azd up", "run azd deploy", "execute deployment", "push to production", "push to cloud", "go live", "ship it", "bicep deploy", "terraform apply", "publish to Azure", "launch on Azure". DO NOT USE WHEN: "create and deploy", "build and deploy", "create a new app", "set up infrastructure", "create and deploy to Azure using Terraform" — use azure-prepare for these.

OfficialDevOps & Cloud568.6K installs

azure-validate

microsoft/azure-skills

Pre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity permissions, and prerequisites before deploying. WHEN: validate my app, check deployment readiness, run preflight checks, verify configuration, check if ready to deploy, validate azure.yaml, validate Bicep, test before deploying, troubleshoot deployment errors, validate Azure Functions, validate function app, validate serverless deployment, verify RBAC roles, check role assignments, review managed identity permissions, what-if analysis, validate Container Apps deployment.

OfficialDevOps & Cloud568K installs