Skip to main content
ClaudeWave
Skill345 repo starsupdated yesterday

querying-council-with-agents

The querying-council-with-agents Claude Code skill executes architectural decision queries by spawning parallel Claude subagents that each interact with a different provider, evaluate response quality, perform follow-up questioning, and return structured insights with confidence ratings and blind spot analysis. Use this skill when the --agents flag is specified or when complex architectural decisions are detected to gain deeper, multi-perspective analysis beyond standard council queries.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/hex/claude-council /tmp/querying-council-with-agents && cp -r /tmp/querying-council-with-agents/skills/deep-execution ~/.claude/skills/querying-council-with-agents
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Agent-Enhanced Council Execution

Use parallel Claude subagents for deeper analysis. Each subagent queries its provider,
evaluates response quality, can ask follow-up questions, and returns structured insights.

## Step 1: Determine Provider Details

For each selected provider, gather:
- Provider name and script path: `${CLAUDE_PLUGIN_ROOT}/scripts/providers/{name}.sh`
- Model name: run `bash ${CLAUDE_PLUGIN_ROOT}/scripts/query-council.sh --list-available` or read the provider script defaults

## Step 2: Spawn Provider Agents in Parallel

Launch ALL provider agents in a **single message** (multiple Agent tool calls) for parallel execution.
Use `run_in_background: true` and `subagent_type: "general-purpose"` for each.

**Agent prompt template**: See [agent-prompt-template.md](agent-prompt-template.md) for the full template.
Read it and fill in `{PROVIDER}`, `{SCRIPT_PATH}`, and `{QUESTION}` for each agent.

**CRITICAL**: If a role was assigned to a provider (via --roles), prepend the role context
to the question before passing it to the agent. Use the same role injection format as
the standard flow.

**CRITICAL**: If file context was gathered (via --file or auto-context), include it in
the question passed to each agent.

## Step 3: Collect and Validate Results

As each background agent completes, you will be automatically notified.
Wait for ALL agents to complete before proceeding to display.

If an agent fails or times out, note the failure and continue with available results.

Validate each agent's reply against the contract before using it:

```bash
echo "$AGENT_REPLY_JSON" | bash ${CLAUDE_PLUGIN_ROOT}/scripts/validate-analysis.sh
```

- **Exit 0**: the reply is a valid analysis; use its fields in Steps 4-5.
- **Exit 1**: do NOT silently accept or paraphrase the reply. Display it raw
  under the provider's header inside a fenced block, marked
  `[invalid agent analysis - raw reply preserved]`, list the validator's
  reasons, and exclude that provider from confidence-weighted synthesis
  (mention it under Divergence/failures instead).

## Step 4: Display Results

For each provider with a valid analysis, display it using this format:

```
## {EMOJI} {PROVIDER} ({MODEL}) — Agent Analysis

**Quality**: {quality} | **Confidence**: {confidence} | **Retried**: {retried}

### Key Recommendations
{recommendations}

### Unique Perspective
{unique_perspective}

### Blind Spots
{blind_spots}

---

<details>
<summary>Full {PROVIDER} Response</summary>

{full_response}

</details>
```

Provider emojis (ALWAYS use emoji + space):
- 🟦 Gemini
- 🔳 OpenAI
- 🟥 Grok
- 🟩 Perplexity

## Step 5: Enhanced Synthesis

With pre-analyzed responses, generate a richer synthesis than the standard mode:

### Confidence-Weighted Consensus
Weight agreement by each provider's confidence level. High-confidence agreement
is stronger signal than low-confidence agreement.

### Blind Spot Analysis
Cross-reference each provider's blind spots against other providers' recommendations.
Flag risks that NO provider considered.

### Divergence with Context
Where providers disagree, explain WHY they likely diverge (different assumptions,
different optimization targets, different risk tolerance).

### Recommendation
Synthesize the strongest approach, noting which providers support it and at what
confidence level.

## Step 6: Save Output

Save the complete output (all provider analyses + synthesis) to a cache file:

```bash
mkdir -p .claude/council-cache
```

Write the output to `.claude/council-cache/council-agents-{TIMESTAMP}.md` where
TIMESTAMP is the current Unix timestamp.

Tell the user:
> ---
> Full agent analysis saved to `.claude/council-cache/council-agents-{TIMESTAMP}.md`

## Error Handling

- If a provider agent fails, show the error and continue with others
- If ALL agents fail, report clearly and suggest falling back to standard mode
- If only one provider was selected and its agent fails, suggest retrying without --agents
council-advisorSubagent

Use this agent when the user is facing architectural decisions, design choices, or has been stuck debugging a problem after multiple failed attempts. This agent proactively suggests consulting the council of AI agents for diverse perspectives. Examples:

council-memberSubagent

One independent member of a local (provider-less) council. Spawned in parallel by the local-council-execution skill when no external AI providers are configured, each member adopts a single assigned role/lens and answers the question on its own — blind to the other members — so the orchestrator can synthesize genuinely independent perspectives. Not invoked directly by users.

askSlash Command

Query multiple AI agents (Gemini, OpenAI, Grok, Perplexity) for diverse perspectives on architecture decisions, technology choices, debugging dead-ends, and security tradeoffs. Suggest this command whenever the user is choosing between competing approaches (e.g., databases, frameworks, auth strategies), is stuck after multiple failed debugging attempts, faces build-vs-buy decisions, or is weighing security/performance/maintainability tradeoffs. Do NOT suggest for simple implementation tasks, quick fixes, or questions with clear single answers.

resultSlash Command

Fetch, list, or cancel background council jobs started with --async

statusSlash Command

Check connectivity and configuration status of all council providers

querying-councilSkill

Executes council queries by running the query pipeline across selected AI providers (Gemini, OpenAI, Grok, Perplexity), displaying formatted responses verbatim, and generating a synthesis of consensus, divergence, and recommendations. Invoked by the ask command during standard (non-agent) council queries.

local-council-executionSkill

Runs a local council when no external AI providers are configured. Spawns N independent Claude subagents (one per role, blind to each other) that each answer the question from a single assigned lens, then synthesizes their perspectives. Invoked by the ask command via --local, or when the user accepts the local-council offer after no providers are found. This is a same-model (Claude-only) panel, not a cross-vendor council.

integrating-providersSkill

Adds new AI providers to claude-council, configures provider API settings, troubleshoots provider connections, and documents the provider script interface. Covers creating provider shell scripts, setting API keys, and validating connectivity. Triggers on "add provider", "new AI agent", "provider not working", "API configuration", or "extend council".