pr-review-canvas
Skill này làm gì
Cho phép agent biến một pull request trên GitHub thành trang review dễ đọc, với diff có chú thích và danh sách kiểm tra. Dành cho người review muốn có hướng dẫn từng bước.
Khi nào nên dùng
- ✓Khi bạn dán liên kết pull request trên GitHub và yêu cầu review hoặc tóm tắt.
- ✓Khi bạn muốn tách các thay đổi cốt lõi khỏi file máy móc hoặc mã lặp lại.
- ✓Khi bạn muốn xem trực quan một pull request lớn.
Liên kết skill
https://github.com/cursor/plugins/blob/main/cursor-team-kit/skills/pr-review-canvas/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Hãy review giúp tôi pull request trên GitHub này và tạo một bản hướng dẫn tương tác để tôi đọc.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent lấy thông tin pull request và diff của từng file thông qua công cụ dòng lệnh gh của GitHub, đọc chúng, rồi viết một trang HTML giải thích thay đổi với các phần có chú thích và danh sách kiểm tra review.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Có cần quyền truy cập GitHub không?
Có. Skill dùng lệnh gh để lấy dữ liệu pull request, nên công cụ này cần được cài đặt sẵn.
Các file mã lặp lại được xử lý thế nào?
File máy móc hoặc mã lặp lại thường được thu gọn mặc định, để những thay đổi cốt lõi nổi bật hơn.
Skill có đăng bình luận lên GitHub không?
Skill mô tả việc tạo trang review từ dữ liệu. Skill không mô tả việc đăng bình luận lên GitHub.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 15k
- Vị trí xếp hạng
- #10940
- Giấy phép
- —
- Cập nhật
- 31/10/2026
Bình luận
- …
Thêm skill từ kho mã này
advisor
15kCho agent hỏi ý kiến một mô hình thứ hai mạnh hơn tại các điểm then chốt, như trước quyết định lớn hoặc khi bị kẹt ở lỗi, nếu bạn bật nó.
check-agent-compatibility
15kKiểm tra xem coding agent AI có khởi động, xác minh và ghi tài liệu được cho một repository không, rồi trả về một điểm tương thích và vấn đề chính.
cli-for-agents
15kDạy agent thiết kế hoặc rà soát công cụ dòng lệnh để các coding agent AI chạy được mà không cần lời nhắc, với trợ giúp rõ ràng và ví dụ.
continual-learning
15kGiữ các ghi chú AGENTS.md của bạn cập nhật bằng cách giao việc rà soát các cuộc trò chuyện trước cho một trình cập nhật bộ nhớ chuyên dụng.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.