--- name: dev-review argument-hint: '[#PR]' description: Independent review of an open PR head — reviewer agents, findings on the PR, verdict line when approved. version: 0.4.7 --- # Dev review Review the current head of one open pull request with agents other than its author. Leave the findings on the PR and, when the head is approved, post the head-bound verdict. `/dev-review` never edits code, pushes or merges. ## 1. Bind the PR 1. Target: the `#PR` argument, else the open PR of the current branch: `gh pr view [] --json number,state,url,headRefOid,baseRefName,body`. 2. No open PR → stop and say so: `/dev-review` runs only on an existing PR. A PR whose base is not the repository's default branch (`gh repo view --json defaultBranchRef`) is not reviewed yet: a stacked PR is reviewed once it targets the default branch. 3. Record `HEAD` = `headRefOid` (40 hex) and `BASE` = `baseRefName`. The review covers that commit only. 4. Fetch from the PR's own repository (its URL without `/pull/`), not `origin`, which may be a fork: - `git fetch refs/heads/`, then `BASE_SHA=$(git rev-parse FETCH_HEAD)`; - `git fetch refs/pull//head`; `git rev-parse FETCH_HEAD` must equal `HEAD`, else stop. The change is `git diff ...`. 5. Check out the reviewed tree apart from the current one, without running its hooks: `git -c core.hooksPath=/dev/null worktree add --detach `. Every source read of the review happens there. Remove it on every exit, a stop included: `git worktree remove --force `. 6. **Composed:** review only the host's `## Accepted Spec` snapshot for the bound issue, including inherited clauses and their source refs. Record its `spec: ` value (64 lowercase hex); if the section or digest is missing or invalid, stop. If you discover a newer accepted own or inherited Spec, stop without publishing review evidence or a verdict: report the accepted change and ask the operator to rerun `/feature` for a new snapshot. A live body edit alone is not evidence of acceptance. Compare `acceptedBodySha256` with the live body hash (`(set -o pipefail; gh api repos///issues/ | jq -erj '.body | strings' | sha256sum)`). Report a mismatch or an unavailable comparison; neither changes the review scope. **Standalone:** read the unambiguous linked issue from the PR body (`Closes #N`, `References #N`, or a `UW #N` line) and use its criteria. The PR body is not proof of binding. 7. Read the tier (`S`, `F-lite` or `F-full`) from the issue's native `size:` label: `gh issue view --repo --json labels`. `evidence-policy.md` applies it. **Composed:** the issue is the bound one. `/feature` admission refused this invocation unless that issue carried exactly one `size:` label equal to the accepted tier; `## Accepted Spec` does not repeat it. If the issue now has no `size:` label or several, stop without publishing review evidence or a verdict and ask the operator to rerun `/feature`. Just before `land`, `/feature` compares the label with this review's `Tier:` line, and `land` rechecks that the label equals the accepted tier. Known limit, accepted by the operator on 2026-11-30: this step reads the label, not the accepted tier, so a label that already differs from it here and is restored between that comparison and `land`'s recheck goes undetected; the approval then rests on the changed label's rules. **Standalone:** the issue is the linked one from step 6. Without a linked issue, or with no `size:` label or several, say so in the review comment and apply the non-S rules. ## 2. Pick the reviewers - Choose independent, read-only reviewers from the agents available to the session. The session that wrote the change does not review it. - Cover adversarial review, including OWASP (e.g. `R-adversarial`). Choose specialists where the diff warrants them: architecture and data flow, security and permissions, test evidence, or CI and configuration. - Spawn them in one `task` batch. Give each: repository, PR number, `HEAD`, the review worktree path (read sources only there), the diff command, the requirements from step 1.6, the tier from step 1.7, and the checklists in this skill directory (`evidence-policy.md`, `review-blind-spots.md`, `review-smells.md`). Give `R-adversarial` the actual `Spawned roster:` if selected. Ask for factual findings only: `file:line`, blocking or non-blocking, the evidence, no fixes. ## 3. Consolidate - Every selected reviewer must return a completed result. Rerun a reviewer that failed, was cancelled or returned nothing; without its result there is no approval. - Merge duplicates. Check each blocking finding in the review worktree. Only the reviewer that raised a blocker drops it: when the code at `HEAD` seems to refute it, send that evidence to that reviewer; the blocker stays unless it withdraws it. - Verdict: **approve** when every reviewer completed and no blocking finding remains, else **request changes**. ## 4. Publish on the PR 1. Re-read the PR. If its head is no longer `HEAD` or its base is no longer `BASE`, stop: the review is stale; run `/dev-review` again. 2. Post one comment (`gh pr comment --body-file `). First line: `## Review — head base spec ` in composed mode, copying the digest from step 1.6; `## Review — head base ` standalone. Second line: `Tier: `, the tier applied from step 1.7, or `Tier: none` when a standalone review applied the non-S rules without one. Then list the reviewers and findings (blocking first) with `file:line`. The last line is exactly `Verdict: approve` or `Verdict: request changes`. `/dev-fix` reads this format. Keep it public-safe: no secrets, private paths, raw logs or client data. 3. On approve, post a second comment whose only line is: ```text review-verdict v1 head= approve evidence= ``` The Review Verdict workflow turns it into the `review` check that the `PR_Main` ruleset requires next to `ci` (CONTRIBUTING.md § PR conventions). The account posting it needs write access. A new commit needs a new review and a new verdict. 4. On request changes, post no verdict line. The next step is `/dev-fix` on this PR. ## 5. Report Remove the review worktree. Report one line: PR, `HEAD`, verdict, comment URLs.