ai-code-review
Skill2 starsChanged 12 days agoMITView on GitHub
AI 多角色代码审查流水线。当需要多 AI 协作审查代码(实现 AI + 2+ 审查 AI + 工具审查)、对弈复核、审查结果收敛、统一修复时使用。触发词:代码审查/审查/多AI审查/对弈复核/审查计划/审查报告/审查收口/校验。跨项目通用,专用部分在 references 定制。
6 other projects use a version of this.
Adopted by
Most recently taken up by
- evertonfernandes3321-wq/mythos-skillstheir own version, first seen Oct 20, 2026
- leafyoung/shared_skillstheir own version, first seen Oct 8, 2026
- leafyoung/pi-agent-skillstheir own version, first seen Sep 7, 2026
- Red-empty-potato/ai-agent-skillstheir own version, first seen Aug 29, 2026
- newesp/my-skillstheir own version, first seen Aug 19, 2026
- daedalus/skillstheir own version, first seen Jun 9, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- leafyoung/pi-agent-skills★ 2same name
- leafyoung/shared_skills★ 2same name
- daedalus/skills★ 1same name
- evertonfernandes3321-wq/mythos-skills★ 0same name
- newesp/my-skills★ 0same name
- Red-empty-potato/ai-agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- skills/iso/light/CLAUDE.mdCLAUDE.md
- api-design-reviewSkill
- architecture-support-briefSkill
- class-design-reviewSkill
- comment-policySkill
- cpp-exemplarsSkill
- error-code-classificationSkill
- essential-tool-installSkill
- isoSkill
- notion-diagramSkill
- reportSkill
- researchSkill
- incident-reviewSkill
- routerSkill
- test-naming-and-structureSkill
The file
Files
AI 多角色代码审查流水线(v0.2)
v0.2 变更:① 新增校验 AI 角色(meta-review——学术实证支持,RevAgent critic);② 反过拟合纪律(审查只报正确性/契约/需求缺口——其余 Nit);③ 维度优先级(设计/契约/并发优先);④ 定级加 Nit 档(可忽略) v0.3 变更:⑤ 新增 references/dimensions.md(评审维度清单 + 自动/人工归属列——补齐 Google 8 维第 3「复杂度」缺口);⑥ G 输入处理三连(协作者输入一律实证核实→规模纠正→解法判定);⑦ shepherd 闭环推动责任(默认校验 AI 兼任,例外可委托其他角色)
3+ AI 角色流水线:实现 AI(唯一完整上下文)→ 2+ 审查 AI(独立审查)→ 对弈收敛 → 统一修复 模型:单一职责(审查者无实现包袱——消除自我确认偏误)+ 实证定级 + 状态机交接 跨项目通用;专用定制在 references(按需覆写)
1. 角色模型
| 角色 | 上下文 | 职责 |
| 实现 AI | 完整(契约+设计+实现决策) | 产出审查包 / 聚合映射 / 确认与疑问 / 统一修复 |
| 审查 AI(2+) | 审查包(契约+设计+diff)——无实现决策上下文 | 独立审查(不共享中间结果——防从众);按维度分工(架构/并发/测试覆盖)互补 |
| 校验 AI | 两轮审查报告 + 代码实证 + 契约(非完整实现上下文) | meta-review(审查的审查)= Oracle Triple(测试领域"独立判官"概念——多视角交叉验证):校验报告正确性 / 找共识盲区(两轮都错/都漏) / 定级修正 / 流程完整性——不重复找问题 / 兼任 shepherd(闭环推动:推进每条 finding 至 close,例外可委托其他角色) |
| 工具审查 | 确定性 | cppcheck / ASan / TSan(自动化兜底) |
| G(用户) | — | 方案期与项目结束复审拍板;执行期零介入——门禁批准与 finding 裁决由架构师做(sop/collaboration-flow.md §1) |
2. 流水线(7 阶段)
| 阶段 | 动作 | 产出 |
| P1 审查准备 | 实现 AI 出审查包:契约+设计+变更 diff+工具基线 + 按 references/dimensions.md 清单逐维覆盖 | review-plan.md |
| P2 独立审查 | 审查 AI 并行(统一发现格式);工具审查同步 | {agent}-代码审查报告 |
| P2.5 校验 | 校验 AI meta-review 两轮报告(正确性/共识盲区/定级/流程)→ 校验报告并入对弈输入 | {agent}-校验报告 |
| P3 聚合映射 | 实现 AI 合并去重(编号映射表)→ 合并清单 | 映射表 + 合并清单 |
| P4 确认与疑问 | 实现 AI 逐条确认(实证核验——非辩护)+ 疑问 | confirm 状态 + 疑问清单 |
| P5 回执 | 审查 AI ≤2 轮(确认/撤回/补证据) | reply 状态 |
| P6 修复 | 修改清单门禁 → 架构师裁决(执行期;G 只在方案期与项目结束复审拍板)→ 实现 AI 修复 → 本地验证绿 | 修改清单 + commit |
| P7 验证闭环 | 编译/测试/sanitizer/CI → 状态全 close | 收口报告 |
3. 交接契约(流水线核心——比流程本身更重要)
3.1 统一发现格式(finding schema——机器可解析)
id: {agent}-{P0|P1|P2|P3}-{n} # agent 前缀消歧
位置: file:line
类别: 契约偏差/并发/内存/逻辑/可维护性/测试/文档
问题: 一句话
证据: 代码原文或工具输出引用(可追溯);**删除/缺失/新增类 finding 必须附版本对证据(旧版有→新版无,如 git show 双版本对比)——评审报告实证护栏(复盘模式 10)**
定级: P0/P1/P2/P3 # 见 references/grading.md
修复建议: 明确动作 + 影响面
状态: open # 状态机流转3.2 状态机(每条发现可视化流转)
open → confirm(实现AI实证核验:成立/撤回/降级)
→ reply(审查AI回执:接受/补证据/撤回)
→ fix(架构师裁决修改清单后)
→ verify(编译+测试+sanitizer)
→ close(CI 绿)这六个状态只活在评审文件里。登记进问题台账时按下表映射,台账的枚举是唯一 schema:
open/confirm/reply → open;fix → fixing;verify → verifying;close → closed。
Nit 级发现只写评审文件的 Nit 表,不进台账正文(references/grading.md),项目收尾时按技术债一次登记。
3.3 权威状态文件(唯一权威源——所有角色读它对齐)
- 路径:
<日期>/<卡号>/评审.md(与卡同目录,见sop/collaboration-flow.md§9.1) - 内容:全部发现 + 状态 + 待拍板项 + 轮次——持续更新——防多 AI 信息不同步
3.4 G 输入处理(协作者三问)
协作者(G)输入一律走三连:① 是否实证(证据链 file:line / 工具输出)?② 规模是否夸大(2 处 vs 全局)?③ 正确解是否与直觉相同(直觉方向对、解法可能不同——nothrow→try/catch、手动锁→RAII)?处理 = 校验 AI 实证核实 → 规模纠正 → shepherd 汇总 → G 拍板;不直接采纳、不直接反驳。
4. 纪律(硬红线)
| # | 纪律 | 原因 |
| 0 | 反过拟合:审查 AI 只报影响正确性/契约/需求的缺口;风格/优化/偏好标 Nit(可忽略)——"为找问题而找问题"是审查失职;可维护性债(魔数/单一权威/名实相符/自注释)属 Nit-登记档:必须登记不得静默丢弃(与命名维度 J-16/29/30 同档) | Anthropic 官方(gap-only)+ 微软数据(仅 15% 评论是真实缺陷)——防噪音淹没真问题 |
| 1 | 审查只读(零改动——审查≠修复) | 防"顺手修"污染审查 |
| 2 | 实证定级(读源码/跑工具;推演标"待实证") | 防推演漂移(P0 待实证条款:复现失败降 P1) |
| 3 | 双向辩证(审查 AI 间也互相质疑——不只对实现 AI) | 本次实证:修正对方口径(4/9→5/8) |
| 4 | 编号 agent 前缀 + 映射表 | 防编号混用(实测发生) |
| 5 | 回执 ≤2 轮(未收敛 → 架构师裁决) | 防对弈死循环 |
| 5b | 绕开已有实现与声明未接线必须作为 finding 提出,附 file:line(判据见 scaffold/policies/constraints-and-criteria.md §2.2 与 top-principles.md §1) | 两类缺口不会让任何用例变红,只能靠审查抓 |
| 6 | 修复走修改清单门禁(6 列——架构师裁决——本地验证绿再提交) | 串行可控 |
| 7 | 撤回无惩罚(实证推翻即撤回——编号保留) | 鼓励诚实 |
| 8 | 校验 AI 独立(不参与对弈——超脱校验双方——防"共识性误判") | 对弈发现不了"双方都错"——需第三方 |
| 9 | 编号黑话判定:评审编号(RWF/TG)与台账编号(J-xx)无自解释即黑话——不进 git log / 代码注释 / 评审主报告(对照 comment-policy D 类) | 台账编号曾被当"先例一致"例外放行(2026-10-23 实证) |
5. 与其他 skill 关系
- incident-review(复盘):审查发现的问题 → 归因复盘;四分类台账由项目台账承接
- iso(重工程轨道):审查收口 → 契约修订 / 关键决策记录
- 专用定制:项目级覆写 references(review-plan 范围 / grading 口径 / 工具命令)
6. 续接
- 读
<日期>/<卡号>/评审.md(权威状态) - 读 references/review-plan.md(范围与纪律) 2.5 读 references/dimensions.md(评审清单 + 归属——P1 逐维覆盖)
- 从 P2(未完成阶段)继续
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
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.

