/prometheus-process-skills:adversarial-reviewfrom prometheus-process-skills
Isolated, cross-model adversarial review of KBD artifacts and change diffs. Dispatches a fresh-context LLM judge over an OpenAI-compatible REST gateway (openai-proxy or `liter-llm api`) with an explicit mandate to find problems — the model that produced an artifact or change is never the model that reviews it. Runs as a pipeline stage inside kbd-assess/analyze/plan (artifact mode) and kbd-execute's single phase-boundary QA step (diff mode, once over the whole phase diff). Findings are severity-bucketed (CRITICAL/WARNING/SUGGESTION) and the judge's own report is screened by sycophancy-correction before it is surfaced.
Ships in prometheus-process-skills. 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; scripts run unread.
Run an isolated, cross-model, mandate-to-find-problems review of either a change diff (post-implementation) or a KBD planning artifact (pre-implementation).
Before building the review packet, emit:
Starting adversarial-review — <mode> <target>
After the normalized findings are written, emit:
Completed adversarial-review — <verdict> (<critical>/<warning>/<suggestion>)
Use the target and counts from the packet/findings files. Never guess them.
This is a different job from the existing gates:
refine-validate is a deterministic checklist — it catches what was
thought of in advance. Adversarial review hunts for what was not.sycophancy-correction corrects existing text for excess agreeableness.
Adversarial review generates a finding set from scratch — and then has
its own report screened by sycophancy-correction (see Anti-Theater Gate).The judge is a fresh-context API call to an OpenAI-compatible
/v1/chat/completions gateway. It
receives only a review packet — diff or artifact, acceptance criteria or
goals, file tree, constraints — and never the producing session's chat
history. Isolation is structural, not honor-system: the session reads only
the normalized findings JSON (the same pattern pmpo-evolver uses for its
isolated collection subprocesses).
The producer never grades itself. The packet records producer_model;
dispatch falls back from the judge role to the critic role when they would
match, and emits a JUDGE_MODEL_COLLISION warning when no alternative differs
(see references/isolation-and-routing.md). A packet with
producer_model: unknown makes that comparison pass trivially, so it is
recorded as cross_model_check: unverified-producer-unknown rather than
passed off as a clean cross-model review.
--mode diff — post-implementation (kbd-execute boundary QA)Reviews the completed phase's cumulative diff against its acceptance criteria,
once, as step 5 of the value-phase boundary (B4). It does not run after an
individual task or change. Runs after refine-validate passes (cheap
deterministic checklist first, expensive judgment second) and before
archive.
Packet contents: change diff, acceptance criteria (tasks.md / OpenSpec spec
/ verification.md), repo file tree, blocking constraints from
.kbd-orchestrator/constraints.md, producer_model.
--mode artifact — pre-implementation (assess / analyze / plan)Vets a stage artifact before the stage hands off, so downstream stages run against reviewed inputs:
| Stage | Artifact(s) | Mandate focus |
|---|---|---|
assess | assessment.md | missed gaps; claims unsupported by the codebase |
analyze | analysis.md, library-candidates.json | build-vs-adopt blind spots; uninspected candidates; stale landscape |
plan | plan.md | wrong ordering; missing dependencies; untestable or ambiguous change criteria |
research | report.md, <slug>.provenance.md, plan.md of a deep-research package | invented or orphan citations; unanswered sub-questions; contradictions presented as settled; a frontmatter verification_status the sidecar does not support |
Packet contents: the artifact(s), phase goals.md, prior-stage handoff
summaries, constraints, producer_model.
The research target is the one artifact target that is not a KBD stage: it
takes --package <dir> instead of --phase, its goals are the run's query,
parameters, and sub-questions (read from checkpoint.json and plan.md), the
three files travel as separate fields (research_report,
research_provenance, research_plan) so the per-field cap applies to each,
review_focus names the failure classes, and packet.truncation is always
recorded. A package missing any of the three files is refused with exit 2.
The deep-research driver (run-research.sh) builds this packet between stage
09 and stage 10, after stage 05 verification has validated and never in the
same dispatch as it; see the "verifier before reviewer" rule in
skills/research/deep-research/SKILL.md.
build-review-packet.sh --mode artifact --target research --package ~/.prometheus/research/<package_id> --out review/packet.json
dispatch-judge.sh --mode artifact --packet review/packet.json --out review/findings.json
--mode skill / --mode agent — generated artifacts (creation gate)Reviews something a generator just produced, so a skill or agent is judged
by a model that did not write it. Unlike the two modes above, --target is a
filesystem path and --phase is optional — a creator often runs outside any
KBD phase, and requiring one would make the gate unreachable where generation
actually happens.
| Mode | Target | Packet contents |
|---|---|---|
skill | generated skill dir | SKILL.md, parsed frontmatter, script inventory, cross-reference map, validate-skill.sh output, original intent |
agent | generated Cargo workspace | agent.toml, system_prompt.md, workspace members with per-crate purpose, mcp_servers, cargo check result, original intent |
--mode decision — an idea, before committing to itReviews a decision someone is about to make, not code. --target is a
single file, not a directory.
The mandate's core instruction is that the judge must not score novelty. Si, Hashimoto & Yang (2025) had 43 experts spend 100+ hours each executing randomly-assigned ideas: LLM ideas rated more novel before execution, then dropped on every metric after it, and the ranking flipped. A pre-execution novelty rating is evidence pointing the wrong way. The judge rates whether the reasoning survives contact with reality.
The packet parses the decision into decision / assumptions / falsifier and
records missing_fields. A decision stating no falsifier cannot be wrong about
anything, which is itself the defect — the packet surfaces that structurally,
without spending a judge call. It also carries prior_decisions (via pk search), so a decision that contradicts an earlier one is visible to the judge.
build-review-packet.sh --mode decision --target decision.md --intent intent.md --out packet.json
dispatch-judge.sh --mode decision --packet packet.json --out findings.json
Decision-mode findings additionally require confidence (0–100),
what_would_change_this, and a non-empty disconfirming array — see
Output contract. These are the automation-bias
countermeasures: a review that cannot say what would change its mind is
manufacturing certainty.
Ordering matters more than the analysis. For personal or hard-to-reverse
decisions, run commit-before-reveal.sh record first. Showing someone the
analysis and then asking what they think produces agreement, not judgement —
confidence in AI predicts whether users scrutinise it at all. The gate exits 2
and writes no analysis until a judgement is on record.
Decisions and their outcomes persist via decision-log.sh (record /
outcome / revisit), so a later decision can be checked against what actually
happened.
build-review-packet.sh --mode skill --target dist/my-skill --intent spec.md --out packet.json
build-review-packet.sh --mode agent --target ./my-agent --intent spec.md --out packet.json
Both are manifest-level: they record what each file is and does, never its body. A generated workspace is several crates of Rust that would not fit a judge's context and would bury the signal if it did. The contract is enforced, not merely intended — a packet whose descriptive fields contain shell-function or Rust syntax is refused with exit 2 and no packet is written.
Truncation is always recorded. Every field is capped
(PACKET_FIELD_CAP_BYTES, default 40000). A clipped field carries an inline
[TRUNCATED …] marker, and packet.truncation reports the cap and per-field
byte counts. The block is present even when nothing was cut, so "nothing was
dropped" is distinguishable from "this packet predates truncation recording" —
otherwise a judge could return PASS on material it never received.
--intent supplies what the artifact was asked to be. Without it the judge can
only assess internal consistency, never whether the result answers the request;
the packet warns when it is missing. cargo check output is read from a
.cargo-check.txt recorded by the creator, or run in-line with
PACKET_RUN_CARGO_CHECK=1 (off by default — a cold workspace build is far too
slow to sit inside packet assembly).
1. preflight scripts/preflight-models.sh [MODEL_ROUTING] class=small
2. packet scripts/build-review-packet.sh [MODEL_ROUTING] class=small
3. judge scripts/dispatch-judge.sh [MODEL_ROUTING] class=frontier
4. gate scripts/check-findings-sycophancy.sh (anti-theater screen)
5. surface findings JSON → caller gate semantics
Concretely:
SKILL_DIR="${CLAUDE_PLUGIN_ROOT}/skills/process/adversarial-review"
# 0. Load the gateway credential and declare the producer.
# KBD_PRODUCER_MODEL is REQUIRED for the guarantee this skill exists to make.
# The judge's collision check compares candidate != producer, so an unknown
# producer makes it pass trivially — which is exactly what happened to all 8
# historical reviews. Set it to the model running THIS session.
#
# Do NOT write ${KBD_PRODUCER_MODEL:-claude-opus-5}. A default does not fix the
# problem, it hides it: the check would then compare the judge against a guess,
# pass, and record verified-distinct for a comparison that never happened.
# Export the real value, or let the guard refuse.
set -a; . ~/.prometheus/kbd/secrets.env 2>/dev/null || true; set +a
export KBD_PRODUCER_MODEL="claude-opus-5" # ← the model running THIS session
# 1. Preflight (cached 24h at .kbd-orchestrator/model-preflight.json)
# Reports the gateway, the model per role, and WHICH config layer supplied it.
bash "$SKILL_DIR/scripts/preflight-models.sh"
# 2. Build the packet
bash "$SKILL_DIR/scripts/build-review-packet.sh" \
--mode diff --phase "$PHASE" --target "$CHANGE_ID" \
--out ".kbd-orchestrator/phases/$PHASE/review/$CHANGE_ID/packet.json"
# 3. Dispatch the judge
bash "$SKILL_DIR/scripts/dispatch-judge.sh" \
--mode diff \
--packet ".kbd-orchestrator/phases/$PHASE/review/$CHANGE_ID/packet.json" \
--out ".kbd-orchestrator/phases/$PHASE/review/$CHANGE_ID/findings.json"
# 4. Anti-theater gate (exit 2 = rejected: re-dispatch once with feedback)
bash "$SKILL_DIR/scripts/check-findings-sycophancy.sh" \
--findings ".kbd-orchestrator/phases/$PHASE/review/$CHANGE_ID/findings.json" \
--counter-key "adv-review-$CHANGE_ID"
Artifact mode replaces --target "$CHANGE_ID" with --target assess|analyze|plan.
Per the liter-llm-bridge and pmpo-evolver conventions — warn, never silently degrade, never block the pipeline:
REST gateway — an OpenAI-compatible POST /v1/chat/completions at the
resolved gateway (openai-proxy on :8181, or liter-llm api). Full isolation,
true cross-model. dispatch-judge.sh exit 0, and the findings record
isolation_mode: rest-gateway:<url> plus cross_model_check.
There is no liter-llm complete — the binary ships only api and mcp
subcommands (it is a proxy server). Earlier revisions of this doc and of
dispatch-judge.sh called that non-existent subcommand; because the guard only
checked that the binary existed, the failure surfaced as "liter-llm
unavailable" rather than as the CLI-contract mismatch it was. Speak REST.
Harness-native fresh-context subagent — when no gateway is reachable
(dispatch-judge.sh exit 3), the calling session dispatches a subagent
(Agent tool / equivalent) whose prompt is exactly: the mode's mandate file
"isolation_mode": "harness-native" — a weaker guarantee (same model
family), stated, not hidden.Pending review (exit 4) — no judge available at all. Write a local
pending_review receipt for the cumulative Git diff. Development may
continue; final local certification requires a completed independent review
receipt or an SSH-signed waiver.
findings.json (schema: assets/schemas/findings.schema.json):
{
"mode": "diff",
"verdict": "BLOCK",
"judge_model": "openai/gpt-4o",
"isolation_mode": "rest-gateway:http://localhost:8181/v1",
"producer_model": "claude-opus-5",
"cross_model_check": "verified-distinct",
"findings": [
{
"severity": "CRITICAL",
"file": "src/auth/session.rs",
"line": 142,
"claim": "Token expiry is checked before refresh, allowing a replay window",
"evidence": "diff hunk @@ -138,+142 removes the pre-refresh revocation check required by AC-3",
"suggested_fix": "Re-check revocation after refresh, before issuing the new token"
}
]
}
Severity semantics (matches the OpenSpec reporting convention):
| Severity | Diff mode | Artifact mode |
|---|---|---|
CRITICAL | record a KBD blocker and set certification blocked; fix, then re-run refine-validate and adversarial-review | revise artifact and re-vet (max 2 rounds, then accept with an "Unresolved review findings" section appended so the next stage sees them) |
WARNING | logged in the change's review dir; proceed to archive | appended to the stage handoff summary |
SUGGESTION | informational | informational |
verdict is BLOCK iff at least one CRITICAL finding exists.
The judge's findings report is itself screened through sycophancy-correction
(scripts/check-findings-sycophancy.sh, reusing shared/scripts/lib/sycophancy.sh):
a report scoring ≥ 0.4 or matching high/critical sycophancy patterns —
e.g. zero findings on a large multi-file diff wrapped in hedged praise — is
rejected, and the judge is re-dispatched once with the rejection feedback
appended to its mandate (dispatch-judge.sh --feedback <file>). A soft cap
then accepts the next report with a logged warning, mirroring the reflector gate.
When the sycophancy binary is absent the gate degrades gracefully (exit 0,
warning) — it never blocks the chain.
The cap defaults to 2 and is overridable via PROMETHEUS_ADV_REJECT_CAP,
following the same pattern as PROMETHEUS_REFLECT_STRICTNESS:
PROMETHEUS_ADV_REJECT_CAP=4 bash scripts/check-findings-sycophancy.sh --findings f.json
| Value | Effect |
|---|---|
| unset | cap 2 (default) |
| 1–5 | honoured |
| above 5 | exit 1 — refused, never clamped |
| 0, negative, non-numeric | exit 1 — refused, never silently defaulted |
A value above the ceiling is an error rather than being clamped down, because a silently-lowered cap would leave you believing a bound was in force that was not.
Every run records the cap in the findings artifact, so a stored review is auditable after the fact:
"sycophancy_screen": { "reject_cap": 4, "cap_overridden": true, "cap_default": 2 }
When the cap is reached in an interactive terminal, the gate asks once
whether to keep rejecting, defaulting to accept. It never prompts without a TTY —
this script runs inside SubagentStop hooks and CI jobs, and a gate that hangs
the pipeline is a gate someone disables. Set PROMETHEUS_ADV_NO_PROMPT=1 to
suppress the prompt on a TTY as well.
This cap bounds how many times an evasive judge report is sent back. The creators' 2-round retry cap — how many times an artifact is re-reviewed after CRITICAL findings — is a separate bound owned by
review-retry-loop.shand is unaffected by this variable. Verified bytests/test-reject-cap-override.sh.
--skip-qa and --skip-adversarial-review are independent. Either records
pending_review; neither satisfies final local certification without an
SSH-signed waiver.scripts/preflight-models.sh runs at KBD method start (kbd-assess step 0)
and lazily before any dispatch without a fresh cache. It:
Checks the liter-llm binary — missing → run /liter-llm-bridge install.
Detects provider keys from the canonical env vars (delegates to
liter-llm-bridge's detect-providers.sh; see
skills/process/liter-llm-bridge/references/provider-env-vars.md).
Resolves each role through shared/scripts/lib/kbd-model-resolve.sh and
reports which config layer supplied it. Two files own this, and neither is a
script:
~/.prometheus/kbd/models.toml — role → model NAME (KBD owns)~/.config/liter-llm/liter-llm-proxy.toml — NAME → provider + base_url +
${KEY} (liter-llm owns)Repair or extend both with /liter-llm-bridge configure (repair,
add-provider, verify). It merges and never clobbers.
The older ~/.config/liter-llm/config.toml with a flat [aliases] table is
retired — that shape is not a schema liter-llm can load, which is why the
judge silently fell back to passing a class name through as a model id.
Verifies ≥ 2 distinct dispatchable models exist (so judge ≠ producer is
always possible). Exactly 1 → status: degraded. It also reports
config_broken with named defects when the liter-llm config exists but cannot
serve a request — missing [general] master_key (401 on everything) or a
localhost base_url with no [security] outbound_policy (deny_private
blocks loopback).
When no keys are found: ask the user which providers to configure (list the env-var name per provider) and instruct them to export the key. This skill never collects, stores, or writes API keys — config.toml holds aliases only; keys stay in the environment.
Cache: .kbd-orchestrator/model-preflight.json — re-run on --force,
config change, or age > 24 h.
Multi-persona debate is deliberately out of scope. The research record shows a single isolated adversarial reviewer captures most of the value, while fixed-round multi-agent debate can launder confidence into consensus — the exact failure mode sycophancy-correction exists to fight. Reserve multi-persona escalation for pre-implementation, hard-to-reverse decisions (Darwin Gate 3). If it is ever built, personas must be adversarial on priorities (security vs shippability vs maintainability) — not the same reviewer run three times.
references/output-contract.md — findings schema and gate semanticsreferences/isolation-and-routing.md — fresh-context judging rationale,
model resolution, collision handling, fallback chain, preflight contractskills/process/kbd-process-orchestrator/references/integrations/adversarial-review.mdassets/reviewer-mandate-agent.md (opens in a new tab)assets/reviewer-mandate-artifact.md (opens in a new tab)assets/reviewer-mandate-decision.md (opens in a new tab)assets/reviewer-mandate-diff.md (opens in a new tab)assets/reviewer-mandate-skill.md (opens in a new tab)assets/schemas/findings.schema.json (opens in a new tab)references/isolation-and-routing.md (opens in a new tab)references/model-configuration.md (opens in a new tab)references/output-contract.md (opens in a new tab)scripts/build-review-packet.sh (opens in a new tab)scripts/check-findings-sycophancy.sh (opens in a new tab)scripts/classify-mobile-execution.sh (opens in a new tab)scripts/commit-before-reveal.sh (opens in a new tab)scripts/decision-log.sh (opens in a new tab)scripts/dispatch-judge.sh (opens in a new tab)scripts/preflight-models.sh (opens in a new tab)scripts/review-retry-loop.sh (opens in a new tab)scripts/validate-decision-artifact.sh (opens in a new tab)tests/fixtures/README.md (opens in a new tab)tests/fixtures/clean-agent/Cargo.toml (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub prometheus-ags/prometheus-skill-system --plugin prometheus-process-skills51 skills in this plugin
/agent-team-creatorCreate, revise, package, and deploy agent-team definitions with staged questions and native exports for UAR, Codex, Claude Code, Copilot, Kimi Code, MiniMax CLI, OpenCode and DeepSeek. Use for team definition and catalog lifecycle; use agent-team-manage for active runtime task state./agent-team-handoffPrepare and accept a durable handoff between agent roles or coding harnesses using task context, Git identity, evidence and memory references. Use when work must continue in another harness or agent; use agent-team-manage for ordinary same-owner task updates. Do not use for ordinary same-owner task updates (see agent-team-manage)./agent-team-manageManage an existing agent team's active task state: assign dependencies and owners, track evidence, cancel or reassign work, and reconcile KBD-linked completion. Use agent-team-creator for definition creation, versioned maintenance, native export, and UAR catalog deployment./agent-team-modelsDiscover configured models and choose explicit capability, strength and cost policies at team, role, skill and task levels. Use when selecting models or controlling an agent team budget; use agent-team-creator for role discovery. Unknown prices and capabilities remain unknown. Do not use for role selection (see agent-team-creator)./clone-skillClone an existing Agent Skill and adapt it for a new domain. Preserves architecture while replacing domain-specific content./create-native-agentGenerate a complete native Rust agent application with Supabase-style CLI, A2A/AG-UI/A2UI protocol support, React 19 assistant-ui chat frontend, liter-llm model routing, MCP client tools, and the Prometheus skills engine. One command scaffolds a runnable multi-protocol agent binary.
2 plugins in one repository ship this exact skill · first indexed Nov 27, 2026