fix-sentry-issues

Use when scanning Sentry issues and creating fix PRs. Trigger phrases include "sentry scan", "fix sentry", "scan errors", "what's crashing".

9 stars

Best use case

fix-sentry-issues is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Use when scanning Sentry issues and creating fix PRs. Trigger phrases include "sentry scan", "fix sentry", "scan errors", "what's crashing".

Teams using fix-sentry-issues should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/fix-sentry-issues/SKILL.md --create-dirs "https://raw.githubusercontent.com/exiao/skills/main/coding/fix-sentry-issues/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/fix-sentry-issues/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How fix-sentry-issues Compares

Feature / Agentfix-sentry-issuesStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Use when scanning Sentry issues and creating fix PRs. Trigger phrases include "sentry scan", "fix sentry", "scan errors", "what's crashing".

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Fix Sentry Issues

Scan recent Sentry issues, analyze root causes, and create PRs to fix them.

## Prerequisites

- Official Sentry CLI (`sentry`) authenticated via `SENTRY_AUTH_TOKEN`
- `$SENTRY_ORG` and `$SENTRY_PROJECT` set
- GitHub CLI (`gh`) authenticated
- Git worktrees for isolated branches

## Workflow

### 1. Fetch recent issues (last 12h, most recent 10)

```bash
sentry issue list $SENTRY_ORG/$SENTRY_PROJECT --limit 10 -t 12h --json \
  | jq '{data:[.data[] | {id,shortId,title,culprit,permalink,status,count,userCount,firstSeen,lastSeen,level,logger,type,issueType,metadata}]}'
```

Use the official Sentry CLI. Do not fall back to MCP tools; configured MCP servers may not expose them consistently.

Note: Fetch ALL issues (not just unresolved) to catch regressions and issues that were auto-resolved but still occurring.

### 1b. Verify recently resolved issues

```bash
sentry issue list $SENTRY_ORG/$SENTRY_PROJECT --limit 10 -t 7d --query 'is:resolved' --json \
  | jq '{data:[.data[] | {id,shortId,title,culprit,permalink,status,statusDetails,metadata,type,issueType,level,logger,project}]}'
```

For each resolved issue:
1. Check `statusDetails.inCommit` or `statusDetails.inRelease` for the resolving commit/PR
2. Read the actual diff. Does it fix root cause or just suppress Sentry noise?
3. **Noise-only fixes to flag:** adding to `ignoreErrors`, `beforeSend` filters, downgrading log levels, or removing `capture_exception` WITHOUT fixing the underlying bug
4. If the "fix" was noise suppression and the underlying issue is a real code bug, mark it FIX

Add a "Resolved Issue Audit" section to the plan:
```markdown
## Resolved Issue Audit
### ISSUE_SHORT_ID — <title>
- **Resolved by:** <commit hash / PR link>
- **Fix type:** ROOT_CAUSE / NOISE_SUPPRESSION / LEGITIMATE_NOISE
- **Assessment:** <Is the underlying issue actually fixed?>
- **Action needed:** NONE / REOPEN_AND_FIX
```

### 2. Deep-analyze every issue

```bash
sentry issue view <ISSUE_SHORT_ID> --json > /tmp/sentry_details/<ISSUE_SHORT_ID>.json
sentry issue events <ISSUE_SHORT_ID> --json > /tmp/sentry_cli_events/<ISSUE_SHORT_ID>.json
```

### 3. Write plan file

Create `~/.hermes/plans/sentry-fix-YYYY-MM-DD-HH.md`:

```markdown
# Sentry Fix Plan — YYYY-MM-DD HH:00

## Summary
- Issues analyzed: N
- Fixable: N
- Noise-only "fixes" reopened: N
- Skipped: N

## Issues

### 1. ISSUE_SHORT_ID — <title>
- **Events (24h):** N | **Users affected:** N
- **Status:** unresolved/resolved/ignored
- **Stack trace summary:** <key frames>
- **Root cause:** <analysis>
- **Proposed fix:** <specific code changes>
- **Verdict:** FIX / SKIP (reason)
```

**FIX if:** clear stack trace in app code, identifiable root cause, contained fix, high frequency/severity, or prior "fix" was noise suppression.

**SKIP if:** third-party code, unclear root cause, requires major architecture changes, duplicate of existing fix, PR already exists, or genuinely fixed.

### 4. Create fixes

For each fixable issue, use a git worktree:

```bash
cd ~/projects/<repo>
git fetch origin
BASE_REF=$(git show-ref --verify --quiet refs/remotes/origin/main && echo origin/main || echo origin/master)
git worktree add ~/projects/_worktrees/sentry-<SHORT_ID> -b fix/sentry-<SHORT_ID> "$BASE_REF"
```

