fable-agent/SKILLS/fusion/SKILL.md

113 lines
4.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
name: fusion
description: >-
Answer a hard question by fanning it out to a PANEL of models running in parallel —
each answering independently, none seeing the others' work — then having the judge model
evaluate every response into a structured analysis (consensus, contradictions, partial
coverage, unique insights, blind spots) and write a final answer grounded in it.
Panel options:
opus4.8-4.8 — two independent Opus 4.8 runs (no external CLI needed)
opus4.8-gpt5.5 — Opus 4.8 + GPT-5.5 via codex CLI
opus4.8-gpt5.5-gemini — Opus 4.8 + GPT-5.5 + Gemini 3.1 Pro
sonnet-haiku-opus — Sonnet 4.6 drafts, Haiku checks, Opus fuses
openrouter-fusion — single call to OpenRouter Fusion API
The judge (always Opus 4.8 unless overridden) writes the final answer.
The pipeline cannot be reversed: panelists cannot call back out to spawn the judge.
Best for: high-stakes research, architectural decisions, debugging,
and any question where being confidently wrong is expensive.
---
# Fusion Skill
## Mechanism
Fusion turns one prompt into a panel. The question goes to several models **at the same time**,
each answering independently — with full tool access and no knowledge of the others. Then the
judge reads every answer, extracts the structure of the panel's reasoning (what they agree on,
where they conflict, what only one saw, what they all missed), and writes a final answer
grounded in that analysis.
The core principle is **independence, then synthesis**. Every panelist gets the task verbatim.
No assigned "lenses" or personas — the diversity comes naturally from independent execution.
## Procedure
### Step 1: Fan Out Panel
Dispatch the task to N panelists in parallel:
```
for each panelist in parallel:
spawn sub-agent with clean context
panelist receives: task (verbatim)
panelist executes: research, tool calls, analysis
panelist returns: full answer
```
### Step 2: Judge Analysis
The judge (Opus 4.8) evaluates every panelist answer and produces a structured analysis:
```
Consensus: what all/most panelists agree on
Contradictions: where panelists disagree (with resolution or flag)
Partial: aspects only some panelists addressed
Unique Insights: things only one panelist found
Blind Spots: what no panelist addressed
```
### Step 3: Grounded Final Answer
The judge writes the final answer, grounded in the analysis:
```
Synthesis of consensus into a coherent position
Resolution of contradictions
Incorporation of unique insights
Acknowledgment of blind spots
Actionable conclusion
```
## Panel Configurations
| Slug | Panelists | Cost Savings vs Fable 5 |
|------|-----------|------------------------|
| opus4.8-4.8 | 2× Opus 4.8 (~$0.09) | ~40% cheaper |
| opus4.8-gpt5.5 | Opus 4.8 + GPT-5.5 (~$0.12) | ~20% cheaper |
| sonnet-haiku-opus | Sonnet + Haiku + Opus (~$0.06) | ~60% cheaper |
| openrouter-fusion | OpenRouter Fusion compound (~$0.08) | ~50% cheaper |
## CLI Usage
```bash
# Default panel (opus4.8-4.8)
node dist/index.js fusion run "Complex research question"
# Specific panel
node dist/index.js fusion run "Design review" --panel sonnet-haiku-opus
# OpenRouter Fusion API
node dist/index.js fusion run "Architecture analysis" --openrouter
# List available panels
node dist/index.js fusion panels
```
## Integration with fable-agent
This skill integrates with:
- **FusionExecutor** (`src/examples/executors/fusion-executor.ts`) — PhaseExecutor-compatible
- **OpenRouterFusionExecutor** (`src/examples/executors/openrouter-fusion-executor.ts`) — API-based fusion
- **DynamicWorkflows.fusionPanel()** — workflow-level fusion dispatch
- **CompoundStack** — fusion as a stakable layer
- **Fable5PromptEngine** — tone/citation/refusal rules from leaked Fable 5 prompt
## References
- [fusion-fable](https://github.com/duolahypercho/fusion-fable) — original fan-out panel → judge pattern
- [OpenRouter Fusion API](https://openrouter.ai) — compound model API
- [Fable 5 leaked system prompt](https://github.com/elder-plinius/CL4R1T4S) — tone, citation, refusal patterns