跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

code-review

Two-mode skill: (1) adversarial review — spec compliance + code quality + security, confidence-scored findings with file:line evidence; (2) receiving review — verify-before- agreeing discipline for acting on external/human review feedback.

romiluz13 · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add romiluz13/cc10x --skill code-review

技能说明


name: code-review description: | Two-mode skill: (1) adversarial review — spec compliance + code quality + security, confidence-scored findings with file:line evidence; (2) receiving review — verify-before- agreeing discipline for acting on external/human review feedback. allowed-tools: Read Grep Glob LSP Bash user-invocable: false

Code Review (Adversarial + Receiving)

Reference Files

Read only what's needed:

  • references/review-order-and-checkpoints.md — review order, checkpoint discipline; load when starting a review that spans multiple files or needs a checkpointed pass
  • references/code-review-heuristics.md — heuristics, pattern recognition, false-positive prevention; load when the diff is non-trivial or before reporting CLEAN (Zero-Finding Halt re-scan)
  • references/security-review-checklist.md — security review checklist; load whenever the diff touches auth, input handling, network, secrets, or data access

Run ADVERSARIAL when producing findings on a diff; run RECEIVING when acting on findings someone else produced. The Code Smells catalog, AI-Generated Anti-Patterns, Metric Honesty Rule, and Deferred Findings handling below apply in both modes.

Mode: ADVERSARIAL REVIEW

Only report issues with confidence ≥80 — below that, a finding is more likely noise than signal, and noise burns the fix loop's time and trust. Do not inflate a score to smuggle a hunch through; a genuine security hunch goes to the Summary as an open question (see the Security exception under Confidence Scoring). Every finding states category, impact, and why it matters. Present a recommendation, not a menu. Be opinionated.

Signal quality rule: One finding with file:line evidence and a fix is worth more than ten generic observations. Never report a pattern without showing where it lives.

Two-Stage Review

Stage 1: Spec Compliance — Does the code do what the plan/spec asked? Check: phase exit criteria met, interfaces match plan's Consumes/Produces, no scope drift, no missing scenarios.

Stage 2: Code Quality — Is the code well-built? Check: correctness, performance, security, clarity, test coverage.

Review Order

Top-down (spec → architecture → module → function → line) for first pass. Bottom-up (line → function → module) for detail pass. See references/review-order-and-checkpoints.md.

Severity Classification

SeverityCriteria
CRITICALData loss, security breach, silent data corruption
HIGHUser-visible broken behavior
MEDIUMSuboptimal but functional
LOWCode smell, style

Confidence Scoring

ConfidenceMeaning
90-100Verified: read the code, confirmed the issue, can cite file:line
80-89Strong: read surrounding context, pattern is clear
<80Do not report — insufficient evidence

Security exception: a security-category finding below 80 confidence is NOT silently dropped. Surface it as an explicit open question in the review Summary (e.g., "Possible auth bypass at file:line — could not confirm exploit path"), not as a finding. The <80 floor drops everything else.

Parallel Review + Router Merge

When code-reviewer and failure-hunter run in parallel (BUILD workflow):

  • code-reviewer (Assessment A): correctness, performance, spec compliance. Forms opinion WITHOUT seeing the hunter's scan.
  • failure-hunter (Assessment B): silent failure scan using red-flags table. Does NOT see the reviewer's findings.
  • Router-owned merge: after both complete, the router writes a merged findings summary into the workflow artifact before verifier handoff. Where both agree → high confidence. Where the hunter caught what the reviewer missed → keep. Where the hunter finding is a false positive → drop with reason. Contradictory verdicts: stricter verdict wins, logged in status_history.

Zero-Finding Halt

Zero findings on a non-trivial change → insufficient depth, not perfect code. Re-scan against heuristics and security checklist before reporting CLEAN.

Code Smells (Fowler Catalog)

Scan for these 16 named smells during review. Each is actionable — not a style preference. "Messy" is not actionable; "Mysterious Name" is. Each smell is a labelled heuristic and always a judgement call ("possible Feature Envy"), never a hard violation:

SmellSignalFix
Mysterious NameFunction/variable name doesn't reveal intentRename to describe what it does
Long MethodMethod > 20 lines doing multiple thingsExtract sub-methods
Long Parameter List> 4 parameters — consider parameter objectExtract into an object
Large ClassClass with too many responsibilitiesSplit by responsibility
Data ClassHolds data, no behavior — anemic domain modelMove behavior in, or inline the class
Duplicated CodeSame logic in 3+ placesExtract shared function
Feature EnvyMethod reads more from another class than its ownMove method to the class it envies
Shotgun SurgeryOne change requires touching many filesConsolidate responsibility
Divergent ChangeOne class changes for different reasonsSplit into separate classes
Primitive ObsessionUsing primitives where a small value object would add meaningCreate a value object
Repeated SwitchesSame switch/if-else on a type across filesReplace with polymorphism
Speculative GeneralityAbstraction for future use that never comesDelete it (YAGNI)
Message Chainsa.b().c().d() — client knows the object graphHide the chain behind a method
Middle ManClass just delegates to another — adds no logicRemove the middleman, use the real object
Refused BequestSubclass doesn't use parent's methodsReplace inheritance with composition
Data Clumps3+ values always passed togetherExtract into an obje
阅读完整来源 ↗