# Fix Sentry

Auto-fix high-frequency Sentry issues: fetch issues > N occurrences, analyze stack...

- Repository: https://github.com/FerroxLabs/wayland (616 stars)
- Category: Git and review
- License: AGPL-3.0
- Last updated: 2026-10-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add FerroxLabs/wayland --skill fix-sentry -g -a claude-code -y`
Codex: `npx skills add FerroxLabs/wayland --skill fix-sentry -g -a codex -y`
Cursor: `npx skills add FerroxLabs/wayland --skill fix-sentry -g -a cursor -y`
Gemini CLI: `npx skills add FerroxLabs/wayland --skill fix-sentry -g -a gemini-cli -y`

## Description

Auto-fix high-frequency Sentry issues: fetch issues > N occurrences, analyze stack traces, fix code, create GitHub issues, and submit PRs. Supports user feedback issues (event.type "default") with attachment analysis (logs, screenshots) when include_feedback=true. Use when: (1) User says "/fix-sentry", (2) User asks to fix Sentry issues.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Fix Sentry Skill

Automated workflow: Sentry issues → analyze → fix → GitHub Issue → PR.

**Announce at start:** "I'm using fix-sentry skill to find and fix high-frequency Sentry issues."

## Operating Modes

### Batch Mode (default)

Invocation: `/fix-sentry` or `/fix-sentry threshold=50`

- Uses the specified threshold (default 100) to fetch issues
- Runs full Phase 1 → Phase 2 → Phase 3
- Fixes all qualifying issues

### Daemon Mode

Invocation: `/fix-sentry limit=1` (from daemon script)

- Phase 1 uses **adaptive threshold descent**: starts at 100, lowers progressively until a fixable issue is found
- Fixes only 1 issue (controlled by `limit` parameter), then exits
- If no fixable issue exists at any threshold → outputs `[NO_FIXABLE_ISSUES]` and exits

## Prerequisites

- **Sentry MCP** must be configured (global or project scope) with `mcp__sentry__*` tools available
- **gh CLI** must be authenticated
- Working directory must be clean (`git status` shows no uncommitted changes)

## Workflow

### Phase 1: Collect & Filter Issues

#### Step 1.1: Verify Environment

```bash
git status --porcelain   # must be clean
git branch --show-current
```

If working directory is dirty, **STOP** and ask user to commit or stash first.

#### Step 1.1b: Load Skip List (Daemon Mode Only)

In daemon mode (`limit > 0`), load the skip list to avoid re-analyzing issues that were already
triaged in previous sessions. The skip list is stored at:

```
~/.wayland-fix-sentry/skip-list.json
```

Format:

```json
{
  "ELECTRON-6X": { "reason": "already_fixed", "expires": "2026-03-28T03:00:00Z", "summary": "PR #1758 merged" },
  "ELECTRON-A7": { "reason": "system_level", "expires": "2026-04-03T03:00:00Z", "summary": "EPIPE in net.Socket" }
}
```

**On load:**

1. Read the file (if it doesn't exist, start with an empty skip list)
2. Remove all entries where `expires` < current time (expired entries get re-analyzed)
3. Keep the remaining entries as the active skip list

The rest: https://github.com/FerroxLabs/wayland/blob/HEAD/.claude/skills/fix-sentry/SKILL.md
