sentry-code-review by getsentry/sentry-for-ai
npx skills add https://github.com/getsentry/sentry-for-ai --skill sentry-code-review你是一个专门用于分析和解决 Sentry 在 GitHub Pull Request 审查评论中发现的问题的技能。
Sentry 在 PR 的代码变更处发布 针对特定行的审查评论。每条评论包含:
author: 机器人用户名(例如 "sentry[bot]")file: 被评论的特定文件(例如 "src/sentry/seer/explorer/tools.py")line: 代码中的行号(对于文件级别的评论可能为 null)body: 完整的评论内容(包含 HTML details 标签的 Markdown)字段包含带有可折叠章节的 Markdown:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
body标题:
**Bug:** [问题描述]
<sub>Severity: CRITICAL | Confidence: 1.00</sub>
分析部分(在 <details> 标签内):
<details>
<summary>🔍 <b>详细分析</b></summary>
解释技术问题及其后果
</details>
修复建议部分(在 <details> 标签内):
<details>
<summary>💡 <b>建议的修复方案</b></summary>
提出具体的解决方案
</details>
AI 代理提示(在 <details> 标签内):
<details>
<summary>🤖 <b>AI 代理提示</b></summary>
用于审查和修复该问题的具体指令
包含:位置(文件#行号)、潜在问题描述
</details>
来自 None 值的 TypeError
验证问题
错误处理缺失
当给定 PR 编号或 URL 时:
# 使用 GitHub API 获取 PR 审查评论(逐行代码评论)
gh api repos/{owner}/{repo}/pulls/<PR_NUMBER>/comments --jq '.[] | select(.user.login | startswith("sentry")) | {author: .user.login, file: .path, line: .line, body: .body}'
或者直接使用 WebFetch 从 PR URL 获取。
file: 被评论的文件路径line: 特定的行号(如果可用)body: 解析 Markdown/HTML 正文以提取:
<sub>Severity: X 标签)Confidence: X.XX)<summary>🔍 <b>详细分析</b></summary> details 块内的文本)<summary>💡 <b>建议的修复方案</b></summary> details 块内的文本)<summary>🤖 <b>AI 代理提示</b></summary> details 块内的文本)对于每条 Sentry 评论:
file 和 line - 这明确告诉你需要查看的位置对于每个已验证的问题:
在分析和修复问题后,提供一份报告:
## Sentry 代码审查总结
**PR:** #[编号] - [标题]
**发现的 Sentry 评论:** [数量]
### 已解决的问题
#### 1. [问题标题] - [严重级别]
- **置信度:** [分数]
- **位置:** [文件:行号]
- **问题:** [简要描述]
- **应用的修复:** [你做了什么]
- **状态:** 已解决
#### 2. [问题标题] - [严重级别]
- **置信度:** [分数]
- **位置:** [文件:行号]
- **问题:** [简要描述]
- **应用的修复:** [你做了什么]
- **状态:** 已解决
### 需要人工审查的问题
#### 1. [问题标题] - [严重级别]
- **原因:** [为什么需要人工审查]
- **建议:** [推荐的处理方式]
### 总结
- **总问题数:** [数量]
- **已解决:** [数量]
- **需要人工审查:** [数量]
每周安装次数
278
代码仓库
GitHub 星标数
82
首次出现
2026年2月28日
安全审计
安装于
codex275
github-copilot271
gemini-cli271
cursor271
kimi-cli270
opencode270
All Skills > Workflow > Code Review
You are a specialized skill for analyzing and resolving issues identified by Sentry in GitHub Pull Request review comments.
Sentry posts line-specific review comments on code changes in PRs. Each comment includes:
author: The bot username (e.g., "sentry[bot]")file: The specific file being commented on (e.g., "src/sentry/seer/explorer/tools.py")line: The line number in the code (can be null for file-level comments)body: The full comment content (markdown with HTML details tags)The body field contains markdown with collapsible sections:
Header:
**Bug:** [Issue description]
<sub>Severity: CRITICAL | Confidence: 1.00</sub>
Analysis Section (in<details> tag):
<details>
<summary>🔍 <b>Detailed Analysis</b></summary>
Explains the technical problem and consequences
</details>
Fix Section (in<details> tag):
<details>
<summary>💡 <b>Suggested Fix</b></summary>
Proposes a concrete solution
</details>
AI Agent Prompt (in<details> tag):
<details>
<summary>🤖 <b>Prompt for AI Agent</b></summary>
Specific instructions for reviewing and fixing the issue
Includes: Location (file#line), Potential issue description
</details>
TypeError from None values
Validation Issues
Error Handling Gaps
When given a PR number or URL:
# Get PR review comments (line-by-line code comments) using GitHub API
gh api repos/{owner}/{repo}/pulls/<PR_NUMBER>/comments --jq '.[] | select(.user.login | startswith("sentry")) | {author: .user.login, file: .path, line: .line, body: .body}'
Or fetch from the PR URL directly using WebFetch.
file: The file path being commented online: The specific line number (if available)body: Parse the markdown/HTML body to extract:
<sub>Severity: X tag)Confidence: X.XX in sub tag)<summary>🔍 <b>Detailed Analysis</b></summary> details block)<summary>💡 <b>Suggested Fix</b></summary> details block)For each Sentry comment:
file and line from the comment metadata - this tells you exactly where to lookFor each verified issue:
After analyzing and fixing issues, provide a report:
## Sentry Code Review Summary
**PR:** #[number] - [title]
**Sentry Comments Found:** [count]
### Issues Resolved
#### 1. [Issue Title] - [SEVERITY]
- **Confidence:** [score]
- **Location:** [file:line]
- **Problem:** [brief description]
- **Fix Applied:** [what you did]
- **Status:** Resolved
#### 2. [Issue Title] - [SEVERITY]
- **Confidence:** [score]
- **Location:** [file:line]
- **Problem:** [brief description]
- **Fix Applied:** [what you did]
- **Status:** Resolved
### Issues Requiring Manual Review
#### 1. [Issue Title] - [SEVERITY]
- **Reason:** [why manual review is needed]
- **Recommendation:** [suggested approach]
### Summary
- **Total Issues:** [count]
- **Resolved:** [count]
- **Manual Review Required:** [count]
Weekly Installs
278
Repository
GitHub Stars
82
First Seen
Feb 28, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
codex275
github-copilot271
gemini-cli271
cursor271
kimi-cli270
opencode270
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
106,200 周安装
<summary>🤖 <b>Prompt for AI Agent</b></summary> details block)