Agent Setup Prompt
Set up the local Fusion / Model Council workflow for this repo.
1. Resolve the Fusion skill first. Prefer the bundled `skills/fusion/SKILL.md` when it exists; otherwise inspect `~/.agents/skills/fusion/SKILL.md`. Read the skill before changing config or running a panel. Do not substitute Oracle or another review tool for the local Fusion CLI.
2. Inspect the local Fusion checkout when available at `~/dev/fusion`. Check `README.md`, `package.json`, `src/fusion.js`, `fusion.config.example.json`, and the preset configs under `configs/` (`low.json`, `medium.json`, `high.json`, `quality.json`). Use the checkout to understand the installed CLI and presets; do not paste private config values into your report.
3. Verify the command wrappers are available:
`command -v fusion fusion-med fusion-high`
If a wrapper is missing, inspect `~/dev/fusion` and use the install/link path supported by that checkout, commonly `npm install` followed by `npm link`, then re-check the wrappers. Do not overwrite an existing unrelated global binary without reporting the conflict.
4. Run provider preflight before any real council run. Use the selected preset's list command, usually:
`fusion-high --list-providers`
For moderate planning, also check:
`fusion-med --list-providers`
Report the configured provider ids, unavailable providers, provider families, and whether the expected Claude/Opus slot is present. The point is a mixed council: OpenAI-style breadth, Anthropic-style critique, Z.ai/GLM or other coding-model pressure, plus any configured local specialists. Treat a missing Opus-class provider as a quality gap to report, not an automatic reason to invent a different workflow.
5. Use durable prompt files for real questions. Create or identify a repo-local prompt file and pass it with `--file`; do not send long briefs through fragile shell quoting. The prompt file should include the decision, relevant repo paths, constraints, commands already run, observed failures, candidate options, verification expectations, and the recommendation format needed.
6. Use `--dry-run` when provider ids, config paths, wrapper behavior, or output location are uncertain:
`fusion-high --dry-run --file path/to/prompt.md`
Then run the full configured panel only after the command shape is clear:
`fusion-high --file path/to/prompt.md`
7. Let Fusion use its default session store unless a repo-local run directory is explicitly requested. Normal runs write under `~/.fusion/sessions/YYYY/MM/DD/<session-id>/` and update `~/.fusion/sessions.jsonl`. Expected artifacts include `run.json`, `panel-*.stdout.md`, `panel-*.stderr.txt`, `finalizer-report.json`, `summary.json`, and `final.md`.
8. Wait for terminal provider states before recommending anything. Valid terminal states include `ok`, `failed`, `timedOut`, `quotaLimited`, `spawnError`, and `interrupted`. While a run is active, use `panel-status.json` or Fusion heartbeat output for status only. Do not act from early `panel-*` artifacts.
9. Continue only after Fusion exits and both `summary.json` and `final.md` have been read, or after a real terminal failure or interruption has been captured. `summary.json` should provide run status, provider states, timings, and artifact paths. `final.md` should provide the council recommendation.
10. Handle quota and rate failures as degraded council input. If a provider hits quota, rate limit, usage limit, 429 exhaustion, timeout, or another terminal failure after artifacts exist, name the provider, preserve the remaining outputs, and continue with the available panel. If a Kimi provider fails preflight with `auth.login_required`, report the Kimi auth failure and rerun once with `--only` set to the other configured provider ids. Do not use `--only` for ordinary narrowing unless explicitly requested.
11. Keep the OpenRouter comparison precise. Local Fusion is a local CLI inspired by the panel, comparison, and final-answer pattern. It is not the hosted OpenRouter Fusion product. Treat OpenRouter and Fable claims as context, not proof that every local run improves every task.
12. Respect privacy boundaries. Do not paste tokens, cookies, API keys, key-helper output, full environment dumps, private endpoints, or raw private session artifacts. Summarize sensitive material with redacted facts, provider states, paths, consensus, disagreements, and decision-relevant excerpts only.
13. Report setup and run results plainly: skill path used, local checkout status, wrapper paths, provider preflight result, provider mix, Opus-class provider present or missing, prompt file path, dry-run result when used, session path, terminal provider states, whether `summary.json` and `final.md` were read, quota/rate handling, consensus, contradictions, unique insights, blind spots, synthesized recommendation, repo evidence used to accept or reject the council output, and verification commands to run next.
14. Treat Fusion output as advisory. Do not start implementation until the council output has been reconciled with repo evidence and the final engineering call is clear.
Big Idea
Use Fusion when one model's answer is too small a surface area for the decision.
Fusion is a local model council workflow. The win is not that models argue for sport. The win is that different model families and provider stacks make different mistakes, notice different risks, and bring different habits to the same bounded software question. Fusion runs those perspectives in parallel, then synthesizes the strongest result.
one hard software question
-> several independent model/provider perspectives
-> comparison of consensus, contradictions, unique insights, and blind spots
-> finalizer / synthesizer
-> fused recommendation
-> human engineering judgment
It is not for tiny edits.
Try This Now
Use Fusion when multiple perspectives can improve the decision.
Start with: fusion-high --list-providers.
For a risky strategy choice, ask the agent to write a prompt file, run the full panel, then read summary.json and final.md.
Good use:
Should this billing webhook fix use provider event ids, invoice locks, or a processing ledger?
Bad use:
Rename this variable.
Fusion is most useful when different strong models may notice different risks:
- architecture review
- risky implementation choice
- auth/session design
- billing webhook idempotency
- migration plan
- debugging strategy with multiple plausible causes
- outage fallback plan
- code review before touching a dangerous subsystem
- choosing between good-looking plans where each has a hidden cost
The point is not voting. The point is coverage. One model might catch the schema risk, another the rollout problem, another the security boundary, and another the boring test nobody wanted to write. The finalizer should turn that spread into one usable recommendation.
Skill Reference Or Files To Inspect
Bundled skill:
skills/fusion/SKILL.md
Common local source checkout:
~/dev/fusion
Common local skill install:
~/.agents/skills/fusion/SKILL.md
Local Fusion source files to inspect when needed:
README.mdsrc/fusion.jsfusion.config.example.jsonconfigs/low.jsonconfigs/medium.jsonconfigs/high.jsonconfigs/quality.jsonpackage.jsonskills/fusion/SKILL.md
Keep command details in the skill. This file explains when to ask for Fusion, what the agent should do, and how to confirm the council output was actually used.
When To Reach For This
Use Fusion when the cost of a missed perspective is higher than the cost of a slower council run.
| Use Fusion For | Why |
|---|---|
| checkout saved payment architecture | UI, data, auth, provider, and rollback risks need different reviewers |
| billing webhook double-processing | one model may prefer event ids, another may notice invoice-level locking or ledger recovery |
| auth/session refresh design | security, migration, UX, and rollback perspectives all matter |
| model outage fallback | provider diversity keeps one model failure from defining the plan |
| risky refactor | one model catches coupling, another catches migration order, another catches missing tests |
| debugging plan | different models may pursue different plausible causes before the finalizer narrows them |
| code review before implementation | the council can preserve minority warnings a single answer would flatten |
Skip Fusion when:
- the fix is obvious and tiny
- one failing test names the exact bug
- latency matters more than deliberation
- the prompt has no concrete repo evidence
- the task is mostly one narrow CLI lookup
- you need Oracle with a large packed codebase context instead
- you already have a chosen implementation and just need to type it
Rule:
Use Fusion when the answer should come from a council, not a monologue.
How This Used To Work
What you used to expect:
Ask one strong model for the answer and trust it if it sounds confident.
What this workflow gives you now:
Ask several independent models the same bounded software question, let each one
take its own path, then synthesize the useful overlap and the useful surprises.
What you used to expect:
The first model that finishes can unblock the work.
What this workflow gives you now:
Partial provider output is not the answer. The answer starts after Fusion writes
summary and final artifacts, because the value is in the comparison and synthesis.
The Mental Model
prompt file
-> provider panel from different model families
-> terminal provider states
-> judge/finalizer comparison
-> synthesis
-> summary.json
-> final.md
-> implementation decision
| Concept | Meaning |
|---|---|
| prompt file | the bounded software question and evidence |
| provider panel | OpenAI, Anthropic, Z.ai/GLM, Gemini, Kimi, OpenCode, Codex, Claude, Agy, or other configured voices running independent passes |
| terminal state | each provider finished, failed, timed out, hit quota, or was interrupted |
| finalizer | compares panel output, preserves consensus, contradictions, unique insights, and blind spots, then writes a final recommendation |
summary.json |
run status, provider states, timings, artifact paths |
final.md |
final council output to read before acting |
| panel artifacts | useful but partial until the run is complete |
Local Fusion shells out to local CLIs. It is not the same product as OpenRouter Fusion.
OpenRouter Fusion is a hosted product.
Local Fusion is a local CLI implementation inspired by the same useful pattern:
panel -> judge/finalizer -> synthesis -> final answer.
Local Fusion runs through configured local commands such as Codex, Claude, Agy, and OpenCode. Those commands can point at different model families and providers, including OpenAI, Anthropic, Z.ai/GLM, Gemini, Kimi, or other local account wiring. Provider availability, cost, quotas, auth, and data handling depend on the local CLI accounts and config.
Origin Story To Keep Straight
The practical origin story is:
Do not anchor serious work to one model's blind spots.
Use multiple independent model/provider perspectives when the decision is expensive.
Synthesize the council output so the final choice carries both consensus and caveats.
OpenRouter Fusion made the pattern visible in a hosted product: send one prompt to a panel of models, have a judge analyze the answers, then produce a fused response. OpenRouter reported that its Fusion tests on DRACO deep research tasks showed panels beating individual models, including budget panels approaching frontier-model performance.
The Fable 5 availability shock sharpened a related lesson: model access can change. Hard-coded single-model workflows are brittle. A council or fallback pattern keeps important work moving when one model disappears, rate-limits, or underperforms.
Careful wording:
- Local Fusion is inspired by the OpenRouter-style panel and judge/finalizer pattern.
- Local Fusion is not OpenRouter Fusion.
- OpenRouter reported strong DRACO deep research results for its hosted Fusion product. Treat those numbers as useful context, not proof that every local Fusion run improves every task.
What Local Fusion Does
Local Fusion:
- reads one prompt
- runs a configured panel of local provider CLIs
- lets different model/provider families inspect the same question independently
- waits for provider terminal states
- keeps partial panel artifacts
- handles failed, timed-out, or quota-limited providers as degraded inputs when possible
- runs a finalizer by default
- preserves consensus, contradictions, unique insights, and blind spots when the finalizer has enough signal
- writes run artifacts under the Fusion session store
- records status in a compact index
- leaves the final engineering decision to the local agent and human
Current default run artifacts usually live under:
~/.fusion/sessions/YYYY/MM/DD/<session-id>/
Common artifacts:
run.jsonpanel-*.stdout.mdpanel-*.stderr.txtfinalizer-report.jsonfinal.mdsummary.json
Treat these as private by default. They may contain prompts, source snippets, commands, stdout, stderr, and model responses.
Command Shape
Ask the agent to use the skill. Do not memorize every flag.
Common shape:
fusion-high --list-providers
fusion-high --dry-run --file path/to/prompt.md
fusion-high --file path/to/prompt.md
Moderate planning:
fusion-med --list-providers
fusion-med --file path/to/prompt.md
Custom config:
fusion --config path/to/fusion.config.json --file path/to/prompt.md
Long prompt rule:
Write a prompt file and use --file.
Do not make the agent jam a long implementation brief through fragile shell quoting.
Prompt Shape
Use a bounded software question, and name the perspectives you want the council to cover.
# Fusion Prompt
## Goal
Choose the safest first implementation strategy for duplicate billing webhook processing.
## Council Perspectives
- architecture reviewer: data model, boundaries, rollback
- security reviewer: replay, idempotency, abuse cases
- implementation reviewer: smallest patch and tests
- operations reviewer: observability, retry behavior, degraded states
## Current Evidence
- provider sends repeated paid invoice events
- current handler sometimes processes the same invoice twice
- suspected files:
- src/billing/webhook.ts
- src/billing/idempotency.ts
- tests/billing/webhook.test.ts
## Candidate Strategies
- provider event id guard
- invoice-level processing lock
- webhook processing ledger
## Constraints
- do not change provider contract
- avoid schema changes in the first pass unless the council strongly argues for it
- preserve existing invoice state transitions
- prefer the smallest patch that can be tested
## Verification
- pnpm test billing-webhook -- --runInBand
- pnpm build
## Ask
Compare the strategies. Identify consensus, contradictions, unique insights,
blind spots, missing tests, and the first shippable slice. Synthesize one
recommendation that keeps the best argument from each useful perspective.
End with rollback notes and the proof commands to run.
Ask The Agent This
Use Fusion for architecture choice:
Use the $fusion skill.
We need to choose the first implementation strategy for duplicate billing webhook
processing. Write a prompt file that compares provider event id guard,
invoice-level processing lock, and webhook processing ledger.
First list providers and report the provider/model-family mix. Then dry-run the command, then run the full configured panel.
Wait for Fusion to finish. Read summary.json and final.md before recommending a
path. Show consensus, contradictions, unique insights, and blind spots. Do not
implement until the synthesized council output has been reconciled with repo evidence.
Use Fusion for auth/session review:
Use the $fusion skill.
Review the auth/session refresh-token rotation plan. The decision is whether to
put rotation in middleware, the session store, or an explicit auth workflow
boundary. Include likely files, constraints, migration risk, rollback risk, and
verification commands in the prompt file.
Run the full configured Fusion panel and wait for terminal provider states.
Read the final artifacts. Then give me the synthesized recommendation, the
minority warnings worth keeping, the recommended first slice, risks, and tests
to run.
Use Fusion for a risky implementation review:
Use the $fusion skill before editing.
The checkout saved payment method implementation touches auth, account billing,
provider customer ids, and checkout UI state. Ask Fusion for independent critique
from different model/provider perspectives: architecture, security, implementation,
and operations. Ask for missing tests, privacy risk, rollback concerns, and the
smallest safe patch.
After Fusion finishes, show the council's consensus, contradictions, unique
insights, blind spots, and synthesized recommendation before making any code change.
Use Fusion for model outage or fallback planning:
Use the $fusion skill.
We need a fallback plan for a model-dependent feature so one model outage does
not take down the app. Ask the council to compare hard-coded model slugs,
provider-layer failover, model fallback chains, and local fallback behavior.
Return the synthesized first shippable config change, the provider failure modes
each model noticed, and what to log when a fallback fires.
What To Confirm / How To Know It Worked
| Goal | Confirmation |
|---|---|
| skill invoked | agent explicitly says it used $fusion |
| providers checked | agent ran --list-providers for the selected preset |
| provider diversity named | agent reports the configured model/provider-family mix |
| prompt was durable | prompt was saved to a file and passed with --file |
| command shape checked | agent used --dry-run when provider ids or paths were uncertain |
| full panel waited | agent waited until providers reached terminal states |
| partial output not overused | agent did not act from only panel-*.stdout.md |
| final artifacts read | agent read summary.json and final.md |
| degraded providers handled | quota, timeout, or failure was reported without throwing away useful outputs |
| synthesis preserved | final answer names consensus, contradictions, unique insights, and blind spots |
| recommendation reconciled | final answer maps the synthesized recommendation back to repo evidence |
| implementation stayed separate | code changes happened only after council output was read |
| private output respected | session artifacts were not pasted wholesale |
Strong proof phrases:
Fusion session:summary.json:final.md:providers:provider mix:terminal states:consensus:contradictions:unique insights:blind spots:synthesized recommendation:chosen path:verification:
Weak proof phrases:
One model said...I saw enough from the first response...Fusion is still running, but...
If It Goes Wrong
Fusion is missing:
command -v fusion fusion-med fusion-high
Then inspect the common local checkout:
cd ~/dev/fusion
npm install
npm link
fusion-med --list-providers
Provider auth fails:
fusion-high --list-providers
Then check the provider CLI directly only when needed. Do not paste tokens, cookies, full environment output, or key-helper config.
One provider hits quota:
Treat it as a degraded council run.
Expected behavior:
- quota-limited provider is named
- remaining provider outputs are preserved
- Fusion continues when possible
- final answer mentions the missing voice
Do not restart the whole run just because one provider is unavailable.
Agent acts before Fusion finishes:
Stop the implementation.
Ask for:
Show the Fusion session path, summary.json status, final.md, provider terminal
states, and the council synthesis. Then continue from that output.
Only panel artifacts exist:
Panel artifacts are partial.
Wait for:
summary.jsonfinal.md
If the run was interrupted, use the interrupted summary as explicit failure evidence.
Prompt was too vague:
Bad: Use Fusion to review auth.
Better: Compare middleware-first, session-store-first, and explicit workflow boundary
for refresh-token rotation. Include constraints, likely files, migration risk,
rollback, and verification commands.
Prompt included secrets:
Stop. Rewrite the prompt.
Include file paths, redacted facts, and failure summaries instead of secrets.
Final answer sounds confident but ignores the council:
Extract consensus, contradictions, unsupported claims, unique insights, blind
spots, and the recommendation from the Fusion artifacts. Do not flatten the
council into one confident paragraph.
Fusion Compared To Nearby Workflows
| Workflow | Use It For | Not For |
|---|---|---|
| Oracle PackX | huge code context and one expensive deep external review | quick local multi-model disagreement |
| Section 6 variations | comparing generated implementation candidates | comparing independent model critiques |
| Fusion | hard decision where disagreement matters | tiny changes or low-latency work |
| Imps | one narrow tool-shaped lookup | architecture tradeoffs |
| Agent markers | capturing a bounded debug moment | choosing among architectural strategies |
References And Resources
- Bundled skill:
skills/fusion/SKILL.md - Common local source checkout:
~/dev/fusion - Common local skill install:
~/.agents/skills/fusion/SKILL.md - Common session store:
~/.fusion/sessions/YYYY/MM/DD/<session-id>/ - Common session index:
~/.fusion/sessions.jsonl - OpenRouter Fusion product page: https://openrouter.ai/fusion
- OpenRouter Fusion model page: https://openrouter.ai/openrouter/fusion
- OpenRouter announcement: https://openrouter.ai/blog/announcements/fusion-beats-frontier/
- OpenRouter model-disappearance post: https://openrouter.ai/blog/tutorials/keep-your-agent-running-when-models-disappear/
Operational boundaries
- Hosted benchmark and model-availability anecdotes are attributed source context, not verified current product claims or proof of this local council’s quality. The saved local result must still survive repository verification.