best-of-n
O que ela faz
Esta skill faz a IA gerar algumas soluções candidatas para uma tarefa importante, pontuá-las com a mesma régua e usar a melhor depois da verificação. É para decisões de alto impacto ou ambíguas, em que comparar opções vale o trabalho extra.
Quando usar
- ✓Quando um projeto ou uma implementação tem várias abordagens plausíveis para comparar.
- ✓Quando uma tarefa de depuração ou explicação é arriscada o bastante para justificar a checagem de várias respostas.
- ✓Quando você quer uma régua de pontuação clara aplicada antes de escolher uma abordagem.
Link da skill
https://github.com/codewhale-hq/Codewhale/blob/main/crates/skills/assets/skills/best-of-n/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Tente três formas diferentes de projetar esta camada de cache, pontue-as e aplique apenas a melhor depois que ela passar nos testes.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
A IA inicia vários candidatos independentes com a mesma tarefa e a mesma régua, reúne os resultados, avalia-os e aplica o vencedor somente depois que a verificação passa.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do GitHub.
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
- Define one task, one evidence packet, and one explicit scoring rubric before launching candidates. Include correctness, fit to the request, simplicity, risk, and verification.
- Choose
Nfrom 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. - 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.
- Prefer a session goal (
create_goalor 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:
{
"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: truewrite_authority: "worktree_write"- the same bounded
write_rootsorexact_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.
Integrate Only After PASS
For proposal-only work, return the winning answer with a compact score summary. For code work:
- Freeze the baseline, evaluator, hard gates, score rule, and authority before a larger search admits candidates. Any evaluator change starts a revision.
- 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.
- 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.
- Present the verified winner for review. Applying or merging is a separate,
explicit user action;
NONEis valid when every candidate fails. - 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.
Perguntas frequentes
Quantos candidatos são usados?
O padrão são três, e a skill permite de dois a quatro para uma comparação rápida.
É desperdício para mudanças pequenas?
A skill diz para não usar em mudanças mínimas ou quando a abordagem já foi escolhida.
Os candidatos podem alterar arquivos?
Propostas, revisões e pesquisas continuam somente para leitura, enquanto os candidatos de implementação trabalham em worktrees separados.
Detalhes
Descrição original do autor
Generate a small set of independent candidate solutions in worktrees, judge them against one explicit rubric, and apply the winner only after PASS verification.
repo: codewhale-hq/Codewhale
Popularidade
- Estrelas no GitHub
- 41 mil
- Posição no ranking
- #6520
- Licença
- MIT
- Atualizada em
- 02/11/2026
Comentários
- …
Mais skills deste repositório
dataviz
41 milAjuda seu agente a escolher um gráfico ou painel adequado para seus dados, com rótulos claros, notas sobre as fontes e verificações de eixos e valores ausentes.
debug
41 milAjuda seu agente a encontrar a causa real de um bug, reproduzindo-o, restringindo o problema e corrigindo somente quando você aprovar, em vez de adivinhar.
delegate
41 milEnsina seu agente a dividir uma tarefa grande em auxiliares paralelos e focados, mantendo o planejamento, a integração e a verificação final sob seu próprio controle.
dependency-update
41 milAjuda seu agente a atualizar um conjunto definido de dependências de software, ler suas notas de versão, corrigir mudanças que quebram o código e executar as verificações do projeto.
Skills parecidas
add-model-provider
394 milPermite que seu agente conecte um novo provedor de modelos de IA ao OpenClaw com comandos seguros, guarde as chaves de API com segurança e faça um teste ao vivo.
acp-router
394 milAjuda seu agente a enviar uma tarefa a um assistente de programação, como Claude Code ou Cursor, pelo OpenClaw, para que o trabalho rode nessa ferramenta.
browser-automation
394 milEnsina seu agente a controlar páginas web passo a passo, incluindo logins, abas e recuperação quando uma página para de responder.