review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

/review

/review

Detects whether to review a plan or code, assembles the right panel, runs the review-fix loop.
自动检测需要审核的是计划还是代码,组建合适的审核小组,运行审核-修复循环。

1. Detect Mode

1. 检测模式

From args or context:
  1. Explicit:
    /review plan
    or
    /review code
    — use that.
  2. Plan file exists in
    ai-workspace/plans/
    (non-
    .done.md
    ) and no commits beyond main — plan mode.
  3. git diff main...HEAD
    produces output — code mode.
  4. Ambiguous — ask: "Reviewing the plan or the code?"
Optional overrides after mode:
  • Round cap: default 3. "thorough" (5) or "quick" (1).
  • Severity gate: default P2. "strict" (P1) or "lenient" (P3).
从参数或上下文判断:
  1. 显式指定:
    /review plan
    /review code
    —— 直接使用指定模式。
  2. ai-workspace/plans/
    目录下存在未标记为
    .done.md
    的计划文件,且主分支之后无提交记录 —— 计划模式
  3. git diff main...HEAD
    输出内容不为空 —— 代码模式
  4. 无法明确判断 —— 询问:"需要审核计划还是代码?"
模式指定后可添加可选参数:
  • 循环次数上限:默认3次。可指定"thorough"(5次)或"quick"(1次)。
  • 严重程度门控:默认P2。可指定"strict"(P1)或"lenient"(P3)。

2. Assemble Panel

2. 组建审核小组

Plan mode (Step 4)

计划模式(步骤4)

Lead:
technical-editor
(always). Target: the plan file.
负责人
technical-editor
(固定)。 审核目标:计划文件。

Code mode (Step 6)

代码模式(步骤6)

Lead:
code-reviewer
(always). Target: changed files (
git diff main...HEAD
).
负责人
code-reviewer
(固定)。 审核目标:变更文件(
git diff main...HEAD
输出的内容)。

Conditional reviewers (both modes)

条件审核人员(两种模式通用)

Scan the target for signals. Add matching reviewers:
SignalPlan modeCode mode
Architecture, new modules, DI patterns
architect-reviewer
architect-reviewer
AGENTS.md, config.toml, sync.sh, skills
codex-specialist
codex-specialist
Auth, credentials, tokens, secrets
security-auditor
security-auditor
UI, CSS, components, accessibility
ui-designer
design-reviewer
No signal match — run with lead only.
Invoke
/assemble-panel
if available for RETAIN, EXPAND, CONVERGE, and ESCALATE_RECURRING governance. Do not duplicate its policy algebra.
Codex/Cursor: read
.agents/skills/assemble-panel/SKILL.md
and apply inline.
扫描审核目标中的特征信号,添加匹配的审核人员:
特征信号计划模式代码模式
架构、新模块、DI模式
architect-reviewer
architect-reviewer
AGENTS.md、config.toml、sync.sh、skills
codex-specialist
codex-specialist
认证、凭据、令牌、密钥
security-auditor
security-auditor
UI、CSS、组件、可访问性
ui-designer
design-reviewer
无匹配特征信号 —— 仅由负责人进行审核。
/assemble-panel
可用,调用该工具进行RETAIN、EXPAND、CONVERGE和ESCALATE_RECURRING治理。请勿重复实现其策略逻辑。
Codex/Cursor:读取
.agents/skills/assemble-panel/SKILL.md
并内联应用。

3. Dispatch

3. 调度

  • Plan mode: invoke
    /plan-review
    via Skill tool. Pass panel and round cap. Its internal P0 loop counts as R1.
  • Code mode: dispatch panel via Agent tool. Request severity-tagged findings (P0-P3).
Untagged findings: treat as P1.
  • 计划模式:通过Skill工具调用
    /plan-review
    。传入审核小组和循环次数上限。其内部P0循环算作第1轮(R1)。
  • 代码模式:通过Agent工具调度审核小组。要求返回标记严重程度的审核结果(P0-P3)。
