pr-review-canvas
它能做什么
让智能体把 GitHub 拉取请求变成一个易读的审阅页面,其中包含带注释的差异和检查清单。适合希望获得逐步导览的审阅者。
适用场景
- ✓当你粘贴 GitHub 拉取请求链接,并请智能体审阅或总结的时候。
- ✓当你希望把核心改动与机械性或样板文件分开的时候。
- ✓当你想为一个较大的拉取请求做可视化导览的时候。
技能链接
https://github.com/cursor/plugins/blob/main/cursor-team-kit/skills/pr-review-canvas/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我审阅这个 GitHub 拉取请求,并做一份我能看懂的交互式导览。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体通过 gh 命令行工具获取拉取请求的详情和文件差异,阅读后生成一个 HTML 页面,用带注释的章节解释这次改动,并附上审阅检查清单。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
PR Review Canvas
Generate an interactive HTML review of a GitHub PR that reads like a peer walking you through what matters.
Workflow
1. Fetch PR data
Run these gh api calls in parallel:
gh api repos/{owner}/{repo}/pulls/{number} --jq '{title, body, user: .user.login, state, additions, deletions, changed_files, base: .base.ref, head: .head.ref}'
gh api repos/{owner}/{repo}/pulls/{number}/files --paginate --jq '.[] | {filename, status, additions, deletions, patch}'
gh api repos/{owner}/{repo}/pulls/{number}/comments --jq '.[] | {user: .user.login, body, path, line}'
2. Analyze the PR and write the body HTML
Read the diffs, understand the PR, and write the <body> content directly as HTML. You have full creative freedom -- the goal is to explain the PR clearly to a reviewer. Use whatever structure best fits the PR.
Typical structure (adapt as needed):
- Header with title, PR number, author, stats
- Summary box explaining what the PR does in plain English
- Core file sections with annotations and diffs
- Mechanical/boilerplate files collapsed by default
- Review checklist at the bottom
But you can also add:
- Pseudocode summaries for verbose code -- show the algorithm in plain English or short pseudocode, with the real diff collapsed below (use a
.bp-sectioncard labeled "Show full implementation"). Great when 150 lines of retry/backoff/error-handling code is really just "fetch with exponential backoff and circuit breaker." - Diagrams (inline SVG, mermaid via CDN, ASCII art in
<pre>) - Flowcharts showing before/after control flow
- Tables comparing old vs new behavior
- Callout boxes for warnings, questions, or gotchas
- Interactive widgets if they help
- Anything else that makes the review clearer
Pseudocode pattern example:
<div class="file-card">
<div class="file-hdr" onclick="toggle(this)">
<span class="fname">retryClient.ts</span>
<div class="fstats"><span class="pill add">+173</span><span class="pill del">−11</span><span class="chev open">▶</span></div>
</div>
<div class="file-body open">
<div class="file-note">
<strong>What this does in plain English:</strong>
<pre style="margin-top:8px;color:var(--text);font-size:12px;line-height:1.6;">
fetch(url):
if circuit breaker is open → fail fast
retry up to N times:
try fetch with timeout
on success → close circuit breaker, return
on retryable error → wait (exponential backoff + jitter)
on non-retryable error → throw
circuit breaker records failure</pre>
</div>
<div class="bp-section" style="margin:0;border:0;border-radius:0;">
<div class="bp-hdr" onclick="toggleBP(this)">
<span>Show full implementation (+173 lines)</span><span class="chev">▶</span>
</div>
<div class="bp-body"><div data-diff="retryClient"></div></div>
</div>
</div>
</div>
3. Available CSS classes and JS utilities
Read styles.css and renderer.js from this skill directory. These give you a prebuilt dark-themed toolkit. Inject them into template.html verbatim.
CSS classes you can use:
| Class | Purpose |
|---|---|
.header, .header h1, .header-meta |
Page header |
.pill.add, .pill.del, .pill.files |
Stat badges (+N, -N, N files) |
.content |
Centered content wrapper (max 900px) |
.summary |
Summary/TL;DR box |
.section-title |
Section heading with bottom border |
.ic |
Inline code reference (mono, blue, dark bg) |
.file-card, .file-hdr, .file-body |
Collapsible file card (use onclick="toggle(this)" on .file-hdr) |
.file-note |
Sticky reviewer annotation inside a file card |
.bp-section, .bp-hdr, .bp-body |
Collapsed boilerplate card (use onclick="toggleBP(this)") |
.bp-note |
Note inside a boilerplate card |
.verdict |
Review checklist box |
JS functions available:
| Function | Usage |
|---|---|
toggle(hdrElement) |
Toggle a .file-body open/closed |
toggleBP(hdrElement) |
Toggle a .bp-body open/closed |
renderDiff(target, diffInput) |
Render a unified diff. target can be a DOM element, string ID, or CSS selector. diffInput can be a raw patch string OR an array of lines -- both work. Automatically filters imports, collapses whitespace-only changes, detects moved code (blue/purple tint). |
esc(string) |
HTML-escape a string |
**Rendering diffs -- use `data-diff
常见问题
需要 GitHub 访问权限吗?
需要。它使用 gh 命令获取拉取请求数据,因此必须先设置好该工具。
样板文件怎么处理?
机械性或样板文件通常默认折叠,使核心改动更加醒目。
它会向 GitHub 发布评论吗?
该技能描述的是根据数据生成审阅页面,并没有描述向 GitHub 发布评论。
详情
作者的原始描述
Generate an interactive PR review walkthrough as an HTML page. Fetches PR data via gh API, categorizes files into core vs mechanical changes, adds reviewer annotations, and renders diffs with moved-code detection. Use when the user pastes a GitHub PR URL and asks for a review, walkthrough, or summary, or says "review this PR".
repo: cursor/plugins
热度
- GitHub 星标
- 15k
- 排名
- #10940
- 许可证
- —
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
advisor
15k如果你开启该功能,让你的智能体在关键节点咨询一个更强的第二模型,例如在重大决定之前,或在错误上卡住时。
check-agent-compatibility
15k全面检查 AI 编程智能体能否启动、验证和记录某个代码仓库,并返回一个兼容性评分以及主要问题。
cli-for-agents
15k教你的智能体设计或审查命令行工具,使 AI 智能体无需提示即可运行,并提供清晰的帮助文字和示例。
continual-learning
15k通过把回顾过往对话的工作交给专门的记忆更新程序,使你的 AGENTS.md 笔记保持最新。