Agent skill

Best-of-N Candidate Tournament

by codewhale-hq in codewhale-hq/Codewhale

Generates several independent candidate solutions in parallel worktrees, judges them once against one explicit rubric, and applies the winning candidate only after it passes verification.

MITAuto-check passedAgent Workflows

Install Best-of-N Candidate Tournament

skills CLI
$ npx skills add codewhale-hq/Codewhale --skill best-of-n -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install codewhale-hq/Codewhale best-of-n --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/codewhale-hq/Codewhale.git skills-src && mkdir -p .claude/skills && cp -r skills-src/crates/tui/assets/skills/best-of-n .claude/skills/best-of-n && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
best-of-n
GitHub stars
41k
Token cost
~1.2k tokens
SKILL.md length
601 words
Files
1
Skills in repo
63
Repo updated
First seen
Licence
MIT

At a glance

Generates several independent candidate solutions in parallel worktrees, judges them once against one explicit rubric, and applies the winning candidate only after it passes verification.

  • Works in 4 steps: Define one task, one evidence packet,… → Choose N from 2 to 4 for a quick… → Give every candidate the same task and… → …
  • Comparing several plausible implementations of a consequential feature
  • SKILL.md covers Set The Tournament, Generate Independently, Judge Once and Integrate Only After PASS
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

This skill is the preferred ensemble pattern for a high-stakes or ambiguous task that has several plausible approaches, such as a consequential design, implementation, explanation or debugging problem, and it explicitly avoids tiny changes or cases where the user already picked an approach. Before any candidate starts, it fixes one task description, one evidence packet and one explicit scoring rubric covering correctness, fit to the request, simplicity, risk and verification, and a candidate count between 2 and 4, defaulting to 3, with an explicit search mode scaling up to 16 live candidates under a worker concurrency gate.

Every candidate gets the identical task and rubric, distinguished only by a candidate number, and is started as a parallel background agent worker so the parent session stays free; candidates that implement code each get their own git worktree and a write authority bounded to the same file paths, and parallel writers are never run in the parent checkout. No candidate sees another's answer before generation finishes, and each builder returns a structured contract: candidate id, hypothesis, paths touched, commands run, a self-verdict, risks and artifact references, with the self-verdict treated as evidence to check rather than a final answer.

A single read-only reviewer, or the parent session for a small result, then judges every candidate against the original rubric by citing evidence from each one rather than voting on style, and only the winning candidate's change is applied after it passes verification.

When your agent uses it

  • Comparing several plausible implementations of a consequential feature
  • Resolving an ambiguous design or debugging approach by trying multiple solutions
  • Running a wider experimental search across many candidate approaches
  • Judging competing proposals against one fixed, explicit rubric

Example prompts

  • “Generate three independent candidates for fixing this race condition and judge them against a rubric for simplicity and risk.”
  • “Run a best-of-4 tournament on two different approaches to this caching layer.”
  • “Set up an explicit search over 8 candidate implementations of this algorithm.”
  • “Judge these three candidate designs against the correctness and risk rubric and tell me the winner.”

Requirements

  • Git worktree support for isolating each candidate's changes
  • A background multi-agent runner able to start, wait on and collect parallel workers

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Define one task, one evidence packet, and one explicit scoring rubric before
  2. Choose N from 2 to 4 for a quick comparison (default 3). For an explicit
  3. Give every candidate the same task and rubric. Add only a candidate number;
  4. Prefer a session goal (create_goal or active /goal) when the tournament

What it can do on your machine

Read from SKILL.md and the folder at commit 0ea319a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Best-of-N Candidate Tournament loads about 1.2k tokens when it runs. Until then it costs about 43 tokens; SKILL.md has 601 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~43
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from codewhale-hq/Codewhale at commit 0ea319a, republished under its MIT licence (© codewhale-hq). 601 words, ~1,177 tokens.

