/task-agent:pr-reviewerfrom task-agent
Reviews a pull request for correctness, tests, repo conventions, and safety. Verifies repo checks in a throwaway worktree and posts a GitHub review with inline comments.
Ships in task-agent. 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.
Wraps the task-agent:pr-reviewer sub-agent so it can be invoked as a skill. The agent only ever posts a COMMENT review — it never approves, requests changes, pushes or merges.
Arguments (key=value form):
pr_url=<url> — full GitHub PR URL (e.g. https://github.com/owner/repo/pull/42). Required.repo=<owner/repo> — repository in owner/repo format. Required.branch=<branch> — branch name the PR is on. Required.checks=<true|false> — whether the agent runs the repo's build / type-check / tests in a throwaway worktree. Optional, default true.Parse pr_url, repo, branch and checks from the invocation arguments.
Derive:
OWNER and REPO_NAME from repo (split on /)PR_NUMBER from the last path segment of pr_urlIf any required argument is missing or cannot be parsed, stop and report the error clearly. If checks is anything other than true or false, stop and report it.
Validate the target before touching any clone:
case "$PR_URL" in "https://github.com/$OWNER/$REPO_NAME/pull/"*) ;; *) echo "pr_url does not belong to $repo"; exit 1;; esac
gh pr view "$PR_NUMBER" --repo "$repo" --json headRefName,headRepositoryOwner,headRepository,state
Reuse the task-agent workdir convention so the clone is shared with a preceding task-agent run:
WORKDIR="${TASK_AGENT_WORKDIR:-$(python3 -c 'import os,tempfile;print(os.path.join(tempfile.gettempdir(),"task-agent"))')}"
LOCAL_PATH="$WORKDIR/$REPO_NAME"
if [ ! -d "$LOCAL_PATH/.git" ]; then
mkdir -p "$WORKDIR"
git clone "https://github.com/$OWNER/$REPO_NAME.git" "$LOCAL_PATH"
fi
git -C "$LOCAL_PATH" fetch origin
Verify the reused clone is this repository before using it (clones of different owners can share a name). A GitHub origin for a different owner/repo is an error; non-GitHub origins (local mirrors) are accepted:
ORIGIN=$(git -C "$LOCAL_PATH" remote get-url origin)
case "$ORIGIN" in
*github.com[:/]*) SLUG=$(printf '%s' "$ORIGIN" | sed -E 's#.*github.com[:/]##; s#\.git$##')
[ "$(printf '%s' "$SLUG" | tr A-Z a-z)" = "$(printf '%s' "$repo" | tr A-Z a-z)" ] || { echo "$LOCAL_PATH is a clone of $SLUG, not $repo"; exit 1; } ;;
esac
The reviewer never checks out, resets or otherwise modifies LOCAL_PATH: the sub-agent fetches the PR head (refs/pull/PR_NUMBER/head, which also works for fork PRs) and reviews a detached worktree at the exact headRefOid, so uncommitted work in a reused clone is safe and branch is informational.
Detect the default branch:
DEFAULT_BRANCH=$(git -C "$LOCAL_PATH" symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||')
DEFAULT_BRANCH="${DEFAULT_BRANCH:-main}"
Spawn the pr-reviewer sub-agent via the Agent tool
(subagent_type: task-agent:pr-reviewer), passing all resolved values in the prompt so the agent can substitute them for OWNER, REPO_NAME, PR_NUMBER, BRANCH, LOCAL_PATH, DEFAULT_BRANCH and RUN_CHECKS.
Print the agent's report verbatim. The review comments it posts are marked <!-- pr-reviewer -->, which is how review-fixer finds them later.
If the agent could not post (for example gh is not authenticated), surface that error and stop — do not retry with a different mechanism.
End your reply with one fenced json block, labelled result: on the line before it, after the relayed report. It is the stable, machine-readable outcome, so callers do not have to parse the prose:
result:
```json
{"findings": 2, "posted": 2, "already_raised": 0, "review_url": "https://github.com/owner/repo/pull/42#pullrequestreview-1", "commit": "<headRefOid>"}
```
posted is N from the report's Posted (N); already_raised is N from Already raised (N).findings is posted + already_raised: findings the reviewer still considers open on this commit, whether it just posted them or they were raised earlier and not yet resolved. 0 means the review was clean.review_url is the posted review's URL, or "" when no review was posted; commit is the reviewed headRefOid.When the report carries no Posted (N) / Already raised (N) counts (for example not posted: already reviewed this commit), do not report findings: 0: that would read as a clean review. Derive findings from the open findings the report lists or, when it lists none, from the unresolved <!-- pr-reviewer --> threads on the PR; if the count still cannot be determined, omit findings (and posted / already_raised) from the block so a caller's findings != 0 guard still runs the fixer.
Take the counts from the agent's report relayed in Step 4. If the review could not be posted because of an error, stop as in Step 4 and emit no block, so a caller sees a failure instead of a clean review.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub dan323/easier-life-skills --plugin task-agent6 skills in this plugin
/pr-reviewer-workflowWorkflow adapter for `pr-reviewer`: runs it with the step args and writes `findings`, `posted`, `already_raised`, `review_url` and `commit` to `$WORKFLOW_OUTPUT`, so a workflow can loop `until: ${{ steps.review.output.findings == 0 }}`. Use `pr-reviewer` directly outside workflows./review-fixerReads unresolved review comments on a pull request — from the `pr-reviewer` agent, repo members, or allowlisted review bots — applies code fixes for the actionable ones, runs the repo's checks, and pushes. Thin skill wrapper around the `review-fixer` sub-agent; ends with a machine-readable `result` block. In a workflow, use `review-fixer-workflow`./review-fixer-workflowOther plugins' skills for the same job