**Fix guidelines:**
- Address the root cause, not just the symptom
- Add proper error handling / null checks / type guards
- If it's a crash, make it a graceful degradation
- Run lint and tests before committing

### 5. Create PRs

```bash
cat > /tmp/sentry-pr-body.md <<'EOF'
## Sentry Issue
- **Issue:** <SENTRY_ISSUE_ID>
- **Error:** <error message>
- **Frequency:** <events/users count>

## Root Cause
<explanation>

## Fix
<what was changed and why>

## Testing
- [ ] Lint passes
- [ ] Tests pass
- [ ] Fix addresses the stack trace
EOF

gh pr create --title "fix: <description> (<SENTRY_ISSUE_ID>)" --body-file /tmp/sentry-pr-body.md
```

### 6. Leave worktrees intact

Do not remove worktrees or branches after opening the PR.

### 7. Report summary

After processing all issues, provide:
- Issues analyzed (count + IDs)
- PRs created (with links)
- Issues skipped (with reasons)
- Plan file location

Move completed plan to `~/.hermes/plans/archive/`.

## Noise Reduction Patterns

When issues aren't code bugs but create Sentry noise:

| Pattern | When | Fix |
|---------|------|-----|
| **Downgrade error → warning** | Expected failures (rate limits, health check timeouts) | Change log level |
| **Remove capture_exception** | Caller already handles error gracefully | Remove explicit Sentry call; keep warning log |
| **Fix double-reporting** | Inner + outer both report | Remove from inner; let caller decide |
| **Add to before_send filter** | Worker signals, known infra noise | Add string match in `before_send` |
| **Frontend beforeSend** | Timeouts, network errors | Drop event in `beforeSend` callback |

**Principle:** All failures still log at warning level for debugging. Only Sentry issue creation is suppressed. True errors continue reporting normally.

## Constraints

- **10 most recent issues per run**
- **Never push to main/master** — always branch + PR
- **Don't make speculative changes** — only fix what you can trace to the stack trace
- Prioritize by frequency x severity
- Check for existing PRs before creating duplicates
- **Always write the plan file first**

Related Skills

writer

9
from exiao/skills

Write content in Eric's voice — articles, blog posts, tweets, social media posts, marketing copy, newsletter drafts. Loads WRITING-STYLE.md and enforces kill phrases.

positioning-angles

9
from exiao/skills

Use when defining product positioning, choosing strategic angles, crafting value propositions, competitive positioning, product messaging, differentiation strategy, or go-to-market angles. Also use for 'how should I position my app', 'what angle should I use', 'painkiller vs vitamin', or 'market positioning'.

outline-generator

9
from exiao/skills

Use when generating outlines, article structures, content outlines, blog outlines, planning article sections, structuring posts, breaking down topics into sections, or organizing ideas for long-form content. Also use for 'outline this', 'structure this article', or 'plan the sections'.

last30days-open

9
from exiao/skills

Use only when the user explicitly asks for the open variant of last30days, including watchlists, briefings, and history queries. Sources: Reddit, X, YouTube, web.

last30days

9
from exiao/skills

Use when researching what happened in the last 30 days on a topic. Also triggered by 'last30'. Sources: Reddit, X, YouTube, web. Produces expert-level summary with copy-paste-ready prompts.

hooks

9
from exiao/skills

Use when generating hooks, headlines, titles, and scroll-stopping openers for content. Also use when analyzing viral posts, Reels, TikToks, YouTube Shorts, or successful social examples to extract reusable hook patterns and improve hook guidance.

evaluate-content

9
from exiao/skills

Use when judging content quality OR editing/improving existing copy: shareability, readability, voice, cuttability, angle, copy sweeps.

editor-in-chief

9
from exiao/skills

Use when a first draft is complete and all Phase 1 gates are done: topic selected (seo-research), title approved (hooks), outline approved (outline-generator), draft written (writer). Runs autonomous diagnosis-prescribe-rewrite loop before Substack.

copywriting

9
from exiao/skills

Write or improve marketing copy for any surface: pages, ads, app stores, landing pages, TikTok/Meta scripts, push notifications, UGC. Combines page copy frameworks with direct response principles.

content-strategy

9
from exiao/skills

Use when building content strategy: hooks, angles, and ideas from what's trending now. Covers organic and paid creative across TikTok, X, YouTube, Meta, LinkedIn.

content-pipeline

9
from exiao/skills

Orchestrator for the 3-article content pipeline — runs research phase, spawns parallel article sub-agents, creates Typefully drafts. Use when running the full content pipeline (usually via cron at 3am).

yt-dlp

9
from exiao/skills

Download audio/video from YouTube and other sites using yt-dlp. Use when the user asks to download music, songs, albums, podcasts, or video from YouTube or similar platforms. Triggers on 'download song', 'get mp3', 'yt-dlp', 'youtube download', 'rip audio'.