Download SKILL.mdSave it as .claude/skills/best-of-n/SKILL.md (or your agent's skills folder).
name
best-of-n
description
Generate a small set of independent candidate solutions in worktrees, judge them against one explicit rubric, and apply the winner only after PASS verification.
metadata.short-description
Compare independent candidates

Best of N

Use this skill when a consequential design, implementation, explanation, or debugging task has several plausible solutions and comparison is worth the extra model work. In Operate mode this is the preferred ensemble pattern for high-stakes or ambiguous approaches. Do not use it for a tiny change or when the user has already chosen the approach.

Set The Tournament

  1. Define one task, one evidence packet, and one explicit scoring rubric before launching candidates. Include correctness, fit to the request, simplicity, risk, and verification.
  2. Choose N from 2 to 4 for a quick comparison (default 3). For an explicit experimental search, use the Workflow search option: 2–16 live candidates, with larger validated populations queued at the Workflow host's 16-worker concurrency gate rather than launched at once.
  3. Give every candidate the same task and rubric. Add only a candidate number; do not steer candidates toward different conclusions unless diversity is an explicit part of the request.
  4. Prefer a session goal (create_goal or active /goal) when the tournament spans more than one parent turn.

Generate Independently

Start the candidates as parallel background agent workers and return agent_ids immediately so the parent stays free. For proposals, reviews, or research, keep them read-only:

json
{
  "action": "start",
  "name": "candidate_1",
  "prompt": "Produce candidate 1 for the task below. Return the proposal, evidence, risks, and rubric self-score. Do not edit files.\n\n<TASK AND RUBRIC>",
  "type": "worker",
  "model_strength": "same",
  "write_authority": "read_only"
}

Launch the remaining candidates with the same contract, then use agent wait or completion events to collect every result. Do not show one candidate another candidate's answer before generation finishes.

When candidates must implement code, give each one:

  • type: "builder"
  • worktree: true
  • write_authority: "worktree_write"
  • the same bounded write_roots or exact_files

Never run parallel writers in the parent checkout. Each builder must return the structured candidate contract (candidate id, hypothesis, paths, commands, self-verdict, risks, and artifact references). A self-verdict is evidence to inspect, not a hard-gate result.

Optional diversity: pin different model / Fleet fleet_profile values when the project has multiple capable routes; otherwise keep model strength same.

Judge Once

Use one read-only reviewer worker, or the parent when the result is small, to score all candidates against the original rubric. The judge must:

  • cite evidence from each candidate rather than vote by style;
  • reject candidates that violate authority, scope, or verification gates;
  • treat candidate-reported commands and PASS claims as untrusted until replay;
  • name the winner and the decisive reasons;
  • identify useful pieces worth combining, if any;
  • say when the candidates are tied or all fail.

Do not ask candidates to vote for themselves. Do not silently merge incompatible approaches into a new unreviewed solution.

Show full SKILL.md (194 more words)Show less

Integrate Only After PASS

For proposal-only work, return the winning answer with a compact score summary. For code work:

  1. Freeze the baseline, evaluator, hard gates, score rule, and authority before a larger search admits candidates. Any evaluator change starts a revision.
  2. After a worker loses write authority, apply its patch to a clean baseline and let the runtime—not that worker—run hard gates and scoring.
  3. Inspect the winning worktree diff and independently replay it on the clean baseline. A different read-only model may look for gaming, but deterministic tests remain the authority.
  4. Present the verified winner for review. Applying or merging is a separate, explicit user action; NONE is valid when every candidate fails.
  5. Preserve losing and failed candidate receipts as useful negative results.

The checked-in operate_best_of_n.workflow.js recipe supports strategy: "search" for structured 2–16 candidate generation and review. It does not yet turn prompt-listed commands into hidden runtime gates. Do not advertise those gates until a runtime evaluator host consumes a frozen search spec.

Stop early when one candidate reveals a hard constraint that invalidates the tournament. Report the negative result rather than spending the remaining budget to manufacture variety.

© codewhale-hq, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in crates/tui/assets/skills/best-of-n of codewhale-hq/Codewhale.

Open the folder on GitHubat commit 0ea319a

Compare with similar skills

Best-of-N Candidate Tournament next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Best-of-N Candidate Tournament compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Best-of-N Candidate Tournament this skillcodewhale-hq/Codewhale41k—~1.2kAutomated safety check: PassMIT
Orca CLIstablyai/orca89k2 repos~593Automated safety check: PassMIT
Agent of Empires Session Manageragent-of-empires/agent-of-empires3.3k—~2.1kAutomated safety check: PassMIT
Agent Manager Fleet TUIYoanWai/agent-manager582—~1kAutomated safety check: PassApache-2.0
Agtx Task Sweepfynnfluegge/agtx1.7k—~1.7kAutomated safety check: PassApache-2.0
PRP Workstream OrchestratorWirasm/prp2.3k—~3.5kAutomated safety check: PassMIT

Similar skills

  • Orca CLI

    stablyai/orca

    Operate Orca-managed worktrees, folder contexts, terminals, repos, automations, artifacts, skill sharing, worktree comments, and Orca's embedded browser…

    89k GitHub starsUsed in 2 repos~593 tokens
    Agent WorkflowsAuto-check passed
  • Agent of Empires Session Manager

    agent-of-empires/agent-of-empires

    Starts, monitors and organizes coding agent sessions that run in tmux through the aoe command, including groups, profiles and worktree-based parallel work.

    3.3k GitHub stars~2.1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Agent Manager Fleet TUI

    YoanWai/agent-manager

    Runs several coding-agent CLIs as real tmux sessions in one terminal UI, color-coded by whether each is working, waiting, idle or blocked.

    582 GitHub stars~1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Agtx Task Sweep

    fynnfluegge/agtx

    Breaks a conversation's results into feature-level tasks and pushes them to the agtx kanban board, where each task gets its own worktree and agent session.

    1.7k GitHub stars~1.7k tokensUpdated 8 days ago
    Agent WorkflowsAuto-check passed
  • Coordinates several PRP workstreams in isolated Git worktrees from one session, verifying proof, holding merge gates and sequencing the merges.

    2.3k GitHub stars~3.5k tokensUpdated 9 days ago
    Agent WorkflowsAuto-check passed
  • Official

    Shared collaboration rules for a team of squad agents covering worktree awareness, writing decisions to an inbox, cross-agent requests and reviewer lockout.

    1.4k GitHub starsUsed in 4 repos~500 tokens
    Agent WorkflowsAuto-check passed

More from codewhale-hq/Codewhale

All 63 skills in this repo
  • Codewhale Dogfood Install

    codewhale-hq/Codewhale

    Proves a Codewhale change in the real product: a stamped release build, an atomic local install, fresh-shell verification and manual QA that automated gates cannot cover.

    41k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Codewhale Session Handoff

    codewhale-hq/Codewhale

    Writes a paste-ready handoff for the next agent session, opening with a state-check command block and separating done, suspected and blocked work.

    41k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Codewhale Landing Workflow

    codewhale-hq/Codewhale

    Decides how verified work should reach main, directly, in a worktree or on an integration branch, while keeping contributor credit and respecting merge gates.

    41k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Sub-Agent Delegation

    codewhale-hq/Codewhale

    Guides when and how to split multi-step coding, research or verification work into focused sub-agent runs while the parent keeps integration and final checks.

    41k GitHub stars~790 tokensUpdated today
    Auto-check passed
  • Codewhale Fleet Manager

    codewhale-hq/Codewhale

    Triages and manages Codewhale fleet runs and workers with typed commands, classifying failures and choosing a safe restart, resume or escalation.

    41k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • GitHub Issue Bulk Assigner

    codewhale-hq/Codewhale

    Moves a list of GitHub issues into a milestone or assigns them to owners with the gh CLI, checking each one before and after the change.

    41k GitHub stars~953 tokensUpdated today
    Auto-check passed

Questions about Best-of-N Candidate Tournament

What does Best-of-N Candidate Tournament do?

Generates several independent candidate solutions in parallel worktrees, judges them once against one explicit rubric, and applies the winning candidate only after it passes verification. This skill is the preferred ensemble pattern for a high-stakes or ambiguous task that has several plausible approaches, such as a consequential design, implementation, explanation or debugging problem, and it explicitly avoids tiny changes or cases where the user already picked an approach. Before any candidate starts, it fixes one task description, one evidence packet and one explicit scoring rubric covering correctness, fit to the request, simplicity, risk and verification, and a candidate count between 2 and 4, defaulting to 3, with an explicit search mode scaling up to 16 live candidates under a worker concurrency gate.

When should I use Best-of-N Candidate Tournament?

Best-of-N Candidate Tournament fits situations like: comparing several plausible implementations of a consequential feature; resolving an ambiguous design or debugging approach by trying multiple solutions; running a wider experimental search across many candidate approaches; judging competing proposals against one fixed, explicit rubric.

How do I install Best-of-N Candidate Tournament in Claude Code?

Run `npx skills add codewhale-hq/Codewhale --skill best-of-n -a claude-code`. Or copy the skill folder (crates/tui/assets/skills/best-of-n in codewhale-hq/Codewhale) into .claude/skills/best-of-n in your project. Claude Code loads it when a task matches its description.

How do I install Best-of-N Candidate Tournament in Codex?

Run `npx skills add codewhale-hq/Codewhale --skill best-of-n -a codex`. Or copy the skill folder (crates/tui/assets/skills/best-of-n in codewhale-hq/Codewhale) into .agents/skills/best-of-n in your project. Codex loads it when a task matches its description.

Can I use Best-of-N Candidate Tournament in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add codewhale-hq/Codewhale --skill best-of-n -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/best-of-n, .gemini/skills/best-of-n, .github/skills/best-of-n and .opencode/skills/best-of-n in your project.

What does Best-of-N Candidate Tournament need to run?

SKILL.md names no scripts, command-line tools or credentials: Best-of-N Candidate Tournament is instructions for the agent only. Our summary lists: Git worktree support for isolating each candidate's changes; A background multi-agent runner able to start, wait on and collect parallel workers.

Does Best-of-N Candidate Tournament access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Best-of-N Candidate Tournament safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Best-of-N Candidate Tournament use?

Best-of-N Candidate Tournament is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Best-of-N Candidate Tournament use?

About 1.2k tokens (SKILL.md is roughly 4.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Best-of-N Candidate Tournament?

Skills that share tags, products or a category with Best-of-N Candidate Tournament: Orca CLI (stablyai/orca, 89k stars), Agent of Empires Session Manager (agent-of-empires/agent-of-empires, 3.3k stars), Agent Manager Fleet TUI (YoanWai/agent-manager, 582 stars) and Agtx Task Sweep (fynnfluegge/agtx, 1.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Best-of-N Candidate Tournament?

codewhale-hq (a GitHub organization) maintains it in codewhale-hq/Codewhale, which has 41,082 GitHub stars. The repository holds 63 skills in this directory. The repository was last updated on October 11, 2026.

Source: codewhale-hq/Codewhale on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.