From consensus-planner
Use when creating an implementation plan using multiple AI models that iterate toward consensus. Spawns parallel agents with user-selected models to independently plan, exchange feedback, and converge. Trigger on requests like 'consensus plan for <task>' or 'multi-model plan for <feature>'.
How this skill is triggered — by the user, by Claude, or both
Slash command
/consensus-planner:planThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**CRITICAL: Read this entire SKILL.md before taking any action. Follow each numbered step exactly. Do NOT improvise the workflow.**
CRITICAL: Read this entire SKILL.md before taking any action. Follow each numbered step exactly. Do NOT improvise the workflow.
Create an implementation plan by spawning multiple AI agents (each using a different model), running iterative feedback rounds, and synthesizing a consensus plan. Follow these steps in order. Do not skip steps.
You MUST follow the step-by-step protocol below. These rules are non-negotiable:
ask_userreferences/planning-prompt.md[consensus]/[majority]/[divergent])Before proceeding, confirm you have read this SKILL.md in full. Display to the user:
🔧 Consensus Planner skill loaded. Starting setup...
Then display the progress checklist:
▶ Step 0: Skill Loaded ☐ Step 1: Setup & Context ☐ Step 2: Configure (models, rounds, cost) ☐ Step 3: Initial Planning ☐ Step 4: Feedback Rounds ☐ Step 5: Consensus Synthesis ☐ Step 6: Final Report
At the start of each subsequent step, redisplay this checklist with the current step marked ▶, completed steps marked ☑, and pending steps marked ☐. This keeps you and the user aligned on progress.
1a: Discover available models (do this FIRST):
Read your own task tool documentation. Look at the model parameter description — it lists all available model names. Extract every model name from that list. Store as AVAILABLE_MODELS.
1b: Identify runtime:
AVAILABLE_MODELS contains any non-Anthropic models (names starting with gpt- or gemini-) → runtime is Copilot CLIAVAILABLE_MODELS contains only Anthropic models (names starting with claude-) → runtime is Claude CodeStore as RUNTIME. Inform the user:
Detected runtime: . Found available models.
1c: Get the task prompt:
If the user already provided a task description when invoking this skill, use it. Otherwise, ask via ask_user:
What task or feature do you want to plan? Describe it in as much detail as possible.
Store as TASK_PROMPT.
1d: Gather codebase context:
Use glob to discover the project structure:
**/*.{ts,js,tsx,jsx,py,rs,go,java,cs,md,json,yaml,yml,toml}
Exclude common non-source directories and generated files from results:
node_modules, dist, build, .next, out, target, vendor, __pycache__, .git, coverage, .cache*.min.js, *.map, *.lock, *.snapIf the project has a .gitignore, use it as additional exclusion guidance.
Identify the most relevant files using these heuristics (in priority order):
TASK_PROMPTUse view to read up to 10 of the most relevant files. Concatenate their contents with file path headers as CODEBASE_CONTEXT:
### <relative-file-path>
<file contents>
If the project has more than 200 files, tell the user which files you selected and ask if they want to add or replace any.
Model selection:
Use ask_user with multiSelect: true to let the user pick 1–5 models in a single prompt. Present all AVAILABLE_MODELS as choices.
Recommend 2 models as a good default for cost/diversity balance:
Store as SELECTED_MODELS.
If only 1 model selected: Inform the user that iterative feedback requires 2+ models. Ask:
If single-model: skip to Step 3, produce one plan, skip Steps 4-5, go directly to Step 6 with that plan.
Max feedback rounds:
Ask via ask_user with choices:
Store the number as MAX_ROUNDS.
Cost estimate:
Calculate and display:
Estimated cost: <SELECTED_MODELS count> models × (<MAX_ROUNDS> feedback rounds + 1 initial) = premium requests
Proceed?
Use ask_user with choices:
If "Adjust," loop back to model selection.
Read the planning prompt template from references/planning-prompt.md (relative to this SKILL.md file).
Replace placeholders:
{TASK_PROMPT} → the user's task description{CODEBASE_CONTEXT} → the gathered codebase contextLaunch parallel planning agents:
For each model in SELECTED_MODELS, use the task tool with:
agent_type: "general-purpose"model: the model namemode: "background"prompt: the complete planning prompt with placeholders filledLaunch ALL agents simultaneously in a single response (parallel tool calls).
Wait for all agents to complete:
Use read_agent with wait: true for each agent. Collect all responses.
If any agent fails, retry it once with the same prompt. If the retry also fails, note the failure and continue with remaining results. If all agents fail (including retries), stop and report the error to the user.
Store results as PLANS — a map of model name → plan text.
Validate plan structure:
For each plan, verify it contains all 7 required section headers: Problem Restatement, Proposed Approach, File-by-File Change List, Key Design Decisions, Risk Areas & Edge Cases, Testing Approach, Complexity Estimate. If any section is missing, retry that agent once with: "Your plan is missing sections: [list]. Please regenerate the complete plan with all 7 sections." If the retry also fails, proceed with what was returned and flag missing sections as [section missing] in the summary.
Present summaries:
For each plan, extract and display:
### Initial Plans Summary
**<model1>:** <approach summary> | Complexity: <S/M/L> | Files: <N>
**<model2>:** <approach summary> | Complexity: <S/M/L> | Files: <N>
...
If only 1 model was selected: Skip this step entirely.
Read the feedback prompt template from references/feedback-prompt.md (relative to this SKILL.md file).
For each round (1 through MAX_ROUNDS):
4a: Construct feedback prompts
For each model in SELECTED_MODELS, replace placeholders in the feedback template:
{TASK_PROMPT} → the user's task description{CODEBASE_CONTEXT} → the gathered codebase context{OWN_PLAN} → this model's plan from the previous round{ALL_PLANS} → all models' plans from the previous round, each wrapped as:
--- Plan by <model name> ---
<plan text>
--- End of plan by <model name> ---
4b: Launch parallel feedback agents
For each model, use the task tool with:
agent_type: "general-purpose"model: the same model that produced the planmode: "background"prompt: the filled feedback promptLaunch ALL agents simultaneously.
4c: Collect results
Use read_agent with wait: true for each agent. Update PLANS with the new revised plans.
If an agent fails in this round, retry it once with the same prompt. If the retry also fails, carry forward its plan from the previous round. Note the failure.
4d: Convergence check
Read each agent's "Remaining Disagreements" section from this round's output.
If converged (all plans substantially agree on approach, files, and key decisions):
✅ Round /<MAX_ROUNDS> complete — Converged. All models agree on the approach. Proceeding to synthesis.
Exit the loop. Proceed to Step 5.
If NOT converged and rounds remain:
🔄 Round /<MAX_ROUNDS> complete — Key disagreements remain:
- <topic 1>: vs
- <topic 2>: ...
Continuing to next round.
Continue the loop.
If NOT converged and no rounds remain:
⚠️ Round <MAX_ROUNDS>/<MAX_ROUNDS> complete — Max rounds reached. Some disagreements remain. Proceeding to synthesis with divergent elements noted.
Proceed to Step 5.
If only 1 model was used: Skip this step. Use the single plan directly in Step 6.
Read the synthesis prompt template from references/synthesis-prompt.md (relative to this SKILL.md file).
Replace placeholders:
{TASK_PROMPT} → the user's task description{ALL_FINAL_PLANS} → all models' final plans, each wrapped as:
--- Plan by <model name> ---
<plan text>
--- End of plan by <model name> ---
{ROUND_COUNT} → the number of feedback rounds completed{MODEL_LIST} → comma-separated list of model namesUse the filled template to perform the synthesis yourself (do not spawn a sub-agent). Produce the merged consensus plan with confidence markers ([consensus]/[majority: N/M]/[divergent]), the Consensus Breakdown, Open Questions, and Model Attribution.
Present the complete consensus plan to the user:
## Consensus Plan: <one-line task summary>
### Configuration
- **Models:** <model1>, <model2>[, ...]
- **Rounds completed:** <N> (<converged at round M> | <reached max>)
- **Runtime:** <Copilot CLI | Claude Code>
### Plan
<the merged consensus plan with all 7 sections, including [consensus]/[majority]/[divergent] markers>
### Consensus Breakdown
- **Full agreement:** <N> elements
- **Majority agreement:** <N> elements
- **Divergent (open questions):** <N> elements
### Open Questions
<if any divergent elements exist, list them>
1. **<topic>**
- <model1> recommends: <approach>
- <model2> recommends: <approach>
- <context for user to decide>
<if no divergent elements>
None — all models converged on the same plan.
### Model Attribution
<for each model>
- **<model>:** <1-2 sentence summary of this model's key contributions or unique insights>
After presenting the report: Do not take further action. The user can use this plan to guide implementation, ask follow-up questions, or invoke other tools.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub filipmares/agent-plugins --plugin consensus-planner