未标记严重程度的结果:视为P1。

4. Loop: Fix, Record, Re-review

4. 循环:修复、记录、重新审核

For each round (R1..R{cap}):
a. Triage by severity gate:
  • Fix (P0 through P{gate}): fix immediately. Commit:
    fix: address R{N} review findings
    with
    Co-Authored-By
    trailer.
  • Record (P{gate+1}+): record, do not fix.
b. Record below-gate findings:
  • Plans: append
    ### Deferred Findings (R{N})
    to the plan file.
  • Code:
    gh issue create --label review-finding --title "R{N}: <summary>"
    . Cap 10/round, 20 total. If
    gh
    unavailable, append to
    .branch-context.md
    .
c–f. Panel governance — invoke
/assemble-panel
for RETAIN, EXPAND, CONVERGE, ESCALATE_RECURRING.
针对每一轮(R1..R{上限}):
a. 根据严重程度门控分类处理
  • 修复(P0至P{门控级别}):立即修复。提交信息为
    fix: address R{N} review findings
    ,并添加
    Co-Authored-By
    尾注。
  • 记录(P{门控级别+1}及以上):仅记录,不修复。
b. 记录低于门控级别的结果
  • 计划:在计划文件末尾追加
    ### Deferred Findings (R{N})
    章节。
  • 代码:执行
    gh issue create --label review-finding --title "R{N}: <summary>"
    。每轮最多记录10条,总计不超过20条。若
    gh
    不可用,追加至
    .branch-context.md
    文件。
c–f. 审核小组治理 —— 调用
/assemble-panel
进行RETAIN、EXPAND、CONVERGE和ESCALATE_RECURRING操作。

5. Summary

5. 总结

Review Summary
───────────────────────────────────────
Mode:      plan | code
Target:    <file or diff summary>
Rounds:    <N of cap>
Gate:      P<N>

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

Verdict: APPROVE | ESCALATE
  • APPROVE — all above-gate findings resolved. Next step:
    • Plan mode → Build (Step 5)
    • Code mode → Archive (Step 7)
  • ESCALATE — unresolved above-gate findings after cap. Present to human.
Review Summary
───────────────────────────────────────
Mode:      plan | code
Target:    <file or diff summary>
Rounds:    <N of cap>
Gate:      P<N>

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

Verdict: APPROVE | ESCALATE
  • APPROVE(通过) —— 所有高于门控级别的问题已解决。下一步:
    • 计划模式 → 构建(步骤5)
    • 代码模式 → 归档(步骤7)
  • ESCALATE(升级) —— 达到循环次数上限后仍有未解决的高于门控级别的问题。提交给人工处理。

Guardrails

护栏规则

  • Never modify protected files (see AGENTS.md).
  • Hard max: 5 rounds even if requested higher.
  • Never auto-merge or auto-approve. Produces a verdict, not an action.
  • Plain text output only — cross-surface safe.
  • 不得修改受保护文件(详见AGENTS.md)。
  • 硬性上限:即使请求更高次数,最多运行5轮。
  • 不得自动合并或自动批准。仅生成审核结论,不执行操作。
  • 仅输出纯文本 —— 确保跨平台兼容性。

Fallbacks

回退方案

  • /plan-review
    unavailable → dispatch
    technical-editor
    +
    architect-reviewer
    directly.
  • /assemble-panel
    unavailable → fall back to
    [technical-editor, code-reviewer]
    , gate=P2, cap=3.
  • gh
    not authenticated → degrade to
    .branch-context.md
    .
  • Reviewer returns DROP → exit immediately, print summary.
  • /plan-review
    不可用 → 直接调度
    technical-editor
    +
    architect-reviewer
  • /assemble-panel
    不可用 → 回退至
    [technical-editor, code-reviewer]
    ,门控级别为P2,循环次数上限为3次。
  • gh
    未认证 → 降级为使用
    .branch-context.md
    记录。
  • 审核人员返回DROP → 立即退出,打印总结。