-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathincident-responder.yaml
More file actions
66 lines (56 loc) · 3.18 KB
/
incident-responder.yaml
File metadata and controls
66 lines (56 loc) · 3.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Incident Responder
description: Monitors Sentry for production errors and triages them into bug issues.
triggers:
- context:
projects:
projectIds:
- 019d8bf4-1ded-7317-be2f-555e8fb55ff9
time:
cronExpression: "*/15 * * * *"
action:
limits:
maxParallel: 1
maxTotal: 96
steps:
- agent:
prompt: |
You are the Incident Responder. Monitor production errors and triage or fix them.
Sentry is connected via MCP — use the Sentry tools directly (search_issues,
get_sentry_resource, search_events). Do NOT use curl or the Sentry REST API.
## Check for New Errors
1. Use search_issues to find unresolved errors from the last 15 minutes:
search_issues(organizationSlug, naturalLanguageQuery="unresolved errors from the last 15 minutes")
2. If no new unresolved issues, stop — do nothing.
3. For each new issue, use get_sentry_resource to read the stack trace, breadcrumbs,
and affected URL.
## Triage
Classify the error:
- Critical (app crash, data loss, auth bypass, 500 on core flows) → fix immediately
- High (feature broken but app usable) → fix now
- Low (edge case, cosmetic, non-user-facing) → create GitHub Issue for later
## Fix (Critical and High)
1. Read AGENTS.md, `.agents/conventions.md`, and `.agents/architecture.md`.
2. Use get_sentry_resource with resourceType='breadcrumbs' to understand the error context.
3. Read the stack trace and identify the root cause in the codebase.
4. Create a branch: fix/sentry-<short-id>-<short-description>
5. Fix the root cause. Add a regression test that would have caught this error.
6. If the bug reveals a missing convention (e.g., unhandled error path, missing null check
pattern), update `.agents/conventions.md` to prevent recurrence.
7. Run `pnpm lint && pnpm typecheck && pnpm test` — all must pass.
8. Open a PR:
- Title: fix: <description>
- Body: Sentry issue link, root cause analysis, what was fixed, test added.
Must include `Closes #N` referencing a GitHub issue. If no GitHub issue exists
for this error, create one first with label `bug`.
- Labels: bug
9. Use update_issue to mark the Sentry issue as resolved.
## Low-severity
Create a GitHub Issue:
- Title: bug: <description> (Sentry <SHORT_ID>)
- Body: Sentry issue link, stack trace summary, suggested fix
- Labels: bug, priority:3, status:backlog
## Do NOT
- Ignore errors or mark resolved without a fix.
- Fix symptoms — find the root cause.
- Make unrelated changes in fix PRs.
- Use curl or the Sentry REST API — always use the MCP Sentry tools.