/agent-toolkit:refine-pr-reviewfrom Agent Toolkit
Triage a fetched PR review comment by comment, draft replies, and produce a REQUIREMENTS file for accepted code changes. Takes a PR-REVIEW file or PR URL.
Ships in Agent Toolkit. 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.
None: SKILL.md is the whole skill.
The Refine phase for review feedback: turn a .PR-REVIEW.md (from /fetch-pr-review; ask if
the path is ambiguous) into user-settled per-comment verdicts, drafted replies, and a REQUIREMENTS
file covering the accepted code changes. Triage and replies are settled here; the plan and execute
phases see only code changes.
A PR URL instead: when the harness has subagents and fetch-pr-review is available
(../fetch-pr-review/SKILL.md beside this skill), a subagent fetches it first per its
delegate.md and the file it returns is the input. Not available
→ say so and ask for the fetched file; available but no subagents → hand off
/fetch-pr-review <url> to a fresh session and stop.
A trailing head=<sha> token (fetch-pr-review's refresh hand-off) is the head a refresh just
confirmed: Phase 1's moved-head check uses it in place of the file's Head line.
Its own .PR-REVIEW.REQUIREMENTS.md instead, once a blocking answer is in: run Phase 1's checkout
and remote-head check first — a checkout differing from the ANSWERS Head, or a dirty tree, is
reported and the user decides, never a branch switch; a moved PR head is reported with the
re-fetch offer and the user decides whether to finish this round first. Verdicts, replies and
Lessons stand as its .PR-REVIEW.ANSWERS.md records them. Apply the answer: every reply whose
described change it alters is re-drafted under Phase 1's voice rule, confirmed, and updated in
place; a verdict changes only as an explicit, user-confirmed exception to Phase 2's "Scope is
settled in Phase 1"; a lesson whose source rows are no longer all accepted is put to the user; no
row affected → the ANSWERS file is not rewritten. Then Phase 2 on that file, then Next step.
Bot findings take bot: included (reply "fixed"), bot: partial (Notes say which part; the
reply names what was fixed and why the rest was not) or bot: ignored (reply: the reason, one
short factual sentence, no thanks or hedging).
Never refer to a comment by index or position, anywhere — questions, batch lists, hand-off text. Quote its opening words instead, truncated to the shortest unique prefix — the comment "the null check here misses …". Always verbatim, never translated or corrected, so the quote can be searched on the page. Only the ANSWERS table's own row numbers stay, for in-file cross-references.
The word autoaccept, in the invocation (by the user or a calling skill) or said at any point, is
the go-ahead given in advance: wherever this skill or refine-ticket would ask, show a draft or wait
for confirmation, the agent takes its own recommendation, which then counts as user-confirmed —
verdicts, replies (drafted as usual, written unshown), lessons, the existing-file question, and
non-blocking requirement gaps, written as settled requirements tagged (Autoaccept). A PR head that
moved before triage is re-fetched first by a subagent, as on the URL path; where that path would
spawn none, the re-fetch offer is still asked.
Still asked: a dirty or mismatched checkout (after any re-fetch); anything the agent is unsure of or
has no recommendation for (a comment's status, a moved head on a REQUIREMENTS input); a reply only
the author can give (their intent or plans, which the code can't show); a blocking requirement gap;
a run on shared or external state; a design decision beyond what the comments ask; a subagent's
blocked. The Next step offer still waits for the user's yes.
Before Next step, list what was decided, one line each: every verdict whose reply is not a canned
one-liner, with its comment; each verdict, reply or lesson changed on a REQUIREMENTS input; each
lesson; each (Autoaccept) requirement.
Before the first code check, compare the checkout with the PR-REVIEW head: a different commit or
branch, or a dirty tree, is reported and the user decides; never switch branches yourself. A PR
head that moved since the fetch (the remote compared with the file's Head, or with the
head=<sha> token when given) → offer a re-fetch before triage; a refresh (no new activity) keeps
the file, the checkout still compared with the current head, and a refresh the URL path's fetch
just reported needs no re-fetch. The URL path gets the same check — the subagent's fetch is seconds
old, the checkout is still the user's.
On a -N file, read the earlier rounds' ANSWERS first: a comment re-raising one already triaged
keeps its verdict and reply unless it brings evidence the earlier one lacked, and its Notes say
kept from round K, row M; a kept row's work and lessons stay with round K, never counted as
accepted below. An earlier round without ANSWERS was never triaged: its comments join this triage,
each row's Notes saying joined from round K, its status read from the latest ## Since round
block listing it. A -N file with no touched thread (a Since block only) → say there is nothing
to triage, list the status changes, write no ANSWERS or REQUIREMENTS file, print no hand-off,
stop. This round's ANSWERS file or REQUIREMENTS file already exists (and the REQUIREMENTS file is
not the input) → one question before triage, covering both: update in place (recommended —
existing rows stand, their verdicts and replies kept unless the user changes them or a comment
brings new evidence; only new or changed comments are triaged) or start over (every comment
re-triaged, both files replaced at write time). Never a second ANSWERS sheet; nothing overwritten
without this answer.
Read the code behind each comment first: verify its premise against the checkout, never judging
from the quoted hunk alone. Then form a recommendation — verdict, reasoning, and a draft reply for
every verdict but address: partial, push back, and a no action reply that answers or explains, a
courtesy reply on an outdated thread included. Before the first such draft in a round (even one
with no partial or push-back row), actually invoke use-conversational-language (Developer
conversations, author replies) and follow it; reciting its rules from memory does not count.
Not installed: plain prose, no dashes and no AI tells. Every reply other than address's canned
one-liner is shown to the user before it is written. Nothing is decided silently, and every
question to the user is worded via explain-in-simple-language when available, the draft reply it
carries excepted:
no action item with its draft reply, for a single confirmation; the user can pull any item out
for individual discussion.Per comment type:
(author) comment → no action unless it carries an ask worth tracking.human reply is
triaged as a human thread, the reply addressed to that person.Phase 1 is complete only when every comment in the PR-REVIEW file has a user-confirmed verdict. Write the ANSWERS file now, before Phase 2.
Treat the accepted work (address, the accepted part of each partial and bot: partial, and included bot findings) as a settled-scope ticket and follow /refine-ticket (load and follow its SKILL.md): code verification, blocking vs non-blocking, the REQUIREMENTS structure, location and naming — all as written, with these overrides:
1234-task.PR-REVIEW.md → 1234-task.PR-REVIEW.REQUIREMENTS.md); later review rounds carry
their suffix through (…PR-REVIEW-2.REQUIREMENTS.md).path:line (threadless: its
Location label), e.g. ("Validate both new option arguments", install.sh:88) — never a row
number.When nothing is accepted (no address, partial, bot: included or bot: partial), skip this phase: no REQUIREMENTS file, nothing to plan or execute.
<input name>.ANSWERS.md next to the input (1234-task.PR-REVIEW.md →
1234-task.PR-REVIEW.ANSWERS.md) — the user's copy-paste sheet and the durable record of what was
pushed back. Header: # Answers: <PR title>, then > **Source** [<PR id>](<url>),
> **Head** <sha> (the head the verdicts were settled against), > **Triaged** YYYY-MM-DD; round
and requirements file follow from the file name. Then one table row per comment, resolved and bot
rows included for completeness:
| # | Original comment | Location | Verdict | Reply | Notes |
path:line as the readable
label; a reply goes inside its thread, never as a top-level comment. A review summary or general
comment has no thread: labelled review summary or general comment, linked to its permalink
when the fetch has one, its reply a top-level comment quoting the ask.address / partial / push back / no action, or resolved earlier /
bot: included / bot: partial / bot: ignored.## Reply <row #>
heading that opens with the original comment quoted in full as a blockquote, so each reply is
checkable against its question without scrolling back to the table.During Phase 1, note accepted comments (address, the accepted part of partial, bot: included, bot:
partial) whose lesson generalizes — would a fresh agent on another task here plausibly repeat the
mistake? A one-off slip fails; a convention or recurring pattern passes. After Phase 2, present
them as one batch for the user to strike or add to, each phrased as the general rule, not the
incident ("Mock external HTTP in unit tests", not "the null check on line 42"). Append the
survivors as a ## Lessons section at the end of the ANSWERS file, one line each with its source
row numbers; none → no section.
State the output paths (project-relative). Remind the user the ANSWERS file is theirs to post
manually once the fixes land. No REQUIREMENTS file → no hand-off block, only that reminder (and
the self-improve subagent or line below when Lessons were written). While the REQUIREMENTS file
holds a blocking Open questions entry, print no execute or plan command and no subagent offer,
only who must answer it and the command for once the answer is in:
/refine-pr-review <requirements-file>. Otherwise hand off by the size of the accepted change set,
leading with your recommendation, then each option as its own fenced block under the label quoted
below, holding the bare prompt. The recommendation names only options printed below: without
create-implementation-plan, a substantial change set is recommended to harden first (when
available), else to execute directly. A skill is available when the agent's skills or plugin dirs
hold it: manual-only skills are missing from the in-session list. One line before any block printed
below says to run one in a fresh session or after clearing this one (/clear is only the example).
When the harness has subagents and at least one subagent below applies, lead with one short
sentence offering to spawn them now, in this session, with autoaccept, naming what each would do,
that it applies its own recommended choices without showing diffs, asking only on a choice that
would reshape the change, and that the self-improve one waits for the execute one ("Recommended: I
spawn subagents to apply and run validation, then persist the 2 lessons; they
pick on their own, without diffs, and stop only on a design or scope decision. Yes, or pick
one."); nothing is spawned before the yes, and the line before the blocks then starts "Or". On the
yes, spawn each as one subagent briefed with nothing else from the session:
blocked; read-only git; apply the file,
then run the project's validation (lint, tests, build); inside the accepted scope take your own
recommended choice, and stop before any choice that would reshape the change (a design decision,
scope beyond the file) or a validation failure outside that scope. Report only done with the
files changed and the validation result, or blocked with what was already applied, the
decision, its candidate answers and your pick with why; no hand-off text./self-improve is available, per
its delegate.md on the ANSWERS file's ## Lessons section, every
lesson in one brief, whatever the change set's size. Spawned after the execute subagent has
finished — its done, or the user's answer to its blocked stopping it — when one was spawned,
else at once; the yes to the offer covers that later spawn. A REQUIREMENTS file whose changes no
execute subagent finished applying (none spawned, or one stopped) means they go to a separate
session:
say, when announcing this spawn, that the execute session is to start after its report, since
both may edit the same file.blocked → put the decision to the user as one question, recommending the subagent's pick, and
relaunch with the answer added to the brief — the execute subagent on the tree as it left it, told
what it already applied, or, the user declining the relaunch, stopped there with nothing more
applied and the execute block re-shown with the report's applied list and the open decision added
to its prompt; the self-improve one per its delegate.md. Show each report as returned, then the
ANSWERS reminder; fidelity is the subagent's job — never re-run validation or re-read its edits to
check.
"Apply the changes, for a small mechanical change set:"
Apply <requirements-file>, then run the project's validation (lint, tests, build)
/create-implementation-plan available — "or plan first, for cross-file rework or design
decisions:"
/create-implementation-plan <requirements-file>
/harden-artifact available — "or harden the requirements first, recommended for a substantial
change set:"
/harden-artifact <requirements-file>
Lessons written and /self-improve available — "Persist the lessons:", or, under an execute block
above, "Then, once the changes are applied, persist the lessons:", since a mechanical lesson may
edit a lint config or CI job the execution also touches:
/self-improve Persist the lessons listed under Lessons in <answers-file>
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
31 skills in this plugin
/agentify-projectMake a project agent-ready by converging it toward a canonical agent-neutral structure. Re-runnable, and doubles as an audit./attach-to-ticketAttach pasted images, files or URLs to a fetched ticket, saved beside its ticket file and referenced from it, or fill an attachment the fetch could not download. Local only — never queries or edits the tracker./check-ticket-implementationCheck how much of a ticket is already implemented and save a per-requirement status report.npx claudepluginhub eai-org/agent-toolkit --plugin agent-toolkitOther plugins' skills for the same job