andrewr303/fusion
Nested multi-agent coding swarm + multi-model council. Architect (Fable 5.1 / Astra) designs a custom hive; nested workers are real AndrewCode processes on one Hive Board.
Main entrypoint for the Fusion Codex plugin. Use when the user says "fusion", "use Fusion", "ask the council", "get a second opinion", "run a panel", "fusion setup", "fusion gate", or wants Codex to coordinate local CLI panelists through the bundled bash and Python backend.
Manage the shared agency context — a centralized data store accessible by all tools and agents within a Fusion session. Store data with one tool and retrieve it with another, eliminating explicit parameter passing and saving tokens. Use for multi-step workflows, complex data sharing, and session state management. Triggers: "agency context", "context.set", "context.get", "master context", "share state", "/fusion:context", "store in context", "get from context".
Hive Board operating manual for Fusion nested swarms. Captains and workers talk on ONE file+SQLite board (Slack-channel + forum hybrid, WAL, no daemon) — not to the human. Use when spawned as a hive agent, when posting/polling the board, DMing another agent, @mentioning a request, or joining lineage-/task- channels. Triggers: "hive board", "fusion board", "post to hive", "poll the board", "FUSION_BOARD", "lineage channel", "@mention an agent", "captain/worker protocol".
Convene the Fusion council for a high-stakes, open-ended decision: blind independent analysis, then anonymized cross-examination with anti-conformity pressure, then a synthesized verdict with a minority report. Use for architecture calls, irreversible choices, "is this plan sound", "what am I missing", pre-mortems. Triggers: "council", "convene the council", "deliberate", "pressure-test this decision".
Stage an adversarial two-model debate on a contested either/or, then adjudicate. Use when the tension itself is the signal — A vs B, ship vs wait, build vs buy, this stack vs that. Two panelists from different families argue opposing sides across rounds; Codex names the cruxes and decides. Triggers: "debate", "argue both sides", "X vs Y", "steelman each side", "for and against".
Architect a nested multi-agent coding swarm before anything is spawned. A top-tier model (Fable 5.1 or Astra via Codex gpt-6-astra) MUST emit a SwarmSpec — catalog form or custom — from the live roster and the user's hard constraints. Use when the user wants Fusion to design the swarm, pick captains and children, invent a topology, or run a nested hive rather than a flat panel. Triggers: "design the swarm", "fusion designer", "custom topology", "nested hive", "ultraswarm design", "architect the swarm", "Fable design this", "Astra design this", "don't just panel it".
Graph engineering for Fusion — design the structure the work runs through, not the prompt. Two halves. TASK GRAPHS (how agents work): turn a job into typed nodes and real edges, run it with dataflow scheduling, adversarial verification, deterministic reducers, routers, bounded loops, and a human gate on irreversible steps. KNOWLEDGE GRAPHS (what agents remember): ontology → extraction → quality gate → fusion → GraphRAG serving, with typed edges, provenance, and bitemporal facts. Use for "design this as a graph", multi-stage pipelines, fan-out audits/sweeps/migrations, open-ended discovery, "why is my pipeline slow/sequential", or building graph memory / GraphRAG. Triggers: "graph", "/fusion:graph", "graph engineering", "task graph", "knowledge graph", "GraphRAG", "DAG", "fan out and verify", "entity resolution", "ontology", "loop until dry", "typed edges".
Nested multi-agent coding hive: a Fable 5.1 and/or Astra (Codex gpt-6-astra) architect talks to the human and may DESIGN a custom swarm; captains are any live CLI (codex, opencode/glm, grok, copilot, kimi, andrewcode/muse); nested workers spawn as REAL AndrewCode processes; everyone except the architect talks on one Hive Board (SQLite + JSONL, Slack-channel + forum hybrid). Use for nested-hive, ultraswarm-with-children, "spawn 4 captains each with 4 children", cross-lineage talk, Fable/Astra designer latitude, hive board. Triggers: "hive", "nested hive", "fusion-hive", "/fusion:hive", "spawn children", "hive board", "nested andrewcode swarm".
Inspect and curate what Fusion has learned: provider reliability, who-wins-by-task-type, best mode per task type, and the distilled lessons the Conductor reads before routing. Use to review the ledger, regenerate lessons.md, record outcome feedback, or prune a bad provider. Triggers: "what has fusion learned", "fusion stats", "fusion leaderboard", "update lessons", "which model wins".
Manage persistent agent memory — store, recall, and forget knowledge that survives across Fusion sessions. Agents leave breadcrumbs (preferences, discoveries, lessons) that are automatically injected as context at session start. Dual-store architecture: markdown wiki (content) + JSON index (search). Use for: saving project conventions, recalling past decisions, injecting session context, managing agent knowledge bases. Triggers: "memory store", "memory recall", "agent memory", "persistent memory", "save for later", "remember this", "/fusion:memory", "what do we know about".
MetaLoop — Fable 5.1 (xhigh) as Main Strategic Planner + an ACTIVE GPT Chief Operator (codex, gpt-5.6-sol @ xhigh, dispatched at plan/adjudicate/review points) + AndrewCode workers (meta/muse-spark-1.3-contributor @ xhigh) and a tiered swarm. Communication = Hive Board when FUSION_BOARD is set; nested workers are real andrewcode processes. Fable frames EVERY run first (strategy, architectural decomposition, risk, taste); the Chief Operator plans, adjudicates worker results, and reviews integration under that frame; AndrewCode workers execute subtasks proposal-mode with workcards; the in-context host executes and owns the tree; deterministic gates outrank model opinion.
The Fusion Conductor. Use for any non-trivial task where one model's blind spots could cost you — research, architecture and design decisions, hard debugging, high-stakes code, "compare X and Y", "is this right", "think hard about". Codex analyzes the task, dynamically picks how the panel should collaborate (solo · panel · council · debate · vote · swarm · hive · designer), dispatches the live CLIs (copilot/gemini, opencode/glm, grok, kimi, andrewcode/muse, and optionally codex/gpt-5.5) in parallel, judges and synthesizes one calibrated answer, then records the run so Fusion gets better over time. For large coding swarms the default is: architect (fable/astra) **designs**, hive executes nested andrewcode workers, Hive Board is the comms fabric. Triggers: "fusion", "/fusion", "ask the council", "fuse this", "get a second opinion", "surpass one model", "hive", "nested swarm".
Run the canonical Fusion panel: dispatch the task blind and in parallel to all live CLIs (codex/gpt-5.5, copilot/gemini, opencode/glm, grok), then judge and synthesize one grounded answer. Includes the cheap variants — vote (model-free majority for verifiable answers) and ranked (pick the single best). Use for research, "compare", code with one clear deliverable, "get the panel's answer". Triggers: "panel", "fuse this", "ask all the models", "vote on this", "second opinion".
Set up and health-check Fusion: detect which panelist CLIs are installed and authed, confirm the default panel works end-to-end with a tiny live smoke test, and configure the panel (models, effort, timeouts, allowlist). Triggers: "fusion setup", "set up fusion", "check fusion providers", "fusion doctor", "configure the panel".
Direct worker steering — attach to running workers mid-task, interrupt, redirect, or check status. Unlike traditional fire-and-forget sub-agents, you can intervene in real time with a running worker. All steering actions return typed SteeringResult contracts. Use for: correcting a worker mid-flight, cancelling a stuck worker, sending follow-up instructions, checking worker status during a long-running swarm. Triggers: "steer worker", "attach to worker", "interrupt worker", "cancel worker", "worker status", "/fusion:steer", "what are my workers doing".
Decompose a large or parallelizable task into subtasks, route each to the best-suited CLI, execute in dependency waves in parallel, then synthesize and verify one coherent deliverable. For large multi-file coding work, prefer hive nested-hive (architect designs, captains spawn real andrewcode children on one Hive Board) over flat dispatch; classic swarm remains available. Triggers: "swarm", "divide and conquer", "parallelize this", "split this across the models", "migrate everything", "nested hive".
Advanced multi-agent swarm patterns for Fusion, ported from the Swarms framework and run over the live CLIs (codex/copilot/opencode/grok) via a Python engine. Use when a plain panel/council isn't the right shape: layered refinement (MoA), deep role-specialized research (heavy), shared-thread brainstorm (discuss), director→workers (hierarchy), a DAG of stages (graph), a custom flow (flow), iterative quality-gated refine, best-of-N, or agent-level reasoning wrappers (reflexion / self-consistency / GKP). Triggers: "moa", "mixture of agents", "heavy swarm", "discuss/brainstorm with the models", "hierarchy", "graph workflow", "reflexion", "self-consistency", "best of N", "refine until good".
Plan → cross-model plan audit → self-correction → implement → cross-model implementation review → tweak, with NO user round-trips in between. Claude writes an in-depth plan, Codex audits the plan's decisions BEFORE any code exists (the reverse of a post-hoc review), Claude adjudicates, runs a pride gate, locks the plan, implements it, then Codex does a fast final review and Claude applies the tweaks. Use for any request worth getting right the first time — features, refactors, migrations, anything where a bad early decision is expensive to unwind. Triggers: "ultimate review", "/fusion:ultimate-review", "plan then build it properly", "have codex check the plan", "fuse claude and codex on this", "review before and after".
UltraCode mode for Fusion. Use when the user asks to launch, validate, install, or reason through the bundled UltraCode-Shim integration. It preserves Fusion's no-simulation, session-scoped routing, doctor-first setup, and no-secrets rules.
UltraSwarm mode. Use when the user wants UltraCode-flavored Fusion with Codex as host plus Grok, OpenCode, Copilot, and optionally an external Codex CLI. Presents model lists with easy defaults (opencode=glm-5.2, copilot=gemini-3.5-flash), lets user type choices, persists the selection, then runs the real council.