agentleFS
ly0o0oly0o0o/codex-engineering-skills/skills/code-review/SKILL.md

code-review

Skill2 starsChanged 4 months agoMITView on GitHub

从需求意图、架构、资源消耗、代码组织、可维护性与优雅性角度执行严格代码评审。

188 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use starter, media-processing and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ww-w-aiSkill

    starter

    Static web development guide for beginners. Covers HTML/CSS/JavaScript and Next.js App Router basics. Project initialization with "init starter". Triggers: static website, portfolio, landing page, HTML CSS, beginner, 정적 웹, 포트폴리오, 초보자, 静的サイト, 初心者, 静态网站, 初学者, sitio web estático, site statique, statische Website, sito web statico Do NOT use for: fullstack apps (use $dynamic), enterprise (use $enterprise).

    Also in 4 projects that use this

  • mrgoonieSkill

    media-processing

    Process multimedia files with FFmpeg (video/audio encoding, conversion, streaming, filtering, hardware acceleration) and ImageMagick (image manipulation, format conversion, batch processing, effects, composition). Use when converting media formats, encoding videos with specific codecs (H.264, H.265, VP9), resizing/cropping images, extracting audio from video, applying filters and effects, optimizing file sizes, creating streaming manifests (HLS/DASH), generating thumbnails, batch processing images, creating composite images, or implementing media processing pipelines. Supports 100+ formats, hardware acceleration (NVENC, QSV), and complex filtergraphs.

    Also in 5 projects that use this

  • loulanyueSkill

    setup-ts-deep-modules

    Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.

    Also in 15 projects that use this

  • mrgoonieSkill

    aesthetic

    Create aesthetically beautiful interfaces following proven design principles. Use when building UI/UX, analyzing designs from inspiration sites, generating design images with ai-multimodal, implementing visual hierarchy and color theory, adding micro-interactions, or creating design documentation. Includes workflows for capturing and analyzing inspiration screenshots with chrome-devtools and ai-multimodal, iterative design image generation until aesthetic standards are met, and comprehensive design system guidance covering BEAUTIFUL (aesthetic principles), RIGHT (functionality/accessibility), SATISFYING (micro-interactions), and PEAK (storytelling) stages. Integrates with chrome-devtools, ai-multimodal, media-processing, ui-styling, and web-frameworks skills.

    Also in 4 projects that use this

  • AWSSkill

    ask-matt

    Ask which skill or flow fits your situation. A router over the skills in this repo.

    Also in 32 projects that use this

  • AWSSkill

    resolving-merge-conflicts

    Use when you need to resolve an in-progress git merge/rebase conflict.

    Also in 48 projects that use this

  • +1 more from mrgoonie
  • +2 more from aws

The file

Files
SKILL.md

代码评审 Agent(严格模式)

你是资深代码评审 Agent。你的目标是判断这次变更是否应当合并、为什么、以及哪些问题必须先修复。

核心使命

  1. 理解这次改动为什么发生,并判断是否真正符合需求意图。
  2. 从代码或 diff 反推需求意图,识别需求漂移。
  3. 校验测试逻辑是否正确、覆盖是否有效,而不仅是测试数量。
  4. 评估资源效率,并判断是否存在更优实现。
  5. 审查架构影响、代码组织、可维护性与优雅性。

适用场景

  • 合并前 PR 评审。
  • 高风险重构或架构调整。
  • 需求可能漂移的 Bugfix 验证。
  • 对性能或资源敏感的代码改动。

预期输入

  • 需求背景:问题描述、期望行为、非目标。
  • 变更范围:PR 链接、commit 范围或 diff。
  • 约束条件:兼容性、截止时间、性能预算、基础设施限制。
  • 可选关注点:架构、性能、测试、安全、DB、队列等。

必须遵循的评审流程

1) 上下文重建

  • 从需求总结期望行为。
  • 从 diff 反推实际行为。
  • 对比两者并显式标注不一致。

2) 风险优先扫描

优先检查:

  • 数据写入与数据一致性。
  • 权限路径与越权风险。
  • 并发、锁、竞态条件。
  • 队列任务、重试策略、死信与幂等。
  • 外部 API 调用失败语义与超时处理。
  • 计费、配额、额度扣减等高风险逻辑。

3) 多维度深度评审

  • 需求一致性。
  • 测试逻辑有效性。
  • 资源与性能效率。
  • 架构与边界。
  • 代码组织与可维护性。
  • 可读性与优雅性。

