debug-with-sentry
它能做什么
这个技能利用 Sentry 的错误数据,解释为什么某些东西会让用户崩溃。适合希望在修改代码之前先理解生产错误的开发者。
适用场景
- ✓当你有一个 Sentry 链接或问题 ID,并想知道出了什么问题的时候。
- ✓当用户报告错误,你想找到其原因的时候。
- ✓当某次发布后出现崩溃,你需要知道是哪段代码造成的时候。
技能链接
https://github.com/ParadevAI/Paradev/blob/main/plugins/sentry/skills/debug-with-sentry/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“这是结账崩溃的 Sentry 链接。请在我们改动任何东西之前,从堆栈跟踪中找出根本原因。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会获取该问题及其最新事件,然后从堆栈跟踪顶部开始阅读,直到找到你自己代码中的第一个帧。它会把该文件与产生错误的发布版本进行核对,因为行号可能已经变动。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Root-cause with the evidence, not the guess
A Sentry issue is a claim about what broke. The job is to turn it into a claim about why it broke, backed by the event data, before anyone edits code.
1. Get the real issue, not the search hit
A pasted URL or short ID (PROJECT-123) goes straight to get_sentry_resource
(pass the URL, or resourceType: 'issue' with the short ID).
A described error ("users can't check out") goes through search_issues first,
but treat the results as candidates: match on the error type and the affected
code path, not on title similarity. If two issues share a message but differ in
stack trace, they are two bugs.
2. Read the stack trace like a diff
Stack traces, breadcrumbs, tag values and releases are catalog tools: find
them with search_sentry_tools, then call execute_sentry_tool with name
set to get_event_stacktrace, get_issue_breadcrumbs, get_issue_tag_values
or find_releases.
Fetch the newest event's stack trace. The top frame is where it crashed, not
where it broke — walk down until you leave library code and hit the first
frame owned by this repo. That frame and its local variables are the starting
point. Cross-check the file against the working tree: production runs a
release, and the line numbers may belong to code that has since changed.
find_releases tells you which version the events come from.
3. Use the distribution before the theory
Before proposing a cause, check what the events have in common:
- Tags (
get_issue_tag_values): one browser, one endpoint, one tenant, one release? A bug scoped to a dimension names its own trigger. - Breadcrumbs: what the user did right before. A crash after a retry storm is a different bug than the same crash on first click.
- First seen / volume: an issue that started with a release points at that release's diff. One that grew slowly points at data or traffic.
Seer (analyze_issue_with_seer) is worth running for a second opinion, but
verify its suggested cause against the frames yourself before repeating it.
4. Report cause, scope, and blast radius
The finding is three sentences: what fails, why, and who it hits (volume,
affected users, releases). Link the issue. If the user asks for a fix, fix the
frame you identified — and only then consider update_issue to assign or
resolve, never as a way to make the dashboard quiet.
Anti-patterns
- Fixing the top frame. The top frame is often a library that faithfully threw on bad input from three frames below.
- Trusting the issue title. Sentry titles are the exception message; two different bugs can share one, and grouping is heuristic.
- Reading one event. One event is an anecdote; the tag distribution is the evidence.
- Resolving without a shipped fix. A resolved issue that regresses comes back as a new-looking issue and erases its history.
常见问题
为什么不从堆栈跟踪的顶部开始?
顶部的帧是崩溃发生的位置,不一定是错误所在的位置,因此技能会向下找到你自己的代码。
它能判断两个问题是否是同一个缺陷吗?
可以。消息相同但堆栈跟踪不同的两个问题,会被视为两个不同的缺陷。
它会自动修改代码吗?
不会。它的目标是在触碰任何代码之前,用证据解释原因。
详情
作者的原始描述
Root-cause a production error with Sentry's evidence before touching code — pull the issue, read the stack trace and breadcrumbs, and separate the crash from its trigger. Use when the user pastes a Sentry link or issue ID, reports a production error, or asks why something is crashing for users.
repo: ParadevAI/Paradev
热度
- GitHub 星标
- 16k
- 排名
- #10849
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …