[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77RAM3BAK5ZMBWX9BR0MZFH":3,"skill-same:01M77RAM3BAK5ZMBWX9BR0MZFH":60},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M77RAM3BAK5ZMBWX9BR0MZFH","fix-sentry",null,"Auto-fix high-frequency Sentry issues: fetch issues > N occurrences, analyze stack traces,\nfix code, create GitHub issues, and submit PRs. Supports user feedback issues (event.type\n\"default\") with attachment analysis (logs, screenshots) when include_feedback=true.\nUse when: (1) User says \"\u002Ffix-sentry\", (2) User asks to fix Sentry issues.","finewood2008\u002Fcentaurai-decision","finewood2008","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F212194470?v=4","01M75HGRZJ31P9W3T90VHFS1X8","Finewood","01M77RA40TQ7E0FEMCYQF58BZ4",1,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Ffinewood2008\u002Fcentaurai-decision\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ffix-sentry\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: fix-sentry\ndescription: |\n  Auto-fix high-frequency Sentry issues: fetch issues > N occurrences, analyze stack traces,\n  fix code, create GitHub issues, and submit PRs. Supports user feedback issues (event.type\n  \"default\") with attachment analysis (logs, screenshots) when include_feedback=true.\n  Use when: (1) User says \"\u002Ffix-sentry\", (2) User asks to fix Sentry issues.\n---\n\n# Fix Sentry Skill\n\nAutomated workflow: Sentry issues → analyze → fix → GitHub Issue → PR.\n\n**Announce at start:** \"I'm using fix-sentry skill to find and fix high-frequency Sentry issues.\"\n\n## Operating Modes\n\n### Batch Mode (default)\n\nInvocation: `\u002Ffix-sentry` or `\u002Ffix-sentry threshold=50`\n\n- Uses the specified threshold (default 100) to fetch issues\n- Runs full Phase 1 → Phase 2 → Phase 3\n- Fixes all qualifying issues\n\n### Daemon Mode\n\nInvocation: `\u002Ffix-sentry limit=1` (from daemon script)\n\n- Phase 1 uses **adaptive threshold descent**: starts at 100, lowers progressively until a fixable issue is found\n- Fixes only 1 issue (controlled by `limit` parameter), then exits\n- If no fixable issue exists at any threshold → outputs `[NO_FIXABLE_ISSUES]` and exits\n\n## Prerequisites\n\n- **Sentry MCP** must be configured (global or project scope) with `mcp__sentry__*` tools available\n- **gh CLI** must be authenticated\n- Working directory must be clean (`git status` shows no uncommitted changes)\n\n## Workflow\n\n### Phase 1: Collect & Filter Issues\n\n#### Step 1.1: Verify Environment\n\n```bash\ngit status --porcelain   # must be clean\ngit branch --show-current\n```\n\nIf working directory is dirty, **STOP** and ask user to commit or stash first.\n\n#### Step 1.1b: Load Skip List (Daemon Mode Only)\n\nIn daemon mode (`limit > 0`), load the skip list to avoid re-analyzing issues that were already\ntriaged in previous sessions. The skip list is stored at:\n\n```\n~\u002F.aionui-fix-sentry\u002Fskip-list.json\n```\n\nFormat:\n\n```json\n{\n  \"ELECTRON-6X\": { \"reason\": \"already_fixed\", \"expires\": \"2026-03-28T03:00:00Z\", \"summary\": \"PR #1758 merged\" },\n  \"ELECTRON-A7\": { \"reason\": \"system_level\", \"expires\": \"2026-04-03T03:00:00Z\", \"summary\": \"EPIPE in net.Socket\" }\n}\n```\n\n**On load:**\n\n1. Read the file (if it doesn't exist, start with an empty skip list)\n2. Remove all entries where `expires` \u003C current time (expired entries get re-analyzed)\n3. Keep the remaining entries as the active skip list\n\n**During Phase 1.2 (Fetch Issues):**\n\nWhen iterating through fetched issues, if an issue's short ID (e.g., `ELECTRON-6X`) is in the\nactive skip list, **skip it immediately** without calling `get_issue_details` or doing any analysis.\nLog the skip: `Skipping ELECTRON-6X (cached: already_fixed — PR #1758 merged)`\n\n**In batch mode (`limit=0`):** skip list is ignored — always analyze everything fresh.\n\n#### Step 1.2: Fetch Unresolved Issues\n\n**Always include `is:unresolved`** to exclude issues already marked as resolved in Sentry.\n\n##### Batch mode (no `limit` parameter or `limit=0`)\n\nUse the specified `threshold` parameter (default 100) directly:\n\n```\nmcp__sentry__list_issues(\n  projectSlugOrId=\"\u003Cproject>\",\n  query=\"times_seen:>\u003Cthreshold> is:unresolved\",\n  sort=\"freq\",\n  limit=25\n)\n```\n\n##### Daemon mode (`limit > 0`): Adaptive Threshold Descent\n\nWhen `limit` is set, use **adaptive threshold descent** to find fixable issues. Start high and\nlower progressively — this ensures the most impactful issues are fixed first.\n\n**Threshold sequence:** 100 → 80 → 60 → 40 → 20 → 10\n\nFor each threshold in the sequence:\n\n1. Fetch issues: `mcp__sentry__list_issues(query=\"times_seen:>\u003Cthreshold> is:unresolved\", sort=\"freq\", limit=25)`\n2. Run Steps 1.3–1.6 (filter, deduplicate, triage)\n3. If any \"Needs fix\" issues are found → proceed to Phase 2 with the top `limit` issues\n4. If all issues are skipped (already fixed, system-level, unfixable) → log and try the next lower threshold\n\nIf **all thresholds are exhausted** with no fixable issues, enter **Deep Analysis Mode** (Step 1.2b).\n\n##### Step 1.2b: Deep Analysis Mode — Issues Without Stack Traces\n\nWhen no fixable issues remain at any standard threshold, search for issues that lack stack traces\nbut may still be fixable through code analysis:\n\n```\nmcp__sentry__list_issues(\n  projectSlugOrId=\"\u003Cproject>\",\n  query=\"!has:stacktrace is:unresolved\",\n  sort=\"freq\",\n  limit=10\n)\n```\n\nFor these issues, apply **Step C (Defensive fix)** logic from Step 1.6:\n\n- Extract distinctive patterns from the error message (file names, paths, keywords)\n- Search the codebase for matching code paths\n- If a matching code path is found → classify as \"Defensive fix\" and proceed to Phase 2\n\nIf deep analysis also yields no fixable issues, output the following **exact text** and exit:\n\n```\n[NO_FIXABLE_ISSUES] All thresholds exhausted, no actionable issues found.\n```\n\n**This marker is machine-readable** — the daemon script uses it to determine backoff timing.\n\n#### Step 1.3: Evidence-Based Filtering\n\nDetermine whether each issue has already been addressed. **Only skip issues with concrete evidence\nof a fix** — version distribution alone is NOT sufficient to conclude an issue is fixed (the latest\nrelease may simply have fewer users).\n\n1. **Get the latest release version:**\n\n   ```bash\n   gh release list --repo \u003Corg>\u002F\u003Crepo> --limit 3\n   ```\n\n2. **Search for existing fixes (concrete evidence required):**\n\n   ```bash\n   gh release view \u003Clatest-tag> --repo \u003Corg>\u002F\u003Crepo>\n   git log --oneline --since=\"\u003Crelease-date>\" --grep=\"\u003Ckeyword-from-error>\"\n   ```\n\n3. **Cross-reference with Sentry issue metadata:**\n   - If the issue has a GitHub annotation linking to a **merged** PR, skip it\n   - If the issue status is `resolved` with `inRelease`, skip it\n   - If release notes explicitly mention a fix for this error, skip it\n\n4. **Check for existing OPEN PRs:**\n\n   ```bash\n   gh pr list --repo \u003Corg>\u002F\u003Crepo> --state open --search \"\u003Cerror-keyword>\" --json number,title,state\n   ```\n\n   - If an OPEN PR already addresses this issue, do NOT create a duplicate\n   - Classify as **\"fix pending merge\"** — the issue is still occurring because the fix hasn't been deployed yet\n   - If the OPEN PR has quality issues (e.g., missing tests), note it for improvement\n\n**Important: version distribution is supplementary info, NOT a skip criterion.**\n\"Only seen on v1.8.30, not on v1.8.31\" does NOT mean the issue is fixed — the latest version\nmay have too few users to trigger the error. Include version info in the triage report for context,\nbut never use it as the sole reason to skip an issue.\n\n**Classification criteria (three states):**\n\n| Condition                                  | Classification    | Action                        |\n| ------------------------------------------ | ----------------- | ----------------------------- |\n| Has merged PR \u002F mentioned in release notes | Already fixed     | Skip                          |\n| Resolved with `inRelease` in Sentry        | Already fixed     | Skip                          |\n| Has OPEN PR addressing the root cause      | Fix pending merge | Skip (or improve existing PR) |\n| No concrete fix evidence found             | Needs fix         | Fix it                        |\n\n#### Step 1.4: Deduplicate by Root Cause\n\nSentry creates separate issues for the same error across different releases or slight variations.\nGroup issues by their **root cause** (same function + same error type):\n\nExample: ELECTRON-5, ELECTRON-6X, ELECTRON-1A are all `fetchModelList` + \"Missing credentials\"\n→ Treat as **one fix group**, reference all Sentry IDs in the PR.\n\n#### Step 1.5: Get Stack Traces (Rate-Limit Aware)\n\nFor each **unique issue group**, get details **one at a time**:\n\n```\nmcp__sentry__get_issue_details(issueUrl=\"\u003Csentry-url>\")\n```\n\n**Important:** Sentry API rate limit is 5 requests\u002Fsecond. Call `get_issue_details` sequentially,\nnever in parallel. If you hit a 429, wait a moment and retry.\n\nExtract:\n\n- Error message and type\n- Event type (`event.type` — `error`, `default`, etc.)\n- Stack trace (file paths, line numbers, function names)\n- First\u002Flast seen timestamps\n- Release version(s) affected\n- Frequency and affected users count\n\n#### Step 1.5b: Attachment Analysis\n\nFor issues where `event.type` is `default` (user feedback) **or** stack traces are absent,\ncheck for attachments that may contain diagnostic information.\n\n**When to run:** After Step 1.5, for any issue group that meets either condition:\n\n- `event.type` is `default` (user feedback \u002F bug report)\n- No usable stack trace was extracted in Step 1.5\n\n**Prerequisite:** Only runs when `include_feedback=true` is set for `event.type: default` issues.\nIssues without stack traces are always eligible regardless of this flag.\n\n**Procedure:**\n\n1. **Get events for the issue** (if not already fetched):\n\n   ```\n   mcp__sentry__list_issue_events(\n     issueUrl=\"\u003Csentry-url>\",\n     limit=3\n   )\n   ```\n\n2. **List attachments** for each event:\n\n   ```\n   mcp__sentry__get_event_attachment(\n     projectSlug=\"\u003Cproject>\",\n     eventId=\"\u003CeventId>\"\n   )\n   ```\n\n3. **Download and analyze attachments by type:**\n\n   | Attachment type | Name \u002F MIME pattern             | Analysis method                                                           |\n   | --------------- | ------------------------------- | ------------------------------------------------------------------------- |\n   | Logs            | `logs.gz`, `*.log`, `*.txt`     | Download → decompress → search for error patterns, stack traces, warnings |\n   | Screenshots     | `*.png`, `*.jpg`, `screenshot*` | Download → use vision to identify UI state, error dialogs, frozen screens |\n   | Config \u002F state  | `*.json`, `*.xml`               | Download → check for misconfigurations                                    |\n\n   ```\n   mcp__sentry__get_event_attachment(\n     projectSlug=\"\u003Cproject>\",\n     eventId=\"\u003CeventId>\",\n     attachmentId=\"\u003CattachmentId>\"\n   )\n   ```\n\n4. **Extract diagnostic signals from logs:**\n   - Error \u002F Warning lines (`error`, `warn`, `fatal`, `crash`, `EPIPE`, etc.)\n   - Stack traces embedded in log output\n   - Performance indicators (memory usage, CPU spikes, event loop delays)\n   - Repeated failure patterns around the reported issue time\n\n5. **Extract signals from screenshots:**\n   - Visible error messages or dialogs\n   - UI freeze indicators (loading spinners stuck, unresponsive elements)\n   - Memory \u002F resource warnings visible in UI\n\n6. **Combine user description + attachment signals** to form a diagnosis hypothesis.\n   Pass the combined evidence to Step 1.6 for triage classification.\n\n**Rate-limit note:** Same as Step 1.5 — call attachment APIs sequentially, never in parallel.\n\n#### Step 1.6: Triage — Can We Fix It?\n\nClassify each issue group using the detailed decision flow in [references\u002Ftriage-rules.md](references\u002Ftriage-rules.md).\n\n**Quick reference — seven categories:**\n\n| Category          | Action                                                             |\n| ----------------- | ------------------------------------------------------------------ |\n| **Direct fix**    | Stack trace → our code → fix                                       |\n| **Defensive fix** | No trace, but pattern matches our code → fix with guards           |\n| **Feedback fix**  | User feedback + attachment analysis → identifiable code path → fix |\n| **Pending merge** | Open PR exists → skip or improve                                   |\n| **Already fixed** | Merged PR \u002F resolved → skip                                        |\n| **System-level**  | EPIPE, ENOSPC, EIO, uv, Chromium → skip                            |\n| **Unfixable**     | No trace, no matching code, no diagnostic attachments → skip       |\n\n**Output a triage report** (see [references\u002Freport-template.md](references\u002Freport-template.md) for format),\nthen **proceed immediately** — do not wait for user confirmation.\n\n### Phase 2: Fix Issues (Serial, One Group at a Time)\n\nPhase 2 handles two types of work:\n\n- **New fixes**: issues with no existing PR → full flow (Steps 2.1–2.7)\n- **Pending-merge fixes**: issues with an OPEN PR that needs improvement (e.g., missing tests)\n  → checkout existing branch, add tests, push update (Steps 2.1b–2.5, then 2.7)\n\nProcess all groups serially: pending-merge groups first (quick improvement), then new fixes.\n\n#### Step 2.1: Create Branch (New Fix)\n\nFor issues with **no existing PR**:\n\n```bash\ngit checkout main\ngit pull origin main\ngit checkout -b fix\u002Fsentry-\u003Cprimary-issue-shortId>\n```\n\nBranch naming: `fix\u002Fsentry-\u003CshortId>` using the highest-frequency issue in the group\n(e.g., `fix\u002Fsentry-ELECTRON-6X`).\n\n#### Step 2.1b: Checkout Existing Branch (Pending-Merge Fix)\n\nFor issues with an **existing OPEN PR** that needs improvement (e.g., missing tests):\n\n```bash\n# Get the branch name from the PR\ngh pr view \u003Cpr-number> --repo \u003Corg>\u002F\u003Crepo> --json headRefName --jq '.headRefName'\n# Checkout and sync\ngit checkout \u003Cbranch-name>\ngit pull origin \u003Cbranch-name>\n```\n\nThen skip Step 2.2 (code fix already exists) and go directly to Step 2.3 (Write Tests).\n\n#### Step 2.2: Locate and Fix Code\n\n1. Use `Glob` to find the actual file path (may differ from Sentry stack trace due to refactoring)\n2. Read the file(s) identified in the stack trace\n3. Understand the surrounding context (read neighboring code, types, callers)\n4. Implement the minimal fix:\n   - Add null\u002Fundefined guards\n   - Add try-catch for unhandled exceptions\n   - Fix incorrect type assertions\n   - Add missing error handling\n   - Fix race conditions with proper async handling\n5. **Do NOT** refactor surrounding code — fix only the reported issue\n\n#### Step 2.3: Write Tests for the Fix\n\n**Every bug fix MUST have a corresponding unit test.** This is enforced by the commit skill\nand the testing skill — do not skip it.\n\n1. Check if a test file already exists for the modified module (e.g., `utils.test.ts` for `utils.ts`)\n2. If no test file exists, create one following the [testing skill](..\u002Ftesting\u002FSKILL.md) conventions\n3. Write test(s) that:\n   - **Reproduce the bug**: a test that would have failed before the fix\n   - **Verify the fix**: the same test now passes with the fix applied\n   - Cover at least one failure path (e.g., null input, missing key, invalid URL)\n4. Run `bun run test` to confirm the new tests pass\n5. If the fix is in code that's hard to unit test (e.g., deep Electron API dependency),\n   document why in a code comment and add the closest possible test\n\n**Examples of good fix tests:**\n\n- Fix: added null check for `apiKey` → Test: call function with `undefined` apiKey, assert graceful error\n- Fix: wrapped `fs.readdir` in try-catch → Test: mock `fs.readdir` to throw EPERM, assert no crash\n- Fix: validated URL before `new URL()` → Test: pass invalid URL string, assert error response\n\n#### Step 2.4: Quality Checks\n\nRun all checks in order. **Every check must pass before proceeding to Step 2.6.**\n\n```bash\n# 1. Lint + auto-fix\nbun run lint:fix\n\n# 2. Format + auto-fix\nbun run format\n\n# 3. Type check — MUST pass\nbunx tsc --noEmit\n\n# 4. Tests — MUST pass\nbun run test\n```\n\n**i18n check** (run if any `src\u002Frenderer\u002F`, `locales\u002F`, or `src\u002Fcommon\u002Fconfig\u002Fi18n` files were modified):\n\n```bash\nbun run i18n:types\nnode scripts\u002Fcheck-i18n.js\n```\n\n- `i18n:types` must run **before** `check-i18n.js`\n- If `check-i18n.js` exits with errors → fix them before proceeding\n- If `check-i18n.js` exits with warnings only → may proceed\n\n**Final CI verification** — replicate the exact CI check locally:\n\n```bash\nprek run --from-ref origin\u002Fmain --to-ref HEAD\n```\n\n- If `prek` reports issues → fix them (run `bun run lint:fix` and `bun run format` again), then re-run `prek`\n- `prek` uses check-only commands (`lint`, `format:check`) — it will catch anything the auto-fix missed\n\n**Gate rules:**\n\n| Check      | Result | Action                                                              |\n| ---------- | ------ | ------------------------------------------------------------------- |\n| Type check | FAIL   | Fix type errors and re-run. Max 3 attempts, then **abandon issue**. |\n| Tests      | FAIL   | Adjust fix\u002Ftest and re-run. Max 3 attempts, then **abandon issue**. |\n| i18n       | FAIL   | Fix missing keys and re-run.                                        |\n| prek       | FAIL   | Fix reported issues and re-run.                                     |\n\n#### Step 2.5: Verify Fix\n\nVerification strategy depends on **which process** the error originates from:\n\n| Culprit path \u002F error origin          | Process  | Verification method |\n| ------------------------------------ | -------- | ------------------- |\n| `src\u002Fprocess\u002F`, `src\u002Findex.ts`       | main     | Unit tests only     |\n| `src\u002Fprocess\u002Fworker\u002F`                | worker   | Unit tests only     |\n| `src\u002Frenderer\u002F`, `src\u002Fcommon\u002F` (IPC) | renderer | CDP + unit tests    |\n\n- **Main \u002F Worker**: unit tests from Step 2.3 are sufficient. Mark as **verified** if tests pass.\n- **Renderer**: use CDP for live verification. See [references\u002Fcdp-verification.md](references\u002Fcdp-verification.md) for full flow.\n\n#### Step 2.6: Commit & Create PR\n\n**Do NOT invoke `\u002Fcommit` or `\u002Foss-pr`** — they may prompt for confirmation, which blocks\nthe daemon flow. Instead, commit and create the PR directly using the commands below.\n\n**Pre-flight duplicate check** (safety net, supplements triage-phase filtering):\n\n```bash\ngh pr list --repo \u003Corg>\u002F\u003Crepo> --state open --search \"\u003Cerror-keyword-or-file>\" --json number,title\ngh issue list --repo \u003Corg>\u002F\u003Crepo> --state open --search \"\u003Cerror-keyword>\" --json number,title\n```\n\nIf an existing OPEN PR\u002Fissue addresses the same root cause, **STOP** — do not create a duplicate.\nInstead, report to the user and suggest updating the existing PR if needed.\n\n1. **Commit** directly:\n\n   ```bash\n   git add \u003Cchanged-files>\n   git commit -m \"\u003Ctype>(\u003Cscope>): \u003Csubject>\"\n   ```\n\n   Follow project commit conventions: `\u003Ctype>(\u003Cscope>): \u003Csubject>` in English.\n   No AI signatures. Reference the Sentry issue IDs in the commit body if needed.\n\n2. **Push branch and create PR as Draft**:\n\n   ```bash\n   git push -u origin fix\u002Fsentry-\u003CshortId>\n\n   gh pr create --draft --title \"\u003Ctype>(\u003Cscope>): \u003Csubject>\" --body \"$(cat \u003C\u003C'EOF'\n   ## Summary\n\n   \u003C1-3 bullet points describing the fix>\n\n   ## Sentry Issues\n\n   - \u003CSentry issue ID> — \u003Cerror message> (\u003Coccurrence count> occurrences)\n\n   ## Test Plan\n\n   - [x] Unit tests pass\n   - [x] Type check passes\n   - [x] Lint and format pass\n   EOF\n   )\"\n   ```\n\n   PR title: under 70 characters, `\u003Ctype>(\u003Cscope>): \u003Cdescription>` format.\n   **NEVER add AI-generated signatures, `Generated with`, or `Co-Authored-By` lines.**\n\n3. **Mark PR Ready based on verification result:**\n\n   | Process  | Verification Result             | PR Action                                            |\n   | -------- | ------------------------------- | ---------------------------------------------------- |\n   | main     | Unit tests pass                 | `gh pr ready \u003Cpr-number>` — mark as Ready for Review |\n   | main     | Unit tests fail \u002F not writable  | Keep as Draft, add `needs-manual-review` label       |\n   | renderer | CDP pass                        | `gh pr ready \u003Cpr-number>` — mark as Ready for Review |\n   | renderer | CDP fail (3 attempts exhausted) | Keep as Draft, add `needs-manual-review` label       |\n\n   ```bash\n   # On pass (unit tests pass for main, or CDP pass for renderer):\n   gh pr ready \u003Cpr-number>\n\n   # On fail:\n   gh pr edit \u003Cpr-number> --add-label \"needs-manual-review\"\n   ```\n\n#### Step 2.7: Return to Main\n\n```bash\ngit checkout main\n```\n\nProceed to the next group.\n\n### Phase 3: Summary Report\n\nAfter all groups are processed, output a summary report.\nSee [references\u002Freport-template.md](references\u002Freport-template.md) for the exact format.\n\n#### Step 3.1: Update Skip List (Daemon Mode Only)\n\nIn daemon mode (`limit > 0`), after the summary report, update `~\u002F.aionui-fix-sentry\u002Fskip-list.json`\nwith all issues that were **skipped** in this session. This prevents the next session from\nre-analyzing the same issues.\n\n**TTL by classification:**\n\n| Classification    | TTL      | Reason                                                |\n| ----------------- | -------- | ----------------------------------------------------- |\n| system_level      | 7 days   | These never change (EPIPE, ENOSPC, EIO, uv, etc.)     |\n| already_fixed     | 48 hours | Re-check in case of regression                        |\n| feedback_no_clue  | 48 hours | User feedback with no diagnostic clues in attachments |\n| unfixable         | 24 hours | Might become fixable with new code changes            |\n| fix_pending_merge | 12 hours | PR might get merged, issue might resolve              |\n\n**Write rules:**\n\n1. Read the existing file first (preserve entries from previous sessions that haven't expired)\n2. For each skipped issue in this session, add or update its entry with the appropriate TTL\n3. For issues that were **fixed** in this session (PR created), do NOT add to skip list —\n   they should be detected as \"already fixed\" by the next session's normal triage\n4. Write the merged result back to the file\n\n**Example output:**\n\n```json\n{\n  \"ELECTRON-A7\": { \"reason\": \"system_level\", \"expires\": \"2026-04-03T03:00:00Z\", \"summary\": \"EPIPE in net.Socket\" },\n  \"ELECTRON-6X\": { \"reason\": \"already_fixed\", \"expires\": \"2026-03-29T03:00:00Z\", \"summary\": \"PR #1758 merged\" },\n  \"ELECTRON-16\": { \"reason\": \"system_level\", \"expires\": \"2026-04-03T03:00:00Z\", \"summary\": \"Electron SingletonCookie\" },\n  \"ELECTRON-X\": { \"reason\": \"fix_pending_merge\", \"expires\": \"2026-03-27T15:00:00Z\", \"summary\": \"PR #1498 open\" }\n}\n```\n\n## Configuration\n\nDefault parameters (can be overridden via skill args):\n\n| Parameter        | Default  | Description                                                        |\n| ---------------- | -------- | ------------------------------------------------------------------ |\n| threshold        | 100      | Minimum occurrence count (batch mode only)                         |\n| project          | electron | Sentry project slug                                                |\n| sort             | freq     | Sort order for issues                                              |\n| limit            | 0        | Max issues to fix per invocation (0 = unlimited, >0 = daemon mode) |\n| include_feedback | false    | Include `event.type: default` (user feedback) issues               |\n\nOverride examples:\n\n- Batch mode: `\u002Ffix-sentry threshold=50 project=electron`\n- Daemon mode: `\u002Ffix-sentry limit=1 project=electron`\n- Include user feedback: `\u002Ffix-sentry include_feedback=true`\n\n## Mandatory Rules\n\n### No AI Signature\n\n**NEVER add any AI-related signatures** to commits, PRs, or issues.\n\n### Minimal Fix Only\n\nFix the reported error. Do NOT refactor, add features, or \"improve\" surrounding code.\n\n### No Blocking Questions\n\nThe entire workflow runs end-to-end without stopping for user confirmation.\nOutput the triage report for transparency, then proceed immediately.\nThe goal is uninterrupted automation — questions block the flow.\n\n### No Duplicate PRs\n\nBefore creating a new PR\u002Fissue, always check for existing OPEN PRs addressing the same root cause.\nIf found, improve the existing PR (e.g., add missing tests) instead of creating a duplicate.\n\n### One Root Cause = One Branch = One PR\n\nGroup duplicate Sentry issues by root cause. Each unique root cause gets one branch, one GitHub issue, and one PR.\n\n### Rate Limit Awareness\n\nSentry API has a rate limit of ~5 requests\u002Fsecond. Always call `get_issue_details` sequentially, never in parallel.\n\n### Skill Changes Stay Separate\n\nDo NOT include changes to `.claude\u002Fskills\u002F` in bug-fix branches. Skill updates should go through their own branch and PR.\n","# Fix Sentry Skill\n\nAutomated workflow: Sentry issues → analyze → fix → GitHub Issue → PR.\n\n**Announce at start:** \"I'm using fix-sentry skill to find and fix high-frequency Sentry issues.\"\n\n## Operating Modes\n\n### Batch Mode (default)\n\nInvocation: `\u002Ffix-sentry` or `\u002Ffix-sentry threshold=50`\n\n- Uses the specified threshold (default 100) to fetch issues\n- Runs full Phase 1 → Phase 2 → Phase 3\n- Fixes all qualifying issues\n\n### Daemon Mode\n\nInvocation: `\u002Ffix-sentry limit=1` (from daemon script)\n\n- Phase 1 uses **adaptive threshold descent**: starts at 100, lowers progressively until a fixable issue is found\n- Fixes only 1 issue (controlled by `limit` parameter), then exits\n- If no fixable issue exists at any threshold → outputs `[NO_FIXABLE_ISSUES]` and exits\n\n## Prerequisites\n\n- **Sentry MCP** must be configured (global or project scope) with `mcp__sentry__*` tools available\n- **gh CLI** must be authenticated\n- Working directory must be clean (`git status` shows no uncommitted changes)\n\n## Workflow\n\n### Phase 1: Collect & Filter Issues\n\n#### Step 1.1: Verify Environment\n\n```bash\ngit status --porcelain   # must be clean\ngit branch --show-current\n```\n\nIf working directory is dirty, **STOP** and ask user to commit or stash first.\n\n#### Step 1.1b: Load Skip List (Daemon Mode Only)\n\nIn daemon mode (`limit > 0`), load the skip list to avoid re-analyzing issues that were already\ntriaged in previous sessions. The skip list is stored at:\n\n```\n~\u002F.aionui-fix-sentry\u002Fskip-list.json\n```\n\nFormat:\n\n```json\n{\n  \"ELECTRON-6X\": { \"reason\": \"already_fixed\", \"expires\": \"2026-03-28T03:00:00Z\", \"summary\": \"PR #1758 merged\" },\n  \"ELECTRON-A7\": { \"reason\": \"system_level\", \"expires\": \"2026-04-03T03:00:00Z\", \"summary\": \"EPIPE in net.Socket\" }\n}\n```\n\n**On load:**\n\n1. Read the file (if it doesn't exist, start with an empty skip list)\n2. Remove all entries where `expires` \u003C current time (expired entries get re-analyzed)\n3. Keep the remaining entries as the active skip list\n\n**During Phase 1.2 (Fetch Issues):**\n\nWhen iterating through fetched issues, if an issue's short ID (e.g., `ELECTRON-6X`) is in the\nactive skip list, **skip it immediately** without calling `get_issue_details` or doing any analysis.\nLog the skip: `Skipping ELECTRON-6X (cached: already_fixed — PR #1758 merged)`\n\n**In batch mode (`limit=0`):** skip list is ignored — always analyze everything fresh.\n\n#### Step 1.2: Fetch Unresolved Issues\n\n**Always include `is:unresolved`** to exclude issues already marked as resolved in Sentry.\n\n##### Batch mode (no `limit` parameter or `limit=0`)\n\nUse the specified `threshold` parameter (default 100) directly:\n\n```\nmcp__sentry__list_issues(\n  projectSlugOrId=\"\u003Cproject>\",\n  query=\"times_seen:>\u003Cthreshold> is:unresolved\",\n  sort=\"freq\",\n  limit=25\n)\n```\n\n##### Daemon mode (`limit > 0`): Adaptive Threshold Descent\n\nWhen `limit` is set, use **adaptive threshold descent** to find fixable issues. Start high and\nlower progressively — this ensures the most impactful issues are fixed first.\n\n**Threshold sequence:** 100 → 80 → 60 → 40 → 20 → 10\n\nFor each threshold in the sequence:\n\n1. Fetch issues: `mcp__sentry__list_issues(query=\"times_seen:>\u003Cthreshold> is:unresolved\", sort=\"freq\", limit=25)`\n2. Run Steps 1.3–1.6 (filter, deduplicate, triage)\n3. If any \"Needs fix\" issues are found → proceed to Phase 2 with the top `limit` issues\n4. If all issues are skipped (already fixed, system-level, unfixable) → log and try the next lower threshold\n\nIf **all thresholds are exhausted** with no fixable issues, enter **Deep Analysis Mode** (Step 1.2b).\n\n##### Step 1.2b: Deep Analysis Mode — Issues Without Stack Traces\n\nWhen no fixable issues remain at any standard threshold, search for issues that lack stack traces\nbut may still be fixable through code analysis:\n\n```\nmcp__sentry__list_issues(\n  projectSlugOrId=\"\u003Cproject>\",\n  query=\"!has:stacktrace is:unresolved\",\n  sort=\"freq\",\n  limit=10\n)\n```\n\nFor these issues, apply **Step C (Defensive fix)** logic from Step 1.6:\n\n- Extract distinctive patterns from the error message (file names, paths, keywords)\n- Search the codebase for matching code paths\n- If a matching code path is found → classify as \"Defensive fix\" and proceed to Phase 2\n\nIf deep analysis also yields no fixable issues, output the following **exact text** and exit:\n\n```\n[NO_FIXABLE_ISSUES] All thresholds exhausted, no actionable issues found.\n```\n\n**This marker is machine-readable** — the daemon script uses it to determine backoff timing.\n\n#### Step 1.3: Evidence-Based Filtering\n\nDetermine whether each issue has already been addressed. **Only skip issues with concrete evidence\nof a fix** — version distribution alone is NOT sufficient to conclude an issue is fixed (the latest\nrelease may simply have fewer users).\n\n1. **Get the latest release version:**\n\n   ```bash\n   gh release list --repo \u003Corg>\u002F\u003Crepo> --limit 3\n   ```\n\n2. **Search for existing fixes (concrete evidence required):**\n\n   ```bash\n   gh release view \u003Clatest-tag> --repo \u003Corg>\u002F\u003Crepo>\n   git log --oneline --since=\"\u003Crelease-date>\" --grep=\"\u003Ckeyword-from-error>\"\n   ```\n\n3. **Cross-reference with Sentry issue metadata:**\n   - If the issue has a GitHub annotation linking to a **merged** PR, skip it\n   - If the issue status is `resolved` with `inRelease`, skip it\n   - If release notes explicitly mention a fix for this error, skip it\n\n4. **Check for existing OPEN PRs:**\n\n   ```bash\n   gh pr list --repo \u003Corg>\u002F\u003Crepo> --state open --search \"\u003Cerror-keyword>\" --json number,title,state\n   ```\n\n   - If an OPEN PR already addresses this issue, do NOT create a duplicate\n   - Classify as **\"fix pending merge\"** — the issue is still occurring because the fix hasn't been deployed yet\n   - If the OPEN PR has quality issues (e.g., missing tests), note it for improvement\n\n**Important: version distribution is supplementary info, NOT a skip criterion.**\n\"Only seen on v1.8.30, not on v1.8.31\" does NOT mean the issue is fixed — the latest version\nmay have too few users to trigger the error. Include version info in the triage report for context,\nbut never use it as the sole reason to skip an issue.\n\n**Classification criteria (three states):**\n\n| Condition                                  | Classification    | Action                        |\n| ------------------------------------------ | ----------------- | ----------------------------- |\n| Has merged PR \u002F mentioned in release notes | Already fixed     | Skip                          |\n| Resolved with `inRelease` in Sentry        | Already fixed     | Skip                          |\n| Has OPEN PR addressing the root cause      | Fix pending merge | Skip (or improve existing PR) |\n| No concrete fix evidence found             | Needs fix         | Fix it                        |\n\n#### Step 1.4: Deduplicate by Root Cause\n\nSentry creates separate issues for the same error across different releases or slight variations.\nGroup issues by their **root cause** (same function + same error type):\n\nExample: ELECTRON-5, ELECTRON-6X, ELECTRON-1A are all `fetchModelList` + \"Missing credentials\"\n→ Treat as **one fix group**, reference all Sentry IDs in the PR.\n\n#### Step 1.5: Get Stack Traces (Rate-Limit Aware)\n\nFor each **unique issue group**, get details **one at a time**:\n\n```\nmcp__sentry__get_issue_details(issueUrl=\"\u003Csentry-url>\")\n```\n\n**Important:** Sentry API rate limit is 5 requests\u002Fsecond. Call `get_issue_details` sequentially,\nnever in parallel. If you hit a 429, wait a moment and retry.\n\nExtract:\n\n- Error message and type\n- Event type (`event.type` — `error`, `default`, etc.)\n- Stack trace (file paths, line numbers, function names)\n- First\u002Flast seen timestamps\n- Release version(s) affected\n- Frequency and affected users count\n\n#### Step 1.5b: Attachment Analysis\n\nFor issues where `event.type` is `default` (user feedback) **or** stack traces are absent,\ncheck for attachments that may contain diagnostic information.\n\n**When to run:** After Step 1.5, for any issue group that meets either condition:\n\n- `event.type` is `default` (user feedback \u002F bug report)\n- No usable stack trace was extracted in Step 1.5\n\n**Prerequisite:** Only runs when `include_feedback=true` is set for `event.type: default` issues.\nIssues without stack traces are always eligible regardless of this flag.\n\n**Procedure:**\n\n1. **Get events for the issue** (if not already fetched):\n\n   ```\n   mcp__sentry__list_issue_events(\n     issueUrl=\"\u003Csentry-url>\",\n     limit=3\n   )\n   ```\n\n2. **List attachments** for each event:\n\n   ```\n   mcp__sentry__get_event_attachment(\n     projectSlug=\"\u003Cproject>\",\n     eventId=\"\u003CeventId>\"\n   )\n   ```\n\n3. **Download and analyze attachments by type:**\n\n   | Attachment type | Name \u002F MIME pattern             | Analysis method                                                           |\n   | --------------- | ------------------------------- | ------------------------------------------------------------------------- |\n   | Logs            | `logs.gz`, `*.log`, `*.txt`     | Download → decompress → search for error patterns, stack traces, warnings |\n   | Screenshots     | `*.png`, `*.jpg`, `screenshot*` | Download → use vision to identify UI state, error dialogs, frozen screens |\n   | Config \u002F state  | `*.json`, `*.xml`               | Download → check for misconfigurations                                    |\n\n   ```\n   mcp__sentry__get_event_attachment(\n     projectSlug=\"\u003Cproject>\",\n     eventId=\"\u003CeventId>\",\n     attachmentId=\"\u003CattachmentId>\"\n   )\n   ```\n\n4. **Extract diagnostic signals from logs:**\n   - Error \u002F Warning lines (`error`, `warn`, `fatal`, `crash`, `EPIPE`, etc.)\n   - Stack traces embedded in log output\n   - Performance indicators (memory usage, CPU spikes, event loop delays)\n   - Repeated failure patterns around the reported issue time\n\n5. **Extract signals from screenshots:**\n   - Visible error messages or dialogs\n   - UI freeze indicators (loading spinners stuck, unresponsive elements)\n   - Memory \u002F resource warnings visible in UI\n\n6. **Combine user description + attachment signals** to form a diagnosis hypothesis.\n   Pass the combined evidence to Step 1.6 for triage classification.\n\n**Rate-limit note:** Same as Step 1.5 — call attachment APIs sequentially, never in parallel.\n\n#### Step 1.6: Triage — Can We Fix It?\n\nClassify each issue group using the detailed decision flow in [references\u002Ftriage-rules.md](references\u002Ftriage-rules.md).\n\n**Quick reference — seven categories:**\n\n| Category          | Action                                                             |\n| ----------------- | ------------------------------------------------------------------ |\n| **Direct fix**    | Stack trace → our code → fix                                       |\n| **Defensive fix** | No trace, but pattern matches our code → fix with guards           |\n| **Feedback fix**  | User feedback + attachment analysis → identifiable code path → fix |\n| **Pending merge** | Open PR exists → skip or improve                                   |\n| **Already fixed** | Merged PR \u002F resolved → skip                                        |\n| **System-level**  | EPIPE, ENOSPC, EIO, uv, Chromium → skip                            |\n| **Unfixable**     | No trace, no matching code, no diagnostic attachments → skip       |\n\n**Output a triage report** (see [references\u002Freport-template.md](references\u002Freport-template.md) for format),\nthen **proceed immediately** — do not wait for user confirmation.\n\n### Phase 2: Fix Issues (Serial, One Group at a Time)\n\nPhase 2 handles two types of work:\n\n- **New fixes**: issues with no existing PR → full flow (Steps 2.1–2.7)\n- **Pending-merge fixes**: issues with an OPEN PR that needs improvement (e.g., missing tests)\n  → checkout existing branch, add tests, push update (Steps 2.1b–2.5, then 2.7)\n\nProcess all groups serially: pending-merge groups first (quick improvement), then new fixes.\n\n#### Step 2.1: Create Branch (New Fix)\n\nFor issues with **no existing PR**:\n\n```bash\ngit checkout main\ngit pull origin main\ngit checkout -b fix\u002Fsentry-\u003Cprimary-issue-shortId>\n```\n\nBranch naming: `fix\u002Fsentry-\u003CshortId>` using the highest-frequency issue in the group\n(e.g., `fix\u002Fsentry-ELECTRON-6X`).\n\n#### Step 2.1b: Checkout Existing Branch (Pending-Merge Fix)\n\nFor issues with an **existing OPEN PR** that needs improvement (e.g., missing tests):\n\n```bash\n# Get the branch name from the PR\ngh pr view \u003Cpr-number> --repo \u003Corg>\u002F\u003Crepo> --json headRefName --jq '.headRefName'\n# Checkout and sync\ngit checkout \u003Cbranch-name>\ngit pull origin \u003Cbranch-name>\n```\n\nThen skip Step 2.2 (code fix already exists) and go directly to Step 2.3 (Write Tests).\n\n#### Step 2.2: Locate and Fix Code\n\n1. Use `Glob` to find the actual file path (may differ from Sentry stack trace due to refactoring)\n2. Read the file(s) identified in the stack trace\n3. Understand the surrounding context (read neighboring code, types, callers)\n4. Implement the minimal fix:\n   - Add null\u002Fundefined guards\n   - Add try-catch for unhandled exceptions\n   - Fix incorrect type assertions\n   - Add missing error handling\n   - Fix race conditions with proper async handling\n5. **Do NOT** refactor surrounding code — fix only the reported issue\n\n#### Step 2.3: Write Tests for the Fix\n\n**Every bug fix MUST have a corresponding unit test.** This is enforced by the commit skill\nand the testing skill — do not skip it.\n\n1. Check if a test file already exists for the modified module (e.g., `utils.test.ts` for `utils.ts`)\n2. If no test file exists, create one following the [testing skill](..\u002Ftesting\u002FSKILL.md) conventions\n3. Write test(s) that:\n   - **Reproduce the bug**: a test that would have failed before the fix\n   - **Verify the fix**: the same test now passes with the fix applied\n   - Cover at least one failure path (e.g., null input, missing key, invalid URL)\n4. Run `bun run test` to confirm the new tests pass\n5. If the fix is in code that's hard to unit test (e.g., deep Electron API dependency),\n   document why in a code comment and add the closest possible test\n\n**Examples of good fix tests:**\n\n- Fix: added null check for `apiKey` → Test: call function with `undefined` apiKey, assert graceful error\n- Fix: wrapped `fs.readdir` in try-catch → Test: mock `fs.readdir` to throw EPERM, assert no crash\n- Fix: validated URL before `new URL()` → Test: pass invalid URL string, assert error response\n\n#### Step 2.4: Quality Checks\n\nRun all checks in order. **Every check must pass before proceeding to Step 2.6.**\n\n```bash\n# 1. Lint + auto-fix\nbun run lint:fix\n\n# 2. Format + auto-fix\nbun run format\n\n# 3. Type check — MUST pass\nbunx tsc --noEmit\n\n# 4. Tests — MUST pass\nbun run test\n```\n\n**i18n check** (run if any `src\u002Frenderer\u002F`, `locales\u002F`, or `src\u002Fcommon\u002Fconfig\u002Fi18n` files were modified):\n\n```bash\nbun run i18n:types\nnode scripts\u002Fcheck-i18n.js\n```\n\n- `i18n:types` must run **before** `check-i18n.js`\n- If `check-i18n.js` exits with errors → fix them before proceeding\n- If `check-i18n.js` exits with warnings only → may proceed\n\n**Final CI verification** — replicate the exact CI check locally:\n\n```bash\nprek run --from-ref origin\u002Fmain --to-ref HEAD\n```\n\n- If `prek` reports issues → fix them (run `bun run lint:fix` and `bun run format` again), then re-run `prek`\n- `prek` uses check-only commands (`lint`, `format:check`) — it will catch anything the auto-fix missed\n\n**Gate rules:**\n\n| Check      | Result | Action                                                              |\n| ---------- | ------ | ------------------------------------------------------------------- |\n| Type check | FAIL   | Fix type errors and re-run. Max 3 attempts, then **abandon issue**. |\n| Tests      | FAIL   | Adjust fix\u002Ftest and re-run. Max 3 attempts, then **abandon issue**. |\n| i18n       | FAIL   | Fix missing keys and re-run.                                        |\n| prek       | FAIL   | Fix reported issues and re-run.                                     |\n\n#### Step 2.5: Verify Fix\n\nVerification strategy depends on **which process** the error originates from:\n\n| Culprit path \u002F error origin          | Process  | Verification method |\n| ------------------------------------ | -------- | ------------------- |\n| `src\u002Fprocess\u002F`, `src\u002Findex.ts`       | main     | Unit tests only     |\n| `src\u002Fprocess\u002Fworker\u002F`                | worker   | Unit tests only     |\n| `src\u002Frenderer\u002F`, `src\u002Fcommon\u002F` (IPC) | renderer | CDP + unit tests    |\n\n- **Main \u002F Worker**: unit tests from Step 2.3 are sufficient. Mark as **verified** if tests pass.\n- **Renderer**: use CDP for live verification. See [references\u002Fcdp-verification.md](references\u002Fcdp-verification.md) for full flow.\n\n#### Step 2.6: Commit & Create PR\n\n**Do NOT invoke `\u002Fcommit` or `\u002Foss-pr`** — they may prompt for confirmation, which blocks\nthe daemon flow. Instead, commit and create the PR directly using the commands below.\n\n**Pre-flight duplicate check** (safety net, supplements triage-phase filtering):\n\n```bash\ngh pr list --repo \u003Corg>\u002F\u003Crepo> --state open --search \"\u003Cerror-keyword-or-file>\" --json number,title\ngh issue list --repo \u003Corg>\u002F\u003Crepo> --state open --search \"\u003Cerror-keyword>\" --json number,title\n```\n\nIf an existing OPEN PR\u002Fissue addresses the same root cause, **STOP** — do not create a duplicate.\nInstead, report to the user and suggest updating the existing PR if needed.\n\n1. **Commit** directly:\n\n   ```bash\n   git add \u003Cchanged-files>\n   git commit -m \"\u003Ctype>(\u003Cscope>): \u003Csubject>\"\n   ```\n\n   Follow project commit conventions: `\u003Ctype>(\u003Cscope>): \u003Csubject>` in English.\n   No AI signatures. Reference the Sentry issue IDs in the commit body if needed.\n\n2. **Push branch and create PR as Draft**:\n\n   ```bash\n   git push -u origin fix\u002Fsentry-\u003CshortId>\n\n   gh pr create --draft --title \"\u003Ctype>(\u003Cscope>): \u003Csubject>\" --body \"$(cat \u003C\u003C'EOF'\n   ## Summary\n\n   \u003C1-3 bullet points describing the fix>\n\n   ## Sentry Issues\n\n   - \u003CSentry issue ID> — \u003Cerror message> (\u003Coccurrence count> occurrences)\n\n   ## Test Plan\n\n   - [x] Unit tests pass\n   - [x] Type check passes\n   - [x] Lint and format pass\n   EOF\n   )\"\n   ```\n\n   PR title: under 70 characters, `\u003Ctype>(\u003Cscope>): \u003Cdescription>` format.\n   **NEVER add AI-generated signatures, `Generated with`, or `Co-Authored-By` lines.**\n\n3. **Mark PR Ready based on verification result:**\n\n   | Process  | Verification Result             | PR Action                                            |\n   | -------- | ------------------------------- | ---------------------------------------------------- |\n   | main     | Unit tests pass                 | `gh pr ready \u003Cpr-number>` — mark as Ready for Review |\n   | main     | Unit tests fail \u002F not writable  | Keep as Draft, add `needs-manual-review` label       |\n   | renderer | CDP pass                        | `gh pr ready \u003Cpr-number>` — mark as Ready for Review |\n   | renderer | CDP fail (3 attempts exhausted) | Keep as Draft, add `needs-manual-review` label       |\n\n   ```bash\n   # On pass (unit tests pass for main, or CDP pass for renderer):\n   gh pr ready \u003Cpr-number>\n\n   # On fail:\n   gh pr edit \u003Cpr-number> --add-label \"needs-manual-review\"\n   ```\n\n#### Step 2.7: Return to Main\n\n```bash\ngit checkout main\n```\n\nProceed to the next group.\n\n### Phase 3: Summary Report\n\nAfter all groups are processed, output a summary report.\nSee [references\u002Freport-template.md](references\u002Freport-template.md) for the exact format.\n\n#### Step 3.1: Update Skip List (Daemon Mode Only)\n\nIn daemon mode (`limit > 0`), after the summary report, update `~\u002F.aionui-fix-sentry\u002Fskip-list.json`\nwith all issues that were **skipped** in this session. This prevents the next session from\nre-analyzing the same issues.\n\n**TTL by classification:**\n\n| Classification    | TTL      | Reason                                                |\n| ----------------- | -------- | ----------------------------------------------------- |\n| system_level      | 7 days   | These never change (EPIPE, ENOSPC, EIO, uv, etc.)     |\n| already_fixed     | 48 hours | Re-check in case of regression                        |\n| feedback_no_clue  | 48 hours | User feedback with no diagnostic clues in attachments |\n| unfixable         | 24 hours | Might become fixable with new code changes            |\n| fix_pending_merge | 12 hours | PR might get merged, issue might resolve              |\n\n**Write rules:**\n\n1. Read the existing file first (preserve entries from previous sessions that haven't expired)\n2. For each skipped issue in this session, add or update its entry with the appropriate TTL\n3. For issues that were **fixed** in this session (PR created), do NOT add to skip list —\n   they should be detected as \"already fixed\" by the next session's normal triage\n4. Write the merged result back to the file\n\n**Example output:**\n\n```json\n{\n  \"ELECTRON-A7\": { \"reason\": \"system_level\", \"expires\": \"2026-04-03T03:00:00Z\", \"summary\": \"EPIPE in net.Socket\" },\n  \"ELECTRON-6X\": { \"reason\": \"already_fixed\", \"expires\": \"2026-03-29T03:00:00Z\", \"summary\": \"PR #1758 merged\" },\n  \"ELECTRON-16\": { \"reason\": \"system_level\", \"expires\": \"2026-04-03T03:00:00Z\", \"summary\": \"Electron SingletonCookie\" },\n  \"ELECTRON-X\": { \"reason\": \"fix_pending_merge\", \"expires\": \"2026-03-27T15:00:00Z\", \"summary\": \"PR #1498 open\" }\n}\n```\n\n## Configuration\n\nDefault parameters (can be overridden via skill args):\n\n| Parameter        | Default  | Description                                                        |\n| ---------------- | -------- | ------------------------------------------------------------------ |\n| threshold        | 100      | Minimum occurrence count (batch mode only)                         |\n| project          | electron | Sentry project slug                                                |\n| sort             | freq     | Sort order for issues                                              |\n| limit            | 0        | Max issues to fix per invocation (0 = unlimited, >0 = daemon mode) |\n| include_feedback | false    | Include `event.type: default` (user feedback) issues               |\n\nOverride examples:\n\n- Batch mode: `\u002Ffix-sentry threshold=50 project=electron`\n- Daemon mode: `\u002Ffix-sentry limit=1 project=electron`\n- Include user feedback: `\u002Ffix-sentry include_feedback=true`\n\n## Mandatory Rules\n\n### No AI Signature\n\n**NEVER add any AI-related signatures** to commits, PRs, or issues.\n\n### Minimal Fix Only\n\nFix the reported error. Do NOT refactor, add features, or \"improve\" surrounding code.\n\n### No Blocking Questions\n\nThe entire workflow runs end-to-end without stopping for user confirmation.\nOutput the triage report for transparency, then proceed immediately.\nThe goal is uninterrupted automation — questions block the flow.\n\n### No Duplicate PRs\n\nBefore creating a new PR\u002Fissue, always check for existing OPEN PRs addressing the same root cause.\nIf found, improve the existing PR (e.g., add missing tests) instead of creating a duplicate.\n\n### One Root Cause = One Branch = One PR\n\nGroup duplicate Sentry issues by root cause. Each unique root cause gets one branch, one GitHub issue, and one PR.\n\n### Rate Limit Awareness\n\nSentry API has a rate limit of ~5 requests\u002Fsecond. Always call `get_issue_details` sequentially, never in parallel.\n\n### Skill Changes Stay Separate\n\nDo NOT include changes to `.claude\u002Fskills\u002F` in bug-fix branches. Skill updates should go through their own branch and PR.\n",{"name":5,"description":7},"main","3c19e850e7cd377dc8b32ba3fea9becd16595524",".claude\u002Fskills\u002Ffix-sentry",0,"https:\u002F\u002Fgithub.com\u002Ffinewood2008\u002Fcentaurai-decision","https:\u002F\u002Fgithub.com\u002Ffinewood2008","Founder & CEO of Centaur AI · Humans lead, AI executes — the Centaur Loop is the smallest work unit for building AI employees.","2026-07-19 22:38:44",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add finewood2008\u002Fcentaurai-decision --skill fix-sentry",{"tool":38,"command":39},"bunx","bunx skills add finewood2008\u002Fcentaurai-decision --skill fix-sentry",{"tool":41,"command":42},"pnpm","pnpm dlx skills add finewood2008\u002Fcentaurai-decision --skill fix-sentry","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ffinewood2008\u002Fcentaurai-decision\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ffix-sentry\u002FSKILL.md",true,[46,52,56],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Fcdp-verification.md","REFERENCE","参考文档",1491,"https:\u002F\u002Fgithub.com\u002Ffinewood2008\u002Fcentaurai-decision\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ffix-sentry\u002Freferences\u002Fcdp-verification.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Freport-template.md",2276,"https:\u002F\u002Fgithub.com\u002Ffinewood2008\u002Fcentaurai-decision\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ffix-sentry\u002Freferences\u002Freport-template.md",{"path":57,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Ftriage-rules.md",6245,"https:\u002F\u002Fgithub.com\u002Ffinewood2008\u002Fcentaurai-decision\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ffix-sentry\u002Freferences\u002Ftriage-rules.md",[61,67,73,80,87,94],{"skillNo":62,"name":63,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M77RBY5HGGVSV6XACWRA1NQK","aionui-troubleshooting","https:\u002F\u002Fgithub.com\u002Ffinewood2008\u002Fcentaurai-decision\u002Fblob\u002Fmain\u002Fresources\u002Fbutler\u002Fskills\u002Faionui-troubleshooting\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M77RBV90N96AHP1KXQGRSS2M","aionui-config","https:\u002F\u002Fgithub.com\u002Ffinewood2008\u002Fcentaurai-decision\u002Fblob\u002Fmain\u002Fresources\u002Fbutler\u002Fskills\u002Faionui-config\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M77RBR054EB4FMMNN2EEHH13","testing","Testing workflow and quality standards for writing and running tests.\nUse when: (1) Writing new tests, (2) Adding a new feature that needs tests,\n(3) Modifying logic that has existing tests, (4) Before claiming a task is complete.","https:\u002F\u002Fgithub.com\u002Ffinewood2008\u002Fcentaurai-decision\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftesting\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M77RBKVHZZXCCY96ERY1QC1R","pr-verify","PR Verification & Merge: verify bot:ready-to-merge PRs with impact analysis, test supplementation, and one-click merge.\nUse when: (1) User says \"\u002Fpr-verify\", (2) User wants to verify and merge ready PRs.","https:\u002F\u002Fgithub.com\u002Ffinewood2008\u002Fcentaurai-decision\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpr-verify\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M77RBF897GD44DVE4GJTXY82","pr-ship","End-to-end PR lifecycle: create PR, wait for CI, review, fix issues, merge — all in one invocation.\nUse when: (1) User says \"\u002Fpr-ship\", (2) User wants to ship current changes as a complete PR lifecycle,\n(3) User wants to resume shepherding an existing PR.","https:\u002F\u002Fgithub.com\u002Ffinewood2008\u002Fcentaurai-decision\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpr-ship\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M77RBA6V98VM087EZJYWZRD1","pr-review","PR Code Review (Local): perform a thorough local code review with full project context.\nUse when: (1) User asks to review a PR, (2) User says \"\u002Fpr-review\", (3) User wants to review code changes before merging.","https:\u002F\u002Fgithub.com\u002Ffinewood2008\u002Fcentaurai-decision\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpr-review\u002FSKILL.md",[],[]]