plan-review-gate
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePlan 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:
| Criterion | How to verify | Blocking if |
|---|---|---|
| Plan file exists on disk | | Returns 0 matches |
| File paths exist | | Any path returns 0 matches and doesn't exist |
| Dependency ordering | Read plan phases — do later phases depend on earlier ones only? | Circular or forward-reference dependencies |
| Technical approach matches codebase | Read 1-2 existing files in the affected area | Proposed patterns/libs differ from what codebase actually uses |
| No unstated infra assumptions | Read plan for external services, env vars, DBs | Plan silently assumes infra that doesn't exist |
使用Read/Grep/Glob执行以下验证:
| 检查项 | 验证方式 | 阻塞条件 |
|---|---|---|
| 磁盘上存在计划文件 | | 返回0个匹配结果 |
| 所有引用的文件路径存在 | 对每个被引用的文件执行 | 任意路径返回0个匹配结果、不存在 |
| 依赖排序 | 读取计划各阶段,确认后续阶段是否仅依赖前置阶段产出 | 存在循环依赖或前向引用依赖 |
| 技术方案与代码库匹配 | 读取受影响区域的1-2个现有文件 | 提议的模式/依赖库与代码库实际使用的不一致 |
| 无未声明的基础设施假设 | 检查计划中是否涉及外部服务、环境变量、数据库 | 计划默认使用了不存在的基础设施 |
Check 2: Completeness — Does it cover the full request?
检查2:完整性——计划是否覆盖了全部需求?
Read the user's original request and compare against the plan:
| Criterion | Blocking if |
|---|---|
| All requirements mapped | Any user requirement has no corresponding plan item |
| Verification steps defined | Any change has no way to verify it worked |
| Edge cases addressed | Obvious error paths, empty states, or boundary conditions missing |
| Cross-file integration | Files that import from changed files not accounted for |
读取用户原始需求,与计划做对比:
| 检查项 | 阻塞条件 |
|---|---|
| 所有需求都已对应 | 任意用户需求没有对应的计划项 |
| 定义了验证步骤 | 任意修改没有对应的验证生效的方式 |
| 覆盖了边界场景 | 遗漏了明显的错误路径、空状态或边界条件 |
| 跨文件集成处理 | 未考虑到导入了被修改文件的其他文件 |
Check 3: Scope & Alignment — Is it right-sized?
检查3:范围与对齐度——计划规模是否合理?
| Criterion | Blocking if |
|---|---|
| Matches user request | Plan solves different problem or adds unrequested features |
| No scope creep | Extra abstractions, refactoring, or features beyond the request |
| No under-scoping | Obvious implications of the request are omitted |
| Complexity proportional | Solution 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: AskUserQuestiontext
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: AskUserQuestionOutput Format
输出格式
GATE_PASS
GATE_PASS
undefinedundefinedPlan Review Gate — GATE_PASS (iteration N of 3)
Plan Review Gate — GATE_PASS (iteration N of 3)
| Check | Result | Key Finding |
|---|---|---|
| Feasibility | PASS | [evidence: file paths verified / patterns match] |
| Completeness | PASS | [evidence: all N requirements mapped] |
| Scope & Alignment | PASS | [evidence: plan matches request, no creep] |
undefined| Check | Result | Key Finding |
|---|---|---|
| Feasibility | PASS | [evidence: file paths verified / patterns match] |
| Completeness | PASS | [evidence: all N requirements mapped] |
| Scope & Alignment | PASS | [evidence: plan matches request, no creep] |
undefinedGATE_FAIL
GATE_FAIL
undefinedundefinedPlan Review Gate — GATE_FAIL (iteration N of 3)
Plan Review Gate — GATE_FAIL (iteration N of 3)
| Check | Result | Blocking Issues |
|---|---|---|
| Feasibility | PASS | — |
| Completeness | FAIL | [N] blocking issues |
| Scope & Alignment | FAIL | [N] blocking issues |
| Check | Result | Blocking Issues |
|---|---|---|
| Feasibility | PASS | — |
| Completeness | FAIL | [N] blocking issues |
| Scope & Alignment | FAIL | [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]
undefinedEscalation (3/3 iterations, still failing)
升级(3轮迭代后仍未通过)
undefinedundefinedPlan 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-Pattern | Why Wrong |
|---|---|
| Skipping file path verification | Fabricated paths are the #1 plan failure mode |
| Treating GATE_FAIL as advisory | GATE_FAIL must block PLAN_CREATED |
| Skipping for "simple" plans | Read the skip criteria — only truly trivial plans qualify |
| Accepting GATE_PASS without evidence | Each check needs a cited finding, not just "looks fine" |
| 反模式 | 问题原因 |
|---|---|
| 跳过文件路径校验 | 虚构路径是计划失败的首要原因 |
| 将GATE_FAIL视为建议性提示 | GATE_FAIL必须阻塞PLAN_CREATED状态的返回 |
| 对“简单”计划跳过校验 | 请仔细阅读跳过条件,仅真正极为简单的计划才可跳过 |
| 无证据就接受GATE_PASS | 每项检查都需要有可引用的校验结果,不能仅靠“看起来没问题” |