/tend-ci-runner:review [PR number]from tend-ci-runner
Reviews a pull request for code quality and correctness. Runs automated PR review with pre-flight checks, diff analysis, and structured workflow.
Ships in tend-ci-runner. 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.
Review a pull request.
PR to review: $ARGUMENTS
Follow these steps in order.
/tend-ci-runner:run-tend first, including its repo-specific overlay./tend-ci-runner:post-to-github before composing the review or any inline reply./tend-ci-runner:code-review before the structured second pass./tend-ci-runner:open-pr if editing the PR description, /tend-ci-runner:dismiss-approval if withdrawing a standing approval, and /tend-ci-runner:monitor-ci after approving or pushing a fix./tend-ci-runner:push-commits before pushing a fix and /tend-ci-runner:merge-pr for the landing decision.Before reading the diff, run the initial snapshot. It pins the open head, resolves the bot's review state, and prepares the accurate incremental when one applies:
tend runtime review-preflight start <number>
On skip, finish. Otherwise read every previous bot review and the conversation:
tend runtime bot-review-state \
feedback <number>
These snapshot fields decide how much of the workflow runs:
already_reviewed — a bot review already stands on this exact commit. Skip the diff and duplicate posting, then continue to Resolve handled suggestions and the remaining workflow. If the conversation holds an unanswered question directed at the bot, proceed so the review can answer it.author — who acts on the findings. On human, the author does. On self (this bot's PR) or bot (Dependabot, renovate), nobody else will, so this run is the author as well as the reviewer: it posts the review, then applies the findings itself in one push per Push fixes. A run that ends on the review leaves its findings to nobody. self also rules out an APPROVE, which GitHub rejects from a PR's author.is_draft — follow references/draft-mode.md: a lighter review submitted as COMMENT only, carrying the hidden draft marker, with no CI polling and no pushes.incremental_path — the bot reviewed an earlier commit on this PR, and the file named holds what was pushed since: each commit with its per-file line counts and its patch, then the base merges. Read the whole file the way references/re-targeting.md reads a delta file: both logs, and git show --cc on each base merge, since what a merge itself changed is part of the push. Review as a person returning to the PR would. The new commits get the close read, with the whole PR (gh pr diff <number>, merge-base→head, the same diff Read and understand the change uses) and the earlier reviews in view: whether the push answers what was raised, and whether the PR still holds together with it in. Code the earlier review covered isn't audited line by line again, though a problem you notice in it still counts. Neither the incremental nor that diff leaks base-branch churn: the incremental excludes everything reachable from the base tip, so a base merge's own commits are not counted as new PR work, and base-merge commits never enter the three-dot diff.The incremental scopes the review, not anything this run writes about the PR as a whole: if you also edit the PR description, scope its claims to the merge base per Keeping PR titles and descriptions current in /tend-ci-runner:open-pr.
If the incremental changes are trivial, skip steps 2–5 and go directly to Resolve handled suggestions for bot threads addressed by the new changes. Then use Submit for the current-head verdict, including its author-readiness and self-authored exceptions, before Complete the review. Rough heuristic: changes under ~20 added+deleted lines that don't introduce new functions, types, or control flow are typically trivial.
Commit and PR authorship do not affect review behavior. Apply the same trivial-vs-substantive heuristic regardless of who pushed the new commits. When tend-notifications or tend-triage pushes a fix to a human-authored PR, reviewing (and re-approving) the updated state is expected — the reviewer role is independent of commit authorship.
A dismissal on push is not a verdict. Where the repository's rules dismiss stale approvals, GitHub dismisses the bot's approval on every push and records the pusher as the timeline event's actor. That review_dismissed event carries dismissed_review.dismissal_commit_id and a null dismissal_message; a person's dismissal carries their message and no dismissal commit. Review the new head as usual after an automatic one. Only a dismissal with a message is a signal to read.
Apply the sibling-workflow dedup rule from /tend-ci-runner:post-to-github to both the review body and inline comments. If a prior bot comment in the conversation already covers a point — a previous review on this or an earlier commit, a tend-mention reply, a tend-triage post, anything from a tend workflow — omit it from this review and stick to diff-grounded findings. If that leaves no new diff-grounded finding on the incremental changes and the only outstanding concern is a still-unresolved thread from an earlier bot review, do not post a new review: that thread already blocks the PR, and restating "the prior thread still applies" on every push is noise. Resolve any bot threads the new commits addressed (Resolve handled suggestions), then finish without posting. When no concern remains, follow Submit for the current-head verdict. When concurrent runs race (a new push while the first run is still responding), both see the same unanswered question — check whether a bot reply exists after the question's timestamp before answering. Address remaining unanswered questions in the review body (not via gh pr comment).
Before reading the diff, scan other open PRs for file overlap. If another PR touches the same files with a similar fix, flag it in the review so one can be closed as a duplicate.
gh pr diff <number>.Scale depth to the change. A docs-only PR or a mechanical rename needs a skim for correctness, not the full checklist. A new algorithm or state-management change needs trace analysis. Don't over-analyze trivial changes.
Check the project's instruction files for language-specific review criteria and conventions. Load any project-specific review skill if available.
Code quality:
Correctness:
Testing:
/tend-ci-runner:fix-a-bug. A test rewritten to accept behavior the change never meant to move is a regression, not a fix.Same pattern elsewhere:
When a PR fixes a bug or changes a pattern, search for the same pattern in other files. If found in the diff, add inline suggestions; if found outside the diff, it is a fix commit per Push fixes.
Citing code outside the diff:
The checkout uses refs/pull/N/merge, so you read the merged tree (PR head + current base branch). When a finding involves code outside gh pr diff — code the PR didn't touch but now interacts with — identify the interacting code by semantic anchor (selector, function name, declaration text) and quote enough of the relevant property/value that the reader can grep for it. Don't lead with the line number: the author's local branch may be behind main, so line numbers from the merged tree won't match their checkout, and a line-number-first citation reads as a hallucination when they check the line on their stale branch. Same principle as the blob/main/...#L42 link rule in /tend-ci-runner:run-tend — line numbers are fragile across diverging refs.
Duplication check (for new functions/types):
For every new public or module-level function added in the diff, search the codebase for existing functions that do the same thing. LLM-generated code frequently reinvents internal APIs — this is the highest-value check for externally contributed PRs.
Two search strategies, both required:
Flag duplicates — reuse is almost always better than a parallel implementation.
Run a /tend-ci-runner:code-review pass in the PR's merged tree, over the PR's diff. When an incremental applies, give it the incremental file as the diff to work through, with the PR's diff and the earlier reviews as context; a ref range built from the file's commits would pull base-branch churn back in. Every review that reaches this step runs one — trivial diffs included; Review's depth-scaling sets how deep the pass goes, never whether it happens. It's a structured second pass — correctness and cleanup angles, then a verify pass — that returns findings rather than posting anything, and it supplements Review's manual checks rather than replacing them.
Scale its depth to how core the change is:
What counts as core is repo-specific; let the project's own instruction files, a repo review skill, or your judgment decide. Both passes feed one verdict: fold its findings into the review Submit posts. It only reports back — it never posts a review, comment, or commit of its own, so the dedup and single-review path is preserved. Its findings are not the review: when it returns, continue to Submit.
For a review that reached the second pass, before submitting, say what that pass returned — its confirmed findings, or "no findings". That statement is a compliance check: say it in the session, not the review body, so an empty-body APPROVE stays empty. The findings themselves still get folded into the review, per Second pass. If you can't say, the pass didn't run — go back to Second pass and run it. A full review that reaches this point without it is not submittable. The trivial-increment and dedup paths under Pre-flight checks skip the second pass and are exempt.
If there are no issues, approve with an empty body — silence means correct.
Unless the author withheld merge readiness. When the PR body — or a later comment from the author or a maintainer — says the change should not merge yet — "should not merge until…", "not ready", design questions the author calls unresolved — the verdict is withheld the same way the draft flag withholds it, and plenty of contributors state it in prose rather than toggling draft. Submit COMMENT instead, naming the stated blocker that holds the verdict; name it once, and on a later pass that finds nothing new stay silent rather than restating it — the surrounding dedup rules are keyed on threads, so they don't reach a body-only COMMENT. Your own findings being closed out does not clear it: "everything the reviewer raised is fixed" and "the author says this must not merge" are independent conditions, and only whoever stated the blocker retracts it. The asymmetry is why this is worth a condition: withholding a warranted approval costs a re-review on the next push, while an APPROVE standing on a PR its author gated is a wrong outward signal that persists until someone notices.
# Read the sha first and bail if it isn't there: inlined as `$(cat ...)` a
# missing file substitutes the empty string and the POST still runs, which is
# the unpinned review this pins against.
REVIEWED=$(cat "$TMPDIR/reviewed-head") || exit 0
tend runtime review-preflight post <number> -- \
gh api "repos/{owner}/{repo}/pulls/<number>/reviews" --method POST \
-f event=APPROVE -f commit_id="$REVIEWED" -f body=""
Before composing findings, apply the actionability bar in Output of /tend-ci-runner:code-review to each candidate. If there are actionable findings, submit them as a review with inline suggestions for concrete fixes. GitHub labels the review approved or commented above its body, so the body opens with the first finding. The review is a decision surface for the author, not a record of the reviewer's work: publish only distinct points that require a change or decision, with enough mechanism and evidence to make each credible and actionable. Correct paths, unaffected behavior, verification inventory, and search history stay in the session. Follow Reader-facing prose in /tend-ci-runner:run-tend for any supporting detail.
Don't explain what the code does — the author wrote it. Don't nitpick formatting — that's what linters are for. Explain why the consequence warrants a change.
Bad:
The new delegation path looks correct. I also verified that the threshold logic is unchanged.
Good:
The failure message still names the removed local path, so it directs users to an option that no longer exists. Update it to name the delegated command.
A findings review never supersedes a standing approval — dismiss it. GitHub moves reviewDecision only on an APPROVED or a CHANGES_REQUESTED, so a COMMENT posted over the bot's own earlier approval leaves the PR reading as bot-approved and mergeable over the findings you just posted. How the head moved makes no difference: an ordinary push leaves the approval standing exactly as a rewrite does. So whenever this round posts a COMMENT that withholds the verdict, dismiss the approval that still decides the PR — after the review POST lands, so a failed post doesn't leave the PR with neither a verdict nor findings. Findings are the common case, but the withheld-merge-readiness COMMENT above is reachable with an approval already standing, and it leaves the same wrong signal: the PR reads bot-approved while the review names a blocker. A COMMENT that withholds nothing does not qualify — the unanswered-question exception under Pre-flight checks posts one at a head the approval already covers, and dismissing there withdraws a verdict the code still earns. /tend-ci-runner:dismiss-approval covers the conclusions reached from outside the PR, which no review round fires on.
# Re-read rather than reusing the pre-flight blob — a whole review has passed since.
# The script no-ops once a dismissal or later CHANGES_REQUESTED has cleared it.
tend runtime bot-review-state \
dismiss <number> "Superseded by the review on a later commit."
Form your own opinion independently. Do not factor in other reviewers' comments or approvals when deciding whether to approve — the value of this review is as an uncorrelated signal.
When confidence is low, go beyond checking the implementation — question the approach: "Does this bypass or duplicate an existing API?" "What does this change not handle?" If the design involves a judgment call, flag it for human review as a COMMENT.
Attribute a withheld approval to whatever actually decided it. Cite the repo's instructions as the reason only when you can name the file and heading they live in. When the call is your own judgment, identify the risky consequence and the human decision it needs; judgment is sufficient authority without inventing a repository policy.
Self-authored PRs (author: self): Complete steps 2–5 — self-review catches real issues (lint failures, edge cases) and is intentionally valuable. Do NOT attempt an APPROVE — GitHub rejects self-approvals. That covers the pre-flight close-out approvals too: on a self-authored PR the threads are the only thing to close out. With concerns, submit them as a COMMENT and carry on through Push fixes, which applies them. With none, stay silent and continue to Resolve handled suggestions and the remaining workflow. The self-review exists to find concerns, not to publish a clean-path verdict or proof that earlier findings were resolved. Always post a current CI failure as a COMMENT because it is itself a concern.
Not confident enough to approve (unfamiliar module, subtle logic): Add a +1 reaction instead — no review needed unless there are specific observations.
gh api "repos/{owner}/{repo}/issues/<number>/reactions" -f content="+1"
Before composing the final payload, run the preflight without a command. It checks the PR is open, re-targets onto a newer descendant head, and stops duplicate reviews:
tend runtime review-preflight post <number>
On skip, post nothing. If the pinned head already carries a review, continue to Resolve handled suggestions and the remaining workflow; a closed PR or a moved head ends this pass. A re-targeted result prints delta: <path> and updates $TMPDIR/reviewed-head: follow references/re-targeting.md before posting, then run the preflight again. Do not post from the re-targeting pass.
A non-zero exit from this commandless check means nothing was decided. Fix the
error and re-run it. In command mode below, post: means the outward command
was attempted; handle that command's failure directly. For a review POST that
returns 422, use the recovery procedure in references/inline-suggestions.md instead of blindly
rerunning the preflight.
Every review POST passes its gh api command to the preflight after --, which runs it only if the pinned head is still open and unreviewed. In that mode the preflight does not re-target.
Pin every review to the commit you read — commit_id in every posting recipe, read back from $TMPDIR/reviewed-head, which Pre-flight checks wrote and the posting preflight rewrites if HEAD moved. Two things depend on the pin. GitHub otherwise anchors the review at whatever is live when the POST lands, so the review claims code this session never saw. And the anchor is what the next run's pre-flight reads as already_reviewed: pinned to the head you re-targeted onto, the queued run finds that head already reviewed and finishes without posting a second review of the same code.
Before APPROVE specifically, run the approval check in references/approving.md — a real red or an author-stated blocker withholds the approval.
Post at most one review per run. Give the current-head verdict (approve or comment, never "request changes") per the rules above. If the dedup rule above left nothing new and a prior unresolved bot thread still stands, post nothing; the earlier review remains the active verdict. Post reviews through the reviews endpoint, not gh pr comment. Note: a COMMENT review requires a non-empty body — if there's nothing to say and no prior concern stands, use the approve-with-empty-body pattern.
Inline suggestions are mandatory for concrete fixes. Whenever there's a concrete fix (typos, doc updates, naming, missing imports, minor refactors, test additions), post it as an inline suggestion on the exact line — never as a code block in the review body. Inline suggestions let the author apply with one click; code blocks force them to find the line and copy-paste manually.
A fix targeting lines outside the diff is a fix commit per Push fixes instead.
Build the review payload — inline comments, commit_id, the preflight-wrapped POST — per references/inline-suggestions.md, which also carries the multi-line suggestion rules and the 422 recovery.
After submitting the review, check if any unresolved bot threads have been addressed by the new changes. Resolve threads where the suggestion was applied.
Only resolve if the substance was addressed. Read both the suggestion and the new code — if the author took a different approach, verify its technical accuracy before resolving. "Different wording" is not "addressed" when the new wording is less accurate than the suggestion. When in doubt, leave the thread open for a human reviewer.
Self-authored PRs are especially risky. When the bot is both author and reviewer, there is a bias toward accepting the code's own claims. Treat self-authored thread resolution with extra skepticism — read the code and verify the claim independently rather than trusting the doc comment or commit message.
tend runtime bot-review-state \
feedback <number> | jq '.review_state.bot_login as $bot |
[.review_threads[] | select(.is_resolved == false and .comments[0].author == $bot)]'
# Read each thread's discussion; resolve only after verifying its substance:
tend runtime bot-review-state \
resolve-thread <thread-id>
Outdated comments (null line) are best-effort — skip if the original context can't be located.
Pushing to the branch under review fires synchronize, which queues another run behind this session rather than cancelling it. Submit the review (Submit) and resolve threads (Resolve handled suggestions) before pushing, so the review documents the code the fix responds to. Batch every fix into a single push; each push costs another review round. Poll the pushed fix's CI to green per /tend-ci-runner:monitor-ci before ending the session, except where Without the CI wait in references/approving.md hands that to the queued run; the queued run reviews the new HEAD.
Before the push, review the fix itself per Review the change before the push in /tend-ci-runner:push-commits. Leave the review pinned to the head you reviewed. Submit's re-targeting is for pushes by others during the review; re-target onto your own fix and the queued run reads that head as already reviewed, then finishes without looking at the fix. That run reviews the pushed head and resolves the threads the fix addressed.
PRs with no human author (author: self or bot): Nobody else will act on the feedback — a third-party bot doesn't read it, and on your own PR you are the author. A review that only describes the fix leaves the PR red and pushes the work onto a maintainer — the opposite of the point. If you can articulate the fix, apply it: commit and push it to the PR branch. "Not a one-token change" and "more than one syntactically valid form exists" are not reasons to defer — pick the option most consistent with the surrounding code and the repo's existing conventions, push it, and note any alternative in the review. Having to choose is a reason to defer only when no defensible default exists: a genuine semantic ambiguity that needs maintainer intent, not merely a fix that took thought to derive. An option that needs that intent, such as a new flag or an output-format change, doesn't block one that doesn't: push the one that doesn't and leave the other to the review. If the review already worked out the answer, that answer is pushable. Rebase onto the latest target branch first if the branch is behind.
The bar for another fix rises with each round. Every fix is a new diff for the queued run to review, and a review usually finds something, so the rounds don't end on their own. One adjustment after the first review is often fine. After a couple, push only for a significant problem, one that would do harm if the PR merged as it stands, and leave the rest; a finding a maintainer should weigh before merging still goes in the review.
If the rounds are thrashing, with findings of one kind recurring or each fix drawing the next finding, hold your own view of the change with less confidence. Lean the way the project leans, and say in the review that the approach is what's in question.
Human PRs (author: human): Post inline suggestions first. Additionally, offer to push a commit when the fixes are mechanical and correctness is obvious. Only push after the author accepts.
gh pr checkout <number>
git add <files>
git commit -m "fix: <description>"
git push
Then record the push per After the push in /tend-ci-runner:push-commits.
If you pushed fixes, finish per Push fixes.
Otherwise, for a non-draft head meeting Reviewed head in
/tend-ci-runner:merge-pr, obtain CI evidence pinned to $TMPDIR/reviewed-head
per /tend-ci-runner:monitor-ci, then handle it per After the approval in
references/approving.md to complete the landing decision. When the prompt
says the review's CI wait is off, follow Without the CI wait in
references/approving.md.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub max-sixty/tend --plugin tend-ci-runner24 skills in this plugin
/act-in-other-reposAct in another repository. Use before filing an issue, commenting, or contributing anywhere other than this repo./check-requester-accessCheck a requester's access tier. Use when a request aims you at someone else's work — close, lock, label, revert, dismiss, push./code-reviewStructured second pass over a diff — correctness and cleanup angles, a verify pass, ranked findings returned to the caller./continue-prContinue an unfinished PR with no human author, including red CI and unresolved findings after a prior response or review./dismiss-approvalDismiss a standing bot approval. Use when you conclude that a PR the bot approved should not merge./fix-a-bugWrite a code fix for a bug. Use before writing any fix, whichever workflow you are running.Other plugins' skills for the same job