name: fusion-algorithm description: Compare multiple algorithm options and pick the best; use when choosing or optimizing an algorithm.
Fusion Algorithm
Overview
Use an F-thread: three workers in separate git worktrees plus a judge queen. Each worker implements the algorithm differently. The queen compares and selects a winner.
Inputs
- Algorithm description
Workflow
- Verify
gitandmprocs. - Create session variables:
SESSION_ID,BASE_BRANCH,PROJECT_ROOT,WORKTREE_ROOT
- Create
.hive/sessions/<session-id>andWORKTREE_ROOT. - Create worktrees:
git worktree add "{WORKTREE_ROOT}/impl-a" -b fusion/{SESSION_ID}/impl-a
git worktree add "{WORKTREE_ROOT}/impl-b" -b fusion/{SESSION_ID}/impl-b
git worktree add "{WORKTREE_ROOT}/impl-c" -b fusion/{SESSION_ID}/impl-c
- Write
tasks.jsonand worker prompts. - Write
.hive/mprocs.yamland launch mprocs.
tasks.json Template
{
"session": "{SESSION_ID}",
"created": "{ISO_TIMESTAMP}",
"status": "active",
"thread_type": "F-Thread (Fusion)",
"task_type": "fusion-algorithm",
"algorithm": {"description": "{ALGO_DESC}"},
"base_branch": "{BASE_BRANCH}",
"worktrees": {
"impl-a": {"path": "{WORKTREE_ROOT}/impl-a", "branch": "fusion/{SESSION_ID}/impl-a", "worker": "worker-a"},
"impl-b": {"path": "{WORKTREE_ROOT}/impl-b", "branch": "fusion/{SESSION_ID}/impl-b", "worker": "worker-b"},
"impl-c": {"path": "{WORKTREE_ROOT}/impl-c", "branch": "fusion/{SESSION_ID}/impl-c", "worker": "worker-c"}
}
}
Worker Prompt Outline
- Worker A: clean, readable implementation
- Worker B: alternative approach or data structure
- Worker C: performance-focused implementation
Queen Prompt Outline
- Compare correctness, complexity, readability, and test results
- Pick a winner or merge best elements
mprocs Launch
mprocs --config .hive/mprocs.yaml
Output
- Three implementations in worktrees and a final evaluation