| name | dual-verify |
| description | Run parallel Claude Code deep-review and Codex code-audit, then consolidate findings before marking PR ready. Use instead of /code-review or auto-verify when doing pre-merge review. Trigger on: "dual verify", "dual-verify", "parallel review", "run dual verify", "双路验证", "双向验证", "并行review", "双路review".
|
| user-invocable | true |
| allowed-tools | Bash, Read, Grep, Glob, Agent |
Dual-Verify
Run Claude Code deep review and Codex code audit in parallel, then consolidate findings and mark review complete.
When
- Before marking any PR as ready for merge.
- As a replacement for single-agent /code-review.
- Whenever CLAUDE.md requires code review before commit.
Division of responsibility
| Responsibility | Owner |
|---|
TypeScript tsc --noEmit | Claude Code |
| Architecture / logic / integration correctness | Claude Code |
| Code style / edge cases / error handling | Codex rescue subagent |
| Metrics completeness (all 4 paths wired) | Codex rescue subagent |
| Memory leak (Map cleanup on all terminal paths) | Codex rescue subagent |
| Windows/PowerShell compat | Codex rescue subagent |
Codex is invoked via Agent tool (rescue subagent) — no manual terminal step required.
Step 1 — Launch parallel reviewers
Claude Code deep review (this session):
BASE=$(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name' 2>/dev/null || echo "master")
if gh api "repos/$(gh repo view --json owner --jq '.owner.login')/$(gh repo view --json name --jq '.name')/branches/develop" --silent 2>/dev/null; then
BASE=develop
fi
git diff "origin/${BASE}...HEAD" --stat
git diff "origin/${BASE}...HEAD"
Check: language-appropriate correctness gates (e.g. tsc --noEmit for TypeScript, pnpm lint, pytest --collect-only for Python), logic correctness, integration points, schema compliance, missing branches in switch/if chains, resource leaks.
Codex audit (rescue subagent — launch via Agent tool with subagent_type: codex:codex-rescue):
Step 2 — Collect results
Each reviewer produces:
## <Reviewer> Review Results
Critical: N High: N Medium: N Low: N
- <finding>
Overall: PASS | FAIL | NEEDS-CHANGES
Step 3 — Cross-reference
Produce a consolidated report:
## Dual-Verify Consolidated Report
Branch: <branch>
Claude: PASS | NEEDS-CHANGES
Codex: PASS | NEEDS-CHANGES
Agreed Issues: <list or none>
Claude-only: <list or none>
Codex-only: <list or none>
Final Verdict: PASS | NEEDS-CHANGES
Step 4 — Fix, verify, mark complete
- Fix all Critical + High issues.
- Run
auto-verify (tsc --noEmit, scope, lint).
- Set the review-passed flag:
mkdir -p .claude/state && touch .claude/state/review-passed
Note: this repo uses .claude/state/ (repo-scoped) instead of .mercury/state/. The original path works only inside the Mercury repo; .claude/state/ is a convention-neutral location that any repo using these skills can adopt.
- Commit and push.
Evidence
dual-verify: PASS (Claude: PASS, Codex: PASS, N issues fixed)
Rules
- Both reviewers must return PASS before proceeding to merge.
- Fix before merge — do not proceed on a split verdict.
- Codex surfaces Windows-specific and platform concerns that may not be visible in Claude's review.
Fallback
If Codex is unavailable or the session cannot be started:
- Use
/code-review (Claude Code built-in) as the sole reviewer.
- Document in the PR description that dual-verify was attempted but Codex was unavailable.
- This fallback is acceptable for low-risk changes; high-risk PRs (orchestrator core, auth, schema changes) should wait for Codex availability.