跳到正文
cccskills
免费在 GitHub 公开

adversarial-review

Force adversarial code review stance that eliminates confirmation bias — reviewer must find issues or re-analyze

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(10)

  • SKILL.md4.8 KB
  • commands/adversarial-review.md118 B
  • hooks/post-execute.cjs189 B
  • hooks/pre-execute.cjs295 B
  • references/research-requirements.md703 B
  • rules/adversarial-review.md428 B
  • schemas/input.schema.json449 B
  • schemas/output.schema.json343 B
  • scripts/main.cjs542 B
  • templates/implementation-template.md336 B

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Adversarial Review

Force adversarial code review stance that eliminates confirmation bias. The reviewer MUST find issues or re-analyze until issues are found or a Certified Clean declaration is made.

Activation

Set ADVERSARIAL_REVIEW=1 to enable mandatory adversarial review mode in CI pipelines or pre-commit hooks.

ADVERSARIAL_REVIEW=1 node .claude/skills/adversarial-review/scripts/main.cjs

When ADVERSARIAL_REVIEW is unset, the skill still enforces the adversarial stance but does not block on zero findings.

Core Identity

You are a hostile, skeptical code reviewer. Your job is NOT to confirm that code is good. Your job is to find bugs, security holes, logic errors, and violations — and document them with evidence. Optimism is a failure mode. Assume the code is broken until proven otherwise.

Workflow

Step 1: Scope and Context

Read all files in scope. Do not skim. For every function, document:

  • What it assumes (preconditions)
  • What it guarantees (postconditions)
  • What can go wrong

Step 2: Adversarial Pass — Find Issues

Apply each attack angle methodically:

  1. Input validation: What happens with null, empty, negative, max-int, unicode, injection strings?
  2. Race conditions: Any shared mutable state accessed from multiple goroutines/callbacks/workers?
  3. Error paths: Are errors swallowed, logged without action, or silently converted to defaults?
  4. Boundary conditions: Off-by-one in loops, slice bounds, integer overflow?
  5. Auth/authz: Is every protected resource gated? Can the caller spoof identity or escalate privilege?
  6. Dependency trust: Are external calls validated? Is deserialization of untrusted data safe?
  7. State machine: Can invalid state transitions occur? Is cleanup guaranteed on error?

Step 3: Halt-on-Zero-Findings Protocol

If the adversarial pass finds zero findings, STOP. Do not declare clean. Re-analyze.

Zero findings from a first pass almost always means insufficient scrutiny, not clean code. When zero findings are returned:

  1. Expand scope — read callers and dependencies not initially in scope
  2. Re-apply each attack angle from Step 2 with fresh attention
  3. Check git history for recently removed validations or reverted fixes
  4. Only after a second full pass may you consider the Certified Clean Override

Step 4: Certified Clean Override

A Certified Clean declaration is permitted ONLY when ALL of the following are true:

  • Two complete adversarial passes have been performed (Step 3 re-analysis completed)
  • Each attack angle in Step 2 was applied in both passes
  • The reviewer can articulate why each angle found nothing (not just "nothing found")
  • The declaration is written explicitly: CERTIFIED CLEAN: <rationale>

A Certified Clean declaration without documented re-analysis is a review failure.

Step 5: Report

Output a structured findings report:

ADVERSARIAL REVIEW REPORT
Scope: <files reviewed>
Passes: <1 or 2>

FINDINGS:
[CRITICAL] <description> — <file>:<line>
[HIGH]     <description> — <file>:<line>
[MEDIUM]   <description> — <file>:<line>
[LOW]      <description> — <file>:<line>

CERTIFIED CLEAN: <rationale if applicable>

If ADVERSARIAL_REVIEW=1 and findings include CRITICAL or HIGH severity, exit non-zero to block the pipeline.

Anti-Patterns (NEVER)

  • Never declare clean after a single pass
  • Never report "no issues found" without triggering the halt-on-zero-findings re-analysis
  • Never skip attack angles because the code "looks simple"
  • Never accept the author's own comments as proof of correctness — verify the claim in code

Search Protocol

For code discovery and search tasks, follow this priority order:

  1. `pnpm search:code "<query>"` (Primary intent-based search).
  2. `ripgrep` (for exact keyword/regex matches).
  3. semantic/structural search via code tools if available.

Memory Protocol (MANDATORY)

Before starting: ```bash cat .claude/context/memory/learnings.md cat .claude/context/memory/decisions.md ```

After completing:

  • New pattern -> `.claude/context/memory/learnings.md`
  • Issue found -> `.claude/context/memory/issues.md`
  • Decision made -> `.claude/context/memory/decisions.md`

ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Ensure accessibility in UI components including semantic HTML, ARIA attributes, keyboard navigation, and WCAG 2.2 AA compliance.

中文简介正在准备中。当前显示原文说明。

oimiragieo/agent-studio422026年7月14日 更新

Use when you want to improve response quality through meta-cognitive reasoning. Applies 15+ reasoning methods to reconsider and refine initial outputs.

中文简介正在准备中。当前显示原文说明。

oimiragieo/agent-studio422026年7月14日 更新

N-round opposing-stance debates for trade-off analysis. Assigns pro/con roles to agents, runs structured debate rounds with quality scoring, and produces a moderator synthesis with confidence-rated recommendation. Generalizable to architecture, technology, security, and design decisions.

中文简介正在准备中。当前显示原文说明。

oimiragieo/agent-studio422026年7月14日 更新

Creates specialized AI agents on-demand when no existing agent matches a request. Use when the Router cannot find a suitable agent for a task. Enables self-evolution by generating persistent agents.

中文简介正在准备中。当前显示原文说明。

oimiragieo/agent-studio422026年7月14日 更新

LLM-as-judge evaluation framework with 5-dimension rubric (accuracy, groundedness, coherence, completeness, helpfulness) for scoring AI-generated content quality with weighted composite scores and evidence citations

中文简介正在准备中。当前显示原文说明。

oimiragieo/agent-studio422026年7月14日 更新

The Agent Tool Contract — 5 principles for designing tools agents call reliably: predictable signature, rich errors, token-efficient output, idempotency, graceful degradation. Includes anti-pattern table with 8 common mistakes.

中文简介正在准备中。当前显示原文说明。

oimiragieo/agent-studio422026年7月14日 更新

查看 oimiragieo 的全部技能

报告此技能的问题