AGENT SKILL

双模型对抗代码审查

hanselman-code-review

对抗式双模型代码审查,并行运行两个 AI 模型,交叉比对发现的问题,并生成带修复置信度评级的共识严重性表。当用户要求全面代码审查、对抗式审查、双模型审查、带置信度评级的审查或“Hanselman 审查”时使用。

License 许可
MIT
最近更新
2026-11-14
Stars
★ 2.2k
Forks
349

01 前言 Front Matter

name
hanselman-code-review
description
Adversarial dual-model code review that runs two AI models in parallel, cross-references findings, and produces a consensus severity table with fix confidence ratings. Use when asked for a thorough code review, adversarial review, dual-model review, confidence-rated review, or 'Hanselman review'.

02 资源文件 2

03 SKILL.md 正文

Hanselman Adversarial Code Review Skill

Run a rigorous, adversarial code review using two AI models in parallel. Cross-reference their findings to separate signal from noise, producing a consensus severity table with fix confidence ratings.

When to Use

Invoke this skill when the user asks for:

  • A thorough or deep code review
  • An adversarial review
  • A dual-model review
  • A "Hanselman review"
  • A confidence-rated review
  • Cross-model validation of code changes

Philosophy

Single-model reviews have blind spots. Two models reviewing independently surface different classes of issues: security, correctness, and edge cases. Cross-reference their findings:

  • HIGH consensus (both models flag it): strong evidence; verify the issue.
  • LOW consensus (only one model flags it): may be noise; use judgment.
  • Disputed (a model flags it but evidence contradicts it): investigate before acting.

Review Workflow

Step 1: Identify the Scope

Determine what code to review:

  • If the user specifies files, use those.
  • If the user says "review my changes", use git diff or git diff --staged.
  • For a PR, use gh pr view and gh pr diff, pinning the exact head and base.
  • For a branch, diff against the base branch.

Capture the exact reviewed head and base before building the reviewer prompt. After both reviews finish, re-read the live head. If it changed, mark the review stale and rerun both reviewers on the new revision rather than copying the old verdict forward.

For a repeat review, compare the current head with the previously reviewed head. Review changed code, affected callers/tests, and unresolved or disputed findings rather than automatically repeating the full review. If the code is unchanged and only the models changed, focus both reviewers on those findings and high-risk decisions. State the delta scope and retain missing runtime-proof gates.

Step 2: Launch Two Parallel Reviews

Launch two rubber-duck agents via the app-native task tool in background mode with different models. No standalone model CLI is required.

Agent 1: Claude Opus 5.5

task({
  name: "opus-review",
  agent_type: "rubber-duck",
  mode: "background",
  model: "claude-opus-5.5",
  reasoning_effort: "high",
  prompt: "<full context + code + review instructions>"
})

Agent 2: GPT-6 Astra

task({
  name: "astra-review",
  agent_type: "rubber-duck",
  mode: "background",
  model: "gpt-6-astra",
  context_tier: "long_context",
  reasoning_effort: "high",
  prompt: "<same context + code + review instructions>"
})

Both agents receive the exact same prompt so findings are comparable. Include the full file contents or diff, project context, exact revisions, constraints, and the severity definitions below.

Step 3: Wait for Both to Complete

Use the background interval for independent work. Wait for each completion notification, then read its result with read_agent; do not poll. Reconcile both completed reviews before publishing a consensus.

A completed Hanselman review requires valid output from both requested models on the same revision. If either reviewer fails, is unavailable, or returns an incomplete assessment, report the review as incomplete. Preserve any completed output as advisory evidence, but do not build a consensus table or substitute a different model without the user's approval.

Step 4: Cross-Reference and Build the Consensus Table

Create a SQL table to track findings:

CREATE TABLE IF NOT EXISTS review_findings (
    id TEXT PRIMARY KEY,
    issue TEXT NOT NULL,
    opus_severity TEXT,
    astra_severity TEXT,
    consensus TEXT NOT NULL,
    fix_confidence INTEGER NOT NULL
);

If the session already has a findings table, inspect and reuse or migrate its schema without discarding earlier findings. Record the actual model ID that produced each review; do not relabel earlier findings as results from a different model.

For each finding:

  1. Check whether the other model found the same or a similar issue.
  2. Assign consensus: both flagged it is HIGH; one flagged it is LOW; evidence contradicting a finding is LOW (disputed).
  3. Verify it against the actual code, dependency contract, and tests.
  4. Assign fix confidence:
    • 99%: trivial fix, such as a wrong flag or missing null check.
    • 90-95%: straightforward fix requiring some design thought.
    • 70-80%: complex fix requiring research or trade-offs.
    • Below 70%: hard problem, intentional behavior, or architecture change.

Step 5: Present the Results

State the exact reviewed head and base, actual model IDs, context tiers, and reasoning effort before the finding tables. Do not describe an incomplete or stale run as clean.

