Synthesize consensus implementation plan from multi-agent debate reports using external AI review
Synthesizes a balanced implementation plan from multi-agent debates using an external AI reviewer.
npx claudepluginhub synthesys-lab/agentizeThis skill is limited to using the following tools:
This skill invokes an external AI reviewer (Codex or Claude Opus) to synthesize a balanced, consensus implementation plan from the combined multi-agent debate report.
IMPORTANT: These CLI tools take long to run, give it 30 minutes of wall time to complete!
This skill uses external CLI tools for consensus review. The implementation pattern follows best practices for security, reasoning quality, and external research capabilities.
The skill uses the acw (Agent CLI Wrapper) abstraction for CLI invocations:
# Source acw wrapper
source "$SCRIPT_DIR/acw.sh" # Local symlink → src/cli/acw.sh
# Create temporary files for input/output
INPUT_FILE=".tmp/issue-${ISSUE_NUMBER}-external-review-input.md"
OUTPUT_FILE=".tmp/issue-${ISSUE_NUMBER}-external-review-output.txt"
# Invoke Codex via acw public CLI (stderr passes through for progress)
acw codex "gpt-5.2-codex" "$INPUT_FILE" "$OUTPUT_FILE" \
-s read-only \
--enable web_search_request \
-c model_reasoning_effort=xhigh
# Read output
CONSENSUS_PLAN=$(cat "$OUTPUT_FILE")
Configuration details:
gpt-5.2-codex - Latest Codex model with enhanced reasoningread-only - Security restriction (no file writes)--enable web_search_request - External research capability for fact-checking and SOTA patternsmodel_reasoning_effort=xhigh - Maximum reasoning depth for thorough analysisBenefits:
When Codex is unavailable, the skill falls back to Claude Code with Opus via acw:
# Source acw wrapper
source "$SCRIPT_DIR/acw.sh" # Local symlink → src/cli/acw.sh
# Create temporary files
INPUT_FILE=".tmp/issue-${ISSUE_NUMBER}-external-review-input.md"
OUTPUT_FILE=".tmp/issue-${ISSUE_NUMBER}-external-review-output.txt"
# Invoke Claude via acw public CLI (stderr passes through for progress)
acw claude "opus" "$INPUT_FILE" "$OUTPUT_FILE" \
--tools "Read,Grep,Glob,WebSearch,WebFetch" \
--permission-mode bypassPermissions
# Read output
CONSENSUS_PLAN=$(cat "$OUTPUT_FILE")
Configuration details:
opus - Claude Opus 4.5 with highest reasoning capabilitybypassPermissions - Skip permission prompts for automated executionBenefits:
After three agents debate a feature from different perspectives, an external, neutral reviewer synthesizes the final plan:
The external reviewer acts as a "tie-breaker" and "integrator" - resolving conflicts between agents and combining their insights into a coherent whole.
When invoked, this skill:
This skill requires exactly 3 agent report file paths:
.tmp/issue-42-bold-proposal.md).tmp/issue-42-critique.md).tmp/issue-42-reducer.md)The script automatically:
# Feature: Example or ## Title: Example**Feature**: Example or **Title**: ExampleFeature: Example or Title: Exampleissue-{N}-* pattern).tmp/issue-{N}-debate.md (if first report has issue number) or .tmp/debate-report-{timestamp}.md (fallback) with all 3 reports combined.tmp/issue-{N}-consensus.md (if debate report has issue number) or .tmp/consensus-plan-{timestamp}.md (fallback) with final implementation planDesign Principle: Minimize human intervention by avoiding environment variable management. The script should be invoked directly and handle all operations autonomously, outputting results to stdout for the user to review.
Direct invocation with 3 report paths - the script handles everything and outputs summary:
# Standard invocation: pass 3 report file paths
.claude/skills/external-consensus/scripts/external-consensus.sh \
.tmp/issue-42-bold-proposal.md \
.tmp/issue-42-critique.md \
.tmp/issue-42-reducer.md
Script automatically:
issue-{N}-* pattern)# Feature:), bold labels (**Feature**:), or plain labels (Feature:).tmp/issue-{N}-debate.md or .tmp/debate-report-{timestamp}.md)gpt-5.2-codex, read-only sandbox, web search enabled, xhigh reasoning (30 min).tmp/issue-{N}-consensus.md or .tmp/consensus-plan-{timestamp}.mdRequired inputs:
No environment variables needed - just invoke the script and review the output
Expected output format:
# Implementation Plan: {Feature Name}
## Consensus Summary
[Summary of balanced approach...]
## Codebase Analysis
**File changes:**
| File | Level | Purpose |
|------|-------|---------|
| `path/to/file` | major/medium/minor/remove | Description |
## Implementation Steps
[Detailed steps with LOC estimates...]
## Test Strategy
[Test approach and cases...]
## Success Criteria
- [ ] Criterion 1
- [ ] Criterion 2
## Risks and Mitigations
[Risk table...]
Modification levels:
Script output on stdout (last line):
.tmp/issue-42-consensus.md
Script output on stderr (summary for review):
Using external AI reviewer for consensus synthesis...
Configuration:
- Input: .tmp/issue-42-external-review-input.md (1012 lines)
- Output: .tmp/issue-42-external-review-output.txt
- Model: gpt-5.2-codex (Codex CLI)
- Sandbox: read-only
- Web search: enabled
- Reasoning effort: xhigh
[Codex execution details...]
External consensus review complete!
Consensus Plan Summary:
- Feature: Review-Standard Simplification with Scoring
- Total LOC: ~350-420 (Medium)
- Implementation Steps: 3
- Risks Identified: 4
Key Decisions:
- Accepted from Bold Proposal: Keep explicit evidence requirements
- Addressed from Critique: Preserve Phase 3 specialized checks
- Applied from Reducer: Single-file architecture, compress prose
Consensus plan saved to: .tmp/issue-42-consensus.md
The script performs validation and summary extraction internally - no additional steps needed.
The external-consensus.sh script handles most error scenarios internally. Here are the main error cases:
The script validates that all 3 report files exist. If any file is missing, it exits with:
Error: Report file not found: {file_path}
Solution: Ensure all 3 agent reports were generated successfully by the multi-agent debate workflow.
The script automatically detects if Codex is available and falls back to Claude Opus:
Codex not available. Using Claude Opus as fallback...
This is seamless and maintains the same research capabilities (WebSearch, WebFetch) and read-only security.
If the external AI (Codex or Claude) fails, the script exits with a non-zero code:
Error: External review failed with exit code {code}
Possible causes:
Solution: Check API credentials, network connection, or retry with different settings.
If the consensus plan is missing required sections, Step 2 validation will detect it:
Warning: Consensus plan may be incomplete. Missing sections: {list}
The plan is available at: {file_path}
Solution: Review the plan manually, adjust the prompt template if needed, or retry the external consensus review.
Input:
.claude/skills/external-consensus/scripts/external-consensus.sh \
.tmp/issue-42-bold-proposal.md \
.tmp/issue-42-critique.md \
.tmp/issue-42-reducer.md
Execution:
Combined debate report saved to: .tmp/issue-42-debate.md
Using Codex (gpt-5.2-codex) for external consensus review...
[Codex executes with advanced features:]
- Model: gpt-5.2-codex
- Sandbox: read-only
- Web search: enabled (researching JWT best practices)
- Reasoning effort: xhigh
- Input: .tmp/issue-42-external-review-input.md
- Output: .tmp/issue-42-external-review-output.txt
Output:
External consensus review complete!
Consensus Plan Summary:
- Feature: JWT Authentication
- Total LOC: ~280 (Medium)
- Components: 4
- Critical risks: 1
Key Decisions:
- From Bold Proposal: Accepted JWT with refresh tokens
- From Critique: Addressed token storage security concern (httpOnly cookies)
- From Reducer: Removed OAuth2 complexity, kept simple JWT
Research Applied:
- Verified OWASP JWT security guidelines (via web search)
- Confirmed refresh token rotation best practices
- Fact-checked token expiration standards
Consensus plan saved to: .tmp/issue-42-consensus.md
Next step: Review plan and create GitHub issue with open-issue skill.
Scenario: Feature requires external research for SOTA patterns.
Input:
.claude/skills/external-consensus/scripts/external-consensus.sh \
.tmp/issue-15-bold-proposal.md \
.tmp/issue-15-critique.md \
.tmp/issue-15-reducer.md
(First report contains: Feature: Real-time Collaboration with CRDT)
Codex behavior:
Combined debate report saved to: .tmp/issue-15-debate.md
Using Codex (gpt-5.2-codex) for external consensus review...
[Web search queries executed:]
- "CRDT implementation best practices 2025"
- "Yjs vs Automerge performance comparison"
- "Operational transformation vs CRDT trade-offs"
[External research findings incorporated into consensus:]
- Yjs recommended for browser-based collaboration (proven, actively maintained)
- WebSocket vs WebRTC trade-off analysis
- Conflict resolution strategies from recent papers
Output includes fact-checked decisions based on web research.
Scenario: Codex unavailable, Claude Code (always available) provides same research capabilities.
Output:
Codex not available. Using Claude Opus as fallback...
[Claude Opus executes with:]
- Model: opus
- Tools: Read, Grep, Glob, WebSearch, WebFetch (read-only)
- Permission mode: bypassPermissions
- Input: .tmp/issue-42-external-review-input.md (via stdin)
- Output: .tmp/issue-42-external-review-output.txt (via stdout)
External consensus review complete!
[Summary as Example 1...]
Note: Used Claude Opus (Codex unavailable)
Research capability: WebSearch and WebFetch used for fact-checking
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill content", or needs guidance on skill structure, progressive disclosure, or skill development best practices for Claude Code plugins.