/projector:summarize-prfrom Projector
Summarize a GitHub pull request's changes as a guided review page, grouped in reading order, with each logical change explained, review notes on each group, file and line, and every hunk syntax-highlighted. Use when the user asks for help walking through, understanding, summarizing, or reviewing a big PR diff.
Ships in Projector. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Summarize a pull request's changes as one guided page a reviewer reads top
to bottom: the diff split into logical groups in reading order, each group
opened by what it does and why, followed by that group's files with every
hunk, and review notes on each group, file and line. This skill writes the
page's data, a summary. The Projector CLI renders it and the repository's
Projector site serves it, so your job is the judgment: the grouping, the
explanations, and the notes. Every command below is the project CLI that ships beside
this skill; install it as Projector's README describes when project is
missing. The CLI updates separately from this skill, so when project
rejects a command below as an invalid choice, run project upgrade and
retry.
Reading a pull request does not authorize changing it. Do not comment on, push to, or approve the pull request unless the user asks.
Resolve the repository (owner/name) and pull request number from the
user's request or the current checkout.
Write a skeleton summary. It records the pull request's head and lists every changed file with its line counts:
project summary init \
--repo OWNER/NAME --pr NUMBER --summary WORKDIR/summary.json
Keep WORKDIR somewhere you can reach again this session. When you will
publish to Claude Artifacts, the Artifact tool accepts files only from the
working directory or its own scratchpad directory, which the host names in
its instructions. Build WORKDIR in that scratchpad, or else under the
working directory. $TMPDIR, /tmp, and a background job's temporary
directory are outside both, and the publish refuses files from them. The
summary is what you edit when the pull request moves.
Read enough to explain the change: the pull request body, the full diff,
plan or design documents the change touches, and the review threads.
Take the diff from the summary's pr.base to its pr.head through the
compare API, the one page and publish read, which works from any
directory:
gh api -H 'Accept: application/vnd.github.diff' \
repos/OWNER/NAME/compare/PR_BASE...PR_HEAD > WORKDIR/pr.diff
In a checkout whose origin is the repository, a local diff holds the
same changes:
git fetch origin PR_BASE PR_HEAD
git diff PR_BASE PR_HEAD > WORKDIR/pr.diff
Do not read it with gh pr diff. GitHub's pull request diff endpoint
refuses a pull request that changes more than 300 files with HTTP 406,
and the compare API does not share that limit. For a large diff, delegate
the reading to subagents and keep only their conclusions. Ask each one
for what its files did before the change and do after it, in plain
words, the terms a newcomer would need defined, and the line numbers of
anything worth a note, taken from inside the diff's hunks.
Fill the summary as format.md describes, and write every piece of prose in
it for the reader that "Write for someone new to the code" below
describes. The groups decide whether the page helps:
build refuses a summary
that misses a file, repeats one, or names one that is not in the diff.context note is what to hold
in mind while reading. A verify note states an invariant you checked
and how: a test you ran, a call you traced, a mutation that failed. The
page labels it verified with no checkbox, so never write one you did
not check; an invariant you want the reader to trace is a context
note. A flag note is your own observation that needs a decision;
confirm it against the code before you write it, and say plainly what
is wrong or risky.line, and renders under
that line in the diff. A note about one file goes on that file. Only a
note that ties several files together stays on the group.collapsed says otherwise, and the page's
Files changed list keeps them in a closed list of their own. A file
the repository marks linguist-generated in .gitattributes counts as
generated, as on GitHub; format.md says how. Give the files a
reviewer must read a one-line note that says what the file is for and
what changed in it, not a list of the names it defines.Then make the two choices the site heads the pull request's stack with,
project and name. init leaves project as null, and publish
refuses it until you choose. Each summary records its own choices, and
copies no other layer's:
project list --json, and look at the plan files the diff changes.
The pull request's body and branch often name the plan. When the
change touches several plans, choose the plan it adds or the plan
whose status it changes. A plan touched only in passing, such as by a
link fix or a rename across every plan, is not the change's project.
For a pull request in a stack, choose the project this layer carries
out, which it may not edit. That is usually the project of the layer
beneath. A layer that starts the work of another plan records that
plan, and the site starts a new header there.
gh api repos/OWNER/NAME/stacks?pull_request=NUMBER lists the stack's
pull requests on GitHub. To read what a summarized layer chose, copy
its newest summary with project summary init --repo OWNER/NAME --pr LAYER --summary WORKDIR/LAYER.json --from-published and read its
project. When that request answers 404 or fails, follow
the summary's pr.basePr down the stack instead, as the site falls
back to base branches. Record the project's name as project list
gives it, such as "stack-header" or "payments/invoices", or ""
when no single plan is the subject.name to two to six words in sentence
case that name the work, such as Stack header plan or
Summary publish retry, at most 60 characters. Do not write a
sentence, and do not copy the pull request's title. When no layer
names a project, the site shows the lowest layer's name as the
stack's title, so on the bottom layer of a stack, name the work of the
whole stack as far as you know it. To change a stack's title, publish
the bottom layer's summary again.Follow the writing guide in ../writing.md when you write every intro, note
and card. Write for a reviewer who may be seeing this code and this part of
the system for the first time (§ 2), with structure (§ 4), and to the reader
(§ 5). A summary also needs these:
"<ol><li>…</li></ol>", renders as written rather than inside a
paragraph. Wrap a table in <div class="tblwrap"><table class="tbl">,
and split a long intro with an <h4>.kicker is
its one line on what the group covers. The intro's opening sentences say
what the group does and why, adding to the kicker rather than repeating
it.For example, instead of:
Pass 1 scores the typed address against the carrier record with
addrmatch(0.92); pass 2 reads the postal check.
write:
When someone saves a shipping address, the service now checks that the address can receive a delivery. The address must pass both steps:
- The typed address matches a known delivery point. The service compares the address the user typed with the carrier's records, using
addrmatch, the fuzzy matcher that already checks billing addresses.- The postal service delivers there. The service asks the postal service whether that address accepts mail.
Before you publish, reread each group intro and note as that newcomer, and check that each has the structure its content calls for. Build as often as you like, since building is how you learn that a note's line sits outside the diff, but publish only once the reread is done. Where a sentence makes sense only to someone who already knows the code, rewrite it.
project site page --summary WORKDIR/summary.json --out WORKDIR/site
page fetches the diff from GitHub's compare API for the summary's merge base
(pr.base) and head, and refuses to run when the pull request's head is no
longer the summary's pr.head, so the page never describes a diff it does not
show. The compare API is not the pull request diff endpoint and does not
share its 300-file limit, so a pull request that gh pr diff refuses still
builds without help. Pass --diff only when page itself reports that
GitHub could not serve the diff. Step 3's compare call reads the same
endpoint and has failed too then, so pass the local git diff from step 3,
taken in a checkout of the repository. The head check
still runs; only when gh cannot reach GitHub does an offline --diff build
go ahead with a warning, because it cannot tell whether the pull request
moved.
The output directory holds index.html with the data embedded, plus the
site's renderer files beside it. Opening index.html from disk works in any
browser.
Publish the summary to the repository's hidden summaries ref, where the
repository's Projector site reads it, whether that site is its GitHub Pages
site or project site serve on the user's machine. From a checkout whose
origin is the repository, or with --checkout naming one, run:
project summary publish --summary WORKDIR/summary.json
publish decides where the summary goes, and says which:
publish pushes the summary,
starts the deploy, and links the summary from the pull request. Setting
that up was the reviewed decision to host summaries there, so publish
without asking again. Get the page's URL with
project site status --repo OWNER/NAME --pr NUMBER and hand it over.publish commits the summary to this checkout's own
refs/projector/summaries and pushes nothing, so nothing on GitHub
changes. Tell the user to preview it with project site serve from that
checkout, at reviews/NUMBER/, which a server already running picks up
within seconds. Say in one sentence that the repository can host its own
summaries, pointing at the "Set up the Projector site" section of
Projector's README.Pass --local to keep the summary in the checkout even where the site is
hosted, when the user wants to preview a summary before it goes live.
Publish a Claude Artifact instead only when the user asks for one, or when
no checkout of the repository is at hand to publish from, and say which.
With Claude Artifacts, publish index.html and pass the two renderer files
through files, so the page loads them by relative path:
file_path: WORKDIR/site/index.htmlfiles: {"summary.js": "WORKDIR/site/summary.js", "summary.css": "WORKDIR/site/summary.css"}icon: code on the first publishdescription: one sentence naming the pull requestThe renderer already meets the Artifact page contract: a named <title>,
light and dark themes from tokens, scripts only from cdnjs, fonts only from
Google Fonts, and a layout that works at phone width. An artifact starts
private, and only its owner can share it, from the page's Share menu. Tell
the user that when you hand over the link.
Without Artifacts, give the user the path to WORKDIR/site/index.html.
A repository can host its own summaries. Summaries live on the hidden ref
refs/projector/summaries, which is not a branch: GitHub lists no branch
and offers no pull request for it, and clones do not fetch it. A workflow on
the default branch builds and deploys them with Projector's shared action.
publish pushes to that hidden ref only in a repository that hosts its
site, which a repository accepts by setting hosting up; anywhere else the
summary stays in the checkout, as the section above describes.
Always publish with project summary publish, run directly. Do not wrap it
in a script of your own, and do not commit to the ref or send the dispatch
yourself. The
command already builds the summary and refuses one that does not build, and a
wrapper only hides what is being written from the user and from the host's
permission checks. You do not need to build the page first; page is a
local preview.
Run project summary publish --summary WORKDIR/summary.json alone, as a tool
call of its own: not after cd, and not joined to another command with &&,
;, or |. When your shell is not in the checkout, as a subagent's shell
that returns to its start directory is not, name the checkout with
--checkout CHECKOUT instead of a cd:
project summary publish --summary WORKDIR/summary.json --checkout CHECKOUT
Do not check the repository's or the site's visibility first.
publish checks hosting itself: it pushes only where the site workflow is on
the default branch and a Pages site exists, and it keeps the summary in the
checkout when a private repository's site is public. When the repository's
own instructions require a visibility check before other writes, run that
check as a tool call of its own, and never join it to the publish. Both
Claude Code and Codex check each command of a chain against the user's
rules and take the strictest result, so one command the rules do not name,
such as gh repo view, sends the whole call, publish included, to the
host's automatic approval.
A host's automatic approval can refuse publish as sending repository content
to another host, unless the user's own settings allow it. project init, run
by a person at a terminal, adds that allow rule to their Claude Code settings
and to their Codex rules, inside a repository or outside one. When the host
refuses publish, never retry it in another form or send the summary by
another path. Work out why it was refused:
project review rules --json, which
writes nothing, and read summary_publish for the host's file,
~/.claude/settings.json for Claude Code or
~/.codex/rules/projector.rules for Codex.
false, or the file is not listed. The rule is missing. Ask the
user to run project init themselves in a terminal, then
project review rules to check it. Codex reads its rules only when a
session starts, so a Codex user starts a new session after init.
init adds the rules only for a person at a terminal, so do not run
it to add them yourself.true. A matching rule is installed, and running init again
changes nothing for this publish, even when allowed is false
because the file lacks newer rules. Do not send the user to
project init for it. A Codex session that started before the rule
was written has not loaded it, so say that a new session would. Then
ask the user to authorize the publish to the repository's site, or to
run the publish command themselves.Keep the summary in WORKDIR and report the publish as unfinished: what
refused it, and the action that would let it through. One refusal stops
only that publish. Summarize and publish the next head as usual, and when the
user authorizes the publish, check that the pull request is still open at the
head you summarized, refresh the summary if the head moved, and run the same
publish command again, alone.
publish fetches the diff once, builds the summary against it, and refuses one
that does not build. It then commits the summary and that diff to
summaries/<number>/<head>/ on the ref, as summary.json and diff.patch,
without touching the checkout, and sends a repository_dispatch event that
starts the workflow. The deploy checks out the default branch, which lacks
the head, so publish also stores the linguist-generated attributes the
head's .gitattributes gives the changed files, as attributes.json, and
the head's version of each changed file whose diff hides some of its lines,
under head/, so a reader can expand the lines around each hunk. It fetches
the head first when the checkout lacks it. Publishes that run at the same
time, as a reviewing session's subagents run them, each land. A publish whose
push loses the race for the ref fetches the ref again, rebuilds its commit on
the new tip, and pushes again, up to five pushes in all. publish fetches
the diff from the compare API, which serves pull requests past the 300-file
limit of gh pr diff, so pass --diff only when publish reports that
GitHub could not serve the diff. The file is then the local git diff from
step 3, since the compare call there fails with publish's. It must be the
diff from the summary's pr.base to its pr.head, because every later
deploy serves the stored diff as it is. Because the diff is
stored, the site deploy asks GitHub for no diff: it checks each summary against
its stored diff and writes each page's data beside it, and the page loads
that data when it opens. The deploy reports and skips any summary that still
fails, or that names another repository, so one bad summary costs one
summary rather than the deployment. The site's Reviews section lists
every summary at reviews/, serves each pull request's newest head at
reviews/<number>/ and each head at reviews/<number>/<head>/, and links the
older heads and every pull request in the same stack from each page. The
summary on the ref is the durable copy: to update a summary later, start
from it with project summary init --from-published, as "Update the page
when the pull request moves" describes, rather than from a fresh skeleton.
A summary that an older release stored there as spec.json does not
appear on the site, and the deploy reports it as skipped.
init --from-published reads a spec.json too, and publish stores the
copy as summary.json. A repository that has not published since summaries
were called walkthroughs has its summaries on refs/projector/walkthroughs,
under walkthroughs/, instead, all stored as spec.json. Its next publish
carries them over to the new ref, where they stay off the site until each is
published again.
Last, publish comments a link to the summary on the pull request, so a
reader on GitHub finds the page. The pull request keeps one such comment
per account, always as its last message: each publish posts the link
again at the end and deletes the older comment. Publishing the same head
again posts nothing while its comment is still the pull request's last
timeline item. A later review, comment, push, or ready-for-review event
makes it post the link again. publish also puts the same link at the
very bottom of the pull request's description, replacing the one an
earlier publish left there. Where the account cannot edit the
description, publish says so and keeps the comment. Pass
--no-describe to post the comment and leave the description alone,
where the repository's instructions forbid agents to edit descriptions.
Setting a repository up is once, with admin rights, and only when the user
asks for it. From a checkout whose origin is the repository, run:
project init --site
It enables Pages with the GitHub Actions source, makes a private
repository's site private, links an empty repository website to the site,
and writes .github/workflows/projector-site.yml. --site makes it fail
rather than skip the site. When it fails because the user is not an admin,
it still writes the workflow and prints the gh commands an admin runs;
relay those commands. When GitHub refuses to make a private repository's
site private, it writes no workflow; report why. Either way, offer project site serve or an Artifact meanwhile. Then add the workflow to the default branch through a
pull request, because GitHub runs dispatched workflows only from there.
The workflow calls ninjudd/projector/actions/site@v0. Pass
--action-ref to pin an exact release tag or a full commit SHA instead.
Start from the newest version of the pull request's summary, whoever
published it. Another session or account can have summarized the pull
request already, at an earlier head or at this one. From a checkout whose
origin is the repository, copy that version:
project summary init --from-published \
--repo OWNER/NAME --pr NUMBER --summary WORKDIR/summary.json
When your shell is not in the checkout, add --checkout CHECKOUT instead
of a cd, as for publish.
--from-published fetches the summaries ref and copies the summary the
site shows as the pull request's newest. A summary an earlier publish
kept in this checkout counts too, when it is newer. It also reads a summary
that an older release stored as spec.json. It names the head the copy
describes, OLD_HEAD. When it finds no summary, build one as "Build the
summary" describes instead. Write the prose and choose the groups
yourself, and let the CLI change everything else:
Bring the summary up to the pull request's current head:
project summary refresh --summary WORKDIR/summary.json
refresh sets every pr field to what GitHub reports now, and prints
each one it changes, such as pr.head: OLD_HEAD → NEW_HEAD. That
includes pr.base, the merge base the page's diff starts from, which
moves when the base branch is merged in. It puts each file new to the
diff in the unassigned group, drops each file that left the diff and
prints that file's note and checks, and lists each note whose line the
new diff no longer shows. It changes no other prose. When pr.head did
not change, the summary already describes this head: skip step 2 and
revise it in place. Pass --diff only when refresh reports that
GitHub could not serve the diff, with the local diff from the new
pr.base to pr.head, as for page.
List what changed since the summary's old head:
git log --oneline OLD_HEAD..NEW_HEAD and
git diff OLD_HEAD NEW_HEAD. A rebase makes the old head unreachable;
compare against the new merge base instead.
Read the new commits and any new review threads, then revise the prose.
Move each file in the unassigned group into the group it belongs to,
and remove that group once it is empty. Carry over what still applies of
a dropped file's prose, such as the note of a file the change renamed.
Rewrite every note, check and overview card the change made untrue.
Make the two choices at the end of step 4 of "Build the summary" again: a
summary published before summaries recorded a project has no project,
and publish refuses it until you set one, and a name must still title
the stack in at most 60 characters.
Move each note that has a line to where its code sits in the new diff,
using step 2's diff, starting with the notes refresh listed, and remove
a note whose code is gone: build checks only that a line is still in
its file's diff, not that it still holds the code the note is about.
Resolve or remove flag checks the new commits fixed.
publish the revised summary, which becomes a new version beside the old
one, pushed to a hosted site or kept in the checkout as the first time.
For an artifact the user asked for, rebuild and republish to the same
one: publish the same file path again in the conversation that created
it, or pass the artifact's URL as url after reading it from any other
conversation.
Summarize for the user what changed in the pull request and which parts of the page moved.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ninjudd/projector --plugin projector14 skills in this plugin
/artifactCreate or revise a static interactive page, visual explanation, chart, diagram, or small tool, with saved versions on the repository's Projector site. Use when the user asks to make an artifact or edit a published one. Do not use for backend applications or ordinary source-code changes./cleanupCheck that a session finished everything it was asked to do, ask what to do with anything left (do it now, open an issue for it, or leave it), release what the session holds, such as its subscriptions, inbox items, reviews, worktrees, and background processes, and confirm that the session is safe to shut down. Use when the user asks to clean up, wrap up, or shut down a session./finishVerify a Projector project's acceptance criteria, record its outcome, and mark it done in the completing change. Use when implementation appears complete or the user ends a project as shipped, abandoned, or superseded.