review-loop

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Review Loop

评审循环

Bounded review-fix-re-review loop. You are the router — parse intent, select reviewers, run the loop.
有限制的评审-修复-复评审循环。你是路由节点——解析意图、选择评审人、运行循环。

1. Parse Intent

1. 解析意图

From natural language after
/review-loop
, determine:
  • Target: plan or work? Check conversation context, recent activity, user's words.
  • Reviewers: user-specified, or your judgment. Available:
    code-reviewer
    ,
    architect-reviewer
    ,
    security-auditor
    ,
    technical-editor
    ,
    accessibility-tester
    ,
    design-reviewer
    ,
    codex-specialist
    . Match to artifact type.
  • Round cap: default 3. User can say "thorough" (5) or "quick" (1).
  • Severity gate: default P2 (fix P0-P2, record P3+). User can say "strict" (P1) or "lenient" (P3).
If ambiguous, ask: "Reviewing the plan or the work?"
/review-loop
后的自然语言中,确定以下信息:
  • 目标:评审方案还是工作内容?检查对话上下文、最近活动、用户表述。
  • 评审人:用户指定,或你自行判断。可选评审人:
    code-reviewer
    architect-reviewer
    security-auditor
    technical-editor
    accessibility-tester
    design-reviewer
    codex-specialist
    。根据工件类型匹配。
  • 轮次上限:默认3轮。用户指定"thorough"(全面)则为5轮,指定"quick"(快速)则为1轮。
  • 严重等级门槛:默认P2(修复P0-P2等级问题,记录P3及以上问题)。用户指定"strict"(严格)则为P1,指定"lenient"(宽松)则为P3。
如果信息有歧义,询问用户:"要评审方案还是工作内容?"

2. Dispatch

2. 任务分派

  • Plan: invoke
    /plan-review
    via Skill tool. Pass round cap. Its internal P0 loop counts as R1.
  • Work: dispatch reviewer(s) via Agent tool. Request severity-tagged findings (P0-P3).
Untagged findings: treat as P1.
  • 方案评审:通过Skill工具调用
    /plan-review
    ,传入轮次上限。其内部P0循环计为R1。
  • 工作内容评审:通过Agent工具分派评审人,要求返回带严重等级标记的问题(P0-P3)。
未标记等级的问题视为P1。

3. Loop: Fix, Record, Re-review

3. 循环:修复、记录、复评审

For each round (R1..R{cap}):
a. Triage findings by severity gate (P0 is highest severity, P3 is lowest):
  • Fix (higher severity than gate — lower P-number, i.e. P0 through P{gate}): fix immediately. Commit:
    fix: address R{N} review findings
    with
    Co-Authored-By
    trailer per AGENTS.md.
  • Record (lower severity than gate — higher P-number, i.e. P{gate+1}+): record, do not fix.
b. Record below-gate findings:
  • Plans: append
    ### Deferred Findings (R{N})
    section to the plan file.
  • Work:
    gh issue create --label review-finding --title "R{N}: <summary>"
    . Cap 10/round, 20 total across all rounds. If
    gh
    unavailable, append to
    .branch-context.md
    .
c. Reviewer retention — zero trust in fixes. A reviewer stays on the panel until they individually return no above-gate findings. Only then are they done.
  • R1: full panel
  • R2+: only reviewers who had above-gate findings in the prior round re-review
  • Reviewers with no above-gate findings are done — they already approved implicitly
d. Exit when: all reviewers have individually confirmed clean (converged), OR cap reached, OR DROP verdict.
e. Recurring findings: if same finding appears across 2+ rounds, escalate severity by 1 level. If an escalated finding reaches P0 and remains unfixed at cap, stop and hand off to human.
针对每一轮(R1..R{cap}):
a. 问题分级 按照严重等级门槛处理问题(P0严重度最高,P3最低):
  • 修复(严重度高于门槛,即P数值更小,范围为P0到P{gate}):立即修复。提交信息为:
    fix: address R{N} review findings
    ,按照AGENTS.md要求添加
    Co-Authored-By
    尾部信息。
  • 记录(严重度低于门槛,即P数值更大,范围为P{gate+1}及以上):仅记录,不修复。
b. 记录低于门槛的问题:
  • 方案类:在方案文件末尾追加
    ### 延期处理问题 (R{N})
    章节。
  • 工作内容类:执行
    gh issue create --label review-finding --title "R{N}: <summary>"
    。每轮最多记录10条,所有轮次总计最多20条。如果
    gh
    不可用,追加到
    .branch-context.md
    文件中。
c. 评审人留存规则——对修复结果零信任。评审人会一直留在评审组中,直到其个人未返回任何高于门槛的问题,才算完成评审。
  • R1:全组评审
  • R2+:仅在上一轮提交过高于门槛问题的评审人参与复评审
  • 未提交高于门槛问题的评审人已完成评审——已隐含批准
d. 循环退出条件: 所有评审人各自确认无问题(达成一致),或达到轮次上限,或收到DROP判定。
e. 重复问题处理: 如果同一问题出现在2轮及以上,严重等级提升1级。如果升级后的问题达到P0且到轮次上限仍未修复,停止循环并移交人工处理。

4. Summary

4. 总结

Review Loop Summary
───────────────────────────────────────
Target:    <plan name or file description>
Rounds:    <N of cap>
Gate:      P<N>

│ Round │ P0 │ P1 │ P2 │ P3+ │ Fixed │ Recorded │
│───────│────│────│────│─────│───────│──────────│

Verdict: APPROVE | ESCALATE
APPROVE = all above-gate findings resolved. ESCALATE = unresolved above-gate findings remain — hand off to human.
Review Loop Summary
───────────────────────────────────────
Target:    <plan name or file description>
Rounds:    <N of cap>
Gate:      P<N>

│ Round │ P0 │ P1 │ P2 │ P3+ │ Fixed │ Recorded │
│───────│────│────│────│─────│───────│──────────│

Verdict: APPROVE | ESCALATE
APPROVE = 所有高于门槛的问题已解决。ESCALATE = 仍有未解决的高于门槛的问题——移交人工处理。

Guardrails

护栏规则

  • Never modify protected files (see AGENTS.md).
  • Hard max: 5 rounds even if user requests more. Note: "thorough" (5) is already the maximum.
  • Do not auto-merge or auto-approve. The loop produces a verdict, not an action.
  • Plain text output only — cross-surface safe.
  • 绝不修改受保护文件(详见AGENTS.md)。
  • 硬上限:即使用户要求更多轮次,最多执行5轮。注意:"thorough"(全面)模式的5轮已经是最大值。
  • 不要自动合并或自动批准。循环仅生成判定结果,不执行操作。
  • 仅输出纯文本——保证跨场景安全。

Failure Modes

故障模式

  • /plan-review
    unavailable → dispatch
    technical-editor
    +
    architect-reviewer
    directly.
  • gh
    not authenticated → degrade to
    .branch-context.md
    or printed list.
  • Reviewer returns DROP → exit immediately, print summary.
  • No reviewers available → use
    code-reviewer
    as minimum viable panel.
  • /plan-review
    不可用 → 直接分派
    technical-editor
    +
    architect-reviewer
    进行评审。
  • gh
    未认证 → 降级使用
    .branch-context.md
    记录或直接打印问题列表。
  • 评审人返回DROP → 立即退出循环,打印总结。
  • 无可用评审人 → 使用
    code-reviewer
    作为最低可行评审组。