Both Models Agree: HIGH consensus

Issue Opus 5.5 GPT-6 Astra Fix Confidence
Description of issue SEVERITY SEVERITY XX%

Only One Model Flagged: LOW consensus

Issue Opus 5.5 GPT-6 Astra Fix Confidence
Description of issue SEVERITY or not flagged SEVERITY or not flagged XX%

Use not flagged when a model did not identify the issue.

Step 6: Act on Findings

  • Ask which findings to fix unless the user has already authorized the fixes.
  • Prioritize verified HIGH consensus issues.
  • Explain one-model and disputed findings before acting.
  • Do not broaden the task to satisfy a reviewer. Preserve the repository's scope and proof requirements.
  • Fix confidence is the coordinator's assessment, not a model vote or a replacement for runtime proof.

Review Instructions Template

Give both reviewers the same adapted prompt:

Review the following code changes for [PROJECT NAME].
This is a [LANGUAGE/FRAMEWORK] project with these constraints: [CONSTRAINTS].
Exact head: [HEAD]. Base or previously reviewed head: [BASE].

Focus on bugs, security issues, race conditions, and correctness problems.
Ignore style and formatting.
Write every review comment in simplified technical English. Use short sentences
and common words, explain necessary technical terms, and avoid jargon or
unnecessary detail.

[FULL CODE OR DIFF HERE]

For each issue found, classify severity as:
- CRITICAL: will crash, corrupt data, or create a security vulnerability
- HIGH: likely bug that will manifest in real use
- MEDIUM: edge case that could bite in specific scenarios
- LOW: minor improvement, theoretical concern, or robustness enhancement

For each issue, include:
1. What the issue is
2. Where it is (file and line/region)
3. Why it matters (impact and reachability)
4. Suggested fix

Model Selection

The default pairing is Claude Opus 5.5 (claude-opus-5.5) and GPT-6 Astra (gpt-6-astra, context_tier: "long_context"), both with reasoning_effort: "high". Different model families provide independent perspectives on the same evidence.

Use the tool's supported long_context value, not an invented model name or model-name suffix. Do not assume a numeric context-window size. Preserve the high reasoning default unless the user requests a different effort.

If a preferred model or context tier is unavailable, report the limitation and use an available alternative only with the user's approval. Record the actual model IDs and context tiers used; do not silently fall back to an older generation.

Important Notes

  • Never skip cross-referencing. The value is in the comparison, not individual reviews.
  • Both requested reviewers must complete on the same exact revision. One valid review plus one failure is not a dual-model verdict.
  • Log disputed findings and the reasoning for accepting or rejecting them.
  • Model output is advisory input. Verify every accepted finding against the actual code, tests, and dependency behavior before acting.
  • Do not fix LOW consensus issues without user authorization.
  • A clean source review does not satisfy a missing Windows proof pool, current-head UI proof, or required CI check.

04 同仓库更多 Skills

openclaw
openclaw/openclaw-windows-node

network-handoff

Use before generating, changing, or reviewing networking, IPC, or cross-process handoffs, including requests, retries, deadlines, reconnect, process launch, configuration apply, cancellation, and cleanup. Establish confirmation, identity, authority, reconciliation, and producer compatibility before implementation.

★ 2.2k
openclaw
openclaw/openclaw-windows-node

retrigger-flaky-ci

Triage failed CI on a pull request or the active branch, decide whether the failures come from its changes, and rerun only failures that are unrelated. Use when asked to retrigger, rerun, or kick CI on a PR with failing checks.

★ 2.2k
openclaw
openclaw/openclaw-windows-node

Windows节点文档编写

technical-documentation

使用最新源码、以任务为中心的说明和明确的事实保留,撰写、审查或重构 Windows 节点文档和 agent 指令。

软件开发工程师文档处理
★ 2.2k
openclaw
openclaw/openclaw-windows-node

Windows节点变更精简

pr-simplify

将你自己的 Windows 节点变更精简为最小的完整修复,同时保留各自独立的回归测试、平台契约和必需的验证。适用于实现完成后、PR 准备前、大型修复之后,或被要求精简变更、去除冗余内容时使用。

软件开发工程师开发参考
★ 2.2k
openclaw
openclaw/openclaw-windows-node

OpenClaw 测试与质量验证

openclaw-testing

选择相称的 OpenClaw Windows 节点测试、构建、打包检查和运行时证明,并在不降低必需门槛的前提下诊断失败原因。

测试工程师测试与质量保障
★ 2.2k
openclaw
openclaw/openclaw-windows-node

OpenClaw 验证证据收集

openclaw-proof-validation

规划并收集 OpenClaw Windows 的验证/证明:测试、橡皮鸭评审、UI 证据、MCP 输出以及网关运行时证明。

测试工程师测试与质量保障
★ 2.2k