code-review-expert

A code-review guide for checking proposed code changes before they are merged. It produces a review report instead of changing the code.

In plain words
What is it for?
Use it to review a Git diff, pull request, commit, or directory and group findings by severity before deciding what to fix.
Why use it?
It helps find security risks, logic errors, performance problems, and maintainability issues with evidence from the code.

Skill for Claude CodeCodexCursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/programmeranthony/expert-coding-harness/code-review-expert
Any agent
npx skills add ProgrammerAnthony/Expert-Coding-Harness --skill code-review-expert
Clone the repo
git clone --depth 1 https://github.com/ProgrammerAnthony/Expert-Coding-Harness

Made for: Claude Code, Codex, Cursor.

Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,852 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00079 $0.01852
Opus 5 $0.00039 $0.00926
Sonnet 5 $0.00016 $0.00370
Haiku 4.5 $0.00008 $0.00185

Measured 2d ago against content hash 7acccaa36824, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-review-expert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/skills/code-review-expert/SKILL.md · 166 lines

How it starts

The opening of the file, as written. The whole thing — 166 lines — stays where its author put it; the contents beside it link to each section on GitHub.

代码审查专家

铁律:默认只输出审查报告,不实现任何修改。未经用户明确确认,不得编写或修改任何代码。

Inputs / Outputs / Gates / Handoffs(统一契约)

  • Inputs(最小输入):审查范围(默认:当前 git diff;或用户指定 commit/目录);运行/测试命令(如有);风险偏好(例如“安全优先/交付优先”)。
  • Outputs(产物形态):结构化审查报告(结构参考 references/review-report-template.md)。
  • Gates(继续前必须满足)
    • 默认只输出报告;用户明确选择“修复”选项前禁止修改代码(保持与本文件 HARD-GATE 一致)。
    • 所有问题必须给证据(文件/行号/调用路径);不确定要明确标注。
    • 通用门控清单可复制使用:references/quality-gates-checklist.md
  • Handoffs(推荐下游)
    • writing-plans(实施计划编写):先写可执行修复计划
    • subagent-driven-development(子代理驱动开发):按计划逐任务执行

严重度分级

级别 名称 说明 处置
P0 致命 安全漏洞、数据丢失风险、逻辑错误 必须阻止合并
P1 严重 重大 SOLID 违反、性能回退、业务逻辑缺陷 合并前应修复
P2 中等 代码异味、可维护性问题、轻微 SOLID 违反 本 PR 修复或创建后续 Issue
P3 建议 风格、命名、优化建议 可选改进

工作流

第一步:预检与上下文收集

执行以下命令建立审查范围:

git status -sb
git diff --stat
git diff

边界情况处理:

  • 无变更:告知用户,询问是否审查暂存区或指定提交范围
  • 大型 diff(>500行):先按文件汇总,再按模块/功能区域分批审查
  • 混合关注点:按功能特性分组,而非按文件顺序

若需要,用 rg 查找相关模块、用法和接口契约,识别入口点、权限边界和关键路径(认证、数据写入、网络调用)。

第二步:SOLID 与架构审查

加载 references/solid-checklist.md 进行系统检查。

重点关注:

  • SRP:类/函数是否承担多个职责
  • OCP:是否通过修改而非扩展来增加功能
  • LSP:子类是否破坏父类契约
  • ISP:接口是否过于臃肿
  • DIP:是否直接依赖具体实现而非抽象

提出重构建议时,必须说明为何能改善内聚性/耦合度,并给出最小化、安全的拆分方案。非简单重构时,提出渐进式计划而非大规模重写。

第三步:可删除代码与迭代计划

加载 references/refactor-plan.md

识别:无用代码、冗余逻辑、功能开关保护的死代码。 分类为:立即安全删除 vs 延后处理(附计划与检查节点)

第四步:安全与可靠性扫描

加载 references/security-checklist.md

覆盖:

  • 注入:SQL 注入、命令注入、LDAP 注入、模板注入
  • 认证与授权:Token 校验缺失、越权访问、会话固定
  • 文件操作:路径穿越、任意文件读写、上传校验不足
  • SSRF:不受限的外部 URL 请求
  • 加密:弱算法、硬编码密钥、不安全随机数
  • 敏感信息:日志泄露、错误信息暴露、配置文件明文
  • 竞态条件与反序列化:并发漏洞、不可信数据反序列化

第五步:代码质量扫描

加载 references/quality-checklist.md

覆盖:错误处理完备性、性能热点、边界条件、可测试性。

第六步:输出报告

输出格式固定如下:

## 代码审查报告

### 总览
[变更范围概述,受影响的核心模块与影响面评估]

### 发现问题

#### P0 致命问题
- **[文件:行号]** 问题描述
  - 原因:[为什么这是问题]
  - 修复建议:[具体如何修复,可含代码示例]

#### P1 严重问题
[同上格式]

#### P2 中等问题
[同上格式]

#### P3 建议
[同上格式]

### 可删除/重构计划
[来自 refactor-plan 的识别结果]

### 安全摘要
[安全扫描结论,无问题则明确说明已覆盖的检查项]

### 亮点
[代码中做得好的部分,平衡批评]

Read the full file on GitHub · 166 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 166 lines · 79 tokens per session scan A 7acccaa36824

Subscribe to this mod's changes

code-review-expert is a skill published in the GitHub repository ProgrammerAnthony/Expert-Coding-Harness (235 stars, last pushed 3mo ago), licensed MIT. It adds 79 tokens to every session and 1,852 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens