plan-review-gate

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Plan Review Gate

计划评审关卡

Core principle: No plan reaches the user without surviving 3 adversarial checks.
How it works: This skill runs inline in the calling agent's context (no subagents). The calling LLM reads the plan and checks it against 3 criteria using its Read/Grep/Glob tools. Same LLM, same context — the value is structured adversarial framing, not agent independence.
核心原则: 任何计划都必须通过3项对抗性检查才能交付给用户。
运行逻辑: 该技能在发起调用的Agent上下文中内联运行(无需子Agent)。发起调用的LLM读取计划后,使用自身的Read/Grep/Glob工具按照3项标准进行校验。校验使用相同的LLM、相同的上下文,核心价值在于结构化的对抗性校验框架,而非Agent独立性。

When to Skip

可跳过校验的场景

Skip when plan is trivial: Single-file fix, copy edit, or config tweak with <3 changes → return GATE_PASS immediately.
计划极为简单时可跳过: 单文件修复、文案编辑、或修改点少于3个的配置调整 → 直接返回GATE_PASS即可。

The 3 Checks (Run in Sequence)

3项检查(按顺序执行)

Check 1: Feasibility — Can this be executed against the real codebase?

检查1:可行性——该计划能否在真实代码库上执行?

Run these verifications using Read/Grep/Glob:
CriterionHow to verifyBlocking if
Plan file exists on disk
Glob(pattern="{plan_file_path}")
where plan_file_path is the path from the calling agent's context
Returns 0 matches
File paths exist
Glob(pattern="{path}")
for every referenced file
Any path returns 0 matches and doesn't exist
Dependency orderingRead plan phases — do later phases depend on earlier ones only?Circular or forward-reference dependencies
Technical approach matches codebaseRead 1-2 existing files in the affected areaProposed patterns/libs differ from what codebase actually uses
No unstated infra assumptionsRead plan for external services, env vars, DBsPlan silently assumes infra that doesn't exist
使用Read/Grep/Glob执行以下验证:
检查项验证方式阻塞条件
磁盘上存在计划文件
Glob(pattern="{plan_file_path}")
其中plan_file_path是发起调用的Agent上下文中的路径
返回0个匹配结果
所有引用的文件路径存在对每个被引用的文件执行
Glob(pattern="{path}")
任意路径返回0个匹配结果、不存在
依赖排序读取计划各阶段,确认后续阶段是否仅依赖前置阶段产出存在循环依赖或前向引用依赖
技术方案与代码库匹配读取受影响区域的1-2个现有文件提议的模式/依赖库与代码库实际使用的不一致
无未声明的基础设施假设检查计划中是否涉及外部服务、环境变量、数据库计划默认使用了不存在的基础设施

Check 2: Completeness — Does it cover the full request?

检查2:完整性——计划是否覆盖了全部需求?

Read the user's original request and compare against the plan:
CriterionBlocking if
All requirements mappedAny user requirement has no corresponding plan item
Verification steps definedAny change has no way to verify it worked
Edge cases addressedObvious error paths, empty states, or boundary conditions missing
Cross-file integrationFiles that import from changed files not accounted for
读取用户原始需求,与计划做对比:
检查项阻塞条件
所有需求都已对应任意用户需求没有对应的计划项
定义了验证步骤任意修改没有对应的验证生效的方式
覆盖了边界场景遗漏了明显的错误路径、空状态或边界条件
跨文件集成处理未考虑到导入了被修改文件的其他文件

Check 3: Scope & Alignment — Is it right-sized?

检查3:范围与对齐度——计划规模是否合理?

CriterionBlocking if
Matches user requestPlan solves different problem or adds unrequested features
No scope creepExtra abstractions, refactoring, or features beyond the request
No under-scopingObvious implications of the request are omitted
Complexity proportionalSolution is over-engineered for the problem
检查项阻塞条件
与用户需求对齐计划解决了其他问题或添加了未被要求的功能
无范围蔓延超出需求范围额外添加了抽象、重构或功能
无范围不足遗漏了需求的明显隐含要求
复杂度匹配方案对问题来说过度设计

Workflow

工作流程

text
1. Check if trivial → skip if yes (return GATE_PASS)
2. Run Check 1: Feasibility (use Read/Grep/Glob to verify file paths)
3. Run Check 2: Completeness (read request vs plan)
4. Run Check 3: Scope & Alignment (read request vs plan)
5. Collect findings:
   - Zero BLOCKING issues across all 3 checks → GATE_PASS
   - Any BLOCKING issue → GATE_FAIL with specifics
