Run the shared AI review of an OPRE-OPS pull request — Flexion's code-review-orchestrator, held to the team rubric in docs/REVIEW.md (S0–S3 severities, risk tiers, pre-existing findings, the verdict line). Use whenever someone asks to review an OPS PR or branch ("review PR 6436", "review my PR", "run the shared review", "is this ready for human review", "re-review after my changes"). Prefer this over calling code-review-orchestrator directly in this repo, so every review uses the same bar for "done".
91%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Low
Low-risk findings worth noting
This skill runs flexion-engineer-base:code-review-orchestrator and holds its output to docs/REVIEW.md. The orchestrator decides which reviewers run and how findings are verified. REVIEW.md decides what severity a finding has, what blocks, and when the review is done. Where they disagree, REVIEW.md wins.
Don't restate REVIEW.md from memory: read it at the start of every run, because it changes through team PRs.
docs/REVIEW.md in full. Every reviewer and skeptic gets the whole file by path, not a summary or a hand-picked list of sections, so this skill keeps working when REVIEW.md changes.$ARGUMENTS if given; otherwise gh pr view --json number. With no PR, review git diff origin/main...HEAD and skip the steps that need one (Turn 0, posting).gh pr view <n> --json number,title,body,author,isDraft,headRefOid,baseRefName,files,labels
gh pr diff <n>gh issue view <issue>. Don't guess the criteria.gh api user --jq .login with the PR's author:
flexion-engineer-base:code-review-orchestrator skill isn't available, stop and tell the user to enable the Flexion plugin. Don't fall back to an ad-hoc review: the point is that everyone runs the same one.Decide both from REVIEW.md before launching any reviewer, and state them at the top of the report:
Ask before launching reviewers when something is missing that the review needs. Put all questions in one short message, and only these:
When the PR has a readable issue and an obvious tier, don't ask anything; start the review.
Look for an earlier shared-review result on the PR: a PR comment by the PR's author containing the marker <!-- shared-review sha=<commit> -->. Ignore markers from anyone else.
gh pr view <n> --json author,comments --jq '.author.login as $a | .comments[] | select(.author.login == $a and (.body | contains("<!-- shared-review sha="))) | {createdAt, body}'Author mode:
sha in the most recent marker as the baseline. This replaces the orchestrator's own baseline lookup, which only looks at formal GitHub reviews and wouldn't find the comment. Following REVIEW.md, the scope is the commits since that SHA, plus already-reviewed code whose behavior they change, plus findings from that result that are still open.Reviewer mode:
Delta scope (both modes). Don't diff the baseline straight to HEAD: if the author merged the base branch in since then, that diff includes other people's merged code. Instead, review the hunks of the current PR diff (gh pr diff <n>) in files that changed since the baseline. Fetch first: in reviewer mode the new head usually isn't local yet.
git fetch origin <base> "pull/<n>/head" # makes <headRefOid> and origin/<base> current; step 4 needs this too
git cat-file -e "<baseline>^{commit}" || echo "baseline commit missing"
git merge-base --is-ancestor <baseline> <headRefOid> && git diff --name-only <baseline> <headRefOid>Intersect that file list with gh pr diff <n> --name-only, then add already-reviewed code whose behavior those hunks change. If the baseline commit is missing, or the ancestry check exits non-zero (the branch was rebased or force-pushed), tell the user which one it was and do a full review instead.
Skeptic turns: N = 3 for Tier 3 PRs, N = 2 otherwise.
The reviewer agents can only read files; they can't run git or gh. Whatever branch the user has checked out isn't necessarily the PR (in reviewer mode it rarely is), so before launching them, put the PR's own code and the base versions in a scratch directory outside the repo and point every brief at those paths, never at the working tree:
The scratch directory is a fixed path, /tmp/ops-pr-review-<n>, because shell variables don't survive from one Bash call to the next. Write the literal path in every command, brief and cleanup step below. If you haven't fetched yet in step 3, run that git fetch line first.
git worktree remove --force /tmp/ops-pr-review-<n>/head 2>/dev/null; rm -rf /tmp/ops-pr-review-<n> # clear a leftover run
mkdir -p /tmp/ops-pr-review-<n>/base
git worktree add --detach /tmp/ops-pr-review-<n>/head <headRefOid> # the full PR tree, for reading consuming code
gh pr diff <n> > /tmp/ops-pr-review-<n>/pr.diff
MB=$(git merge-base "origin/<base>" <headRefOid>) # where the PR branched off; the PR diff is measured from here
git diff --name-status -M "$MB" <headRefOid> | while IFS=$'\t' read -r kind old new; do
case "$kind" in
A) echo "added in PR: $old" ;;
R*|C*) mkdir -p "/tmp/ops-pr-review-<n>/base/$(dirname "$new")"
git show "$MB:$old" > "/tmp/ops-pr-review-<n>/base/$new"
echo "renamed in PR: $old -> $new" ;;
*) mkdir -p "/tmp/ops-pr-review-<n>/base/$(dirname "$old")"
git show "$MB:$old" > "/tmp/ops-pr-review-<n>/base/$old" ;;
esac
doneRun the block in one Bash call, since $MB only lives inside it. Also write the PR body and the linked issue there.
Base copies come from the merge-base, the commit the PR branched from, not the base branch tip: that is what the PR diff is measured against, so a later change on the base branch doesn't look like something the PR did, and a file deleted on the base since then still gets its copy. Base copies are stored under each file's new path, so base/<path> and head/<path> line up even for renamed files. Tell the reviewers which files were added (no base copy) and which were renamed, from the loop's output.
When the review is done, clean up with git worktree remove --force /tmp/ops-pr-review-<n>/head && rm -rf /tmp/ops-pr-review-<n>. If a run was interrupted and the directory is already gone, git worktree prune clears the stale entry.
Invoke the flexion-engineer-base:code-review-orchestrator skill in the mode above and follow it, with these additions to every reviewer agent's launch brief and every skeptic's brief:
docs/REVIEW.md with an instruction to read all of it, plus the PR's scope and tier, and the acceptance criteria (or "not available").[Pre-existing S<n>]. Compare against the base/ copies, which come from the merge-base with the PR's base branch (baseRefName, which isn't always main: stacked PRs target another feature branch).REOPENED and cite the unchanged code. Suppression still applies to S2/S3.If the PR has open CodeQL, Semgrep or Snyk alerts on lines it changed, map them with REVIEW.md's scanner rules and include them as findings.
Keep the orchestrator's disposition table, with a Final S column added. Then:
<sha>), N.[tracked] and link the thread), plus any prior finding the delta's resolution table marks UNRESOLVED or PARTIALLY-RESOLVED (tag it [unresolved]). Give tracked and unresolved items an S label too if they don't have one.[Pre-existing S<n>] labels.[missed] right after the severity, for example [S1][missed] path:line. If the author's result was on an older commit, a finding counts as missed only if its code was already in that commit. If the author posted no result, say so and tag nothing.Verdict: BLOCKING (n) or Verdict: NOT BLOCKING, where n is the number of findings in the Blocking list. A finding that doesn't block under the PR's Scope (any S1 on a bot PR; an S1 on a docs-only or tooling PR that isn't a broken command, path or rule) goes in Non-blocking instead and isn't counted.A clean run is one whose verdict is NOT BLOCKING on the PR's current head commit. Re-running until a finding disappears doesn't close it; only a fix, or a won't-fix agreed by a second developer in a PR comment, does.
Show the report to the user first, in markdown in the conversation, and post it only when they ask. You can show the comment or review you'd post, but don't post it until they say so.
Draft PRs: don't post on a draft PR. If the user asks you to, tell them it's a draft and ask whether they want to wait until it's marked ready for review.
Author mode:
gh pr comment <n> --body-file <file>, and put <!-- shared-review sha=<head sha reviewed> --> on its first line so the next run can find its baseline.NOT BLOCKING and the repo has a ready-for-human-review label, offer to add it. Don't create labels. Check with an exact match, since gh label list --search is fuzzy and returns other labels when this one doesn't exist:
gh label list --limit 500 --json name --jq '.[].name' | grep -qx ready-for-human-reviewReviewer mode:
[missed] tag if it has one.REQUEST_CHANGES if the verdict is BLOCKING, otherwise COMMENT. Never APPROVE: approving is the human reviewer's decision, made after the intent and risk checks in REVIEW.md.gh api repos/{owner}/{repo}/pulls/<n>/reviews --input review.jsonreview.json has commit_id (the head SHA reviewed), event, body and comments. Each comment has path, line, side and body: use side: "RIGHT" with the new file's line number, or side: "LEFT" with the old file's line number for a finding on a deleted line (for example a removed @is_authorized). If you can't place a finding on a line that's in the diff, put it in the body instead; one bad line makes GitHub reject the whole review.[missed] and the repo has a missed label (gh label list --limit 500 --json name --jq '.[].name' | grep -qx missed), offer to add it to the PR. Don't create labels.HHS/OPRE-OPS
f75fe0e
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.