best-of-n
하는 일
이 스킬은 AI가 중요한 작업에 대해 몇 가지 후보 해결책을 만들고, 같은 기준으로 점수를 매긴 뒤, 검증을 거쳐 가장 좋은 것을 사용하게 합니다. 비교할 가치가 있는 고위험 또는 모호한 결정을 위한 스킬입니다.
사용하는 경우
- ✓설계나 구현에 그럴듯한 접근법이 여러 개 있어 비교가 필요할 때.
- ✓디버깅이나 설명 작업이 위험해서 여러 답을 확인할 가치가 있을 때.
- ✓접근법을 고르기 전에 명확한 채점 기준을 적용하고 싶을 때.
스킬 링크
https://github.com/codewhale-hq/Codewhale/blob/main/crates/skills/assets/skills/best-of-n/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 캐싱 계층을 설계하는 방법을 세 가지로 시도해서 점수를 매기고, 테스트를 통과한 최고의 방법 하나만 적용해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 같은 작업과 기준으로 여러 독립 후보를 시작하고, 결과를 모아 평가한 뒤, 검증을 통과한 우승자만 적용합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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.
자주 묻는 질문
후보는 몇 개를 사용하나요?
기본은 세 개이며, 빠른 비교를 위해 두 개에서 네 개까지 허용합니다.
작은 변경에도 낭비인가요?
네. 스킬은 아주 작은 변경이거나 이미 접근법이 정해진 경우에는 사용하지 말라고 합니다.
후보가 파일을 바꿀 수 있나요?
제안, 검토, 조사는 읽기 전용으로 유지되며, 구현 후보는 별도의 worktree에서 작업합니다.
상세 정보
작성자의 원본 설명
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
인기도
- GitHub 스타
- 41k
- 순위
- #6520
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
dataviz
41k에이전트가 데이터에 맞는 차트나 대시보드를 고르도록 돕습니다. 명확한 레이블, 출처 메모, 축과 누락된 값에 대한 점검을 포함합니다.
debug
41k에이전트가 버그를 재현하고 범위를 좁혀 실제 원인을 찾도록 돕습니다. 추측하지 않고, 승인을 받은 경우에만 고칩니다.
delegate
41k에이전트가 큰 작업을 집중된 병렬 도우미들에게 나누어 맡기되, 계획, 통합, 최종 확인은 직접 맡도록 가르칩니다.
dependency-update
41k에이전트가 지정한 소프트웨어 의존성 묶음을 업데이트하고, 릴리스 노트를 읽고, 호환성이 깨지는 변경을 고치고, 프로젝트 검사를 실행하도록 돕습니다.
비슷한 스킬
add-model-provider
394k에이전트가 안전한 설정 명령으로 새 AI 모델 제공자를 OpenClaw에 연결하고, API 키를 평문으로 두지 않으며, 실시간 테스트를 실행하도록 돕습니다.
acp-router
394k에이전트가 OpenClaw를 통해 Claude Code나 Cursor 같은 코딩 도우미에 작업을 전달해, 작업이 그 도구에서 실행되도록 돕습니다.
browser-automation
394k에이전트가 로그인, 탭, 페이지 응답이 멈췄을 때의 복구를 포함해 웹 페이지를 단계별로 조작하도록 가르칩니다.