/amag-pr-respond:amag-pr-respond <PR-URL> | <PR-id> <repo-slug> | <TICKET-KEY> [finding numbers] | (nothing — infer from the current worktree's branch)from amag-pr-respond
Use when addressing review feedback on your own work — reviewer comments on a Bitbucket PR you authored, or the saved findings of a local amag-pr-review of a ticket worktree. Triggers — "address the comments on my PR", "respond to the review feedback", "fix what the reviewer found", "work through the review findings for SYM-1234". SKIP for: reviewing someone else's PR (amag-pr-review), reviewing uncommitted local changes (/code-review).
Ships in amag-pr-respond. 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; scripts run unread.
Fetch the unaddressed reviewer comments on a PR you authored, investigate each one against the real code in its worktree, fix the ones that are right, push back on the ones that aren't — then, after one human review pause, push and reply in-thread to every comment. Finally, feed each real defect the reviewer caught back into amag-pr-review's checklists so the next automated review catches its kind.
The arguments are: $ARGUMENTS
Local mode: when the argument is a ticket key (SYM-1234, any case) or a path under
C:\repos\ticket-work, optionally followed by finding numbers, there's no PR: the feedback is the
review-findings.json a local amag-pr-review saved in that ticket folder. Read
local-mode.md and follow it instead of steps 1–4 and 6–10; the Prerequisites don't
apply. Anything else is PR mode, below.
REQUIRED SUB-SKILL: superpowers:receiving-code-review governs step 5 — verify every claim against the code before implementing or rebutting; no performative agreement, no blind fixes.
**Nothing about the PR leaves the machine before the pause is approved.** No push of the source branch, no reply, no thread resolve until the user has seen the step-8 review table and said go. Commits are local and fine; everything outward waits. This gate has no exceptions — not for a one-line fix, not for "the reviewer is obviously right", not because the session is about to compact. Its scope is the PR: amag-pr-review's own repo is outside it, and step 7 pushes the retro there.BITBUCKET_USERNAME (Atlassian email) + BITBUCKET_PASSWORD (scoped API
token: read:repository, read:pullrequest, write:pullrequest) in the environment, or configured on
the bitbucket MCP server in ~/.claude.json. The helper script finds either. Without them,
stop at step 1 and tell the user what to configure. Gotcha: User-scope env vars set after this
session started aren't visible to it — check
[Environment]::GetEnvironmentVariable('BITBUCKET_USERNAME','User') before declaring them
missing; if set there, inject them per-call from the registry or have the user restart.mcp__bitbucket__* tools when the session has them, else
node scripts/bb.mjs get <path> (paginates automatically). Replies ALWAYS go through
node scripts/bb.mjs reply — the MCP comment tool cannot thread.workspace, repo_slug, pr_idhttps://bitbucket.org/<workspace>/<repo_slug>/pull-requests/<id>/....<id> <repo-slug> arguments: workspace comes from the repo's git remote, never assumed.git branch --show-current) and find the open
PR whose source branch matches: repositories/<ws>/<slug>/pullrequests?state=OPEN. Zero or
several matches → stop and ask.repositories/<ws>/<slug>/pullrequests/<id>/comments (helper merges pages).Keep a comment when ALL hold; record file + line (inline.path, inline.to/inline.from) or mark
it PR-level:
deleted, not authored by the userZero actionable comments → report that and stop; do not invent work.
C:/repos/ticket-work for the one whose checked-out branch equals the
PR source branch (git -C <dir> branch --show-current).git status; the user decides (it may be their
in-progress work — never stash or discard it).git fetch and fast-forward to origin/<source-branch> if behind.Build the whole picture first, once: read the PR description and skim the branch's commit
subjects (git log --format='%s' origin/<destination>..origin/<source>) so every comment is judged
against what the change is trying to do, not just its own text — "this looks redundant" is only
answerable knowing what an earlier commit on the branch established. Intent context decides which
reading of an ambiguous comment is live; it never substitutes for evidence. The verdict is still
earned from the code, and adopting the author's framing uncritically is the same failure as adopting
the reviewer's.
Apply superpowers:receiving-code-review per comment, reading the actual code (not just the diff hunk): callers, error paths, the thing the reviewer claims.
Fan out with 4+ actionable comments (below that, investigate inline). First gauge each comment's blast radius — which files and subsystem its claim actually touches — and dispatch one read-only agent per CLUSTER: comments anchored in the same file or plausibly sharing a root cause ride together, so that code is read once instead of once per comment; independent areas get their own agents, in parallel. Each agent gets its cluster's comments (author, file, line, text), the PR's branches, the worktree path, and the intent context above (PR description + commit subjects), and returns a verdict PER COMMENT, the evidence as file:line references with the load-bearing lines quoted, and a fix sketch. Agents NEVER edit, commit, or post — investigation only; a verdict whose quoted evidence doesn't check out when you open the file is re-investigated, not trusted. The session then merges overlapping verdicts across clusters (two comments, one root cause → one fix, both replies cite the same commit) and does every edit itself in step 6 — parallel edits to one worktree race, and the HARD-GATE belongs to the session, not to agents.
Verdict is one of:
| Verdict | Meaning | Action |
|---|---|---|
| fix | Reviewer is right | Implement in step 6 |
| push-back | Code is correct as-is | Draft a reply citing the evidence (file:line, behavior) |
| clarify | Comment ambiguous / can't verify | Draft a reply asking the specific question |
Every kept comment gets a verdict and a draft reply. None are silently dropped.
Each verdict also gets a confidence, shown in the terminal table and not posted: high = traced in the code; medium = the evidence is in the code but the outcome rests on something unconfirmed (runtime config, a caller outside the worktree, library behaviour); low = plausible, not confirmed.
A comment asking for a test is judged by risk (the risk lists in the guidelines file of step 6): fix when the untested behaviour is a risk, push-back when it isn't, naming why ("label text, visible on the page; a test would only restate it").
Misreading is a smell, not just a push-back. When a reviewer misunderstood correct code, first ask whether the code invited the misreading — if a rename, an extracted variable, or a why comment would have prevented it, the verdict is fix (make the code clearer) even though the logic was right. Clarify the code, not the comment thread: the thread helps one reviewer once; the code helps every future reader.
references/engineering-guidelines.md under TQ = ticket-quest's installed skill directory (the
most recently modified ~/.claude/plugins/cache/*/ticket-quest/*/skills/ticket-quest). Every fix
follows them: the behaviour baseline and impact list for the code it touches, risk-based testing
(a fix that touches a risk gets a test that would fail without it; a no-risk fix gets none), no
debug code, regenerated artifacts reverted, helper scripts kept out of the repo. Its worktree,
Jira and handover steps don't apply. Not installed → say so in the pause table and go on.git log --oneline -10), includes the ticket key when the branch
carries one, and describes the concern addressed — never "address review comments".Fixed in <hash>, <one sentence on what changed>.PRR = amag-pr-review's installed skill directory (the most recently modified
~/.claude/plugins/cache/*/amag-pr-review/*/skills/amag-pr-review). Write fixes.md in the
scratchpad: per fix commit, a ## Comment <root id>: <path>:<line> heading, the comment's text,
then git show --format= <hash> in a diff fence. Dispatch one amag-pr-review:pr-review-reader
with $PRR/references/prompts/fix-review.md: SKILL_DIR = $PRR, CHECKLIST_FILES =
$PRR/references/dimensions/correctness.md plus the language file for each touched file,
REPOS = the worktree, FIXES_FILE = that file, OUT_FILE = fix-review.json beside it.
Each defect or incomplete: rework it as a further commit (the reply cites both hashes) and
review the reworked fixes once more. Every verdict goes in the pause table.Runs right after the fixes, before the pause, and is committed and pushed in this step, so a run that ends at the pause (the usual case) has still taught amag-pr-review.
Only comments where the reviewer was right count: a fix verdict for a real defect a human caught that amag-pr-review didn't. Skip push-back and clarify comments, and skip fixes made only because a reviewer misread correct code (step 5's misreading smell): there was no defect to catch. For each fix (merged root causes count once), find why it was missed, and land the lesson where the next review reads it.
Miss analysis — answer these in order for each counted defect, before editing anything:
Did one of our own fixes write this code? A fix amag-pr-review suggested and someone applied, or a fix an earlier amag-pr-respond run committed, is code the review wrote, so a defect in it is a bad fix even though the review never saw it in a diff. Check both:
node $PRR/scripts/local-findings.mjs provenance <worktree> <repo> <path> <from> <to> <ticketDir>/review-findings.json <ticketDir>/review-findings.prev.json
over the commented lines (<ticketDir> = the worktree's parent folder). Each hit names the
finding whose recorded fix added those lines.git blame -L <from>,<to> on the same lines: a commit that an earlier reply of ours on this PR
cited as Fixed in <hash> is a bad fix from that run.A bad fix takes the "our own fix introduced it" row of the table below, then goes on to question 4 as well: the fix-review pass reads the same checklists, so a missing checklist line is a second gap.
Did amag-pr-review see this code? Find the commits amag-pr-review last reviewed (its PR state's
reviewedCommit, or the head it ran on). If the defect arrived later, or amag-pr-review never ran on
that version, it isn't a miss: record "not reviewed" and change nothing.
Was it raised and then lost? Look for a candidate or finding on the same code that verify
dropped or downgraded, or recheck upheld. If so, the cause is that step's reason: name it (e.g.
"treated a test added in the same change as proof of intent") and fix the rule in
references/prompts/verify.md or recheck.md that allowed it.
Otherwise it was never raised: pick the row in the table below.
Record each answer in a miss table (defect | from our fix? | seen by amag-pr-review? | raised then lost? | cause | change) for the pause and the summary.
Edit amag-pr-review where a change lasts: the amag-pr-review/skills/amag-pr-review folder of a
checkout of its marketplace repo, if the user has one, or a personal copy at
~/.claude/skills/amag-pr-review. Never edit the plugin cache (an update overwrites it). With
neither, put the proposed lines in the summary instead. Before any edit, read the checklists the reviewer would have had:
references/dimensions/<dimension>.md for the dimension the defect belongs to, plus
references/languages/<lang>.md for the file's language, and grep all of references/ for the
class of defect so you sharpen an existing line instead of adding a near-duplicate.
| Why it was missed | Fix |
|---|---|
| No checklist line covers this class of defect | Add one bullet to that file's ## Look for |
| A line covers it, but too narrowly (its scope leaves this case out) or too abstractly to bite | Rewrite that line so it names this case's trigger |
| A line already covers it concretely | Nothing; report "covered, reviewer missed it" (the same report across several PRs points at the prompts, not the checklists) |
A ## Don't flag line or severity rule in references/severity.md would suppress it | Narrow that line so it no longer covers this case |
The evidence lived where amag-pr-review never looks (a repo missing from ALLOWED in its scripts/xrepo.mjs, an undetected file type, a linked Jira issue, a file its scripts filter out) | Pipeline change in amag-pr-review's SKILL.md or scripts/, see below. Before claiming one, check that the filter applies on the path this PR's size takes through amag-pr-review's reviewer roster (scripts/dispatch.mjs) |
| The defect has a fixed code shape (a call checked the wrong way, a missing handler around a call known to throw, a value built into SQL) | As well as any checklist row: an Opengrep rule in amag-pr-review's rules/, as its references/rules.md says. A rule may name the project's types, scoped with paths; the generic-line rule below is for checklist lines |
| Our own suggested or applied fix introduced it (question 1) | Add one bullet to references/fixes.md's ## Don't suggest, naming the class of wrong fix. If a line there already covers it concretely, sharpen references/prompts/fix-review.md instead: the fix-review pass had the rule and passed the fix |
| Needs knowledge outside the code, ticket and repo (product intent, one reviewer's taste, a customer setup) | Nothing; say so in the summary |
A defect can match several rows: act on each. When both files fit, the language file wins if the trigger or the fix is a language or framework
API (CultureInfo, StreamReader, goroutines); the dimension file wins if the defect would read
the same in any language.
Every line written into amag-pr-review is generic. amag-pr-review reviews every repo, so a line is the class of defect in terms any codebase has (a cache, a fallback, a configured value, a retry, a test against real OS behaviour): the failure, what to check, in one or two lines, with at most a short generic example. It names no product, repo, subsystem, file, class, method, ticket, PR or person, and carries no "seen on" note. Before writing it, read it as a reviewer of an unrelated codebase in the same language would: if it only makes sense to someone who knows this project, rewrite it until it doesn't. A lesson that can't be said without the project's names is project knowledge, not a review rule: put it in the summary for the user to record in that repo's CLAUDE.md instead.
A pipeline change is the smallest edit that puts the missing evidence in front of a reviewer. A
script change comes with a test in scripts/test/ that fails without it, and the whole suite must
pass afterwards: node --test scripts/test/*.test.mjs from the amag-pr-review directory (passing the
directory itself fails). Red suite → revert the script change and report it as an unfixed pipeline
gap with the failure.
Commit and push every retro change to main, once the lines are written and any script suite
is green. The checkout often holds the user's own uncommitted work, which must not ride along:
git status --short in the amag-pr-review repo. Stage only the files
the retro edited, by path, never git add -A. A file that already had uncommitted changes stays
uncommitted and goes in the summary.main. On any other branch, don't switch: leave the change uncommitted and report it.amag-pr-review: checklist line(s) from a PR-respond retro (checklist line(s) and rule(s) when the retro added a rule), then one bullet per file changed. A rule's fixture is
committed with it, and only after opengrep scan --test rules/ passes.git push origin main. Rejected → report it; never force-push.claude plugin marketplace update <marketplace>, then
claude plugin update amag-pr-review@<marketplace>, and tell the user to run /reload-plugins
(or restart) for the running session to pick it up.Show the user, in the terminal:
node scripts/bb.mjs preview <header flags> with the draft on stdin (step 9 has the flags)git diff origin/<source-branch>..HEAD)ok, what was reworked or why it standsgit revert its retro commit and push the revert.Then stop and wait for explicit approval. The user may amend verdicts, reword replies, or drop items; apply their changes and re-present anything that changed materially.
git push the source branch. Push must succeed before any reply is posted — a reply citing an
unpushed hash is a broken promise. Push rejected (remote moved) → report and return to the user;
never force-push.node scripts/bb.mjs reply <workspace> <repo_slug> <pr_id> <parent_comment_id> --verdict <v> --model "<m>".
The parent is the thread's ROOT comment id. <v> is fixed, push-back or clarify; <m> is
the model this session runs as (e.g. Opus 5.5). The script writes the header, in the same layout as amag-pr-review's comments, and refuses to post without
one.Reply craft — the text under the header is ≤3 sentences (1–2 is better), permanent, and read by the whole team later. The body never carries a header of its own; the script adds it.
Voice: a teammate on Slack, not an assistant. Replies are written as the user, to a colleague who sits ten feet away. Contractions, plain verbs, lowercase energy. Before posting, reread each reply and strip the AI tells:
Per verdict:
Fixed in <hash>, <short what-changed>. A plain "good catch" is fine when they genuinely
caught a bug; effusive praise is not. Add a second sentence only when the fix took a different
shape than they suggested.repositories/<ws>/<slug>/commit/<hash>/statuses) once CI has had a moment to report; a red or
in-progress build goes in the summary. Fixing a broken pipeline is a separate task, not a silent
extension of this one.Fixed / pushed-back / clarifying counts, commits pushed, reply links, and anything that needs the
user (failed replies, verification gaps, disputed threads to watch). Then the step-7 retro as it
stands after any vetoes: the miss table, then per fix the
amag-pr-review file:line changed plus the test added and the suite result for a script change (or "unfixed pipeline gap: <what,
why>" / "out of reach: " / "not reviewed"),
followed by each line this run added or rewrote, quoted with its file (old text too for a rewrite),
and the retro commit hash (or why nothing was committed).
Quote them rather than showing git diff: the touched file may already carry the user's own edits.
If a fix taught a reusable technique (a tool feature, a way to test or profile), write an article by
C:\repos\articles\WRITING.md when that file exists, and give its path in the summary.
main in step 7, before the pause;
only the files the retro touched.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub bow-meow/agent.vellum.lib --plugin amag-pr-respond