Structured plan review with Phase 0 self-review, 5-phase code review (Architecture, Code Quality, Tests, Performance, Production Readiness), approval scope triage, decision logging, and blast radius assessment. Use when reviewing plans, PRs, or preparing non-trivial changes for implementation.
NO PLAN APPROVAL WITHOUT ALL 5 PHASES REVIEWED — Phase 0 self-review runs first; skipping any phase voids the review
Structured review workflow for non-trivial changes. Covers planning discipline (Phase 0) and 5-phase technical review with severity triage, decision logging, and production readiness gates.
Ask the user which mode to use:
| Mode | When | Phases | |------|------|--------| | Big Change | New features, architectural changes, multi-service work | Phase 0 + all 5 review sections (up to 4 issues each) + Phase 6 if architecture decision present | | Small Change | Focused feature, single-service change | Phase 0 + top issue per section only | | Review Only | PR review, existing code audit, refactor | Skip Phase 0 (lightweight outcome check only) + all 5 review sections |
Load references as needed per phase:
| Phase | Reference File | Contents | |-------|---------------|----------| | Core | reference/plan-mode-protocol.md | Approval scope triage, severity classification, Phase 0 gate requirements, multi-turn continuity, token limit triage | | Phase 0 | reference/phase0-self-review.md | Outcome spec, 3 approaches, self-critique, deletion pass, gate check | | Phase 0.5 | reference/confidence-gate.md | 4-dimension confidence scoring rubric, thresholds, gap recovery | Big Change mode only | | Phase 5 | reference/production-readiness-gate.md | Blast radius, rollback strategy, dependency health, cost/infra impact, data migration, second-order effects | | All phases | reference/review-interaction-protocol.md | Question format, decision log, visualization requirements, section pause protocol |
For Review Only mode: skip Phase 0 but run a lightweight outcome check — ask "Is this still the right thing to build/maintain? Has the original goal changed?"
Score the plan across 4 dimensions before allowing implementation to proceed. Each dimension is 0–100. Overall must reach ≥ 80 to proceed (≥ 95 for irreversible changes: migrations, public API contracts, auth architecture).
| Dimension | Questions | Score | |-----------|-----------|-------| | Requirement Clarity | All user stories defined? Edge cases documented? Acceptance criteria measurable? Dependencies identified? | /100 | | Technical Feasibility | Architecture approach proven? No unknown unknowns? APIs/libs verified against docs? Performance implications understood? | /100 | | Resource Assessment | Scope realistic for session? Dependencies available? No unverified external APIs? | /100 | | Quality Assurance | Test strategy defined? Rollback plan exists? Security implications understood? | /100 |
OVERALL CONFIDENCE: (D1 + D2 + D3 + D4) / 4 = XX%
[≥ 80%] → Proceed to implementation
[60–79%] → Address gaps listed below before proceeding
[< 60%] → STOP — plan needs significant work
Gaps to resolve before proceeding:
- [dimension]: [specific gap — what question couldn't be answered]
Skip for: Small Change and Review Only modes (qualitative Phase 0 gate is sufficient).
For irreversible changes (schema migrations, public API contracts, auth changes): threshold is 95%, not 80%.
Read reference/confidence-gate.md for the full scoring rubric, gap recovery actions, and examples.
Read reference/review-interaction-protocol.md for visualization and question format requirements.
Evaluate:
Generate a Mermaid or ASCII diagram of the current architecture BEFORE discussing issues.
Evaluate:
code-standards.md)For deep review, delegate to the code-reviewer agent with its checklist.
Evaluate:
Evaluate:
Generate an annotated request/data flow diagram showing timing or complexity.
When to trigger: Phase 1 (Architecture Review) identified two or more competing valid approaches, OR the change is irreversible (schema migration, public API contract, auth architecture, major refactor).
Skip when: The approach is already decided and uncontested, or the change is scoped to a single service with no structural impact.
3-role structure:
Proponent → Presents the chosen approach with supporting evidence
↓
Opponent → Identifies flaws, raises the strongest case for an alternative
↓
Synthesizer → Weighs both sides, produces a verdict with explicit trade-off reasoning
↓
If unresolved → Escalate to human with both positions documented
How to run:
Output format:
## Debate: [decision being evaluated]
### Proponent
[Strongest case FOR the chosen approach — evidence-backed]
### Opponent
[Strongest case AGAINST — concrete failure scenarios or better alternative]
### Synthesizer Verdict
**Winner:** [Chosen approach / Alternative / Inconclusive]
**Deciding factors:** [What tipped the balance]
**Accepted trade-offs:** [What the winning side gives up]
**Escalate to human:** [Yes/No — if yes, state the specific question]
Relationship to plan-challenger agent: plan-challenger runs one-sided attack (finds holes). Phase 6 debate runs two-sided structured opposition (proponent + opponent + neutral verdict). Use plan-challenger first to find weaknesses, then Phase 6 when two competing valid positions remain after the challenge.
| Need | Delegate to |
|------|-------------|
| Architecture Decision Records | architecture-decision-records skill |
| Deep security audit | security-reviewer agent |
| Database migration patterns | database-schema-designer skill |
| Code review checklist | code-reviewer agent |
| Tech debt / duplication | dedup-code-agent agent |
No plan provided: Ask the user to describe the change, paste the plan, or point to a PR/branch.
Scope unclear: Ask which mode (Big Change / Small Change / Review Only) and which phases to include.
Phase 0 gate fails: List which gate items are incomplete. Do NOT proceed — ask the user to resolve.
Cannot verify a claim: Mark as [UNVERIFIED — needs manual check] with the specific command or URL to verify. Never fabricate evidence.
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer