Code Review Specialists
Use this workflow to review broad or risky diffs through focused, read-only
specialist lenses before a reviewer makes a decision.
Contract
Prereqs:
- Run inside the target git repository with
git available on PATH.
review-specialists is installed from the released nils-cli package and
available on PATH.
- Know the base ref for the diff under review, or explicitly choose one before
running scope detection.
- Keep this workflow read-only: it does not auto-fix code, merge, close PRs/MRs,
open/close issues, or post live provider comments.
- On hosts that spawn subagents without an explicit per-run request (e.g. Claude
Code, or any host where the user invoked a delegation mode or explicitly asked),
dispatch the managed read-only
reviewer-<lens> subagents for the selected
lenses by default. On hosts that only spawn subagents on explicit request (e.g.
Codex), run the lenses inline by default — the expected path for that host, not
a waiver — and dispatch subagents only when the user explicitly opts in. Either
way the parent agent owns lens selection, dispatch, validation, and merge, and
records a waiver only when an intended dispatch genuinely fails.
- Use
review-dispatch-lane-pr for PR decision actions and review-evidence only
when findings need a retained evidence record.
Inputs:
- Diff base ref, optional review target summary, and optional validation
evidence to inspect.
- Optional forced specialist flags:
--testing, --security,
--performance, --data-migration, --api-contract, --maintainability,
--red-team, or --all-specialists.
- Optional specialist JSONL finding files for deterministic validation, merge,
rendering, and bundle synthesis.
- Optional confidence display threshold for merged findings.
Outputs:
- Scope JSON from
review-specialists scope describing changed files, diff
size, stack signals, test framework signals, and suggested specialists.
- Read-only specialist findings with concrete file or evidence anchors.
- A final specialist review report using
references/SPECIALIST_REVIEW_REPORT_TEMPLATE.md.
- Optional
review-evidence records when retained workflow evidence is needed.
- No source edits, PR/MR comments, merge decisions, or close decisions from this
workflow.
Failure modes:
- Base ref is missing or does not resolve in the target repository.
- Diff is too small or low-risk for specialist review and no specialist was
forced.
- Specialist output is malformed JSONL, lacks required fields, uses unsupported
severity values, or omits evidence anchors.
- Findings lack enough confidence or evidence to support a concrete issue; mark
them as residual risk instead of presenting them as verified findings.
- Caller tries to use this workflow as a substitute for
review-dispatch-lane-pr,
review-evidence, browser-session checks, CI repair automation, or
implementation work.
Entrypoint
Use the released CLI directly:
review-specialists scope --base "$BASE_REF" --format json
review-specialists validate --input findings.jsonl --format json
review-specialists merge --input findings.jsonl --summary-out specialist-review.md --format json
review-specialists render --profile report --input merged-findings.json --out specialist-review.md
review-specialists bundle --input findings.jsonl --out-dir "$REVIEW_OUT" --profile report --format json
When To Use
- The user explicitly asks for specialist code review.
- A PR/MR or diff is large, risky, security-sensitive, migration-heavy,
API-contract heavy, or broader than normal reviewer confidence.
- Normal tests are not enough to reason about cross-cutting risk.
- An issue or plan PR review needs supplemental specialist findings before the
review-dispatch-lane-pr decision path.
Do not use it for tiny diffs, ordinary implementation work, pure formatting or
doc-only changes unless requested, CI repair loops, or browser-facing checks
owned by browser-session workflows.
Use code-review-quick-pass for lightweight review, code-review-focused-lens
for one explicitly requested lens, code-review-pre-merge-gate for delivery
gate review, and code-review-follow-up when re-checking previous findings
after fixes.
Workflow
Establish the review target and base ref. For a PR/MR, use the actual
PR/MR base or merge-base rather than a moving origin/main guess.
Run deterministic scope detection:
review-specialists scope --base "$BASE_REF" --format json
If diff_lines < 50, skip specialist review unless the user forced a
specialist or all specialists.
Select specialists:
- Always consider
testing and maintainability for larger diffs.
- Consider
security for auth changes or backend changes over 100 diff
lines.
- Consider
performance for backend or frontend runtime changes.
- Consider
data-migration for migration, schema, or data transform changes.
- Consider
api-contract for route, controller, API schema, OpenAPI,
GraphQL, or protocol changes.
Select the matching managed reviewer subagents for the chosen lenses
(reviewer-testing, reviewer-maintainability, reviewer-security,
reviewer-performance, reviewer-data-migration, reviewer-api-contract),
installed at ~/.codex/agents/reviewer-<lens>.toml and
~/.claude/agents/reviewer-<lens>.md.
Dispatch the selected read-only reviewer subagents one per lens, handing each
the base ref and scope; each inspects read-only and returns JSONL findings for
its lens. This is the default on hosts that spawn subagents without an explicit
per-run request (e.g. Claude Code). On hosts that only spawn subagents on
explicit request (e.g. Codex), or when an intended dispatch fails, run the
lenses inline (reading the prompt from references/specialists/); inline is
the expected path for explicit-only hosts and needs no waiver, but record a
waiver when an intended dispatch genuinely fails. You stay the parent: you own
base-ref selection, lens selection, dispatch, and the validation/merge steps
below.
Collect each subagent's JSONL findings (or the inline equivalent) following
references/SPECIALIST_REVIEW_CONTRACT.md. Treat malformed JSONL, missing
required fields, unsupported severities, or absent evidence anchors as a
workflow failure or residual risk for that lens — never promote it to a
verified finding. Mark unverifiable claims as residual risk, not findings.
Validate and merge findings:
review-specialists validate --input findings.jsonl --validate-paths --format json
review-specialists merge --input findings.jsonl --summary-out specialist-review.md --format json
Run red-team only after the selected specialists when diff_lines > 200, any
selected specialist produced a critical finding, or the reviewer forced it.
On hosts that spawn subagents without an explicit per-run request, dispatch
reviewer-red-team; on explicit-only hosts such as Codex, run the same
red-team lens inline from references/specialists/red-team.md unless the
user explicitly opted into subagents. Hand it the merged first-wave findings
so it can probe cross-cutting failure modes. Pass the red-team JSONL through
review-specialists validate, then append it to the first-wave JSONL and run
review-specialists merge again over the combined input so duplicate
fingerprints, confirming specialists, and confidence ordering are resolved in
the final report.
Use the report template for the final synthesis. The recommended next step
may route to review-dispatch-lane-pr, a normal implementation workflow, or a
retained review-evidence record, but this workflow does not execute that
decision.
Boundary
code-review-specialists owns scope detection, specialist selection,
reviewer-subagent dispatch, validation and merge of the returned findings, and
the merged report. Each reviewer-<lens> subagent owns only its read-only lens.
This workflow does not fix code, post PR or MR review comments, mark a draft
reviewable ready, merge, close issues, or execute the recommended next step —
those belong to the owning PR / MR delivery skills, review-dispatch-lane-pr,
or review-evidence.
References
- Reviewer subagent sources:
core/agents/code-review/reviewer-<lens>/AGENT.md.tera
- Specialist review contract:
references/SPECIALIST_REVIEW_CONTRACT.md
- Quick pass workflow:
skills/code-review/code-review-quick-pass/SKILL.md
- Focused lens workflow:
skills/code-review/code-review-focused-lens/SKILL.md
- Pre-merge gate workflow:
skills/code-review/code-review-pre-merge-gate/SKILL.md
- Follow-up workflow:
skills/code-review/code-review-follow-up/SKILL.md
- Report template:
references/SPECIALIST_REVIEW_REPORT_TEMPLATE.md
- Specialist prompts:
references/specialists/
- Delivery specialist review gate:
references/DELIVERY_SPECIALIST_REVIEW_GATE.md
- Delivery review outcome comment:
references/DELIVERY_REVIEW_OUTCOME_COMMENT.md
- Delivery review outcome schema:
references/DELIVERY_REVIEW_OUTCOME_SCHEMA.md
- PR decision workflow:
skills/dispatch/review-dispatch-lane-pr/SKILL.md
- Review evidence tool:
skills/evidence/review-evidence/SKILL.md
Source: graysurf/agent-runtime-kit — distributed by TomeVault.
1---2name: code-review-specialists3description: Use this workflow to review broad or risky diffs through focused, read-only4---56# Code Review Specialists78Use this workflow to review broad or risky diffs through focused, read-only9specialist lenses before a reviewer makes a decision.1011## Contract1213Prereqs:1415- Run inside the target git repository with `git` available on `PATH`.16- `review-specialists` is installed from the released nils-cli package and17 available on `PATH`.18- Know the base ref for the diff under review, or explicitly choose one before19 running scope detection.20- Keep this workflow read-only: it does not auto-fix code, merge, close PRs/MRs,21 open/close issues, or post live provider comments.22- On hosts that spawn subagents without an explicit per-run request (e.g. Claude23 Code, or any host where the user invoked a delegation mode or explicitly asked),24 dispatch the managed read-only `reviewer-<lens>` subagents for the selected25 lenses by default. On hosts that only spawn subagents on explicit request (e.g.26 Codex), run the lenses inline by default — the expected path for that host, not27 a waiver — and dispatch subagents only when the user explicitly opts in. Either28 way the parent agent owns lens selection, dispatch, validation, and merge, and29 records a waiver only when an intended dispatch genuinely fails.30- Use `review-dispatch-lane-pr` for PR decision actions and `review-evidence` only31 when findings need a retained evidence record.3233Inputs:3435- Diff base ref, optional review target summary, and optional validation36 evidence to inspect.37- Optional forced specialist flags: `--testing`, `--security`,38 `--performance`, `--data-migration`, `--api-contract`, `--maintainability`,39 `--red-team`, or `--all-specialists`.40- Optional specialist JSONL finding files for deterministic validation, merge,41 rendering, and bundle synthesis.42- Optional confidence display threshold for merged findings.4344Outputs:4546- Scope JSON from `review-specialists scope` describing changed files, diff47 size, stack signals, test framework signals, and suggested specialists.48- Read-only specialist findings with concrete file or evidence anchors.49- A final specialist review report using50 `references/SPECIALIST_REVIEW_REPORT_TEMPLATE.md`.51- Optional `review-evidence` records when retained workflow evidence is needed.52- No source edits, PR/MR comments, merge decisions, or close decisions from this53 workflow.5455Failure modes:5657- Base ref is missing or does not resolve in the target repository.58- Diff is too small or low-risk for specialist review and no specialist was59 forced.60- Specialist output is malformed JSONL, lacks required fields, uses unsupported61 severity values, or omits evidence anchors.62- Findings lack enough confidence or evidence to support a concrete issue; mark63 them as residual risk instead of presenting them as verified findings.64- Caller tries to use this workflow as a substitute for `review-dispatch-lane-pr`,65 `review-evidence`, browser-session checks, CI repair automation, or66 implementation work.6768## Entrypoint6970Use the released CLI directly:7172```bash73review-specialists scope --base "$BASE_REF" --format json74review-specialists validate --input findings.jsonl --format json75review-specialists merge --input findings.jsonl --summary-out specialist-review.md --format json76review-specialists render --profile report --input merged-findings.json --out specialist-review.md77review-specialists bundle --input findings.jsonl --out-dir "$REVIEW_OUT" --profile report --format json78```7980## When To Use8182- The user explicitly asks for specialist code review.83- A PR/MR or diff is large, risky, security-sensitive, migration-heavy,84 API-contract heavy, or broader than normal reviewer confidence.85- Normal tests are not enough to reason about cross-cutting risk.86- An issue or plan PR review needs supplemental specialist findings before the87 `review-dispatch-lane-pr` decision path.8889Do not use it for tiny diffs, ordinary implementation work, pure formatting or90doc-only changes unless requested, CI repair loops, or browser-facing checks91owned by browser-session workflows.92Use `code-review-quick-pass` for lightweight review, `code-review-focused-lens`93for one explicitly requested lens, `code-review-pre-merge-gate` for delivery94gate review, and `code-review-follow-up` when re-checking previous findings95after fixes.9697## Workflow98991. Establish the review target and base ref. For a PR/MR, use the actual100 PR/MR base or merge-base rather than a moving `origin/main` guess.1012. Run deterministic scope detection:102103 ```bash104 review-specialists scope --base "$BASE_REF" --format json105 ```1061073. If `diff_lines < 50`, skip specialist review unless the user forced a108 specialist or all specialists.1094. Select specialists:110 - Always consider `testing` and `maintainability` for larger diffs.111 - Consider `security` for auth changes or backend changes over 100 diff112 lines.113 - Consider `performance` for backend or frontend runtime changes.114 - Consider `data-migration` for migration, schema, or data transform changes.115 - Consider `api-contract` for route, controller, API schema, OpenAPI,116 GraphQL, or protocol changes.1175. Select the matching managed reviewer subagents for the chosen lenses118 (`reviewer-testing`, `reviewer-maintainability`, `reviewer-security`,119 `reviewer-performance`, `reviewer-data-migration`, `reviewer-api-contract`),120 installed at `~/.codex/agents/reviewer-<lens>.toml` and121 `~/.claude/agents/reviewer-<lens>.md`.1226. Dispatch the selected read-only reviewer subagents one per lens, handing each123 the base ref and scope; each inspects read-only and returns JSONL findings for124 its lens. This is the default on hosts that spawn subagents without an explicit125 per-run request (e.g. Claude Code). On hosts that only spawn subagents on126 explicit request (e.g. Codex), or when an intended dispatch fails, run the127 lenses inline (reading the prompt from `references/specialists/`); inline is128 the expected path for explicit-only hosts and needs no waiver, but record a129 waiver when an intended dispatch genuinely fails. You stay the parent: you own130 base-ref selection, lens selection, dispatch, and the validation/merge steps131 below.1327. Collect each subagent's JSONL findings (or the inline equivalent) following133 `references/SPECIALIST_REVIEW_CONTRACT.md`. Treat malformed JSONL, missing134 required fields, unsupported severities, or absent evidence anchors as a135 workflow failure or residual risk for that lens — never promote it to a136 verified finding. Mark unverifiable claims as residual risk, not findings.1378. Validate and merge findings:138139 ```bash140 review-specialists validate --input findings.jsonl --validate-paths --format json141 review-specialists merge --input findings.jsonl --summary-out specialist-review.md --format json142 ```1431449. Run red-team only after the selected specialists when `diff_lines > 200`, any145 selected specialist produced a `critical` finding, or the reviewer forced it.146 On hosts that spawn subagents without an explicit per-run request, dispatch147 `reviewer-red-team`; on explicit-only hosts such as Codex, run the same148 red-team lens inline from `references/specialists/red-team.md` unless the149 user explicitly opted into subagents. Hand it the merged first-wave findings150 so it can probe cross-cutting failure modes. Pass the red-team JSONL through151 `review-specialists validate`, then append it to the first-wave JSONL and run152 `review-specialists merge` again over the combined input so duplicate153 fingerprints, confirming specialists, and confidence ordering are resolved in154 the final report.15510. Use the report template for the final synthesis. The recommended next step156 may route to `review-dispatch-lane-pr`, a normal implementation workflow, or a157 retained `review-evidence` record, but this workflow does not execute that158 decision.159160## Boundary161162`code-review-specialists` owns scope detection, specialist selection,163reviewer-subagent dispatch, validation and merge of the returned findings, and164the merged report. Each `reviewer-<lens>` subagent owns only its read-only lens.165This workflow does not fix code, post PR or MR review comments, mark a draft166reviewable ready, merge, close issues, or execute the recommended next step —167those belong to the owning PR / MR delivery skills, `review-dispatch-lane-pr`,168or `review-evidence`.169170## References171172- Reviewer subagent sources:173 `core/agents/code-review/reviewer-<lens>/AGENT.md.tera`174- Specialist review contract:175 `references/SPECIALIST_REVIEW_CONTRACT.md`176- Quick pass workflow:177 `skills/code-review/code-review-quick-pass/SKILL.md`178- Focused lens workflow:179 `skills/code-review/code-review-focused-lens/SKILL.md`180- Pre-merge gate workflow:181 `skills/code-review/code-review-pre-merge-gate/SKILL.md`182- Follow-up workflow:183 `skills/code-review/code-review-follow-up/SKILL.md`184- Report template:185 `references/SPECIALIST_REVIEW_REPORT_TEMPLATE.md`186- Specialist prompts:187 `references/specialists/`188- Delivery specialist review gate:189 `references/DELIVERY_SPECIALIST_REVIEW_GATE.md`190- Delivery review outcome comment:191 `references/DELIVERY_REVIEW_OUTCOME_COMMENT.md`192- Delivery review outcome schema:193 `references/DELIVERY_REVIEW_OUTCOME_SCHEMA.md`194- PR decision workflow:195 `skills/dispatch/review-dispatch-lane-pr/SKILL.md`196- Review evidence tool:197 `skills/evidence/review-evidence/SKILL.md`198199---200> Source: [graysurf/agent-runtime-kit](https://github.com/graysurf/agent-runtime-kit) — distributed by [TomeVault](https://tomevault.io).201<!-- tomevault:4.0:skill_md:2026-06-16 -->