Fix sentry issue

From artsy/force · View interactive version

Fix sentry issue is an AI agent skill from the GitHub repository artsy/force. Investigates the most actionable open Sentry issue for force-production, locates the root cause in source code, and opens a fix PR. Use when asked to look at Sentry, fix a Sentry issue, or investigate production errors.

How to use this skill

Skill file

Fix a Sentry issue

Prerequisites

You need the Sentry MCP server connected to Claude Code. Run this once:

claude mcp add --transport http sentry https://mcp.sentry.dev/mcp

Then authenticate when prompted.


Sentry org: artsynet — project: force-production

Check Sentry MCP is available

Before doing anything else, verify the Sentry MCP tools are accessible by attempting to call mcp__sentry__whoami. If the call fails or the tool is not available, stop immediately and tell the user:

The Sentry MCP server is not connected. Use /mcp to reconnect it, or run claude mcp add --transport http sentry https://mcp.sentry.dev/mcp if it hasn't been added yet. Then start a new session and try again.

Do not attempt to work around this using the REST API, environment variables, or subagents.


Use this checklist to track progress:


Find the most actionable issue

Query mcp__sentry__search_issues with:

Pick the issue that best matches all of these criteria. The best candidate will match most of them:

If a specific issue ID was provided by the user, skip this step and use that instead.


Confirm with user

Present the chosen issue (title, event count, Sentry URL) and use AskUserQuestion to ask whether to proceed with it or pick the next candidate. This prevents the skill from duplicating work when a fix is already in flight but not yet merged.


Investigate root cause

  1. Use mcp__sentry__get_sentry_resource on the issue URL to get full details including the stack trace
  2. Find a representative recent event using mcp__sentry__search_events or mcp__sentry__search_issue_events — prefer events where the stack trace resolves to TypeScript filenames (source maps present)
  3. Read the stack trace carefully:
  1. Check whether multiple events share the same root frame, or whether the issue groups unrelated bugs under one fingerprint

Common patterns seen in this codebase:


Locate source code

Use the file path and line number from the stack trace to read the relevant source files. Understand:


Implement fix


Verify quality

Run all three checks and fix any issues before committing:

yarn type-check
yarn jest $(git ls-files --modified --others --exclude-standard)
yarn lint $(git ls-files --modified --others --exclude-standard)

Open PR

Open a PR with:

IMPORTANT — do not auto-resolve the Sentry issue prematurely.

Never use Fixes FORCE-PRODUCTION-XXXX or Closes FORCE-PRODUCTION-XXXX in a commit message. Sentry's GitHub integration treats these as trigger keywords and will resolve the issue immediately when the branch is pushed — before the fix is deployed. Reference the Sentry issue only as a URL in the PR body, never as a keyword in a commit message.

Celebrate

Indicate you are done with a /beep

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.