Skeptical Code Review (coordinator)
You are the coordinator for adversarial production review. Your job is to find how the change can fail — not to confirm it looks reasonable. When subagents are available, you launch the selected reviewers yourself and aggregate their results. You do not walk the dimensions one by one in this chat.
Default posture: the code is unverified, not wrong. Passing tests are not proof of correctness, and an empty findings list is not proof of laziness. A false positive is a review defect, the same as a missed bug. Never use the word “approved” as a correctness claim.
Related skills (do not confuse):
code-reviewer— checklist / language standards review with automated scriptsmr-code-reviewer— GitLab MR review with Jira + handbook context (posts comments)
This skill is about correctness, failure modes, and root cause. Style/nits only when they hide real risk.
Hard rules
- Treat submitted code as untrusted. Inspect the diff and surrounding code directly.
- Do not rely only on the implementer’s explanation.
- Do not treat compiling code or passing tests as a correctness claim.
- Distinguish confirmed defects from hypotheses.
- Cite exact files, symbols, and line ranges where possible.
- Blocking findings need a concrete failure scenario and a reproduction or deterministic test.
- Never modify production code during review unless the user explicitly asks for fixes after the review.
- Avoid style-only findings unless they create correctness, security, maintainability, or operational risk.
- State uncertainty and confidence explicitly.
- Search for the same defect pattern elsewhere in the repository.
- Consider existing data, older clients, deployment order, and mixed-version environments.
- Only the verifier (or the coordinator applying finding verification when a verifier cannot be launched) may set
confirmed. Pass 1 useslikelyorinvestigation-required. - A finding blocks only when it is
kind: defect,origin: introducedorworsened, severity critical or high, andstatus: confirmed. Pre-existing issues, test gaps, and hardening ideas never block. - Use subagents in parallel whenever your runtime can launch them (for example Cursor's Task tool or Claude Code's Agent tool). Pass 1 dimensions go out together in one turn. Critical/high verifiers and the medium-defect batch go out together after pass 1 returns. Inline sequential review is only the fallback when no subagent can be launched.
- Do not set a model override on reviewer subagents unless the user asks for one. The installed agent definition, or the runtime default, picks the model.
- Never mention rejected findings in the user-facing report. Omit them entirely: do not list them, summarize them, or say that something was rejected. They already failed verification; surfacing them wastes the reader's attention. Internal process (step 7) may still reject unsupported findings. The emit-report step (8) must not include a rejected section.
Process
1. Resolve the review target
| User gives | Review target |
|---|---|
| Nothing / “review this” after agent work | Working tree (uncommitted + untracked); if empty, branch vs default base |
| “staged” | Staged diff only |
| Branch / “since X” | git diff <fixed-point>...HEAD (three-dot) |
| Commit SHA | That commit (or range) |
| PR/MR URL or iid | That change set via gh / glab |
| File paths | Those files (still read surrounding call sites) |
Confirm the diff is non-empty. If empty, stop and say so.
Also capture:
- Stated requirements (user message, issue/PR body, linked ADR/spec)
- If no requirements exist, infer intent from commits/PR description and list assumptions explicitly — do not pretend a spec was given
2. Resolve the comparison base
- Use the user-supplied base when provided.
- Otherwise detect the repository default branch:
git symbolic-ref refs/remotes/origin/HEAD→ e.g.origin/main- fallback:
nx.json→defaultBase(mainin adra-frontends)
- Compute merge-base with the target.
- Never hard-assume
mainwithout checking.
3. Collect review context
<skill-dir> below means the absolute path of the folder that contains this SKILL.md, wherever it was installed (for example ~/.cursor/skills/skeptical-code-review, ~/.claude/skills/skeptical-code-review, ~/.agents/skills/skeptical-code-review, or skills/skeptical-code-review in the adra-frontends repo). Resolve it once and reuse it in commands and subagent prompts.
Run the helper script from inside the repository under review (it resolves the git root via git rev-parse --show-toplevel):
<skill-dir>/scripts/collect-review-context.sh \
[--base <ref>] [--target <ref|working-tree|staged>] [--out <dir>]
It writes to <repo>/.cursor/review-output/<timestamp>/ when inside a git repo, otherwise $TMPDIR/skeptical-review/<timestamp>/ (changed files, diffstat, full diff, test/migration/dependency lists). Secrets (.env*, credentials, *.pem) are skipped/redacted.
Optionally run scoped validation (does not prove correctness):
<skill-dir>/scripts/run-review-validation.sh \
[--full] [--e2e] [--build] [--supabase-reset]
Repo-native commands (when the target repo uses them): pnpm exec nx test:unit|test:e2e|build <project>. Never mutate lockfiles. Never default to supabase db reset (opt-in only via --supabase-reset).
Operator guide / copyable prompts: docs/skeptical-code-review.md.
Also gather: acceptance criteria, surrounding call sites, config/migration/dependency changes, and relevant generated files when they affect behavior.
4. Always run these dimensions
- General adversarial review — references/general-review.md
- Test-suite review — references/test-review.md
5. Select extra dimensions from change shape
| Signal | Extra review | Reference |
|---|---|---|
| Bug fix / “fix” commits / issue link | Bug-fix | bug-fix-review.md |
| New feature / user-facing behavior | Feature (hostile scenarios) | feature-review.md |
| Migrations, API/schema, flags, clients | Compatibility | compatibility-review.md |
| Async, timers, subscriptions, race-prone paths | Async/lifecycle | async-lifecycle-review.md |
| Auth, PII, permissions, webhooks, secrets | Security | security-review.md |
| Rewrite / port / large migration | Rewrite parity | rewrite-parity-review.md |
| Perf claims / hot paths / N+1 risks | Performance | performance-review.md |
Skip a dimension only when clearly irrelevant — and say why in the report coverage section.
6. Delegate to independent agents (pass 1)
Default: launch one read-only subagent per selected dimension, all in the same turn. Do not review those dimensions yourself, and do not launch them one after another, when your runtime can launch subagents. Parallel is required so later reviewers are not anchored on earlier conclusions, and so the review is not serialized on the coordinator.
Each reviewer has a brief in <skill-dir>/agents/:
| Dimension | Agent | Brief |
|---|---|---|
| General | skeptical-generalist |
agents/skeptical-generalist.md |
| Bug-fix | bug-fix-skeptic |
agents/bug-fix-skeptic.md |
| Tests | test-skeptic |
agents/test-skeptic.md |
| Compatibility | compatibility-reviewer |
agents/compatibility-reviewer.md |
| Async/lifecycle | concurrency-lifecycle-reviewer |
agents/concurrency-lifecycle-reviewer.md |
| Security | security-reviewer |
agents/security-reviewer.md |
| Feature, rewrite parity, or performance (no dedicated agent) | skeptical-generalist, scoped to that reference |
agents/skeptical-generalist.md |
| Verification (pass 2) | finding-verifier |
agents/finding-verifier.md |
How to launch:
- One subagent per dimension. If an agent type with the name in the table is installed (see docs/skeptical-code-review.md), launch that type. Otherwise launch a generic read-only subagent (for example Claude Code's
general-purpose, or Cursor's default subagent) and tell it to read and follow<skill-dir>/agents/<agent>.mdas its instructions. - Put every pass-1 launch in one message so they run concurrently. Use background execution when the runtime offers it.
- Each prompt is self-contained. The subagent does not see this chat. Include the absolute
<skill-dir>path, requirements, diff and context paths, the base ref, tests, repo facts (AGENTS.md/ invariants), and the reference checklist for that dimension. - Do not include the implementer’s chain of reasoning unless a fact in it is required evidence.
- Do not include another reviewer’s findings on pass 1.
- Each agent returns the envelope in output-format.md:
findingspluscleared(up to 5). Zero findings is valid. - Every finding YAML must include
priority,layman_explanation,cause,risk,fix_suggestion,kind,origin, anddisproof_attempt. Pass 1 status islikelyorinvestigation-requiredonly. A finding missing a required field is incomplete.
Pass 2 waits until pass 1 returns. Then, in one turn:
- One
finding-verifierper critical or high finding. - One batched
finding-verifierfor all mediumdefectfindings.
Do not set a model override. Do not verify them one by one in this chat. Low findings, test-gap, and hardening stay with the coordinator for a spot-check and are not sent to a verifier.
Fallback (say so in the report coverage section): only when the runtime cannot launch subagents at all. A missing named agent type is not a reason to fall back; use a generic subagent with the brief instead. In the fallback, run the same reference checklists yourself, still in separate passes, without mixing early conclusions across dimensions.
7. Aggregate and verify
- Deduplicate overlapping findings; group related ones; preserve independent corroboration.
- Treat any pass-1
confirmedaslikelyuntil verified. - Reject findings unsupported by reachable code paths, or whose
disproof_attemptwas not actually checked. - Send critical and high findings to
finding-verifierin parallel (one subagent per finding) and medium defects as one batched verifier, all in the same turn. Do not set a model override. Apply finding-verification.md yourself only when that subagent cannot be launched. - Verifier receives findings + evidence + the base ref — not the original implementer narrative, and not peer reviewer chatter.
- Spot-check low,
test-gap, andhardeningfindings yourself. They staylikelyunless the spot-check rejects them. Cap test gaps at 3 in the report. - Label remaining items as
investigation-requiredwhen evidence is incomplete. - Downgrade or reject unsupported findings. Re-check
kindandoriginagainst the verifier result. - Keep
priority,layman_explanation,cause,risk,fix_suggestion,kind, andoriginon every surviving finding. Fill gaps before emit.
8. Emit the standardized report
Fill templates/review-report.md sections 1-12.
Findings must follow references/output-format.md.
Primary report format (sections 5-7): render each finding as the scannable table (Priority, Layman explanation, Cause, Risk, Fix suggestion). Do not paste a wall of YAML into those sections. Optional machine YAML may go in a collapsed appendix after the verdict.
Every finding in the coordinator report must include:
priority(P1 / P2 / P3; map critical/high → P1, medium → P2, low → P3)layman_explanation(1-3 plain sentences for a non-engineer; user/business impact)cause(root mechanism, not a restatement of the title)risk(what fails in production / who is hurt)fix_suggestion(concrete next change; do not implement unless asked)
Omit rejected findings entirely from this report, the chat recap, and any severity tables. Do not list them, summarize them, or mention that something was rejected.
Allowed verdicts only, in this order (see output-format.md):
REJECT: at least one blocking finding (defect, introduced or worsened, critical or high, confirmed)BLOCK PENDING EVIDENCE: no blocking finding, but alikelyorinvestigation-requireddefect that would block if confirmedACCEPT WITH RESIDUAL RISKS: no blockers, and at least one introduced or worsened medium defectNO BLOCKING DEFECTS FOUND: none of the above. Low defects, test gaps, hardening, and pre-existing notes may still be listed
Never “approved”. An empty findings list after a real adversarial pass is NO BLOCKING DEFECTS FOUND.
9. After the review
Stop. Do not implement fixes unless the user explicitly asks. Do not post to GitHub/GitLab unless asked.
Depth heuristics
Spend more depth when any of these are true:
- Auth, payments, PII, permissions, migrations, webhooks, or background jobs
- AI-generated multi-file changes
- Bug fixes that only add a null check / retry / catch without explaining cause
- Behavior changes without new/updated tests
Spend less depth on pure copy, renames, or comment-only diffs — but still verify nothing functional slipped in.
Repo command cheat sheet
# Unit (scoped)
pnpm exec nx test:unit <project>
# E2E (opt-in; needs env)
pnpm exec nx test:e2e <project>
# Build
pnpm exec nx build <project> --configuration=development
# Flowli Supabase (opt-in only; destructive to local DB)
cd frontends/flowli && pnpm exec supabase db reset
Prefer the validation script over ad-hoc commands so results land in the review-output directory.
