Back to Skills

pr-review-canvas

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".

3,899stars318forksUpdated 8/20/2026

Security Assessment

Safe(95/100)
Security Score95/100

About pr-review-canvas

pr-review-canvas generates an interactive, self-contained HTML walkthrough of a GitHub pull request that reads like a peer explaining what matters. It solves the problem of dense, hard-to-scan PR diffs by fetching the PR's metadata, changed files, and review comments through the gh API, categorizing files into core versus mechanical/boilerplate changes, adding reviewer annotations, and rendering diffs with moved-code detection so a reviewer can focus on the substantive changes first.

The skill ships a prebuilt dark-themed toolkit — a styles.css of CSS classes (headers, stat pills, collapsible file cards, sticky reviewer notes, boilerplate cards, verdict checklist) and a renderer.js of JS utilities (toggle helpers, a renderDiff function that filters imports, collapses whitespace-only changes, and tints moved code, plus an HTML-escape helper) — injected into a template.html. The assistant writes the PR body HTML with creative freedom, optionally adding plain-English pseudocode summaries for verbose code, diagrams, before/after flowcharts, and callout boxes. Notably, the skill includes careful, security-conscious guidance for safely embedding diff patch strings: because patches can contain a script-closing sequence plus newlines and quotes, it instructs saving patches to a JSON file via jq and injecting them with Unicode-escaped JSON through a small Python step so a raw patch cannot break out of an HTML script tag.

It targets developers and reviewers who want a richer, shareable review artifact than a plain diff. It is read-only with respect to the repository — it only fetches PR data via gh and produces a local HTML file — making it a benign documentation/visualization tool.

FAQ

What does this skill generate?

A single interactive HTML page reviewing a GitHub PR, with a summary, core file sections with annotations and rendered diffs, collapsed boilerplate files, and a review checklist. It reads like a peer walking a reviewer through what matters.

How does it get the PR data?

Through parallel `gh api` calls that fetch the PR metadata (title, body, author, stats, base/head refs), the changed files with their patches, and the review comments. It is read-only against the repository.

When is it triggered?

When the user pastes a GitHub PR URL and asks for a review, walkthrough, or summary, or says 'review this PR'. It has model invocation disabled by default, so it is invoked explicitly.

How does it safely embed diff patches into HTML?

It saves patches to a JSON file using jq for correct escaping, then injects the JSON into the template with Python while Unicode-escaping angle brackets and ampersands, so a patch string containing a script-closing sequence cannot terminate the HTML script tag early.

What rendering helpers are available?

A renderDiff function that renders unified diffs while filtering imports, collapsing whitespace-only changes, and detecting moved code; toggle helpers for collapsible cards; and an HTML-escape utility. These come from the skill's prebuilt styles.css and renderer.js.

All Files

4 files
renderer.js6.6 KB
View
template.html0.5 KB
View
styles.css5.7 KB
View
SKILL.md8.9 KB
View

Install pr-review-canvas

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

cursor/plugins