plan-review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Phase gate: PLAN checkpoint. MUST get APPROVE from all reviewers before proceeding to Build.
阶段门禁:PLAN检查点。在进入构建阶段前必须获得所有评审人员的批准。

Inputs

输入参数

  • Plan file path (default: most recent non-
    .done.md
    file in
    ai-workspace/plans/
    )
  • --include <agent>
    : Force-add an agent to the panel
  • --exclude <agent>
    : Remove an agent (except technical-editor, which cannot be excluded)
  • 计划文件路径(默认:
    ai-workspace/plans/
    目录下最新的非
    .done.md
    文件)
  • --include <agent>
    :强制将某个Agent添加到评审小组
  • --exclude <agent>
    :移除某个Agent(technical-editor除外,不可被移除)

Steps

执行步骤

  1. Find the plan file:
    bash
    ls -t ai-workspace/plans/*.md | grep -v '.done.md' | head -1
    If no plan file found → error: "No plan file in ai-workspace/plans/. Write a plan first." If plan file is
    .done.md
    → error: "This plan is already finalized."
  2. Read the plan and extract:
    • Files to Modify section
    • Full body text
    • Plan scope (count files changed, count body lines)
  3. Auto-assemble the review panel using these deterministic rules:
    Tier 1 — Always included:
    AgentWhen
    technical-editor
    EVERY plan review (cannot be excluded)
    Tier 2 — Auto-included by scope:
    AgentTrigger
    code-reviewer
    Plan includes ANY code changes (files ending in
    .ts
    ,
    .js
    ,
    .sh
    ,
    .yml
    , or paths containing
    src/
    ,
    tests/
    )
    architect-reviewer
    Plan is medium/large: >3 files changed, OR plan body >100 lines, OR multiple workflow steps affected
    Tier 3 — Auto-included by keyword scanning:
    AgentTrigger keywords (scan Files to Modify + body)
    codex-specialist
    AGENTS.md, config.toml, sync.sh, skills, dotfiles
    designer
    +
    design-reviewer
    component, UI, CSS, design, wireframe, mockup, Figma, layout
    security-auditor
    auth, credentials, permissions, OWASP, token, secret, vulnerability
    accessibility-tester
    a11y, WCAG, aria, keyboard, screen reader, focus, semantic HTML
    fact-checker
    docs, research, ecosystem, reference, guide, educational
    Log which agents were selected and why.
  4. Apply overrides:
    --include
    adds agents,
    --exclude
    removes (except technical-editor).
  5. Dispatch all selected agents IN PARALLEL using the Agent tool (single message, multiple Agent tool calls). Each agent receives:
    • The plan file content
    • Their specific review mandate
    • Instructions to return: APPROVE / REVISE / DROP with findings tagged P0/P1/P2
  6. Collect verdicts and synthesize into a summary table:
    ## Plan Review Summary
    | Agent | Verdict | P0 | P1 | P2 | Key Finding |
    |-------|---------|----|----|-----|-------------|
  7. Gate logic:
    • All APPROVE → "Proceed to Build"
    • Any P0 REVISE → MUST fix before proceeding. List required fixes.
    • P1 REVISE → should fix. List recommended fixes.
    • P2 → nice to have, can proceed.
    • If P0 exists, enter revise-resubmit loop (up to 2 rounds). After 2 rounds, escalate to human.
  1. 查找计划文件
    bash
    ls -t ai-workspace/plans/*.md | grep -v '.done.md' | head -1
    如果未找到计划文件 → 错误:"ai-workspace/plans/目录下不存在计划文件,请先编写计划。" 如果计划文件是
    .done.md
    格式 → 错误:"该计划已完成定稿。"
  2. 读取计划并提取以下内容:
    • 待修改文件章节
    • 完整正文内容
    • 计划范围(统计变更文件数量、正文行数)
  3. 按照以下确定性规则自动组建评审小组
    第一层 — 固定纳入:
    Agent触发条件
    technical-editor
    所有计划评审都必须纳入(不可被排除)
    第二层 — 根据计划范围自动纳入:
    Agent触发条件
    code-reviewer
    计划包含任意代码变更(文件后缀为
    .ts
    .js
    .sh
    .yml
    ,或路径包含
    src/
    tests/
    architect-reviewer
    计划为中/大型:变更文件超过3个,或计划正文超过100行,或影响多个工作流步骤
    第三层 — 通过关键词扫描自动纳入(扫描待修改文件列表+正文):
    Agent触发关键词
    codex-specialist
    AGENTS.md、config.toml、sync.sh、skills、dotfiles
    designer
    +
    design-reviewer
    component、UI、CSS、design、wireframe、mockup、Figma、layout
    security-auditor
    auth、credentials、permissions、OWASP、token、secret、vulnerability
    accessibility-tester
    a11y、WCAG、aria、keyboard、screen reader、focus、semantic HTML
    fact-checker
    docs、research、ecosystem、reference、guide、educational
    记录入选的Agent及其入选原因。
  4. 应用覆盖规则
    --include
    参数可添加Agent,
    --exclude
    参数可移除Agent(technical-editor除外)。
  5. 使用Agent工具并行调度所有入选的Agent(单条消息,多Agent工具调用)。每个Agent会收到:
    • 计划文件内容
    • 其专属的评审要求
    • 返回要求:需返回APPROVE / REVISE / DROP结论,且发现的问题需标注P0/P1/P2等级
  6. 收集评审结论,整合为汇总表:
    ## Plan Review Summary
    | Agent | Verdict | P0 | P1 | P2 | Key Finding |
    |-------|---------|----|----|-----|-------------|
  7. 门禁逻辑
    • 全部通过 → "进入构建阶段"
    • 存在任意P0等级需修改问题 → 继续推进前必须修复,列出必填修复项
    • 存在P1等级需修改问题 → 建议修复,列出推荐修复项
    • P2等级问题 → 优化项,可继续推进
    • 如果存在P0问题,进入修改-重提交流程(最多2轮),2轮后仍未通过则上报人工处理

Panel Bounds

评审小组规模范围

  • Minimum: technical-editor alone (1 agent, trivial plans)
  • Typical: technical-editor + code-reviewer + architect-reviewer (3)
  • Maximum: all agents (rare, large cross-cutting plans)
  • 最小:仅technical-editor(1个Agent,适用于极简计划)
  • 常规:technical-editor + code-reviewer + architect-reviewer(3个Agent)
  • 最大:所有Agent(极少出现,适用于大型跨领域计划)