Skip to content

/deep-execution

Executes agent-enhanced council queries by spawning parallel Claude subagents that each query a provider, evaluate response quality, ask follow-up questions, and return structured insights with confidence ratings and blind spot analysis. Invoked when the --agents flag is used or

From plugin
5614 skills1 agents3 commands1 hooks
shell
$ npx -y skills add hex/claude-council --skill deep-execution --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/deep-execution
How auto-invocation works

Context preview

The summary Claude sees to decide when to auto-load this skill.

Executes agent-enhanced council queries by spawning parallel Claude subagents that each query a provider, evaluate response quality, ask follow-up questions, and return structured insights with confidence ratings and blind spot analysis. Invoked when the --agents flag is used or

SKILL.md

deep-execution.SKILL.md
name: deep-execution
description: Executes agent-enhanced council queries by spawning parallel Claude subagents that each query a provider, evaluate response quality, ask follow-up questions, and return structured insights with confidence ratings and blind spot analysis. Invoked when the --agents flag is used or when complex architectural decisions are detected.

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), build the role-injected question with the same helper the standard flow uses — source `scripts/lib/prompts.sh` and `scripts/lib/roles.sh`, then `build_prompt_with_role "<question>" "<role>"` — and pass its output as the agent's `{QUESTION}`. The role format itself is defined in `${CLAUDE_PLUGIN_ROOT}/prompts/role-injection.md`.

**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. Write the reply to a file first (its JSON may contain quotes, backticks, and `$()` that an inline `echo` would let the shell mangle or execute), then feed it on stdin:

cat > /tmp/council-reply.json <<'COUNCIL_REPLY_EOF'
<paste the agent's raw JSON reply here, verbatim, unescaped>
COUNCIL_REPLY_EOF
bash ${CLAUDE_PLUGIN_ROOT}/scripts/validate-analysis.sh < /tmp/council-reply.json
  • **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:

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
Read more
Read it on GitHub ↗
Ships withclaude-council

A Claude Code plugin that consults multiple AI coding agents in parallel and shows you their answers side-by-side.

Get the whole plugin, auto-invoked
Stats
561
Stars
0
Views
72
Forks
Active
Maintenance
Shell
Language
MIT
License
5h ago
Last commit
7mo ago
Created

Repo: hex/claude-council