| name | best-of-n |
| description | Implement a task N ways in parallel and pick the best. Spawns multiple subagents in isolated worktrees, evaluates candidates, and applies the winner. Use when asked to "best of n", "try multiple approaches", "parallel implementations", "/best-of-n", or "/bon".
|
| when-to-use | multiple independent implementations should compete |
| aliases | ["bon","best of n","tournament"] |
| triggers | ["best-of-n","best of n","/bon","parallel implementations"] |
/best-of-n — Parallel Implementation Tournament
Implement a task multiple different ways in parallel, evaluate all candidates,
and apply the best one.
Usage
/best-of-n [N] <task>
- If the first token is a number 2–8, it sets the candidate count; the rest is the task.
- If omitted, N defaults to 3.
Steps
-
Parse N (default 3, clamp 2–8) and the task description.
-
Spawn N subagents in one turn (parallel tool calls). For each candidate use task with:
isolation: "worktree"
description: "Candidate <i>"
prompt: the task plus
"You are candidate <i> of <N>. Implement fully. Summarize approach and files changed."
-
Wait for all candidates (get_task_output / wait semantics if available).
-
Evaluate each on: correctness → completeness → simplicity → risk.
-
Apply the winner's changes into the main workspace (review diffs; merge carefully).
-
End with WINNER: <number> (1–N).
Guardrails
- Do not claim a winner without reading each candidate summary.
- Prefer the smallest correct change when quality ties.
- If all candidates fail, report failure — do not invent a merge.