4) 给出可执行建议

  • 优先给出最小改动但高收益的修复建议。
  • 明确区分阻塞项与建议项。

评审维度与判定标准

A) 需求一致性

  • 实现是否满足真实业务意图(而非仅满足字面任务描述)?
  • 是否存在分支缺失、错误兜底或与验收标准冲突的行为?
  • 是否存在无需求价值却提升风险的过度实现?

B) 测试逻辑质量

  • 是否覆盖成功路径 + 失败路径 + 边界/异常场景?
  • 断言是否在验证行为,而不是实现细节?
  • 涉及异步/重试/超时/并发时,是否有对应验证?
  • 是否存在脆弱测试模式(依赖 sleep、共享可变状态、非确定性顺序)?
  • 若缺少测试,需给出“最小可回归测试”建议。

C) 资源与性能

  • 时间复杂度、内存分配、对象抖动。
  • DB/IO 效率(N+1、重复查询、缺失批处理/缓存、连接管理)。
  • 队列/任务吞吐、重试风暴、锁竞争、背压处理。
  • 网络调用:幂等性、超时、重试策略、熔断/降级行为。
  • 仅在收益明确且复杂度可控时提出替代实现。

D) 架构影响

  • 分层/边界是否被破坏(route-service-repo、领域泄漏、循环依赖)。
  • 对外契约稳定性与向后兼容性。
  • 事务/一致性边界与失败语义是否清晰。
  • 关键路径可观测性是否充足(日志、指标、追踪)。
  • 回滚可行性与影响面。

E) 代码组织与可维护性

  • 内聚性、函数/类职责、命名清晰度。
  • 错误处理质量:不得吞错,需保留上下文。
  • 类型安全与空值处理是否正确。
  • 重复与抽象的权衡是否合理。
  • 面向后续修改的可读性如何。

F) 优雅性

  • 方案是否简单、直接、易理解?
  • 避免“聪明但脆弱”的代码。
  • 优先表达业务语义,而非堆叠偶然实现细节。

严重级别模型

  • S0 Blocker:必须在合并前修复(正确性/安全性/数据丢失/重大需求不一致)。
  • S1 High:强烈建议合并前修复(高回归风险或高运行风险)。
  • S2 Medium:应尽快修复(有明确影响的可维护性/性能债务)。
  • S3 Low:可选优化(样式/可读性提升,风险较低)。

评论风格

  • 每条问题使用:问题 -> 影响原因 -> 修复建议。
  • 结论要具体、可证据化,避免空泛的样式挑刺。
  • 不确定时需明确假设前提。
  • 仅在关键信息缺失导致无法判断时,最多提出 3 个澄清问题。

输出格式(严格)

  1. 结论(Verdict):Approve / Request Changes / Block。
  2. 需求一致性摘要(包含反推需求意图与漂移结论)。
  3. 关键问题清单:带 [S0-S3] 级别、分类、影响、修复建议。
  4. 测试评审摘要:已覆盖 / 缺失 / 最小新增测试建议。
  5. 资源与架构评估:当前风险 + 更优方案(若有充分理由)。
  6. 合并建议与修复优先级顺序。

默认评审原则

  • 架构、资源效率、代码组织、可维护性、优雅性均在审查范围内。
  • 优先给出低风险、高信号、可落地的反馈,帮助团队安全交付并可持续演进。

关键词(用于匹配是否启用此技能)

  • code review
  • PR review
  • diff review
  • merge readiness
  • request changes
  • blocker
  • architecture review
  • performance review
  • test quality
  • requirement drift
  • regression risk
  • security review
  • database consistency
  • queue/retry/idempotency

使用示例

示例 1:PR 严格评审请求

输入:

请评审这个 PR 是否可以合并:
- PR: https://github.com/org/repo/pull/123
- 背景:修复重复扣费
- 非目标:不改动账单导出
- 约束:必须保持向后兼容,接口响应结构不能变
- 关注点:幂等、并发、重试

预期:

  • 给出明确 Verdict(Approve / Request Changes / Block)。
  • 列出 S0/S1 级问题(若有)并附最小修复建议。
  • 明确是否存在需求漂移、测试缺口与回归风险。

示例 2:commit 范围回归评审

输入:

评审 commit 范围 abc123..def456:
背景:优化任务队列吞吐。
约束:CPU 增幅不超过 10%,不可牺牲失败任务可观测性。

预期:

  • 优先检查重试风暴、队列背压、日志与指标完整性。
  • 给出资源评估与必要的压测/最小回归建议。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.