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:
- Explicit: or
/review plan— use that./review code - Plan file exists in (non-
ai-workspace/plans/) and no commits beyond main — plan mode..done.md - produces output — code mode.
git diff main...HEAD - 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).
从参数或上下文判断:
- 显式指定:或
/review plan—— 直接使用指定模式。/review code - 目录下存在未标记为
ai-workspace/plans/的计划文件,且主分支之后无提交记录 —— 计划模式。.done.md - 输出内容不为空 —— 代码模式。
git diff main...HEAD - 无法明确判断 —— 询问:"需要审核计划还是代码?"
模式指定后可添加可选参数:
- 循环次数上限:默认3次。可指定"thorough"(5次)或"quick"(1次)。
- 严重程度门控:默认P2。可指定"strict"(P1)或"lenient"(P3)。
2. Assemble Panel
2. 组建审核小组
Plan mode (Step 4)
计划模式(步骤4)
Lead: (always).
Target: the plan file.
technical-editor负责人:(固定)。
审核目标:计划文件。
technical-editorCode mode (Step 6)
代码模式(步骤6)
Lead: (always).
Target: changed files ().
code-reviewergit diff main...HEAD负责人:(固定)。
审核目标:变更文件( 输出的内容)。
code-reviewergit diff main...HEADConditional reviewers (both modes)
条件审核人员(两种模式通用)
Scan the target for signals. Add matching reviewers:
| Signal | Plan mode | Code mode |
|---|---|---|
| Architecture, new modules, DI patterns | | |
| AGENTS.md, config.toml, sync.sh, skills | | |
| Auth, credentials, tokens, secrets | | |
| UI, CSS, components, accessibility | | |
No signal match — run with lead only.
Invoke if available for RETAIN, EXPAND, CONVERGE, and ESCALATE_RECURRING governance. Do not duplicate its policy algebra.
/assemble-panelCodex/Cursor: read and apply inline.
.agents/skills/assemble-panel/SKILL.md扫描审核目标中的特征信号,添加匹配的审核人员:
| 特征信号 | 计划模式 | 代码模式 |
|---|---|---|
| 架构、新模块、DI模式 | | |
| AGENTS.md、config.toml、sync.sh、skills | | |
| 认证、凭据、令牌、密钥 | | |
| UI、CSS、组件、可访问性 | | |
无匹配特征信号 —— 仅由负责人进行审核。
若 可用,调用该工具进行RETAIN、EXPAND、CONVERGE和ESCALATE_RECURRING治理。请勿重复实现其策略逻辑。
/assemble-panelCodex/Cursor:读取 并内联应用。
.agents/skills/assemble-panel/SKILL.md3. Dispatch
3. 调度
- Plan mode: invoke via Skill tool. Pass panel and round cap. Its internal P0 loop counts as R1.
/plan-review - Code mode: dispatch panel via Agent tool. Request severity-tagged findings (P0-P3).
Untagged findings: treat as P1.
- 计划模式:通过Skill工具调用 。传入审核小组和循环次数上限。其内部P0循环算作第1轮(R1)。
/plan-review - 代码模式:通过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: with
fix: address R{N} review findingstrailer.Co-Authored-By - Record (P{gate+1}+): record, do not fix.
b. Record below-gate findings:
- Plans: append to the plan file.
### Deferred Findings (R{N}) - Code: . Cap 10/round, 20 total. If
gh issue create --label review-finding --title "R{N}: <summary>"unavailable, append togh..branch-context.md
c–f. Panel governance — invoke for RETAIN, EXPAND, CONVERGE, ESCALATE_RECURRING.
/assemble-panel针对每一轮(R1..R{上限}):
a. 根据严重程度门控分类处理:
- 修复(P0至P{门控级别}):立即修复。提交信息为 ,并添加
fix: address R{N} review findings尾注。Co-Authored-By - 记录(P{门控级别+1}及以上):仅记录,不修复。
b. 记录低于门控级别的结果:
- 计划:在计划文件末尾追加 章节。
### Deferred Findings (R{N}) - 代码:执行 。每轮最多记录10条,总计不超过20条。若
gh issue create --label review-finding --title "R{N}: <summary>"不可用,追加至gh文件。.branch-context.md
c–f. 审核小组治理 —— 调用 进行RETAIN、EXPAND、CONVERGE和ESCALATE_RECURRING操作。
/assemble-panel5. 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
回退方案
- unavailable → dispatch
/plan-review+technical-editordirectly.architect-reviewer - unavailable → fall back to
/assemble-panel, gate=P2, cap=3.[technical-editor, code-reviewer] - not authenticated → degrade to
gh..branch-context.md - Reviewer returns DROP → exit immediately, print summary.
- 不可用 → 直接调度
/plan-review+technical-editor。architect-reviewer - 不可用 → 回退至
/assemble-panel,门控级别为P2,循环次数上限为3次。[technical-editor, code-reviewer] - 未认证 → 降级为使用
gh记录。.branch-context.md - 审核人员返回DROP → 立即退出,打印总结。