Sentry javascript bugs

From getsentry/sentry · View interactive version

Sentry javascript bugs is an AI agent skill from the GitHub repository getsentry/sentry. 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 to use this skill

Skill file

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.

| Confidence | Criteria | Action |

| ---------- | --------------------------------------------------------------------- | ---------------------------- |

| HIGH | Traced the code path, confirmed the pattern matches a known bug class | Report with fix |

| MEDIUM | Pattern is present but context may mitigate it | Report as needs verification |

| LOW | Theoretical or mitigated elsewhere | Do not report |

Step 1: Classify the Code

Determine what you are reviewing and load the relevant reference.

| Code Type | Load Reference |

| ----------------------------------------------------------------------- | --------------------------------------- |

| Null/undefined property access, optional chaining, object destructuring | references/null-reference-errors.md |

| Dashboard widgets, chart visualization, widget URL generation | references/dashboard-widget-errors.md |

| Trace views, span details, trace tree rendering | references/trace-view-errors.md |

| API calls, response handling, error states, fetch wrappers | references/api-response-handling.md |

| React hooks, context providers, render loops, component lifecycle | references/react-lifecycle-errors.md |

| AI Insights, LLM prompt parsing, gen_ai span data | references/ai-insights-parsing.md |

| Array operations, date/time values, numeric formatting | references/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:

Safe patterns:

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

Widget visualization components throw when receiving data in unexpected formats.

Red flags:

Safe patterns:

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:

Safe patterns:

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:

Safe patterns:

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

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

Red flags:

Safe patterns:

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:

Safe patterns:

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

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

Red flags:

Safe patterns:

Check 8: Logic Correctness -- not pattern-based

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

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:

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.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.