pr-analysis
Skill3 starsChanged 34 days agoMITView on GitHub
Create an interactive, single-file HTML report that explains what a pull request changes and why, block by block with live syntax-colored diffs that show changed lines with expandable context, findings, verification, follow-ups, a theme toggle, a text size control, a color palette switch, and a color vision deficiency palette. Use this whenever the user invokes /pr-analysis, asks for a PR report, PR explainer, PR walkthrough, PR summary page, "explain this PR as a page", "HTML report for PR 123", "help my team understand this PR", or wants a shareable document about a pull request, even if they do not say "report" or "HTML". Do not use it to post review comments on GitHub, that is what code-review does.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- jokob-sk/NetAlertXtheir own version, first seen Nov 1, 2026
- netalertx/NetAlertXtheir own version, first seen Nov 1, 2026
- harness/harness-skillstheir own version, first seen Nov 1, 2026
- kaeawc/auto-mobiletheir own version, first seen Oct 8, 2026
- The-Resonance-Team/skillstheir own version, first seen Sep 3, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- jokob-sk/NetAlertX★ 7.4ksame name
- netalertx/NetAlertX★ 7.4ksame name
- harness/harness-skills★ 127same name
- kaeawc/auto-mobile★ 56same name
- The-Resonance-Team/skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- 2020-hindsight-scalaSkill
- centralize-ai-outputSkill
- gen-motion-graphicsSkill
- riper-5Skill
- setup-metals-mcpSkill
- setup-serena-mcpSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. 0 are common, 8 are distinctive, and 9 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 24
Call AskUserQuestion exactly once, before reading any file or running any command.
- Distinctive: line 31
Do not ask about language.
- Distinctive: line 35
Run from the repository root:
- Very specific: line 43
Write the references answer to <workdir>/references.txt so the check script can allow links to those hosts.
- Distinctive: line 56
If the user's prompt names a location, use it and do not ask.
- Very specific: line 60
If central_error is set, show it to the user.
- Very specific: line 63
When central is chosen, run sh <skill>/scripts/ai-output-dir.sh once before the first write.
- Very specific: line 69
Before embedding anything, scan the changed files for credentials.
- Very specific: line 77
Write <workdir>/content/manifest.json and the fragment files described in references/manifest-schema.md.
- Distinctive: line 116
Do not publish to Claude Artifacts, Codex Sites, Gemini Canvas or any external service unless explicitly requested.
- Distinctive: line 117
Do not edit the generated HTML by hand.
- Very specific: line 118
Do not hard code organisation hosts, repository names, or ticket systems.
- Distinctive: line 119
Do not write email addresses, full names, or anything that looks like a credential into the page.
- Very specific: line 120
Do not assume HEAD~1, the local branch, or the working tree is the PR.
- Distinctive: line 121
Do not present figures from the PR description as measured.
- Very specific: line 122
Do not load design skills at runtime.
- Distinctive: line 123
Do not vendor the highlighter into the skill folder or the repository.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
pr-analysis
Build one self-contained HTML page that lets someone who did not write a pull request understand it: what changed, why it had to change that way, what was verified, and what is left. The page carries the diffs themselves, computed in the browser from the embedded before and after text, so it stays truthful and works offline.
The engine (layout, diff viewer, theme, accessibility) is a bundled template. Node scripts gather the data, assemble the page, and check it. Your work is the analysis and the words: findings, grouping, headings, verification, follow-ups, palette. You never write the HTML page by hand.
0. Parse the arguments
The text after /pr-analysis is the argument string (the harness substitutes it into this skill as $ARGUMENTS). It may contain, in any order:
--helporhelp: printreferences/help.mdverbatim (the fenced block, without the fence) and stop. Make no other tool call.- A PR identifier: a bare integer (
123),#123, or a PR URL. bilingual=<Language>optionally followed byshoworhide. The language is the token after=up to the next space. The mode isbothwhen the words after the language containshoworboth, otherwisehidden. Sobilingual=Koreanalone andbilingual=Korean hideare hidden,bilingual=Korean showis both, and the oldershow bothandhidden with the paramresolve by the same rule. Map the language name to a code with the table inreferences/writing-rules.md. Unknown name: use the lowercased name as the code and say so at the end.
Without bilingual= the report is English only. Examples: /pr-analysis 70, /pr-analysis 70 bilingual=Korean show, /pr-analysis #70 bilingual=Korean hide, /pr-analysis #70 bilingual=Korean (hidden, same as hide).
1. Intake, before anything else
Call AskUserQuestion exactly once, before reading any file or running any command. The user asked for this order so no analysis tokens are spent before they have confirmed the inputs. Ask up to four questions:
- PR (only when no PR identifier was given): options "PR of the current branch" (resolved with
gh pr viewand no number) and "Most recently updated open PR in this repository" (gh pr list --limit 1 --json number). The user can type a number or URL as Other. - Issue: options "Detect from the PR" (branch name, title, and body are scanned for
ABC-123or#123, falling back tono-ticket) and "None". Other acceptsABC-123,123,#123, orissue-123. - Color, asked as "Which color palette should the report use?": options "Default (Solarized Light / Atom One Dark)" (the
solarized-one-darktheme fromassets/themes.json) and "Pick a pastel for me" (a random pastel fromreferences/design-rules.md, never the theme). Other accepts a brief such as "blue controls on a mild solarized-light yellow ground". - References: option "None". Other accepts file paths, URLs, repository paths, and notes. These are read during analysis and any question they raise gets its own section.
Do not ask about language. The arguments decide it. The output location is the only later question, in step 3.
2. Gather
Run from the repository root:
node <skill>/scripts/gather.mjs --pr <N> --out <workdir><skill> is this skill's directory. <workdir> is <scratchpad>/pr-analysis/pr-<N>/ when the session has a scratchpad directory, otherwise $TMPDIR/pr-analysis/<repo>-pr-<N>/. The script fetches the PR's base and head, computes the merge-base (the same point GitHub compares against, never HEAD~1), writes every changed file at both commits, the patch, the commit messages, and meta.json. It records authors by login only. If it prints a WARNING about local state, keep it for the completion message. The local working tree is never the source of the report.
Write the references answer to <workdir>/references.txt so the check script can allow links to those hosts.
3. Resolve the issue ID and output path
- Detected or typed Jira style key (
ABC-123): folderABC-123, upper-cased. Link to<jiraBase>/browse/<KEY>whenmeta.jiraBaseor a/browse/URL in the references gives a base, otherwise unlinked. - Digits,
#N, orissue-N: folderissue-N, linked to<repoUrl>/issues/N. - Nothing: folder
no-ticket. - Anything else typed: keep it after replacing characters outside
[A-Za-z0-9._-]with-.
Output path, always: <output>/docs/pr/<folder>/pr-<N>-report.html. <skill> is this skill's directory. Say the resolved absolute path before continuing.
Choose <output> once per session, before the first file is written:
- If the user's prompt names a location, use it and do not ask.
- Else run
sh <skill>/scripts/ai-output-choices.shfrom the project folder. Do not check the folders yourself. It printskey=valuelines:centralis the central folder,${AI_AGENT_OUTPUT_DIR:-~/.ai}/<project key>. The key is<host>/<owner>/<repo>from the Git remote, orlocal/<project folder name>-<hash of the absolute project path>when there is no remote or no Git repository.projectis.aiin the project root.ask=nomeans that.aiis a symbolic link to the central folder. Useuseand do not ask.- If
central_erroris set, show it to the user. The central folder is not an option then.
- Else ask "Where should the PR report be stored?", with a choice prompt if the agent has one. Show the options in the
orderfrom the script:central,projectandother("Other": a folder that the user types). Each option shows its absolute path, and says whether the folder exists already (central_exists,project_exists). Mark the option named byrecommendedwith "(Recommended)". Whenrecommended=none, mark none. For "Other", expand a leading~, a relative path is relative to the current folder, and say the resulting absolute path. - If the user chooses
project, tell the user how to move it to the central folder later: run/centralize-ai-outputif that skill is installed, or run themigratecommand from the project root (a dry run) and then the same command with--apply. Do not run them yourself, and do not offer the migration again. - When
centralis chosen, runsh <skill>/scripts/ai-output-dir.shonce before the first write. It creates the folder and its.project-info. If a sandbox blocks a write, tell the user to allow writes to that folder (sh <skill>/scripts/ai-output-dir.sh --rootprints the central root).
4. Read the change
Read <workdir>/diff.patch, then each changed file's before and after (files/<i>.before, files/<i>.after), then the PR body in meta.json and the commit messages in commits/. Read enough surrounding code in the repository to explain why each change was made, not only what changed. Read the user's references: local files with Read, URLs with WebFetch when available, repositories by path. Do not read files unrelated to the change.
Before embedding anything, scan the changed files for credentials. references/writing-rules.md says how to redact.
5. Design the content
Follow references/content-spec.md. Decide, in this order: the kinds (two to four categories with a tone and a glyph), the findings, the grouping of files into blocks and groups, which optional sections earn their place (mechanism figure, quoted PR figures, extra sections for reference questions) and whether any finding, group, or block earns a figure (read references/figures.md only when one does), the verification rows, the follow-ups, and the stat tiles. Then pick the palette (solarized-one-dark for the default theme, a name from assets/palettes.json for a pastel, or four values from a color brief) and the font pairing per references/design-rules.md.
6. Write the manifest and fragments
Write <workdir>/content/manifest.json and the fragment files described in references/manifest-schema.md. Every visible string follows references/writing-rules.md and references/accessibility.md. In bilingual mode every English element has a second-language twin. In English-only mode no element carries class="l2".
7. Build
node <skill>/scripts/build.mjs --work <workdir> --template <skill>/assets/template.html --out <output path>The build validates the manifest, escapes and embeds the file text, generates the table of contents, blocks, and commits section, and fills the template. It fails loudly on a missing fragment, an unknown kind, or an anchor without a target.
The build reads assets/palettes.json and assets/themes.json next to the template and embeds the named palettes and themes in the page for the palette switch. The output never references either file.
The build also downloads highlight.js and the grammars the PR's file types need into ~/.cache/pr-analysis on first use, verifies them against pinned checksums, and inlines them. Terraform files use the third-party highlightjs-terraform grammar, pinned by commit. When the download fails it prints a WARNING and builds without syntax colors. Keep that warning for the completion message. Never add the library to the skill.
8. Check
node <skill>/scripts/check.mjs --work <workdir> --html <output path>Fix every FAIL by editing the manifest or fragments and rebuilding. Read every WARN and decide: expand an acronym, remove a semicolon, or leave it when it is a quoted string or an identifier, and say why in the completion message. Never edit the output HTML directly.
9. Look once
If open or a headless Chrome is available, render the page once and glance at it: header, one diff block, the theme toggle. One pass of fixes through the fragments, rebuild, then stop. Do not loop on screenshots. When headless Chrome does not exit in a sandbox, pass --host-resolver-rules="MAP * ~NOTFOUND" so the font stylesheet fails fast, and avoid #fragment URLs, which render blank in headless mode.
10. Finish
Report, in this order:
- The absolute output path, a markdown link to it with the absolute path (opens in the editor), and a
file://link (opens in the browser). For hidden bilingual mode add the samefile://link with?lang=<code>. - One sentence on what the page contains (blocks, groups, findings, extra sections).
- Which palette (theme or pastel name, or custom from the brief) and font pairing you used.
- Any warnings: local state from gather, an unknown language code, redactions, syntax colors off and why, WARN lines left standing and why.
Nothing is committed, pushed, or published.
What not to do
- Do not publish to Claude Artifacts, Codex Sites, Gemini Canvas or any external service unless explicitly requested. The deliverable is the local HTML file.
- Do not edit the generated HTML by hand. The manifest and fragments are the source, the build is the only writer.
- Do not hard code organisation hosts, repository names, or ticket systems. Everything comes from
meta.json, the manifest, or the user's references. - Do not write email addresses, full names, or anything that looks like a credential into the page.
- Do not assume
HEAD~1, the local branch, or the working tree is the PR. The PR is base merge-base to head, as gathered. - Do not present figures from the PR description as measured. Quote them and label them.
- Do not load design skills at runtime.
references/design-rules.mdcarries what matters here. - Do not vendor the highlighter into the skill folder or the repository. The build fetches it into the cache.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

