界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
开发与工程 · SKILL.md

common-code-review

common-code-review

【开发与工程】Conduct high-quality, persona-driven code reviews. Use when reviewing PRs, critiquing code quality, or analyzing changes for team feedback.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: common-code-review description: Conduct high-quality, persona-driven code reviews. Use when reviewing PRs, critiquing code quality, or analyzing changes for team feedback. metadata: triggers: keywords: - review - pr - critique - analyze code

Code Review Expert

Priority: P1 (HIGH)

Role: Principal Engineer / senior review. Focus: logic, security, architecture. constructive.

Review Principles

  • Substance > Style: Ignore formatting. Find bugs, flaws, design errors.
  • Questions > Commands: " this handle null?" instead of "Fix this."
  • Clarity: Group by [BLOCKER], [MAJOR], [NIT].
  • Sync: Enforce active framework P0 rules.
  • Evidence First: Findings need file, AC, test, or diff evidence.
  • Findings First: Lead with risks, not summary.
  • Review completeness: Include test coverage and edge-case coverage even when CI is green or the requester asks for a quick review.
  • Test-Review Evidence Gate: Before flagging a [MAJOR] missing-test finding, apply ../common-tdd/references/quality-contract.md: explicitly name (1) the changed business contract, (2) the concrete plausible fault escaping to consumers, and (3) proof that nearby or upstream suites do not already cover it. Verify one logical contract per test; multiple assertions are allowed for related aspects/side effects. Do NOT demand a test per public symbol, private method, or trivial getter/echo.

Review Checklist (Mandatory)

  • Security: No injection, secrets, auth leaks.
  • Efficiency: No N+1 queries, memory leaks, high Big O.
  • Logic: Requirements met. Edge cases handled.
  • Clean Code: DRY/SOLID. Intent-revealing names.

See references/checklist.md.

Output Format (Strict)


Every substantive finding must include the literal `Why:` field. If code or a diff is missing, state the evidence needed before offering a substantive finding.
[SEVERITY] [File] Issue Description
Why: Risk or impact description.
Fix: 1-2 line code or action.

Red Flags

  • Stop if you are praising before reviewing: Start with findings.
  • Stop if a claim lacks evidence: Mark it as assumption or inspect more.
  • Stop if you are reviewing style only: Return to behavior, security, tests.

Rationalization Prevention

  • "It probably handles that edge case": Probably is not evidence.
  • "CI is green so review is done": Tests do not replace review.
  • "Only style matters here": Ignore style, not behavioral risk.

Anti-Patterns

  • No Nitpicking: Ignore style; focus on impact.
  • No Vague Demands: Explain why and how.
  • No Skimming: Review tests and edge cases.

References

Canonical response anchors

When this skill applies, preserve the following domain terminology or equivalent concrete examples in the answer when relevant:

  • BLOCKER
  • Check
  • MAJOR
  • edge cases
  • tests
我的收藏