6. IF GATE_FAIL and iteration < 3:
   a. Present blocking issues clearly
   b. Revise the plan to address them
   c. Re-run checks (increment iteration counter)
   <!-- CC10X-M9: iteration counter is in-context only — not persisted to memory. If compaction occurs mid-retry, counter resets to 0 and gate may retry more than 3 times. Acceptable for now (gate still converges). -->
7. IF GATE_FAIL after 3 iterations → ESCALATION: AskUserQuestion
text
1. Check if trivial → skip if yes (return GATE_PASS)
2. Run Check 1: Feasibility (use Read/Grep/Glob to verify file paths)
3. Run Check 2: Completeness (read request vs plan)
4. Run Check 3: Scope & Alignment (read request vs plan)
5. Collect findings:
   - Zero BLOCKING issues across all 3 checks → GATE_PASS
   - Any BLOCKING issue → GATE_FAIL with specifics
6. IF GATE_FAIL and iteration < 3:
   a. Present blocking issues clearly
   b. Revise the plan to address them
   c. Re-run checks (increment iteration counter)
   <!-- CC10X-M9: iteration counter is in-context only — not persisted to memory. If compaction occurs mid-retry, counter resets to 0 and gate may retry more than 3 times. Acceptable for now (gate still converges). -->
7. IF GATE_FAIL after 3 iterations → ESCALATION: AskUserQuestion

Output Format

输出格式

GATE_PASS

GATE_PASS

undefined
undefined

Plan Review Gate — GATE_PASS (iteration N of 3)

Plan Review Gate — GATE_PASS (iteration N of 3)

CheckResultKey Finding
FeasibilityPASS[evidence: file paths verified / patterns match]
CompletenessPASS[evidence: all N requirements mapped]
Scope & AlignmentPASS[evidence: plan matches request, no creep]
undefined
CheckResultKey Finding
FeasibilityPASS[evidence: file paths verified / patterns match]
CompletenessPASS[evidence: all N requirements mapped]
Scope & AlignmentPASS[evidence: plan matches request, no creep]
undefined

GATE_FAIL

GATE_FAIL

undefined
undefined

Plan Review Gate — GATE_FAIL (iteration N of 3)

Plan Review Gate — GATE_FAIL (iteration N of 3)

CheckResultBlocking Issues
FeasibilityPASS
CompletenessFAIL[N] blocking issues
Scope & AlignmentFAIL[N] blocking issues
CheckResultBlocking Issues
FeasibilityPASS
CompletenessFAIL[N] blocking issues
Scope & AlignmentFAIL[N] blocking issues

Blocking Issues (MUST ADDRESS before returning PLAN_CREATED)

Blocking Issues (MUST ADDRESS before returning PLAN_CREATED)

  • [Check]: [specific issue with evidence]
undefined
  • [Check]: [specific issue with evidence]
undefined

Escalation (3/3 iterations, still failing)

升级(3轮迭代后仍未通过)

undefined
undefined

Plan Review Gate — ESCALATION REQUIRED (3/3 iterations exhausted)

Plan Review Gate — ESCALATION REQUIRED (3/3 iterations exhausted)

Remaining Blocking Issues

Remaining Blocking Issues

[List by check with evidence]

→ Use `AskUserQuestion` with options: "Override (proceed with known risks)" | "Revise manually" | "Simplify scope" | "Cancel"
[List by check with evidence]

→ 使用`AskUserQuestion`工具,提供以下选项:"Override (proceed with known risks)(忽略风险继续执行)" | "Revise manually(手动修改)" | "Simplify scope(简化范围)" | "Cancel(取消)"

Anti-Patterns

反模式

Anti-PatternWhy Wrong
Skipping file path verificationFabricated paths are the #1 plan failure mode
Treating GATE_FAIL as advisoryGATE_FAIL must block PLAN_CREATED
Skipping for "simple" plansRead the skip criteria — only truly trivial plans qualify
Accepting GATE_PASS without evidenceEach check needs a cited finding, not just "looks fine"
反模式问题原因
跳过文件路径校验虚构路径是计划失败的首要原因
将GATE_FAIL视为建议性提示GATE_FAIL必须阻塞PLAN_CREATED状态的返回
对“简单”计划跳过校验请仔细阅读跳过条件,仅真正极为简单的计划才可跳过
无证据就接受GATE_PASS每项检查都需要有可引用的校验结果,不能仅靠“看起来没问题”