/synthex:review-code/synthex:review-code
BuildMulti-perspective review — Code + Security + (optional) Performance, prompt-file, and multi-model reviewers.
Invocation
Run from inside Claude Code in any project where Synthex is installed:
/synthex:review-codeSome commands accept parameters; see the source-of-truth file linked below for the full parameter list and workflow.
Lifecycle phase
Build. Parallel-executed, peer-reviewed task delivery.
Related agents
- Tech Lead · Full-stack orchestrator. Breaks tasks down, delegates to specialists, rolls up the result.
- Lead Frontend Engineer · Coordinates frontend delivery, enforces UX quality, accessibility, and design-system fidelity.
- Architect · System design, ADRs, plan-review feasibility, technology trade-offs.
- Code Reviewer · Craftsmanship review — correctness, maintainability, reuse, conventions.
- Security Reviewer · Mandatory gate. Secrets, injection, auth, supply chain, OWASP.
- Quality Engineer · Test strategy, gap analysis, behavior-driven test authoring.
- Design System · Token ownership, component governance, compliance audit.
- Technical Writer · API docs, guides, migrations, changelogs verifiable against code.
Source
The command's parameters, workflow, and sub-agent invocations are defined in markdown at bluminal/lumenai/blob/main/plugins/synthex/commands/review-code.md.
Last modified:
What it does, end-to-end
/synthex:review-code/synthex:review-code is the standalone command for reviewing a diff. It runs the same reviewer pipeline that /synthex:next-priority/synthex:next-priority uses internally during the build phase — but here it's user-facing, so you can invoke it on demand against any diff.
Each invocation:
- Routes to a standing pool, if one is running. With
standing_pools.enabled: trueand a running pool whose roster covers the configured reviewers, the review is submitted to that pool and the pool's report is the review. Prompt-file reviewers don't run on that path. See Standing pools. Otherwise it continues below. - Resolves the diff under review. Default: the staged changes, or the unstaged changes
when nothing is staged. Pass
targetto review specific files, a directory, or a git range such asmain..HEAD. - Gathers context. The project instruction file (
AGENTS.md,CLAUDE.md, or your harness's equivalent), the convention sources (.eslintrc,.prettierrc), and the languages and frameworks in the diff. Reviewers check relevant specs undercode_review.spec_pathsthemselves. - Fans out to reviewers. The mandatory pair — Code Reviewer
and Security Reviewer — runs in parallel,
along with any extra reviewers configured under
code_review.reviewersorcode_review.specialists. When the diff touches UI files (.tsx,.jsx,.css,.scss,.vue,.svelte), the Design System Agent joins automatically — no config needed. Withcode_review.verification: prose, each reviewer double-checks its top critical and high findings before reporting them (see Verification pass). On Claude Code withcode_review.engine: workflowand aWorkflowtool available, this step runs through the review engine instead, andcode_review.refute_pass: onadds an adversarial refute pass on critical and high findings. - Optionally fans out to multi-model. When both
multi_model_review.enabledandmulti_model_review.per_command.review_code.enabledare true (and the diff isn't trivial), or you pass--multi-model, the Multi-Model Review Orchestrator also runs external CLI reviewers from other model families. All findings feed into the same consolidator.--no-multi-modelforces native-only for one run. See Multi-model review. - Consolidates findings. The Findings Consolidator dedupes, preserves attribution, ranks by severity. Output is one tractable list, not three-to-five overlapping reports.
- Iterates the review loop. If findings at or above
min_severity_to_address(defaulthigh) remain, the orchestrator (Tech Lead, when invoked from /synthex:next-priority/synthex:next-priority, or you, when run standalone) addresses them and reviewers re-run. Bounded bymax_cycles(default2). - Emits a verdict. PASS / WARN / FAIL with the consolidated findings list. The overall verdict follows the strictest reviewer: FAIL if any CRITICAL or HIGH finding remains after the cycle cap, WARN if only MEDIUM findings remain, PASS otherwise. WARN doesn't trigger the fix loop.
Reviewer roster
Default mandatory pair:
code_review:
reviewers:
- code-reviewer
- security-reviewerAdd specialists for performance-critical or regulated codebases:
code_review:
reviewers:
- code-reviewer
- security-reviewer
- performance-engineer
specialists:
- agent: compliance-reviewer
focus: "Regulatory compliance, audit-trail requirements"The convention: everything under reviewers runs in parallel on every review. specialists is
an optional list of additional reviewers, each with a focus prompt. The Design System Agent
needs no entry: it is added automatically whenever the diff touches UI files.
Prompt-file reviewers
A reviewers entry can also point at a markdown prompt file in your project — for example,
an existing CI review prompt — instead of naming a Synthex agent:
code_review:
reviewers:
- code-reviewer
- security-reviewer
- prompt: .github/scripts/pr-guardian/prompt.md
id: pr-guardian # optional
enabled: true # optional; false skips it| Key | Required | Meaning |
|---|---|---|
prompt | Yes | Path to the prompt file, relative to the project root. Absolute paths and paths outside the project are rejected. |
id | No | Name the reviewer is reported under. Defaults as described below. |
enabled | No | false skips the reviewer. Defaults to true. |
The prompt runs alongside the agent reviewers, and its findings flow through the same Findings
Consolidator — deduped, severity-ranked, attributed to pr-guardian, and counted toward the
PASS / WARN / FAIL verdict. On the multi-model path, prompt-file reviewers are launched
alongside the orchestrator and merged into its report. A review routed to a standing pool does
not run them. Synthex appends its own findings format to the prompt, so a prompt written for CI
doesn't need rewriting — and the reviewer is told to ignore any instruction to post comments or
otherwise act. That is a convention, not a sandbox: review prompt files as you would any code
that runs in your repo. A bad path skips that one reviewer with a warning, never the whole review. See
Prompt-file reviewers for the full key reference.
The id is optional. Without one, the reviewer is named after the file's frontmatter name;
failing that, a generic filename (prompt.md, review.md, index.md) takes its directory's
name, so .github/scripts/pr-guardian/prompt.md reports as pr-guardian. Any other file is
named after its filename, without the extension.
An empty roster fails
If every reviewer is disabled, skipped, or unusable — for example, a list made only of prompt-file entries whose paths don't exist — the review reports FAIL rather than an empty PASS. A review that checked nothing never reads as clean.
What "PASS" actually means
A PASS verdict is not a guarantee the code is correct. It is a guarantee that:
- Both mandatory reviewers ran on the diff.
- All findings at or above the configured severity threshold were addressed.
- The diff matches the project conventions in
convention_sources(within the reviewer's ability to detect). - No spec violations were found in the configured
spec_paths.
It does not guarantee runtime correctness, performance, or completeness — those are
covered by tests, audits, and observation, not review. The reviewers are advisory; the
final accountability for what merges is the orchestrating agent's (and yours, for [H]
gates).
When to invoke it directly
You normally don't — /synthex:next-priority/synthex:next-priority wraps it during the build phase. Reach for /synthex:review-code/synthex:review-code standalone when:
- Running review on a non-Synthex-orchestrated change (manual edit, hotfix, contributor PR).
- Reviewing a diff that's larger than
code_review.max_diff_lines(default300) — Synthex warns and asks before continuing; large diffs get lower-confidence findings. - Re-running review after addressing prior findings without re-engaging the full Tech Lead workflow.
Parameters
| Parameter | Description | Default | Required |
|---|---|---|---|
target | File paths, a directory, or a git range (e.g. main..HEAD) to review | Staged changes, else unstaged changes | No |
config_path | Path to the Synthex project config | .synthex/config.yaml | No |
--multi-model / --no-multi-model | Force multi-model review on or off for this run, overriding config | From multi_model_review config | No |
--profile <tier> | Override models.profile (economy, balanced, premium) for the spawned reviewers | models.profile (balanced) | No |
--loop | Re-run until the completion promise is emitted (see Native looping) | Off | No |
--completion-promise <text> | Text that ends the loop | ALLDONE<session_id> (falls back to ALLDONE<loop_id>) | No |
--max-iterations <n> | Loop iteration cap (hard ceiling 200) | 20 | No |
--loop-isolated | Run each loop iteration in a fresh sub-agent | Off | No |
--name <slug> | Loop id slug (^[a-z0-9][a-z0-9-]{0,63}$) | review-code-<4-char-hex> | No |
Common scenarios
"Diff is too large to review"
When a diff exceeds max_diff_lines, Synthex warns, suggests splitting it, and asks whether
to continue. You have two options:
- Split the diff into smaller PRs, then review each. This is the higher-quality path.
- Confirm and proceed, accepting that findings will be less precise.
Synthex asks rather than refusing, because real projects sometimes need to review a large change.
"All findings are below the threshold"
The verdict is WARN (MEDIUM findings) or PASS (only LOW findings), but the consolidated
findings list is non-empty. These are recorded in the output for your review; they don't
trigger the fix loop or block merge, but they're worth scanning. Some teams set a quarterly
cleanup cadence to address accumulated medium findings as a batch.
"Reviewers disagree on severity"
The Findings Consolidator preserves both verdicts with attribution. You decide. Disagreement is high-signal — usually it means the issue has a nuance one reviewer caught and the other didn't.
Native looping
Pass --loop to re-run review until the diff stabilizes — useful when iterating on
findings without leaving the command. The framework contract (state file, resume semantics,
auto-compaction) lives at Native looping; this section
covers only the command-specific emission rule.
Inner vs. outer. The pre-existing review_loops.max_cycles (default 2) is the
inner review-cycle bound — reviewers re-run after findings get addressed within a
single /synthex:review-code invocation. --loop is the outer wrapper that re-runs
the whole invocation. They compose without interfering: the inner cycle finishes per
invocation; the outer loop's emission check fires only at end-of-invocation.
Emission rule. The loop terminates when:
- The cycle ended with zero
FAILfindings, and - All
WARNfindings are either resolved or explicitly accepted by the author, and - No recommended-change items remain, and
- A follow-up iteration would not surface new findings on the current diff.
Example. Iterate review-and-fix on a branch until clean:
/synthex:review-code --loop \
--completion-promise "REVIEW_CLEAN" \
--max-iterations 10 \
target=main..feature/payments-v2